From 85e1e1ac34f456f9196cdd1c0e7cdc6a127c4b41 Mon Sep 17 00:00:00 2001 From: Zxl hhyccc Date: Fri, 19 Jul 2024 00:45:20 +0800 Subject: [PATCH 01/21] kernel: bump 6.1 to 6.1.100 https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.100 All patches automatically rebased. Build system: bcm53xx ath79 Signed-off-by: Zxl hhyccc --- include/kernel-6.1 | 4 ++-- ...mem-core-remove-spurious-white-space.patch | 2 +- ...e-add-an-index-parameter-to-the-cell.patch | 18 ++++++++--------- ...the-removal-of-the-cells-in-nvmem_ad.patch | 4 ++-- ...05-nvmem-core-add-nvmem_add_one_cell.patch | 4 ++-- ...vmem_add_one_cell-in-nvmem_add_cells.patch | 4 ++-- ...2-nvmem-core-introduce-NVMEM-layouts.patch | 10 +++++----- ...ndle-the-absence-of-expected-layouts.patch | 6 +++--- ...-core-request-layout-modules-loading.patch | 2 +- ...em-core-add-per-cell-post-processing.patch | 6 +++--- ...ow-to-modify-a-cell-before-adding-it.patch | 4 ++-- ...m-cell-drop-global-cell_post_process.patch | 4 ++-- ...de-own-priv-pointer-in-post-process-.patch | 4 ++-- ...rt-specifying-both-cell-raw-data-pos.patch | 8 ++++---- ...e-add-support-for-fixed-cells-layout.patch | 10 +++++----- ...e-all-cells-before-adding-the-nvmem-.patch | 2 +- ...-Do-not-open-code-existing-functions.patch | 2 +- ...tify-when-a-new-layout-is-registered.patch | 2 +- ...it-config-option-to-read-old-syntax-.patch | 4 ++-- ...4-Revert-nvmem-add-new-config-option.patch | 2 +- ...ect-fixed-layouts-to-grab-a-layout-d.patch | 2 +- ...mem_layout_get_container-in-another-.patch | 2 +- ...03-nvmem-Simplify-the-add_cells-hook.patch | 2 +- ...vmem-Move-and-rename-fixup_cell_info.patch | 6 +++--- ...rk-layouts-to-become-regular-devices.patch | 20 +++++++++---------- ...vmem-core-Expose-cells-through-sysfs.patch | 6 +++--- ...factor-.add_cells-callback-arguments.patch | 2 +- ...mem-drop-nvmem_layout_get_match_data.patch | 2 +- ...nvmem-core-add-nvmem_dev_size-helper.patch | 2 +- .../hack-6.1/904-debloat_dma_buf.patch | 2 +- ...-support-mac-base-fixed-layout-cells.patch | 4 ++-- 31 files changed, 76 insertions(+), 76 deletions(-) diff --git a/include/kernel-6.1 b/include/kernel-6.1 index dcdebfc6cba4f7..ebec105b22d4f5 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .99 -LINUX_KERNEL_HASH-6.1.99 = c086ee9ce2b1eeba6e085d569bc97ae764a5d15f6322847f0ebc9f787ae34dd3 +LINUX_VERSION-6.1 = .100 +LINUX_KERNEL_HASH-6.1.100 = b9aa6ec1a00f234d6c6f2d428fbb0a6bf459606c259263df978f86685b65a8b9 diff --git a/target/linux/generic/backport-6.1/809-v6.3-0001-nvmem-core-remove-spurious-white-space.patch b/target/linux/generic/backport-6.1/809-v6.3-0001-nvmem-core-remove-spurious-white-space.patch index 01400fd490d027..9eec0bc48fefe8 100644 --- a/target/linux/generic/backport-6.1/809-v6.3-0001-nvmem-core-remove-spurious-white-space.patch +++ b/target/linux/generic/backport-6.1/809-v6.3-0001-nvmem-core-remove-spurious-white-space.patch @@ -15,7 +15,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -764,7 +764,7 @@ struct nvmem_device *nvmem_register(cons +@@ -763,7 +763,7 @@ struct nvmem_device *nvmem_register(cons if (!nvmem) return ERR_PTR(-ENOMEM); diff --git a/target/linux/generic/backport-6.1/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch b/target/linux/generic/backport-6.1/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch index 454d3bf0ed1a4b..84ee69b8151a39 100644 --- a/target/linux/generic/backport-6.1/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch +++ b/target/linux/generic/backport-6.1/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch @@ -47,7 +47,7 @@ Signed-off-by: Greg Kroah-Hartman }; static DEFINE_MUTEX(nvmem_mutex); -@@ -1122,7 +1123,8 @@ struct nvmem_device *devm_nvmem_device_g +@@ -1121,7 +1122,8 @@ struct nvmem_device *devm_nvmem_device_g } EXPORT_SYMBOL_GPL(devm_nvmem_device_get); @@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman { struct nvmem_cell *cell; const char *name = NULL; -@@ -1141,6 +1143,7 @@ static struct nvmem_cell *nvmem_create_c +@@ -1140,6 +1142,7 @@ static struct nvmem_cell *nvmem_create_c cell->id = name; cell->entry = entry; @@ -65,7 +65,7 @@ Signed-off-by: Greg Kroah-Hartman return cell; } -@@ -1179,7 +1182,7 @@ nvmem_cell_get_from_lookup(struct device +@@ -1178,7 +1181,7 @@ nvmem_cell_get_from_lookup(struct device __nvmem_device_put(nvmem); cell = ERR_PTR(-ENOENT); } else { @@ -74,7 +74,7 @@ Signed-off-by: Greg Kroah-Hartman if (IS_ERR(cell)) __nvmem_device_put(nvmem); } -@@ -1227,15 +1230,27 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1226,15 +1229,27 @@ struct nvmem_cell *of_nvmem_cell_get(str struct nvmem_device *nvmem; struct nvmem_cell_entry *cell_entry; struct nvmem_cell *cell; @@ -105,7 +105,7 @@ Signed-off-by: Greg Kroah-Hartman nvmem_np = of_get_parent(cell_np); if (!nvmem_np) { -@@ -1257,7 +1272,7 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1256,7 +1271,7 @@ struct nvmem_cell *of_nvmem_cell_get(str return ERR_PTR(-ENOENT); } @@ -114,7 +114,7 @@ Signed-off-by: Greg Kroah-Hartman if (IS_ERR(cell)) __nvmem_device_put(nvmem); -@@ -1410,8 +1425,8 @@ static void nvmem_shift_read_buffer_in_p +@@ -1409,8 +1424,8 @@ static void nvmem_shift_read_buffer_in_p } static int __nvmem_cell_read(struct nvmem_device *nvmem, @@ -125,7 +125,7 @@ Signed-off-by: Greg Kroah-Hartman { int rc; -@@ -1425,7 +1440,7 @@ static int __nvmem_cell_read(struct nvme +@@ -1424,7 +1439,7 @@ static int __nvmem_cell_read(struct nvme nvmem_shift_read_buffer_in_place(cell, buf); if (nvmem->cell_post_process) { @@ -134,7 +134,7 @@ Signed-off-by: Greg Kroah-Hartman cell->offset, buf, cell->bytes); if (rc) return rc; -@@ -1460,7 +1475,7 @@ void *nvmem_cell_read(struct nvmem_cell +@@ -1459,7 +1474,7 @@ void *nvmem_cell_read(struct nvmem_cell if (!buf) return ERR_PTR(-ENOMEM); @@ -143,7 +143,7 @@ Signed-off-by: Greg Kroah-Hartman if (rc) { kfree(buf); return ERR_PTR(rc); -@@ -1773,7 +1788,7 @@ ssize_t nvmem_device_cell_read(struct nv +@@ -1772,7 +1787,7 @@ ssize_t nvmem_device_cell_read(struct nv if (rc) return rc; diff --git a/target/linux/generic/backport-6.1/809-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch b/target/linux/generic/backport-6.1/809-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch index 8f996eab348ff4..b20c500e7ce01b 100644 --- a/target/linux/generic/backport-6.1/809-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch +++ b/target/linux/generic/backport-6.1/809-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch @@ -22,7 +22,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -515,7 +515,7 @@ static int nvmem_add_cells(struct nvmem_ +@@ -514,7 +514,7 @@ static int nvmem_add_cells(struct nvmem_ int ncells) { struct nvmem_cell_entry **cells; @@ -31,7 +31,7 @@ Signed-off-by: Greg Kroah-Hartman cells = kcalloc(ncells, sizeof(*cells), GFP_KERNEL); if (!cells) -@@ -525,28 +525,22 @@ static int nvmem_add_cells(struct nvmem_ +@@ -524,28 +524,22 @@ static int nvmem_add_cells(struct nvmem_ cells[i] = kzalloc(sizeof(**cells), GFP_KERNEL); if (!cells[i]) { rval = -ENOMEM; diff --git a/target/linux/generic/backport-6.1/809-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch b/target/linux/generic/backport-6.1/809-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch index 711ce229b2c748..df4a02b8c50092 100644 --- a/target/linux/generic/backport-6.1/809-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch +++ b/target/linux/generic/backport-6.1/809-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -502,6 +502,36 @@ static int nvmem_cell_info_to_nvmem_cell +@@ -501,6 +501,36 @@ static int nvmem_cell_info_to_nvmem_cell } /** @@ -56,7 +56,7 @@ Signed-off-by: Greg Kroah-Hartman * nvmem_add_cells() - Add cell information to an nvmem device * * @nvmem: nvmem device to add cells to. -@@ -514,34 +544,15 @@ static int nvmem_add_cells(struct nvmem_ +@@ -513,34 +543,15 @@ static int nvmem_add_cells(struct nvmem_ const struct nvmem_cell_info *info, int ncells) { diff --git a/target/linux/generic/backport-6.1/809-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch b/target/linux/generic/backport-6.1/809-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch index e1791e5c83cff0..1b4a3f3ef319d7 100644 --- a/target/linux/generic/backport-6.1/809-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch +++ b/target/linux/generic/backport-6.1/809-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -688,15 +688,14 @@ static int nvmem_validate_keepouts(struc +@@ -687,15 +687,14 @@ static int nvmem_validate_keepouts(struc static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) { @@ -39,7 +39,7 @@ Signed-off-by: Greg Kroah-Hartman addr = of_get_property(child, "reg", &len); if (!addr) continue; -@@ -706,40 +705,24 @@ static int nvmem_add_cells_from_of(struc +@@ -705,40 +704,24 @@ static int nvmem_add_cells_from_of(struc return -EINVAL; } diff --git a/target/linux/generic/backport-6.1/811-v6.4-0002-nvmem-core-introduce-NVMEM-layouts.patch b/target/linux/generic/backport-6.1/811-v6.4-0002-nvmem-core-introduce-NVMEM-layouts.patch index 94cd23c18ac347..77d2af7269c277 100644 --- a/target/linux/generic/backport-6.1/811-v6.4-0002-nvmem-core-introduce-NVMEM-layouts.patch +++ b/target/linux/generic/backport-6.1/811-v6.4-0002-nvmem-core-introduce-NVMEM-layouts.patch @@ -103,7 +103,7 @@ Signed-off-by: Greg Kroah-Hartman static int __nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offset, void *val, size_t bytes) { -@@ -728,6 +732,101 @@ static int nvmem_add_cells_from_of(struc +@@ -727,6 +731,101 @@ static int nvmem_add_cells_from_of(struc return 0; } @@ -205,7 +205,7 @@ Signed-off-by: Greg Kroah-Hartman /** * nvmem_register() - Register a nvmem device for given nvmem_config. * Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem -@@ -834,6 +933,12 @@ struct nvmem_device *nvmem_register(cons +@@ -833,6 +932,12 @@ struct nvmem_device *nvmem_register(cons goto err_put_device; } @@ -218,7 +218,7 @@ Signed-off-by: Greg Kroah-Hartman if (config->cells) { rval = nvmem_add_cells(nvmem, config->cells, config->ncells); if (rval) -@@ -854,12 +959,17 @@ struct nvmem_device *nvmem_register(cons +@@ -853,12 +958,17 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_cells; @@ -236,7 +236,7 @@ Signed-off-by: Greg Kroah-Hartman if (config->compat) nvmem_sysfs_remove_compat(nvmem, config); err_put_device: -@@ -881,6 +991,7 @@ static void nvmem_device_release(struct +@@ -880,6 +990,7 @@ static void nvmem_device_release(struct device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom); nvmem_device_remove_all_cells(nvmem); @@ -244,7 +244,7 @@ Signed-off-by: Greg Kroah-Hartman device_unregister(&nvmem->dev); } -@@ -1246,6 +1357,15 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1245,6 +1356,15 @@ struct nvmem_cell *of_nvmem_cell_get(str return ERR_PTR(-EINVAL); } diff --git a/target/linux/generic/backport-6.1/811-v6.4-0003-nvmem-core-handle-the-absence-of-expected-layouts.patch b/target/linux/generic/backport-6.1/811-v6.4-0003-nvmem-core-handle-the-absence-of-expected-layouts.patch index 6fa7b6382d8941..40ce320b6e3368 100644 --- a/target/linux/generic/backport-6.1/811-v6.4-0003-nvmem-core-handle-the-absence-of-expected-layouts.patch +++ b/target/linux/generic/backport-6.1/811-v6.4-0003-nvmem-core-handle-the-absence-of-expected-layouts.patch @@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -755,7 +755,7 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregiste +@@ -754,7 +754,7 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregiste static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem) { struct device_node *layout_np, *np = nvmem->dev.of_node; @@ -37,7 +37,7 @@ Signed-off-by: Greg Kroah-Hartman layout_np = of_get_child_by_name(np, "nvmem-layout"); if (!layout_np) -@@ -938,6 +938,13 @@ struct nvmem_device *nvmem_register(cons +@@ -937,6 +937,13 @@ struct nvmem_device *nvmem_register(cons * pointer will be NULL and nvmem_layout_put() will be a noop. */ nvmem->layout = config->layout ?: nvmem_layout_get(nvmem); @@ -51,7 +51,7 @@ Signed-off-by: Greg Kroah-Hartman if (config->cells) { rval = nvmem_add_cells(nvmem, config->cells, config->ncells); -@@ -970,6 +977,7 @@ struct nvmem_device *nvmem_register(cons +@@ -969,6 +976,7 @@ struct nvmem_device *nvmem_register(cons err_remove_cells: nvmem_device_remove_all_cells(nvmem); nvmem_layout_put(nvmem->layout); diff --git a/target/linux/generic/backport-6.1/811-v6.4-0004-nvmem-core-request-layout-modules-loading.patch b/target/linux/generic/backport-6.1/811-v6.4-0004-nvmem-core-request-layout-modules-loading.patch index b9341666f91f9d..13712d76c65960 100644 --- a/target/linux/generic/backport-6.1/811-v6.4-0004-nvmem-core-request-layout-modules-loading.patch +++ b/target/linux/generic/backport-6.1/811-v6.4-0004-nvmem-core-request-layout-modules-loading.patch @@ -36,7 +36,7 @@ Signed-off-by: Greg Kroah-Hartman #include struct nvmem_device { -@@ -761,6 +762,13 @@ static struct nvmem_layout *nvmem_layout +@@ -760,6 +761,13 @@ static struct nvmem_layout *nvmem_layout if (!layout_np) return NULL; diff --git a/target/linux/generic/backport-6.1/811-v6.4-0005-nvmem-core-add-per-cell-post-processing.patch b/target/linux/generic/backport-6.1/811-v6.4-0005-nvmem-core-add-per-cell-post-processing.patch index 53628cd4e4ffb4..50f3504132b612 100644 --- a/target/linux/generic/backport-6.1/811-v6.4-0005-nvmem-core-add-per-cell-post-processing.patch +++ b/target/linux/generic/backport-6.1/811-v6.4-0005-nvmem-core-add-per-cell-post-processing.patch @@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman struct device_node *np; struct nvmem_device *nvmem; struct list_head node; -@@ -470,6 +471,7 @@ static int nvmem_cell_info_to_nvmem_cell +@@ -469,6 +470,7 @@ static int nvmem_cell_info_to_nvmem_cell cell->offset = info->offset; cell->bytes = info->bytes; cell->name = info->name; @@ -36,7 +36,7 @@ Signed-off-by: Greg Kroah-Hartman cell->bit_offset = info->bit_offset; cell->nbits = info->nbits; -@@ -1563,6 +1565,13 @@ static int __nvmem_cell_read(struct nvme +@@ -1562,6 +1564,13 @@ static int __nvmem_cell_read(struct nvme if (cell->bit_offset || cell->nbits) nvmem_shift_read_buffer_in_place(cell, buf); @@ -50,7 +50,7 @@ Signed-off-by: Greg Kroah-Hartman if (nvmem->cell_post_process) { rc = nvmem->cell_post_process(nvmem->priv, id, index, cell->offset, buf, cell->bytes); -@@ -1671,6 +1680,14 @@ static int __nvmem_cell_entry_write(stru +@@ -1670,6 +1679,14 @@ static int __nvmem_cell_entry_write(stru (cell->bit_offset == 0 && len != cell->bytes)) return -EINVAL; diff --git a/target/linux/generic/backport-6.1/811-v6.4-0006-nvmem-core-allow-to-modify-a-cell-before-adding-it.patch b/target/linux/generic/backport-6.1/811-v6.4-0006-nvmem-core-allow-to-modify-a-cell-before-adding-it.patch index 32990148c806f9..1b77992a2bf6df 100644 --- a/target/linux/generic/backport-6.1/811-v6.4-0006-nvmem-core-allow-to-modify-a-cell-before-adding-it.patch +++ b/target/linux/generic/backport-6.1/811-v6.4-0006-nvmem-core-allow-to-modify-a-cell-before-adding-it.patch @@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -695,6 +695,7 @@ static int nvmem_validate_keepouts(struc +@@ -694,6 +694,7 @@ static int nvmem_validate_keepouts(struc static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) { @@ -26,7 +26,7 @@ Signed-off-by: Greg Kroah-Hartman struct device *dev = &nvmem->dev; struct device_node *child; const __be32 *addr; -@@ -724,6 +725,9 @@ static int nvmem_add_cells_from_of(struc +@@ -723,6 +724,9 @@ static int nvmem_add_cells_from_of(struc info.np = of_node_get(child); diff --git a/target/linux/generic/backport-6.1/811-v6.4-0008-nvmem-cell-drop-global-cell_post_process.patch b/target/linux/generic/backport-6.1/811-v6.4-0008-nvmem-cell-drop-global-cell_post_process.patch index eac202b8829841..e6f4be261cd894 100644 --- a/target/linux/generic/backport-6.1/811-v6.4-0008-nvmem-cell-drop-global-cell_post_process.patch +++ b/target/linux/generic/backport-6.1/811-v6.4-0008-nvmem-cell-drop-global-cell_post_process.patch @@ -26,7 +26,7 @@ Signed-off-by: Greg Kroah-Hartman struct gpio_desc *wp_gpio; struct nvmem_layout *layout; void *priv; -@@ -903,7 +902,6 @@ struct nvmem_device *nvmem_register(cons +@@ -902,7 +901,6 @@ struct nvmem_device *nvmem_register(cons nvmem->type = config->type; nvmem->reg_read = config->reg_read; nvmem->reg_write = config->reg_write; @@ -34,7 +34,7 @@ Signed-off-by: Greg Kroah-Hartman nvmem->keepout = config->keepout; nvmem->nkeepout = config->nkeepout; if (config->of_node) -@@ -1575,13 +1573,6 @@ static int __nvmem_cell_read(struct nvme +@@ -1574,13 +1572,6 @@ static int __nvmem_cell_read(struct nvme if (rc) return rc; } diff --git a/target/linux/generic/backport-6.1/811-v6.4-0009-nvmem-core-provide-own-priv-pointer-in-post-process-.patch b/target/linux/generic/backport-6.1/811-v6.4-0009-nvmem-core-provide-own-priv-pointer-in-post-process-.patch index 46b30a2ed90417..b39626f6e78a3e 100644 --- a/target/linux/generic/backport-6.1/811-v6.4-0009-nvmem-core-provide-own-priv-pointer-in-post-process-.patch +++ b/target/linux/generic/backport-6.1/811-v6.4-0009-nvmem-core-provide-own-priv-pointer-in-post-process-.patch @@ -29,7 +29,7 @@ Signed-off-by: Greg Kroah-Hartman struct device_node *np; struct nvmem_device *nvmem; struct list_head node; -@@ -471,6 +472,7 @@ static int nvmem_cell_info_to_nvmem_cell +@@ -470,6 +471,7 @@ static int nvmem_cell_info_to_nvmem_cell cell->bytes = info->bytes; cell->name = info->name; cell->read_post_process = info->read_post_process; @@ -37,7 +37,7 @@ Signed-off-by: Greg Kroah-Hartman cell->bit_offset = info->bit_offset; cell->nbits = info->nbits; -@@ -1568,7 +1570,7 @@ static int __nvmem_cell_read(struct nvme +@@ -1567,7 +1569,7 @@ static int __nvmem_cell_read(struct nvme nvmem_shift_read_buffer_in_place(cell, buf); if (cell->read_post_process) { diff --git a/target/linux/generic/backport-6.1/811-v6.4-0017-nvmem-core-support-specifying-both-cell-raw-data-pos.patch b/target/linux/generic/backport-6.1/811-v6.4-0017-nvmem-core-support-specifying-both-cell-raw-data-pos.patch index eeb407e9bb664c..a1ebd53d074b88 100644 --- a/target/linux/generic/backport-6.1/811-v6.4-0017-nvmem-core-support-specifying-both-cell-raw-data-pos.patch +++ b/target/linux/generic/backport-6.1/811-v6.4-0017-nvmem-core-support-specifying-both-cell-raw-data-pos.patch @@ -51,7 +51,7 @@ Signed-off-by: Greg Kroah-Hartman int bytes; int bit_offset; int nbits; -@@ -469,6 +470,7 @@ static int nvmem_cell_info_to_nvmem_cell +@@ -468,6 +469,7 @@ static int nvmem_cell_info_to_nvmem_cell { cell->nvmem = nvmem; cell->offset = info->offset; @@ -59,7 +59,7 @@ Signed-off-by: Greg Kroah-Hartman cell->bytes = info->bytes; cell->name = info->name; cell->read_post_process = info->read_post_process; -@@ -1560,7 +1562,7 @@ static int __nvmem_cell_read(struct nvme +@@ -1559,7 +1561,7 @@ static int __nvmem_cell_read(struct nvme { int rc; @@ -68,7 +68,7 @@ Signed-off-by: Greg Kroah-Hartman if (rc) return rc; -@@ -1571,7 +1573,7 @@ static int __nvmem_cell_read(struct nvme +@@ -1570,7 +1572,7 @@ static int __nvmem_cell_read(struct nvme if (cell->read_post_process) { rc = cell->read_post_process(cell->priv, id, index, @@ -77,7 +77,7 @@ Signed-off-by: Greg Kroah-Hartman if (rc) return rc; } -@@ -1594,14 +1596,15 @@ static int __nvmem_cell_read(struct nvme +@@ -1593,14 +1595,15 @@ static int __nvmem_cell_read(struct nvme */ void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) { diff --git a/target/linux/generic/backport-6.1/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch b/target/linux/generic/backport-6.1/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch index 59b2f9fa2c6707..3b4654822a4712 100644 --- a/target/linux/generic/backport-6.1/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch +++ b/target/linux/generic/backport-6.1/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch @@ -27,7 +27,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -696,7 +696,7 @@ static int nvmem_validate_keepouts(struc +@@ -695,7 +695,7 @@ static int nvmem_validate_keepouts(struc return 0; } @@ -36,7 +36,7 @@ Signed-off-by: Greg Kroah-Hartman { struct nvmem_layout *layout = nvmem->layout; struct device *dev = &nvmem->dev; -@@ -704,7 +704,7 @@ static int nvmem_add_cells_from_of(struc +@@ -703,7 +703,7 @@ static int nvmem_add_cells_from_of(struc const __be32 *addr; int len, ret; @@ -45,7 +45,7 @@ Signed-off-by: Greg Kroah-Hartman struct nvmem_cell_info info = {0}; addr = of_get_property(child, "reg", &len); -@@ -742,6 +742,28 @@ static int nvmem_add_cells_from_of(struc +@@ -741,6 +741,28 @@ static int nvmem_add_cells_from_of(struc return 0; } @@ -74,7 +74,7 @@ Signed-off-by: Greg Kroah-Hartman int __nvmem_layout_register(struct nvmem_layout *layout, struct module *owner) { layout->owner = owner; -@@ -972,7 +994,7 @@ struct nvmem_device *nvmem_register(cons +@@ -971,7 +993,7 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_cells; @@ -83,7 +83,7 @@ Signed-off-by: Greg Kroah-Hartman if (rval) goto err_remove_cells; -@@ -982,6 +1004,10 @@ struct nvmem_device *nvmem_register(cons +@@ -981,6 +1003,10 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_cells; diff --git a/target/linux/generic/backport-6.1/814-v6.6-0014-nvmem-core-Create-all-cells-before-adding-the-nvmem-.patch b/target/linux/generic/backport-6.1/814-v6.6-0014-nvmem-core-Create-all-cells-before-adding-the-nvmem-.patch index f9532f39c35bac..990ce8ecf1c7d4 100644 --- a/target/linux/generic/backport-6.1/814-v6.6-0014-nvmem-core-Create-all-cells-before-adding-the-nvmem-.patch +++ b/target/linux/generic/backport-6.1/814-v6.6-0014-nvmem-core-Create-all-cells-before-adding-the-nvmem-.patch @@ -15,7 +15,7 @@ Signed-off-by: Srinivas Kandagatla --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -998,17 +998,17 @@ struct nvmem_device *nvmem_register(cons +@@ -997,17 +997,17 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_cells; diff --git a/target/linux/generic/backport-6.1/814-v6.6-0016-nvmem-core-Do-not-open-code-existing-functions.patch b/target/linux/generic/backport-6.1/814-v6.6-0016-nvmem-core-Do-not-open-code-existing-functions.patch index 28d8bba1949adf..4ebf229695d258 100644 --- a/target/linux/generic/backport-6.1/814-v6.6-0016-nvmem-core-Do-not-open-code-existing-functions.patch +++ b/target/linux/generic/backport-6.1/814-v6.6-0016-nvmem-core-Do-not-open-code-existing-functions.patch @@ -14,7 +14,7 @@ Signed-off-by: Srinivas Kandagatla --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -786,10 +786,10 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregiste +@@ -785,10 +785,10 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregiste static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem) { diff --git a/target/linux/generic/backport-6.1/814-v6.6-0017-nvmem-core-Notify-when-a-new-layout-is-registered.patch b/target/linux/generic/backport-6.1/814-v6.6-0017-nvmem-core-Notify-when-a-new-layout-is-registered.patch index b62a0e18daa74b..6803397d60b720 100644 --- a/target/linux/generic/backport-6.1/814-v6.6-0017-nvmem-core-Notify-when-a-new-layout-is-registered.patch +++ b/target/linux/generic/backport-6.1/814-v6.6-0017-nvmem-core-Notify-when-a-new-layout-is-registered.patch @@ -14,7 +14,7 @@ Signed-off-by: Srinivas Kandagatla --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -772,12 +772,16 @@ int __nvmem_layout_register(struct nvmem +@@ -771,12 +771,16 @@ int __nvmem_layout_register(struct nvmem list_add(&layout->node, &nvmem_layouts); spin_unlock(&nvmem_layout_lock); diff --git a/target/linux/generic/backport-6.1/816-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch b/target/linux/generic/backport-6.1/816-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch index be293e6f2a3f4c..547122ae48b1f4 100644 --- a/target/linux/generic/backport-6.1/816-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch +++ b/target/linux/generic/backport-6.1/816-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch @@ -95,7 +95,7 @@ Signed-off-by: Greg Kroah-Hartman .stride = sizeof(u32), --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -998,9 +998,11 @@ struct nvmem_device *nvmem_register(cons +@@ -997,9 +997,11 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_cells; @@ -132,7 +132,7 @@ Signed-off-by: Greg Kroah-Hartman imx_ocotp_nvmem_config.priv = priv; --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c -@@ -74,6 +74,7 @@ static int meson_efuse_probe(struct plat +@@ -80,6 +80,7 @@ static int meson_efuse_probe(struct plat econfig->dev = dev; econfig->name = dev_name(dev); diff --git a/target/linux/generic/backport-6.1/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch b/target/linux/generic/backport-6.1/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch index 7d80ad37f18bc1..1ed7c4333220bd 100644 --- a/target/linux/generic/backport-6.1/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch +++ b/target/linux/generic/backport-6.1/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch @@ -48,7 +48,7 @@ Signed-off-by: Greg Kroah-Hartman mtd->nvmem = nvmem_register(&config); --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -936,7 +936,7 @@ struct nvmem_device *nvmem_register(cons +@@ -935,7 +935,7 @@ struct nvmem_device *nvmem_register(cons nvmem->nkeepout = config->nkeepout; if (config->of_node) nvmem->dev.of_node = config->of_node; diff --git a/target/linux/generic/backport-6.1/816-v6.7-0005-nvmem-Do-not-expect-fixed-layouts-to-grab-a-layout-d.patch b/target/linux/generic/backport-6.1/816-v6.7-0005-nvmem-Do-not-expect-fixed-layouts-to-grab-a-layout-d.patch index bd5ceaabf7d49e..65b8878310e668 100644 --- a/target/linux/generic/backport-6.1/816-v6.7-0005-nvmem-Do-not-expect-fixed-layouts-to-grab-a-layout-d.patch +++ b/target/linux/generic/backport-6.1/816-v6.7-0005-nvmem-Do-not-expect-fixed-layouts-to-grab-a-layout-d.patch @@ -30,7 +30,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -797,6 +797,12 @@ static struct nvmem_layout *nvmem_layout +@@ -796,6 +796,12 @@ static struct nvmem_layout *nvmem_layout if (!layout_np) return NULL; diff --git a/target/linux/generic/backport-6.1/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch b/target/linux/generic/backport-6.1/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch index 2093fac8a125c2..59175c8051d571 100644 --- a/target/linux/generic/backport-6.1/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch +++ b/target/linux/generic/backport-6.1/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -848,14 +848,6 @@ static int nvmem_add_cells_from_layout(s +@@ -847,14 +847,6 @@ static int nvmem_add_cells_from_layout(s } #if IS_ENABLED(CONFIG_OF) diff --git a/target/linux/generic/backport-6.1/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch b/target/linux/generic/backport-6.1/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch index db2d8c1b46ed70..1f39dfea2f9689 100644 --- a/target/linux/generic/backport-6.1/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch +++ b/target/linux/generic/backport-6.1/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch @@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -817,7 +817,7 @@ static int nvmem_add_cells_from_layout(s +@@ -816,7 +816,7 @@ static int nvmem_add_cells_from_layout(s int ret; if (layout && layout->add_cells) { diff --git a/target/linux/generic/backport-6.1/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch b/target/linux/generic/backport-6.1/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch index 65aa37f8344e6d..c2968f2c6750d8 100644 --- a/target/linux/generic/backport-6.1/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch +++ b/target/linux/generic/backport-6.1/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -676,7 +676,6 @@ static int nvmem_validate_keepouts(struc +@@ -675,7 +675,6 @@ static int nvmem_validate_keepouts(struc static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) { @@ -33,7 +33,7 @@ Signed-off-by: Greg Kroah-Hartman struct device *dev = &nvmem->dev; struct device_node *child; const __be32 *addr; -@@ -706,8 +705,8 @@ static int nvmem_add_cells_from_dt(struc +@@ -705,8 +704,8 @@ static int nvmem_add_cells_from_dt(struc info.np = of_node_get(child); @@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman ret = nvmem_add_one_cell(nvmem, &info); kfree(info.name); -@@ -896,6 +895,7 @@ struct nvmem_device *nvmem_register(cons +@@ -895,6 +894,7 @@ struct nvmem_device *nvmem_register(cons kref_init(&nvmem->refcnt); INIT_LIST_HEAD(&nvmem->cells); diff --git a/target/linux/generic/backport-6.1/819-v6.8-0005-nvmem-core-Rework-layouts-to-become-regular-devices.patch b/target/linux/generic/backport-6.1/819-v6.8-0005-nvmem-core-Rework-layouts-to-become-regular-devices.patch index 18813323408fe2..9a19dc44524e21 100644 --- a/target/linux/generic/backport-6.1/819-v6.8-0005-nvmem-core-Rework-layouts-to-become-regular-devices.patch +++ b/target/linux/generic/backport-6.1/819-v6.8-0005-nvmem-core-Rework-layouts-to-become-regular-devices.patch @@ -84,7 +84,7 @@ Signed-off-by: Greg Kroah-Hartman static int __nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offset, void *val, size_t bytes) { -@@ -741,97 +738,22 @@ static int nvmem_add_cells_from_fixed_la +@@ -740,97 +737,22 @@ static int nvmem_add_cells_from_fixed_la return err; } @@ -189,7 +189,7 @@ Signed-off-by: Greg Kroah-Hartman const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem, struct nvmem_layout *layout) { -@@ -839,7 +761,7 @@ const void *nvmem_layout_get_match_data( +@@ -838,7 +760,7 @@ const void *nvmem_layout_get_match_data( const struct of_device_id *match; layout_np = of_nvmem_layout_get_container(nvmem); @@ -198,7 +198,7 @@ Signed-off-by: Greg Kroah-Hartman return match ? match->data : NULL; } -@@ -951,19 +873,6 @@ struct nvmem_device *nvmem_register(cons +@@ -950,19 +872,6 @@ struct nvmem_device *nvmem_register(cons goto err_put_device; } @@ -218,7 +218,7 @@ Signed-off-by: Greg Kroah-Hartman if (config->cells) { rval = nvmem_add_cells(nvmem, config->cells, config->ncells); if (rval) -@@ -984,24 +893,24 @@ struct nvmem_device *nvmem_register(cons +@@ -983,24 +892,24 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_cells; @@ -249,7 +249,7 @@ Signed-off-by: Greg Kroah-Hartman if (config->compat) nvmem_sysfs_remove_compat(nvmem, config); err_put_device: -@@ -1023,7 +932,7 @@ static void nvmem_device_release(struct +@@ -1022,7 +931,7 @@ static void nvmem_device_release(struct device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom); nvmem_device_remove_all_cells(nvmem); @@ -258,7 +258,7 @@ Signed-off-by: Greg Kroah-Hartman device_unregister(&nvmem->dev); } -@@ -1325,6 +1234,12 @@ nvmem_cell_get_from_lookup(struct device +@@ -1324,6 +1233,12 @@ nvmem_cell_get_from_lookup(struct device return cell; } @@ -271,7 +271,7 @@ Signed-off-by: Greg Kroah-Hartman #if IS_ENABLED(CONFIG_OF) static struct nvmem_cell_entry * nvmem_find_cell_entry_by_node(struct nvmem_device *nvmem, struct device_node *np) -@@ -1343,6 +1258,18 @@ nvmem_find_cell_entry_by_node(struct nvm +@@ -1342,6 +1257,18 @@ nvmem_find_cell_entry_by_node(struct nvm return cell; } @@ -290,7 +290,7 @@ Signed-off-by: Greg Kroah-Hartman /** * of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id * -@@ -1405,16 +1332,29 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1404,16 +1331,29 @@ struct nvmem_cell *of_nvmem_cell_get(str return ERR_CAST(nvmem); } @@ -322,7 +322,7 @@ Signed-off-by: Greg Kroah-Hartman return cell; } -@@ -1528,6 +1468,7 @@ void nvmem_cell_put(struct nvmem_cell *c +@@ -1527,6 +1467,7 @@ void nvmem_cell_put(struct nvmem_cell *c kfree(cell); __nvmem_device_put(nvmem); @@ -330,7 +330,7 @@ Signed-off-by: Greg Kroah-Hartman } EXPORT_SYMBOL_GPL(nvmem_cell_put); -@@ -2105,11 +2046,22 @@ EXPORT_SYMBOL_GPL(nvmem_dev_name); +@@ -2104,11 +2045,22 @@ EXPORT_SYMBOL_GPL(nvmem_dev_name); static int __init nvmem_init(void) { diff --git a/target/linux/generic/backport-6.1/819-v6.8-0006-nvmem-core-Expose-cells-through-sysfs.patch b/target/linux/generic/backport-6.1/819-v6.8-0006-nvmem-core-Expose-cells-through-sysfs.patch index 89872bec2e59d3..07e44d7b21cdaf 100644 --- a/target/linux/generic/backport-6.1/819-v6.8-0006-nvmem-core-Expose-cells-through-sysfs.patch +++ b/target/linux/generic/backport-6.1/819-v6.8-0006-nvmem-core-Expose-cells-through-sysfs.patch @@ -111,7 +111,7 @@ Signed-off-by: Greg Kroah-Hartman static struct bin_attribute bin_attr_nvmem_eeprom_compat = { .attr = { .name = "eeprom", -@@ -381,6 +428,68 @@ static void nvmem_sysfs_remove_compat(st +@@ -380,6 +427,68 @@ static void nvmem_sysfs_remove_compat(st device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom); } @@ -180,7 +180,7 @@ Signed-off-by: Greg Kroah-Hartman #else /* CONFIG_NVMEM_SYSFS */ static int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem, -@@ -740,11 +849,25 @@ static int nvmem_add_cells_from_fixed_la +@@ -739,11 +848,25 @@ static int nvmem_add_cells_from_fixed_la int nvmem_layout_register(struct nvmem_layout *layout) { @@ -207,7 +207,7 @@ Signed-off-by: Greg Kroah-Hartman } EXPORT_SYMBOL_GPL(nvmem_layout_register); -@@ -903,10 +1026,20 @@ struct nvmem_device *nvmem_register(cons +@@ -902,10 +1025,20 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_dev; diff --git a/target/linux/generic/backport-6.1/819-v6.8-0008-nvmem-layouts-refactor-.add_cells-callback-arguments.patch b/target/linux/generic/backport-6.1/819-v6.8-0008-nvmem-layouts-refactor-.add_cells-callback-arguments.patch index 1bf3ba35b6d91e..400004c617cb0f 100644 --- a/target/linux/generic/backport-6.1/819-v6.8-0008-nvmem-layouts-refactor-.add_cells-callback-arguments.patch +++ b/target/linux/generic/backport-6.1/819-v6.8-0008-nvmem-layouts-refactor-.add_cells-callback-arguments.patch @@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -855,7 +855,7 @@ int nvmem_layout_register(struct nvmem_l +@@ -854,7 +854,7 @@ int nvmem_layout_register(struct nvmem_l return -EINVAL; /* Populate the cells */ diff --git a/target/linux/generic/backport-6.1/819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch b/target/linux/generic/backport-6.1/819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch index 514b5f2de5c246..510f3dd8417418 100644 --- a/target/linux/generic/backport-6.1/819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch +++ b/target/linux/generic/backport-6.1/819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch @@ -24,7 +24,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -877,19 +877,6 @@ void nvmem_layout_unregister(struct nvme +@@ -876,19 +876,6 @@ void nvmem_layout_unregister(struct nvme } EXPORT_SYMBOL_GPL(nvmem_layout_unregister); diff --git a/target/linux/generic/backport-6.1/819-v6.8-0010-nvmem-core-add-nvmem_dev_size-helper.patch b/target/linux/generic/backport-6.1/819-v6.8-0010-nvmem-core-add-nvmem_dev_size-helper.patch index aa0bbaa0c55834..ccdcc09736d843 100644 --- a/target/linux/generic/backport-6.1/819-v6.8-0010-nvmem-core-add-nvmem_dev_size-helper.patch +++ b/target/linux/generic/backport-6.1/819-v6.8-0010-nvmem-core-add-nvmem_dev_size-helper.patch @@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -2164,6 +2164,19 @@ const char *nvmem_dev_name(struct nvmem_ +@@ -2163,6 +2163,19 @@ const char *nvmem_dev_name(struct nvmem_ } EXPORT_SYMBOL_GPL(nvmem_dev_name); diff --git a/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch b/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch index 105eb3da4bb67b..0a73146d022354 100644 --- a/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch @@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -4367,6 +4367,7 @@ int wake_up_state(struct task_struct *p, +@@ -4366,6 +4366,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-6.1/804-nvmem-core-support-mac-base-fixed-layout-cells.patch b/target/linux/generic/pending-6.1/804-nvmem-core-support-mac-base-fixed-layout-cells.patch index 9bb94a28b54b6a..da25b39ae9c1a6 100644 --- a/target/linux/generic/pending-6.1/804-nvmem-core-support-mac-base-fixed-layout-cells.patch +++ b/target/linux/generic/pending-6.1/804-nvmem-core-support-mac-base-fixed-layout-cells.patch @@ -33,7 +33,7 @@ string. #include #include #include -@@ -780,6 +783,62 @@ static int nvmem_validate_keepouts(struc +@@ -779,6 +782,62 @@ static int nvmem_validate_keepouts(struc return 0; } @@ -96,7 +96,7 @@ string. static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) { struct device *dev = &nvmem->dev; -@@ -814,6 +873,25 @@ static int nvmem_add_cells_from_dt(struc +@@ -813,6 +872,25 @@ static int nvmem_add_cells_from_dt(struc if (nvmem->fixup_dt_cell_info) nvmem->fixup_dt_cell_info(nvmem, &info); From 66177c081f1b05e4eb7f6c23d97954e8172c4336 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 18 Jul 2024 16:15:36 -0400 Subject: [PATCH 02/21] kernel: bump 6.6 to 6.6.41 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.41 Manually rebased: lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch All other patches automatically rebased. Build system: x86/64 Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia --- include/kernel-6.6 | 4 ++-- .../900-unaligned_access_hacks.patch | 2 +- ...hci_fixup_endpoint-for-interval-adju.patch | 4 ++-- ...d-add-the-endpoint-context-in-xhci_f.patch | 2 +- ...4-Revert-nvmem-add-new-config-option.patch | 2 +- ...mem_layout_get_container-in-another-.patch | 2 +- ...03-nvmem-Simplify-the-add_cells-hook.patch | 2 +- ...vmem-Move-and-rename-fixup_cell_info.patch | 6 +++--- ...rk-layouts-to-become-regular-devices.patch | 20 +++++++++---------- ...vmem-core-Expose-cells-through-sysfs.patch | 6 +++--- ...factor-.add_cells-callback-arguments.patch | 2 +- ...mem-drop-nvmem_layout_get_match_data.patch | 2 +- ...nvmem-core-add-nvmem_dev_size-helper.patch | 2 +- .../generic/hack-6.6/902-debloat_proc.patch | 2 +- .../hack-6.6/904-debloat_dma_buf.patch | 2 +- ...-support-mac-base-fixed-layout-cells.patch | 4 ++-- .../999-atm-mpoa-intel-dsl-phy-support.patch | 4 ++-- .../0028-NET-lantiq-various-etop-fixes.patch | 4 ++-- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index a736da59cb0265..24fff19d3bc93a 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .40 -LINUX_KERNEL_HASH-6.6.40 = 5c3a3c03c055b8d601a6d7f80d1465ada6b83a12299f6ace2027b47f0baff538 +LINUX_VERSION-6.6 = .41 +LINUX_KERNEL_HASH-6.6.41 = 9ec99c578158ab85d99b37791a76643d2ea4c3f72ecbef7b5eb6d60f3de032ef diff --git a/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch index df672946d85813..acc23796119b17 100644 --- a/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch @@ -751,7 +751,7 @@ SVN-Revision: 35130 EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4205,14 +4205,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4214,14 +4214,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/bcm27xx/patches-6.6/950-0161-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-6.6/950-0161-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch index 73baf3312b5cb2..a5352c6c482d70 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0161-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0161-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1487,6 +1487,109 @@ command_cleanup: +@@ -1497,6 +1497,109 @@ command_cleanup: } /* @@ -125,7 +125,7 @@ Signed-off-by: Jonathan Bell * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it */ -@@ -5316,6 +5419,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5326,6 +5429,7 @@ static const struct hc_driver xhci_hc_dr .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, diff --git a/target/linux/bcm27xx/patches-6.6/950-0163-usb-xhci-drop-and-add-the-endpoint-context-in-xhci_f.patch b/target/linux/bcm27xx/patches-6.6/950-0163-usb-xhci-drop-and-add-the-endpoint-context-in-xhci_f.patch index 957ed424079280..1e5bb6059d2762 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0163-usb-xhci-drop-and-add-the-endpoint-context-in-xhci_f.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0163-usb-xhci-drop-and-add-the-endpoint-context-in-xhci_f.patch @@ -19,7 +19,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1576,7 +1576,7 @@ static void xhci_fixup_endpoint(struct u +@@ -1586,7 +1586,7 @@ static void xhci_fixup_endpoint(struct u return; } ctrl_ctx->add_flags = xhci_get_endpoint_flag_from_index(ep_index); diff --git a/target/linux/generic/backport-6.6/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch b/target/linux/generic/backport-6.6/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch index 39be82d4bfd012..36d15248b8a966 100644 --- a/target/linux/generic/backport-6.6/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch +++ b/target/linux/generic/backport-6.6/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch @@ -48,7 +48,7 @@ Signed-off-by: Greg Kroah-Hartman mtd->nvmem = nvmem_register(&config); --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -941,7 +941,7 @@ struct nvmem_device *nvmem_register(cons +@@ -940,7 +940,7 @@ struct nvmem_device *nvmem_register(cons nvmem->nkeepout = config->nkeepout; if (config->of_node) nvmem->dev.of_node = config->of_node; diff --git a/target/linux/generic/backport-6.6/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch b/target/linux/generic/backport-6.6/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch index 59175c8051d571..7ca426e87aff94 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -847,14 +847,6 @@ static int nvmem_add_cells_from_layout(s +@@ -846,14 +846,6 @@ static int nvmem_add_cells_from_layout(s } #if IS_ENABLED(CONFIG_OF) diff --git a/target/linux/generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch b/target/linux/generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch index 1f39dfea2f9689..dac691e117af03 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch @@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -816,7 +816,7 @@ static int nvmem_add_cells_from_layout(s +@@ -815,7 +815,7 @@ static int nvmem_add_cells_from_layout(s int ret; if (layout && layout->add_cells) { diff --git a/target/linux/generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch b/target/linux/generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch index d2c274033ea3a1..0a614fc13dd884 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -675,7 +675,6 @@ static int nvmem_validate_keepouts(struc +@@ -674,7 +674,6 @@ static int nvmem_validate_keepouts(struc static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) { @@ -33,7 +33,7 @@ Signed-off-by: Greg Kroah-Hartman struct device *dev = &nvmem->dev; struct device_node *child; const __be32 *addr; -@@ -705,8 +704,8 @@ static int nvmem_add_cells_from_dt(struc +@@ -704,8 +703,8 @@ static int nvmem_add_cells_from_dt(struc info.np = of_node_get(child); @@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman ret = nvmem_add_one_cell(nvmem, &info); kfree(info.name); -@@ -895,6 +894,7 @@ struct nvmem_device *nvmem_register(cons +@@ -894,6 +893,7 @@ struct nvmem_device *nvmem_register(cons kref_init(&nvmem->refcnt); INIT_LIST_HEAD(&nvmem->cells); diff --git a/target/linux/generic/backport-6.6/819-v6.8-0005-nvmem-core-Rework-layouts-to-become-regular-devices.patch b/target/linux/generic/backport-6.6/819-v6.8-0005-nvmem-core-Rework-layouts-to-become-regular-devices.patch index ce33b52328a145..1a41050d08928b 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0005-nvmem-core-Rework-layouts-to-become-regular-devices.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0005-nvmem-core-Rework-layouts-to-become-regular-devices.patch @@ -84,7 +84,7 @@ Signed-off-by: Greg Kroah-Hartman static int __nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offset, void *val, size_t bytes) { -@@ -740,97 +737,22 @@ static int nvmem_add_cells_from_fixed_la +@@ -739,97 +736,22 @@ static int nvmem_add_cells_from_fixed_la return err; } @@ -189,7 +189,7 @@ Signed-off-by: Greg Kroah-Hartman const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem, struct nvmem_layout *layout) { -@@ -838,7 +760,7 @@ const void *nvmem_layout_get_match_data( +@@ -837,7 +759,7 @@ const void *nvmem_layout_get_match_data( const struct of_device_id *match; layout_np = of_nvmem_layout_get_container(nvmem); @@ -198,7 +198,7 @@ Signed-off-by: Greg Kroah-Hartman return match ? match->data : NULL; } -@@ -950,19 +872,6 @@ struct nvmem_device *nvmem_register(cons +@@ -949,19 +871,6 @@ struct nvmem_device *nvmem_register(cons goto err_put_device; } @@ -218,7 +218,7 @@ Signed-off-by: Greg Kroah-Hartman if (config->cells) { rval = nvmem_add_cells(nvmem, config->cells, config->ncells); if (rval) -@@ -983,24 +892,24 @@ struct nvmem_device *nvmem_register(cons +@@ -982,24 +891,24 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_cells; @@ -249,7 +249,7 @@ Signed-off-by: Greg Kroah-Hartman if (config->compat) nvmem_sysfs_remove_compat(nvmem, config); err_put_device: -@@ -1022,7 +931,7 @@ static void nvmem_device_release(struct +@@ -1021,7 +930,7 @@ static void nvmem_device_release(struct device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom); nvmem_device_remove_all_cells(nvmem); @@ -258,7 +258,7 @@ Signed-off-by: Greg Kroah-Hartman device_unregister(&nvmem->dev); } -@@ -1324,6 +1233,12 @@ nvmem_cell_get_from_lookup(struct device +@@ -1323,6 +1232,12 @@ nvmem_cell_get_from_lookup(struct device return cell; } @@ -271,7 +271,7 @@ Signed-off-by: Greg Kroah-Hartman #if IS_ENABLED(CONFIG_OF) static struct nvmem_cell_entry * nvmem_find_cell_entry_by_node(struct nvmem_device *nvmem, struct device_node *np) -@@ -1342,6 +1257,18 @@ nvmem_find_cell_entry_by_node(struct nvm +@@ -1341,6 +1256,18 @@ nvmem_find_cell_entry_by_node(struct nvm return cell; } @@ -290,7 +290,7 @@ Signed-off-by: Greg Kroah-Hartman /** * of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id * -@@ -1404,16 +1331,29 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1403,16 +1330,29 @@ struct nvmem_cell *of_nvmem_cell_get(str return ERR_CAST(nvmem); } @@ -322,7 +322,7 @@ Signed-off-by: Greg Kroah-Hartman return cell; } -@@ -1527,6 +1467,7 @@ void nvmem_cell_put(struct nvmem_cell *c +@@ -1526,6 +1466,7 @@ void nvmem_cell_put(struct nvmem_cell *c kfree(cell); __nvmem_device_put(nvmem); @@ -330,7 +330,7 @@ Signed-off-by: Greg Kroah-Hartman } EXPORT_SYMBOL_GPL(nvmem_cell_put); -@@ -2104,11 +2045,22 @@ EXPORT_SYMBOL_GPL(nvmem_dev_name); +@@ -2103,11 +2044,22 @@ EXPORT_SYMBOL_GPL(nvmem_dev_name); static int __init nvmem_init(void) { diff --git a/target/linux/generic/backport-6.6/819-v6.8-0006-nvmem-core-Expose-cells-through-sysfs.patch b/target/linux/generic/backport-6.6/819-v6.8-0006-nvmem-core-Expose-cells-through-sysfs.patch index 4a1f9aefc8b393..8442636b091544 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0006-nvmem-core-Expose-cells-through-sysfs.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0006-nvmem-core-Expose-cells-through-sysfs.patch @@ -111,7 +111,7 @@ Signed-off-by: Greg Kroah-Hartman static struct bin_attribute bin_attr_nvmem_eeprom_compat = { .attr = { .name = "eeprom", -@@ -380,6 +427,68 @@ static void nvmem_sysfs_remove_compat(st +@@ -379,6 +426,68 @@ static void nvmem_sysfs_remove_compat(st device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom); } @@ -180,7 +180,7 @@ Signed-off-by: Greg Kroah-Hartman #else /* CONFIG_NVMEM_SYSFS */ static int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem, -@@ -739,11 +848,25 @@ static int nvmem_add_cells_from_fixed_la +@@ -738,11 +847,25 @@ static int nvmem_add_cells_from_fixed_la int nvmem_layout_register(struct nvmem_layout *layout) { @@ -207,7 +207,7 @@ Signed-off-by: Greg Kroah-Hartman } EXPORT_SYMBOL_GPL(nvmem_layout_register); -@@ -902,10 +1025,20 @@ struct nvmem_device *nvmem_register(cons +@@ -901,10 +1024,20 @@ struct nvmem_device *nvmem_register(cons if (rval) goto err_remove_dev; diff --git a/target/linux/generic/backport-6.6/819-v6.8-0008-nvmem-layouts-refactor-.add_cells-callback-arguments.patch b/target/linux/generic/backport-6.6/819-v6.8-0008-nvmem-layouts-refactor-.add_cells-callback-arguments.patch index 400004c617cb0f..a95770a05906a1 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0008-nvmem-layouts-refactor-.add_cells-callback-arguments.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0008-nvmem-layouts-refactor-.add_cells-callback-arguments.patch @@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -854,7 +854,7 @@ int nvmem_layout_register(struct nvmem_l +@@ -853,7 +853,7 @@ int nvmem_layout_register(struct nvmem_l return -EINVAL; /* Populate the cells */ diff --git a/target/linux/generic/backport-6.6/819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch b/target/linux/generic/backport-6.6/819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch index 510f3dd8417418..291854bcb579d5 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch @@ -24,7 +24,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -876,19 +876,6 @@ void nvmem_layout_unregister(struct nvme +@@ -875,19 +875,6 @@ void nvmem_layout_unregister(struct nvme } EXPORT_SYMBOL_GPL(nvmem_layout_unregister); diff --git a/target/linux/generic/backport-6.6/819-v6.8-0010-nvmem-core-add-nvmem_dev_size-helper.patch b/target/linux/generic/backport-6.6/819-v6.8-0010-nvmem-core-add-nvmem_dev_size-helper.patch index ccdcc09736d843..93fd1ce6adf71f 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0010-nvmem-core-add-nvmem_dev_size-helper.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0010-nvmem-core-add-nvmem_dev_size-helper.patch @@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -2163,6 +2163,19 @@ const char *nvmem_dev_name(struct nvmem_ +@@ -2162,6 +2162,19 @@ const char *nvmem_dev_name(struct nvmem_ } EXPORT_SYMBOL_GPL(nvmem_dev_name); diff --git a/target/linux/generic/hack-6.6/902-debloat_proc.patch b/target/linux/generic/hack-6.6/902-debloat_proc.patch index eda0f45b729d59..559d4032429eb3 100644 --- a/target/linux/generic/hack-6.6/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.6/902-debloat_proc.patch @@ -235,7 +235,7 @@ Signed-off-by: Felix Fietkau if (!pe) --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -4447,6 +4447,8 @@ static const struct seq_operations vmall +@@ -4455,6 +4455,8 @@ static const struct seq_operations vmall static int __init proc_vmalloc_init(void) { diff --git a/target/linux/generic/hack-6.6/904-debloat_dma_buf.patch b/target/linux/generic/hack-6.6/904-debloat_dma_buf.patch index 8fdaab5ad6b8e1..4d2ea46212df45 100644 --- a/target/linux/generic/hack-6.6/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-6.6/904-debloat_dma_buf.patch @@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -4487,6 +4487,7 @@ int wake_up_state(struct task_struct *p, +@@ -4486,6 +4486,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-6.6/804-nvmem-core-support-mac-base-fixed-layout-cells.patch b/target/linux/generic/pending-6.6/804-nvmem-core-support-mac-base-fixed-layout-cells.patch index d08ed63eaaf8f2..44b98626545396 100644 --- a/target/linux/generic/pending-6.6/804-nvmem-core-support-mac-base-fixed-layout-cells.patch +++ b/target/linux/generic/pending-6.6/804-nvmem-core-support-mac-base-fixed-layout-cells.patch @@ -33,7 +33,7 @@ string. #include #include #include -@@ -779,6 +782,62 @@ static int nvmem_validate_keepouts(struc +@@ -778,6 +781,62 @@ static int nvmem_validate_keepouts(struc return 0; } @@ -96,7 +96,7 @@ string. static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) { struct device *dev = &nvmem->dev; -@@ -813,6 +872,25 @@ static int nvmem_add_cells_from_dt(struc +@@ -812,6 +871,25 @@ static int nvmem_add_cells_from_dt(struc if (nvmem->fixup_dt_cell_info) nvmem->fixup_dt_cell_info(nvmem, &info); diff --git a/target/linux/ipq40xx/patches-6.6/999-atm-mpoa-intel-dsl-phy-support.patch b/target/linux/ipq40xx/patches-6.6/999-atm-mpoa-intel-dsl-phy-support.patch index 3d5b7afe8c2f96..eab26ccb11d5f7 100644 --- a/target/linux/ipq40xx/patches-6.6/999-atm-mpoa-intel-dsl-phy-support.patch +++ b/target/linux/ipq40xx/patches-6.6/999-atm-mpoa-intel-dsl-phy-support.patch @@ -4,7 +4,7 @@ Subject: [PATCH] UGW_SW-29163: ATM oam support --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c -@@ -2953,6 +2953,22 @@ char *ppp_dev_name(struct ppp_channel *c +@@ -2968,6 +2968,22 @@ char *ppp_dev_name(struct ppp_channel *c return name; } @@ -27,7 +27,7 @@ Subject: [PATCH] UGW_SW-29163: ATM oam support /* * Disconnect a channel from the generic layer. -@@ -3599,6 +3615,7 @@ EXPORT_SYMBOL(ppp_unregister_channel); +@@ -3614,6 +3630,7 @@ EXPORT_SYMBOL(ppp_unregister_channel); EXPORT_SYMBOL(ppp_channel_index); EXPORT_SYMBOL(ppp_unit_number); EXPORT_SYMBOL(ppp_dev_name); diff --git a/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch index 8ac10972679019..ea3ba66e10f815 100644 --- a/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch +++ b/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch @@ -276,9 +276,9 @@ Signed-off-by: John Crispin free_irq(ch->dma.irq, priv); - if (IS_RX(ch->idx)) { + if (ch == &priv->txch) { - int desc; + struct ltq_dma_channel *dma = &ch->dma; - for (desc = 0; desc < LTQ_DESC_NUM; desc++) + for (dma->desc = 0; dma->desc < LTQ_DESC_NUM; dma->desc++) @@ -228,80 +305,135 @@ static void ltq_etop_hw_exit(struct net_device *dev) { From 2bebf133575f6669316d24601966a88dbcdbf61a Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Sun, 14 Jul 2024 22:21:52 -0700 Subject: [PATCH 03/21] libbpf: Update to v1.4.5 Update to the latest upstream release to include recent improvements and bugfixes. Link: https://github.com/libbpf/libbpf/releases/tag/v1.4.5 Link: https://github.com/libbpf/libbpf/releases/tag/v1.4.4 Signed-off-by: Tony Ambardar --- package/libs/libbpf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/libbpf/Makefile b/package/libs/libbpf/Makefile index 3b732e37bbd64e..a6fe9831d7348f 100644 --- a/package/libs/libbpf/Makefile +++ b/package/libs/libbpf/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libbpf -PKG_VERSION:=1.4.3 +PKG_VERSION:=1.4.5 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/libbpf/libbpf -PKG_MIRROR_HASH:=53f2f290fced9663da309e9e03ddcb0b176a47d39d61639c74dbc555d6b979a8 +PKG_MIRROR_HASH:=09ad44597d170c12f9f710f7ac4bacfa2b01d110c45810ac0f16c6a3f5d51a0d PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION))) From 02e8285051fc458fa0847eca8dc2490df51d6fc4 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Sat, 13 Jul 2024 16:40:30 -0400 Subject: [PATCH 04/21] mac80211: fix kconf build warnings This patch cleans up the following warnings during build: "warning: format not a string literal" ``` conf.c: In function 'conf_askvalue': conf.c:89:17: warning: format not a string literal and no format arguments [-Wformat-security] 89 | printf(_("(NEW) ")); | ^~~~~~ conf.c: In function 'conf_choice': conf.c:285:33: warning: format not a string literal and no format arguments [-Wformat-security] 285 | printf(_(" (NEW)")); | ^~~~~~ conf.c: In function 'check_conf': conf.c:440:41: warning: format not a string literal and no format arguments [-Wformat-security] 440 | printf(_("*\n* Restart config...\n*\n")); | ^~~~~~ conf.c: In function 'main': conf.c:617:41: warning: format not a string literal and no format arguments [-Wformat-security] 617 | _("\n*** The configuration requires explicit update.\n\n")); | ^ conf.c:669:25: warning: format not a string literal and no format arguments [-Wformat-security] 669 | fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); | ^~~~~~~ conf.c:673:25: warning: format not a string literal and no format arguments [-Wformat-security] 673 | fprintf(stderr, _("\n*** Error during update of the configuration.\n\n")); | ^~~~~~~ conf.c:684:25: warning: format not a string literal and no format arguments [-Wformat-security] 684 | fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); | ^~~~~~~ ``` And POSIX Yacc warnings ``` lex -ozconf.lex.c -L zconf.l yacc -ozconf.tab.c -t -l zconf.y zconf.y:34.1-7: warning: POSIX Yacc does not support %expect [-Wyacc] 34 | %expect 32 | ^~~~~~~ zconf.y:97.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] 97 | %destructor { | ^~~~~~~~~~~ gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DKBUILD_NO_NLS -c -o zconf.tab.o zconf.tab.c gcc conf.o zconf.tab.o -o conf ``` After: gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DKBUILD_NO_NLS -c -o conf.o conf.c yacc -Wno-yacc -ozconf.tab.c -t -l zconf.y gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DKBUILD_NO_NLS -c -o zconf.tab.o zconf.tab.c gcc conf.o zconf.tab.o -o conf Signed-off-by: Sean Khan Link: https://github.com/openwrt/openwrt/pull/15953 Signed-off-by: Hauke Mehrtens --- .../build/005-fix-kconf-warnings.patch | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 package/kernel/mac80211/patches/build/005-fix-kconf-warnings.patch diff --git a/package/kernel/mac80211/patches/build/005-fix-kconf-warnings.patch b/package/kernel/mac80211/patches/build/005-fix-kconf-warnings.patch new file mode 100644 index 00000000000000..00e94003f27caa --- /dev/null +++ b/package/kernel/mac80211/patches/build/005-fix-kconf-warnings.patch @@ -0,0 +1,76 @@ +--- a/kconf/conf.c ++++ b/kconf/conf.c +@@ -86,7 +86,7 @@ static int conf_askvalue(struct symbol * + enum symbol_type type = sym_get_type(sym); + + if (!sym_has_value(sym)) +- printf(_("(NEW) ")); ++ printf("%s", _("(NEW) ")); + + line[0] = '\n'; + line[1] = 0; +@@ -282,7 +282,7 @@ static int conf_choice(struct menu *menu + if (child->sym->name) + printf(" (%s)", child->sym->name); + if (!sym_has_value(child->sym)) +- printf(_(" (NEW)")); ++ printf("%s", _(" (NEW)")); + printf("\n"); + } + printf(_("%*schoice"), indent - 1, ""); +@@ -437,7 +437,7 @@ static void check_conf(struct menu *menu + } + } else { + if (!conf_cnt++) +- printf(_("*\n* Restart config...\n*\n")); ++ printf("%s", _("*\n* Restart config...\n*\n")); + rootEntry = menu_get_parent_menu(menu); + conf(rootEntry); + } +@@ -614,7 +614,7 @@ int main(int ac, char **av) + name = getenv("KCONFIG_NOSILENTUPDATE"); + if (name && *name) { + fprintf(stderr, +- _("\n*** The configuration requires explicit update.\n\n")); ++ "%s", _("\n*** The configuration requires explicit update.\n\n")); + return 1; + } + } +@@ -666,22 +666,22 @@ int main(int ac, char **av) + * All other commands are only used to generate a config. + */ + if (conf_get_changed() && conf_write(NULL)) { +- fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); ++ fprintf(stderr, "%s", _("\n*** Error during writing of the configuration.\n\n")); + exit(1); + } + if (conf_write_autoconf()) { +- fprintf(stderr, _("\n*** Error during update of the configuration.\n\n")); ++ fprintf(stderr, "%s", _("\n*** Error during update of the configuration.\n\n")); + return 1; + } + } else if (input_mode == savedefconfig) { + if (conf_write_defconfig(defconfig_file)) { +- fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"), ++ fprintf(stderr, _("\n*** Error while saving defconfig to: %s\n\n"), + defconfig_file); + return 1; + } + } else if (input_mode != listnewconfig) { + if (conf_write(NULL)) { +- fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); ++ fprintf(stderr, "%s", _("\n*** Error during writing of the configuration.\n\n")); + exit(1); + } + } +--- a/kconf/Makefile ++++ b/kconf/Makefile +@@ -17,7 +17,7 @@ clean: + zconf.tab.c: zconf.lex.c + + %.tab.c: %.y +- $(YACC) -o$@ -t -l $< ++ $(YACC) -Wno-yacc -o$@ -t -l $< + + %.lex.c: %.l + $(LEX) -o$@ -L $< From c5a443635a24ccbf03fc809339ab0a51982cd133 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Sat, 13 Jul 2024 12:11:34 +0200 Subject: [PATCH 05/21] lantiq: properly release descriptors in etop driver detach This patch fixes two issues in the driver detach: * double free of the same descriptor (upstream bug, backported in 66177c081f1b05e4eb7f6c23d97954e8172c4336), * releasing tx descriptor instead of rx (downstream bug). The driver is compiled into the kernel that is why the error is not visible in normal use. Signed-off-by: Aleksander Jan Bajkowski Link: https://github.com/openwrt/openwrt/pull/15939 Signed-off-by: Hauke Mehrtens --- .../patches-6.6/0028-NET-lantiq-various-etop-fixes.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch index ea3ba66e10f815..f5b6a0347b86ca 100644 --- a/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch +++ b/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch @@ -5,8 +5,8 @@ Subject: [PATCH 28/36] NET: lantiq: various etop fixes Signed-off-by: John Crispin --- - drivers/net/ethernet/lantiq_etop.c | 555 +++++++++++++++++++++++++----------- - 1 file changed, 389 insertions(+), 166 deletions(-) + drivers/net/ethernet/lantiq_etop.c | 531 ++++++++++++++++++++--------- + 1 file changed, 374 insertions(+), 157 deletions(-) --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -275,7 +275,7 @@ Signed-off-by: John Crispin if (ch->dma.irq) free_irq(ch->dma.irq, priv); - if (IS_RX(ch->idx)) { -+ if (ch == &priv->txch) { ++ if (ch == &priv->rxch) { struct ltq_dma_channel *dma = &ch->dma; for (dma->desc = 0; dma->desc < LTQ_DESC_NUM; dma->desc++) From ccfc4545488d215d94cf15282295c25ae9c9564b Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Sat, 13 Jul 2024 12:36:02 +0200 Subject: [PATCH 06/21] lantiq: fix checkpatch warnings in etop driver This commit fixes all errors reported by the checkpatch script. This should make it easier to accept upstream this patch. There should be no functional changes. Signed-off-by: Aleksander Jan Bajkowski Link: https://github.com/openwrt/openwrt/pull/15939 Signed-off-by: Hauke Mehrtens --- ...tiq_etop-remove-redundant-device-nam.patch | 31 +++++ .../0028-NET-lantiq-various-etop-fixes.patch | 106 +++++++++--------- ...iq-wifi-and-ethernet-eeprom-handling.patch | 2 +- .../0701-NET-lantiq-etop-of-mido.patch | 4 +- 4 files changed, 87 insertions(+), 56 deletions(-) create mode 100644 target/linux/lantiq/patches-6.6/0027-v6.11-net-ethernet-lantiq_etop-remove-redundant-device-nam.patch diff --git a/target/linux/lantiq/patches-6.6/0027-v6.11-net-ethernet-lantiq_etop-remove-redundant-device-nam.patch b/target/linux/lantiq/patches-6.6/0027-v6.11-net-ethernet-lantiq_etop-remove-redundant-device-nam.patch new file mode 100644 index 00000000000000..abaef6c3a80331 --- /dev/null +++ b/target/linux/lantiq/patches-6.6/0027-v6.11-net-ethernet-lantiq_etop-remove-redundant-device-nam.patch @@ -0,0 +1,31 @@ +From 9283477e28913c1e7625c0a8d6959745e2431533 Mon Sep 17 00:00:00 2001 +From: Aleksander Jan Bajkowski +Date: Sat, 13 Jul 2024 19:09:20 +0200 +Subject: [PATCH] net: ethernet: lantiq_etop: remove redundant device name + setup + +The same name is set when allocating the netdevice structure in the +alloc_etherdev_mq()->alloc_etherrdev_mqs() function. Therefore, there +is no need to manually set it. + +This fixes CheckPatch warnings: +WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88 + strcpy(dev->name, "eth%d"); + +Signed-off-by: Aleksander Jan Bajkowski +Link: https://patch.msgid.link/20240713170920.863171-1-olek2@wp.pl +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/lantiq_etop.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/net/ethernet/lantiq_etop.c ++++ b/drivers/net/ethernet/lantiq_etop.c +@@ -675,7 +675,6 @@ ltq_etop_probe(struct platform_device *p + err = -ENOMEM; + goto err_out; + } +- strcpy(dev->name, "eth%d"); + dev->netdev_ops = <q_eth_netdev_ops; + dev->ethtool_ops = <q_etop_ethtool_ops; + priv = netdev_priv(dev); diff --git a/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch index f5b6a0347b86ca..788a34d61abfc3 100644 --- a/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch +++ b/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch @@ -5,8 +5,8 @@ Subject: [PATCH 28/36] NET: lantiq: various etop fixes Signed-off-by: John Crispin --- - drivers/net/ethernet/lantiq_etop.c | 531 ++++++++++++++++++++--------- - 1 file changed, 374 insertions(+), 157 deletions(-) + drivers/net/ethernet/lantiq_etop.c | 530 ++++++++++++++++++++--------- + 1 file changed, 375 insertions(+), 155 deletions(-) --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -66,10 +66,10 @@ Signed-off-by: John Crispin -#define LTQ_ETOP_IGPLEN 0x16080 + +#define MAC_CFG_MASK 0xfff -+#define MAC_CFG_CGEN (1 << 11) -+#define MAC_CFG_DUPLEX (1 << 2) -+#define MAC_CFG_SPEED (1 << 1) -+#define MAC_CFG_LINK (1 << 0) ++#define MAC_CFG_CGEN BIT(11) ++#define MAC_CFG_DUPLEX BIT(2) ++#define MAC_CFG_SPEED BIT(1) ++#define MAC_CFG_LINK BIT(0) #define MAX_DMA_CHAN 0x8 #define MAX_DMA_CRC_LEN 0x4 @@ -89,11 +89,11 @@ Signed-off-by: John Crispin -#define IS_TX(x) ((x) == LTQ_ETOP_TX_CHANNEL) -#define IS_RX(x) ((x) == LTQ_ETOP_RX_CHANNEL) +#define ETOP_CFG_MASK 0xfff -+#define ETOP_CFG_FEN0 (1 << 8) -+#define ETOP_CFG_SEN0 (1 << 6) -+#define ETOP_CFG_OFF1 (1 << 3) -+#define ETOP_CFG_REMII0 (1 << 1) -+#define ETOP_CFG_OFF0 (1 << 0) ++#define ETOP_CFG_FEN0 BIT(8) ++#define ETOP_CFG_SEN0 BIT(6) ++#define ETOP_CFG_OFF1 BIT(3) ++#define ETOP_CFG_REMII0 BIT(1) ++#define ETOP_CFG_OFF0 BIT(0) + +#define LTQ_GBIT_MDIO_CTL 0xCC +#define LTQ_GBIT_MDIO_DATA 0xd0 @@ -103,8 +103,8 @@ Signed-off-by: John Crispin +#define LTQ_GBIT_PMAC_RX_IPG 0xa8 +#define LTQ_GBIT_RGMII_CTL 0x78 + -+#define PMAC_HD_CTL_AS (1 << 19) -+#define PMAC_HD_CTL_RXSH (1 << 22) ++#define PMAC_HD_CTL_AS BIT(19) ++#define PMAC_HD_CTL_RXSH BIT(22) + +/* Switch Enable (0=disable, 1=enable) */ +#define GCTL0_SE 0x80000000 @@ -170,14 +170,13 @@ Signed-off-by: John Crispin int tx_burst_len; int rx_burst_len; -- spinlock_t lock; + int tx_irq; + int rx_irq; + + unsigned char mac[6]; + phy_interface_t mii_mode; -+ -+ spinlock_t lock; ++ + spinlock_t lock; + + struct clk *clk_ppe; + struct clk *clk_switch; @@ -186,7 +185,7 @@ Signed-off-by: John Crispin }; +static int ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, -+ int phy_reg, u16 phy_data); ++ int phy_reg, u16 phy_data); + static int ltq_etop_alloc_skb(struct ltq_etop_chan *ch) @@ -256,12 +255,12 @@ Signed-off-by: John Crispin return 1; } -@@ -202,9 +278,10 @@ static irqreturn_t +@@ -202,9 +278,11 @@ static irqreturn_t ltq_etop_dma_irq(int irq, void *_priv) { struct ltq_etop_priv *priv = _priv; - int ch = irq - LTQ_DMA_CH0_INT; -- + - napi_schedule(&priv->ch[ch].napi); + if (irq == priv->txch.dma.irq) + napi_schedule(&priv->txch.napi); @@ -270,7 +269,7 @@ Signed-off-by: John Crispin return IRQ_HANDLED; } -@@ -216,7 +293,7 @@ ltq_etop_free_channel(struct net_device +@@ -216,7 +294,7 @@ ltq_etop_free_channel(struct net_device ltq_dma_free(&ch->dma); if (ch->dma.irq) free_irq(ch->dma.irq, priv); @@ -279,7 +278,7 @@ Signed-off-by: John Crispin struct ltq_dma_channel *dma = &ch->dma; for (dma->desc = 0; dma->desc < LTQ_DESC_NUM; dma->desc++) -@@ -228,80 +305,135 @@ static void +@@ -228,80 +306,137 @@ static void ltq_etop_hw_exit(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -320,13 +319,14 @@ Signed-off-by: John Crispin + ltq_gbit_w32_mask(0x300, 0, LTQ_GBIT_GCTL0); + /* disable pmac & dmac headers */ + ltq_gbit_w32_mask(PMAC_HD_CTL_AS | PMAC_HD_CTL_RXSH, 0, -+ LTQ_GBIT_PMAC_HD_CTL); ++ LTQ_GBIT_PMAC_HD_CTL); + /* Due to traffic halt when burst length 8, -+ replace default IPG value with 0x3B */ ++ *replace default IPG value with 0x3B ++ */ + ltq_gbit_w32(0x3B, LTQ_GBIT_PMAC_RX_IPG); + /* set mdc clock to 2.5 MHz */ + ltq_gbit_w32_mask(MDC_CLOCK_MASK, 4 << MDC_CLOCK_OFFSET, -+ LTQ_GBIT_RGMII_CTL); ++ LTQ_GBIT_RGMII_CTL); } static int @@ -336,11 +336,10 @@ Signed-off-by: John Crispin - int i; - int err; + phy_interface_t mii_mode = priv->mii_mode; - -- ltq_pmu_enable(PMU_PPE); ++ + clk_enable(priv->clk_ppe); -- switch (priv->pldata->mii_mode) { +- ltq_pmu_enable(PMU_PPE); + if (of_machine_is_compatible("lantiq,ar9")) { + ltq_etop_gbit_init(dev); + /* force the etops link to the gbit to MII */ @@ -349,7 +348,8 @@ Signed-off-by: John Crispin + ltq_etop_w32_mask(MDIO_CFG_MASK, 0, LTQ_ETOP_MDIO_CFG); + ltq_etop_w32_mask(MAC_CFG_MASK, MAC_CFG_CGEN | MAC_CFG_DUPLEX | + MAC_CFG_SPEED | MAC_CFG_LINK, LTQ_ETOP_MAC_CFG); -+ + +- switch (priv->pldata->mii_mode) { + switch (mii_mode) { case PHY_INTERFACE_MODE_RMII: - ltq_etop_w32_mask(ETOP_MII_MASK, ETOP_MII_REVERSE, @@ -373,7 +373,8 @@ Signed-off-by: John Crispin + /* enable clock for internal PHY */ + clk_enable(priv->clk_ephycgu); + /* we need to write this magic to the internal phy to -+ make it work */ ++ * make it work ++ */ + ltq_etop_mdio_wr(NULL, 0x8, 0x12, 0xC020); + pr_info("Selected EPHY mode\n"); + break; @@ -464,12 +465,12 @@ Signed-off-by: John Crispin } static void -@@ -320,6 +452,39 @@ static const struct ethtool_ops ltq_etop +@@ -320,6 +455,39 @@ static const struct ethtool_ops ltq_etop }; static int +ltq_etop_mdio_wr_xr9(struct mii_bus *bus, int phy_addr, -+ int phy_reg, u16 phy_data) ++ int phy_reg, u16 phy_data) +{ + u32 val = MDIO_XR9_REQUEST | MDIO_XR9_WRITE | + (phy_data << MDIO_XR9_WR_OFFSET) | @@ -504,7 +505,7 @@ Signed-off-by: John Crispin ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int phy_reg, u16 phy_data) { u32 val = MDIO_REQUEST | -@@ -327,9 +492,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in +@@ -327,9 +495,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET) | phy_data; @@ -516,7 +517,7 @@ Signed-off-by: John Crispin return 0; } -@@ -340,12 +505,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in +@@ -340,12 +508,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in ((phy_addr & MDIO_ADDR_MASK) << MDIO_ADDR_OFFSET) | ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET); @@ -533,7 +534,7 @@ Signed-off-by: John Crispin return val; } -@@ -361,7 +526,10 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -361,7 +529,10 @@ ltq_etop_mdio_probe(struct net_device *d struct ltq_etop_priv *priv = netdev_priv(dev); struct phy_device *phydev; @@ -545,7 +546,7 @@ Signed-off-by: John Crispin if (!phydev) { netdev_err(dev, "no PHY found\n"); -@@ -369,14 +537,17 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -369,14 +540,17 @@ ltq_etop_mdio_probe(struct net_device *d } phydev = phy_connect(dev, phydev_name(phydev), @@ -565,7 +566,7 @@ Signed-off-by: John Crispin phy_attached_info(phydev); -@@ -397,8 +568,13 @@ ltq_etop_mdio_init(struct net_device *de +@@ -397,8 +571,13 @@ ltq_etop_mdio_init(struct net_device *de } priv->mii_bus->priv = dev; @@ -581,7 +582,7 @@ Signed-off-by: John Crispin priv->mii_bus->name = "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); -@@ -435,18 +611,21 @@ static int +@@ -435,18 +614,21 @@ static int ltq_etop_open(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -613,7 +614,7 @@ Signed-off-by: John Crispin netif_tx_start_all_queues(dev); return 0; } -@@ -455,18 +634,19 @@ static int +@@ -455,18 +637,19 @@ static int ltq_etop_stop(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -643,7 +644,7 @@ Signed-off-by: John Crispin return 0; } -@@ -476,15 +656,16 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -476,15 +659,16 @@ ltq_etop_tx(struct sk_buff *skb, struct int queue = skb_get_queue_mapping(skb); struct netdev_queue *txq = netdev_get_tx_queue(dev, queue); struct ltq_etop_priv *priv = netdev_priv(dev); @@ -660,11 +661,11 @@ Signed-off-by: John Crispin - if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || ch->skb[ch->dma.desc]) { + if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || -+ priv->txch.skb[priv->txch.dma.desc]) { ++ priv->txch.skb[priv->txch.dma.desc]) { netdev_err(dev, "tx ring full\n"); netif_tx_stop_queue(txq); return NETDEV_TX_BUSY; -@@ -492,7 +673,7 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -492,7 +676,7 @@ ltq_etop_tx(struct sk_buff *skb, struct /* dma needs to start on a burst length value aligned address */ byte_offset = CPHYSADDR(skb->data) % (priv->tx_burst_len * 4); @@ -673,7 +674,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); -@@ -503,11 +684,11 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -503,11 +687,11 @@ ltq_etop_tx(struct sk_buff *skb, struct wmb(); desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | LTQ_DMA_TX_OFFSET(byte_offset) | (len & LTQ_DMA_SIZE_MASK); @@ -688,7 +689,7 @@ Signed-off-by: John Crispin netif_tx_stop_queue(txq); return NETDEV_TX_OK; -@@ -518,11 +699,14 @@ ltq_etop_change_mtu(struct net_device *d +@@ -518,11 +702,14 @@ ltq_etop_change_mtu(struct net_device *d { struct ltq_etop_priv *priv = netdev_priv(dev); unsigned long flags; @@ -704,7 +705,7 @@ Signed-off-by: John Crispin spin_unlock_irqrestore(&priv->lock, flags); return 0; -@@ -575,6 +759,9 @@ ltq_etop_init(struct net_device *dev) +@@ -575,6 +762,9 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; ltq_etop_change_mtu(dev, 1500); @@ -714,7 +715,7 @@ Signed-off-by: John Crispin memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr)); if (!is_valid_ether_addr(mac.sa_data)) { -@@ -592,9 +779,10 @@ ltq_etop_init(struct net_device *dev) +@@ -592,9 +782,10 @@ ltq_etop_init(struct net_device *dev) dev->addr_assign_type = NET_ADDR_RANDOM; ltq_etop_set_multicast_list(dev); @@ -724,11 +725,11 @@ Signed-off-by: John Crispin + if (!ltq_etop_mdio_init(dev)) + dev->ethtool_ops = <q_etop_ethtool_ops; + else -+ pr_warn("etop: mdio probe failed\n");; ++ pr_warn("etop: mdio probe failed\n"); return 0; err_netdev: -@@ -614,6 +802,9 @@ ltq_etop_tx_timeout(struct net_device *d +@@ -614,6 +805,9 @@ ltq_etop_tx_timeout(struct net_device *d err = ltq_etop_hw_init(dev); if (err) goto err_hw; @@ -738,7 +739,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); netif_wake_queue(dev); return; -@@ -637,14 +828,18 @@ static const struct net_device_ops ltq_e +@@ -637,14 +831,18 @@ static const struct net_device_ops ltq_e .ndo_tx_timeout = ltq_etop_tx_timeout, }; @@ -761,7 +762,7 @@ Signed-off-by: John Crispin res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { -@@ -670,19 +865,55 @@ ltq_etop_probe(struct platform_device *p +@@ -670,18 +868,54 @@ ltq_etop_probe(struct platform_device *p goto err_out; } @@ -777,7 +778,7 @@ Signed-off-by: John Crispin + goto err_out; + } + ltq_gbit_membase = devm_ioremap(&pdev->dev, -+ gbit_res->start, resource_size(gbit_res)); ++ gbit_res->start, resource_size(gbit_res)); + if (!ltq_gbit_membase) { + dev_err(&pdev->dev, "failed to remap gigabit switch %d\n", + pdev->id); @@ -787,7 +788,6 @@ Signed-off-by: John Crispin } + + dev = alloc_etherdev_mq(sizeof(struct ltq_etop_priv), 4); - strcpy(dev->name, "eth%d"); dev->netdev_ops = <q_eth_netdev_ops; - dev->ethtool_ops = <q_etop_ethtool_ops; priv = netdev_priv(dev); @@ -823,7 +823,7 @@ Signed-off-by: John Crispin spin_lock_init(&priv->lock); SET_NETDEV_DEV(dev, &pdev->dev); -@@ -698,15 +929,10 @@ ltq_etop_probe(struct platform_device *p +@@ -697,15 +931,10 @@ ltq_etop_probe(struct platform_device *p goto err_free; } @@ -843,7 +843,7 @@ Signed-off-by: John Crispin err = register_netdev(dev); if (err) -@@ -735,31 +961,22 @@ ltq_etop_remove(struct platform_device * +@@ -734,31 +963,22 @@ ltq_etop_remove(struct platform_device * return 0; } diff --git a/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch index b06c5ab47cebb5..3e349d4c32c756 100644 --- a/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch +++ b/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch @@ -203,7 +203,7 @@ Signed-off-by: John Crispin +early_param("ethaddr", setup_ethaddr); --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c -@@ -763,7 +763,11 @@ ltq_etop_init(struct net_device *dev) +@@ -766,7 +766,11 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; diff --git a/target/linux/lantiq/patches-6.6/0701-NET-lantiq-etop-of-mido.patch b/target/linux/lantiq/patches-6.6/0701-NET-lantiq-etop-of-mido.patch index 19c027b9f85e22..d80cdb0872323b 100644 --- a/target/linux/lantiq/patches-6.6/0701-NET-lantiq-etop-of-mido.patch +++ b/target/linux/lantiq/patches-6.6/0701-NET-lantiq-etop-of-mido.patch @@ -18,7 +18,7 @@ Signed-off-by: Johann Neuhauser #include -@@ -558,7 +559,8 @@ static int +@@ -561,7 +562,8 @@ static int ltq_etop_mdio_init(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -28,7 +28,7 @@ Signed-off-by: Johann Neuhauser priv->mii_bus = mdiobus_alloc(); if (!priv->mii_bus) { -@@ -578,7 +580,15 @@ ltq_etop_mdio_init(struct net_device *de +@@ -581,7 +583,15 @@ ltq_etop_mdio_init(struct net_device *de priv->mii_bus->name = "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); From 93ead910dc6069e5fe174a7fc843bb86b43a323f Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Wed, 19 Jun 2024 14:49:44 +0200 Subject: [PATCH 07/21] ramips: mt7620: remove kmod-switch-rtl8366-smi from package list Remove kmod-switch-rtl8366-smi from the package list, as it is still loaded because kmod-switch-rtl8367b depends on it Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/15757 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/image/mt7620.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index da1c3e69e6a073..67deb8f0409d7a 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -1220,7 +1220,7 @@ define Device/tplink_archer-c2-v1 DEVICE_MODEL := Archer C2 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci \ - kmod-usb-ledtrig-usbport kmod-switch-rtl8366-smi kmod-switch-rtl8367b + kmod-usb-ledtrig-usbport kmod-switch-rtl8367b endef TARGET_DEVICES += tplink_archer-c2-v1 @@ -1605,7 +1605,7 @@ define Device/zyxel_keenetic-viva DEVICE_VENDOR := ZyXEL DEVICE_MODEL := Keenetic Viva DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ - kmod-switch-rtl8366-smi kmod-switch-rtl8367b + kmod-switch-rtl8367b IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to 64k | check-size | \ zyimage -d 8997 -v "ZyXEL Keenetic Viva" From f2f428c6991ba4be7180208c99693d8bb37e082b Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 6 Jul 2024 15:30:31 +0800 Subject: [PATCH 08/21] mediatek: add ABT ASR3000 support Hardware specification: SoC: MediaTek MT7981B 2x A53 Flash: 128 MB SPI-NAND RAM: 256MB Ethernet: 4x 10/100/1000 Mbps Switch: MediaTek MT7531AE WiFi: MediaTek MT7976C Button: Reset, Mesh Power: DC 12V 1A Gain telnet access: 1. Login into web interface, and download the configuration. 2. Decode and uncompress the configuration: * Enter fakeroot if you are not login as root. base64 -d e-xxxxxxxxxxxx-cfg.tar.gz | tar -zx 3. Edit 'etc/passwd', remove root password: 'root::1:0:99999:7:::'. 4. Edit 'etc/rc.local', insert telnetd command before 'exit 0': ( sleep 3s; /usr/sbin/telnetd; ) & 5. Repack the configuration: tar -zc etc/ | base64 > e-xxxxxxxxxxxx-cfg.tar.gz 6. Upload new configuration via web interface, now you can connect to ASR3000 via telnet. Flash instructions: 1. Connect to ASR3000, backup everything, especially 'Factory' part. 2. Write new BL2: mtd write openwrt-mediatek-filogic-abt_asr3000-preloader.bin BL2 3. Write new FIP: mtd write openwrt-mediatek-filogic-abt_asr3000-bl31-uboot.fip FIP 4. Set static IP on your PC: IP 192.168.1.254/24, GW 192.168.1.1 5. Serve OpenWrt initramfs image using TFTP server. 6. Cut off the power and re-engage, wait for TFTP recovery to complete. 7. After OpenWrt has booted, perform sysupgrade. Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/15887 Signed-off-by: Hauke Mehrtens --- .../uboot-envtools/files/mediatek_filogic | 29 +- package/boot/uboot-mediatek/Makefile | 13 + .../patches/444-add-abt_asr3000.patch | 347 ++++++++++++++++++ .../mediatek/dts/mt7981b-abt-asr3000.dts | 275 ++++++++++++++ .../filogic/base-files/etc/board.d/01_leds | 5 + .../filogic/base-files/etc/board.d/02_network | 13 +- .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 7 + .../base-files/lib/upgrade/platform.sh | 31 +- target/linux/mediatek/image/filogic.mk | 24 ++ 9 files changed, 709 insertions(+), 35 deletions(-) create mode 100644 package/boot/uboot-mediatek/patches/444-add-abt_asr3000.patch create mode 100644 target/linux/mediatek/dts/mt7981b-abt-asr3000.dts diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 67d37931c29b9e..c6d914eb70fc6f 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -33,6 +33,21 @@ ubootenv_add_ubi_default() { } case "$board" in +abt,asr3000|\ +h3c,magic-nx30-pro|\ +jcg,q30-pro|\ +netcore,n60|\ +nokia,ea0326gmp|\ +qihoo,360t7|\ +tplink,tl-xdr4288|\ +tplink,tl-xdr6086|\ +tplink,tl-xdr6088|\ +xiaomi,mi-router-ax3000t-ubootmod|\ +xiaomi,mi-router-wr30u-ubootmod|\ +xiaomi,redmi-router-ax6000-ubootmod|\ +zyxel,ex5601-t0-ubootmod) + ubootenv_add_ubi_default + ;; asus,rt-ax59u) ubootenv_add_uci_config "/dev/mtd0" "0x100000" "0x20000" "0x20000" ;; @@ -70,20 +85,6 @@ zbtlink,zbt-z8103ax) dlink,aquila-pro-ai-m30-a1) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" ;; -h3c,magic-nx30-pro|\ -jcg,q30-pro|\ -netcore,n60|\ -nokia,ea0326gmp|\ -qihoo,360t7|\ -tplink,tl-xdr4288|\ -tplink,tl-xdr6086|\ -tplink,tl-xdr6088|\ -xiaomi,mi-router-ax3000t-ubootmod|\ -xiaomi,mi-router-wr30u-ubootmod|\ -xiaomi,redmi-router-ax6000-ubootmod|\ -zyxel,ex5601-t0-ubootmod) - ubootenv_add_ubi_default - ;; glinet,gl-mt2500|\ glinet,gl-mt6000) local envdev=$(find_mmc_part "u-boot-env") diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index 71b72ba018f1ff..d3363ea7130c3a 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -219,6 +219,18 @@ define U-Boot/mt7629_rfb UBOOT_CONFIG:=mt7629_rfb endef +define U-Boot/mt7981_abt_asr3000 + NAME:=ABT ASR3000 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=abt_asr3000 + UBOOT_CONFIG:=mt7981_abt_asr3000 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=spim-nand + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 +endef + define U-Boot/mt7981_cmcc_rax3000m-emmc NAME:=CMCC RAX3000M BUILD_SUBTARGET:=filogic @@ -734,6 +746,7 @@ UBOOT_TARGETS := \ mt7628_rfb \ mt7628_ravpower_rp-wd009 \ mt7629_rfb \ + mt7981_abt_asr3000 \ mt7981_cmcc_rax3000m-emmc \ mt7981_cmcc_rax3000m-nand \ mt7981_h3c_magic-nx30-pro \ diff --git a/package/boot/uboot-mediatek/patches/444-add-abt_asr3000.patch b/package/boot/uboot-mediatek/patches/444-add-abt_asr3000.patch new file mode 100644 index 00000000000000..162e502f1ad5b4 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/444-add-abt_asr3000.patch @@ -0,0 +1,347 @@ +--- /dev/null ++++ b/configs/mt7981_abt_asr3000_defconfig +@@ -0,0 +1,107 @@ ++CONFIG_ARM=y ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEFAULT_DEVICE_TREE="mt7981-abt-asr3000" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_TARGET_MT7981=y ++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-abt-asr3000.dtb" ++CONFIG_LOGLEVEL=7 ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_LOG=y ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_PROMPT="MT7981> " ++CONFIG_CMD_CPU=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_CMD_STRINGS=y ++CONFIG_CMD_DM=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_UUID=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_UBI=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_ENV_UBI_PART="ubi" ++CONFIG_ENV_UBI_VOLUME="ubootenv" ++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2" ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_USE_DEFAULT_ENV_FILE=y ++CONFIG_DEFAULT_ENV_FILE="abt_asr3000_env" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_NETCONSOLE=y ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_CLK=y ++CONFIG_GPIO_HOG=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++# CONFIG_MMC is not set ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_MTD_UBI_FASTMAP=y ++CONFIG_PHY_FIXED=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7981=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_RAM=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPIM=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y ++CONFIG_LMB_MAX_REGIONS=64 +--- /dev/null ++++ b/arch/arm/dts/mt7981-abt-asr3000.dts +@@ -0,0 +1,176 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "ABT ASR3000"; ++ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x10000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ ++ button-reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ button-wps { ++ label = "mesh"; ++ linux,code = ; ++ linux,input-type = ; ++ gpios = <&gpio 0 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ label = "red:wan"; ++ gpios = <&gpio 4 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ ++ led-1 { ++ label = "green:wan"; ++ gpios = <&gpio 8 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ ++ mesh_led: led-2 { ++ label = "green:mesh"; ++ gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ led-3 { ++ label = "green:wlan2g"; ++ gpios = <&gpio 34 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ ++ led-4 { ++ label = "green:wlan5g"; ++ gpios = <&gpio 35 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "2500base-x"; ++ mediatek,switch = "mt7531"; ++ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ }; ++}; ++ ++&pinctrl { ++ spi_flash_pins: spi0-pins-func-1 { ++ mux { ++ function = "flash"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++}; ++ ++&spi0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi_flash_pins>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <2>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x100000 0x80000>; ++ }; ++ ++ partition@180000 { ++ label = "art"; ++ reg = <0x180000 0x100000>; ++ }; ++ ++ partition@280000 { ++ label = "factory"; ++ reg = <0x280000 0x100000>; ++ }; ++ ++ partition@380000 { ++ label = "fip"; ++ reg = <0x380000 0x200000>; ++ }; ++ ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x580000 0x7a80000>; ++ compatible = "linux,ubi"; ++ }; ++ }; ++ }; ++}; ++ ++&uart0 { ++ mediatek,force-highspeed; ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; +--- /dev/null ++++ b/abt_asr3000_env +@@ -0,0 +1,55 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootargs=root=/dev/fit0 rootwait ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-abt_asr3000-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-abt_asr3000-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-abt_asr3000-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-abt_asr3000-squashfs-sysupgrade.itb ++bootled_pwr=green:mesh ++bootled_rec=green:mesh ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2 ++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 ++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr ++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr ++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format ++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset ++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi ++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs ++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery ++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/target/linux/mediatek/dts/mt7981b-abt-asr3000.dts b/target/linux/mediatek/dts/mt7981b-abt-asr3000.dts new file mode 100644 index 00000000000000..dd07def3033496 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-abt-asr3000.dts @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include +#include +#include +#include "mt7981.dtsi" + +/ { + model = "ABT ASR3000"; + compatible = "abt,asr3000", "mediatek,mt7981"; + + aliases { + led-boot = &mesh_led; + led-failsafe = &mesh_led; + led-upgrade = &mesh_led; + label-mac-device = &gmac1; + serial0 = &uart0; + }; + + chosen { + rootdisk = <&ubi_rootdisk>; + stdout-path = "serial0:115200n8"; + }; + + memory@40000000 { + reg = <0 0x40000000 0 0x10000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + button-mesh { + label = "mesh"; + linux,code = ; + linux,input-type = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led-0 { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&pio 4 GPIO_ACTIVE_LOW>; + }; + + led-1 { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&pio 8 GPIO_ACTIVE_LOW>; + }; + + mesh_led: led-2 { + label = "green:mesh"; + gpios = <&pio 15 GPIO_ACTIVE_HIGH>; + }; + + led-3 { + function = LED_FUNCTION_WLAN_2GHZ; + color = ; + gpios = <&pio 34 GPIO_ACTIVE_LOW>; + }; + + led-4 { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + gpios = <&pio 35 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cells = <&macaddr_art_0 0>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + + nvmem-cells = <&macaddr_art_0 0>; + nvmem-cell-names = "mac-address"; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bl2"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + partition@180000 { + label = "art"; + reg = <0x180000 0x100000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@280000 { + label = "factory"; + reg = <0x280000 0x100000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + + partition@380000 { + label = "fip"; + reg = <0x380000 0x200000>; + read-only; + }; + + partition@580000 { + compatible = "linux,ubi"; + label = "ubi"; + reg = <0x580000 0x7a80000>; + + volumes { + ubi_rootdisk: ubi-volume-fit { + volname = "fit"; + }; + }; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan3"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan1"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + status = "okay"; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index 16d8617c54e81b..82f61dd5d9b932 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -6,6 +6,11 @@ board=$(board_name) board_config_update case $board in +abt,asr3000) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" + ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wlan-2ghz" "phy0-ap0" + ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wlan-5ghz" "phy1-ap0" + ;; confiabits,mt7981) ucidef_set_led_netdev "lan1" "lan1" "blue:lan-1" "lan1" "link tx rx" ucidef_set_led_netdev "lan2" "lan2" "blue:lan-2" "lan2" "link tx rx" diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index c9c8a87f54b882..8246a3b0041b05 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -11,6 +11,13 @@ mediatek_setup_interfaces() acelink,ew-7886cax) ucidef_set_interface_lan "eth0" "dhcp" ;; + abt,asr3000|\ + cmcc,rax3000m|\ + h3c,magic-nx30-pro|\ + nokia,ea0326gmp|\ + zbtlink,zbt-z8103ax) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1 + ;; acer,predator-w6) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1 ;; @@ -46,12 +53,6 @@ mediatek_setup_interfaces() bananapi,bpi-r4-poe) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 eth1" "wan eth2" ;; - cmcc,rax3000m|\ - h3c,magic-nx30-pro|\ - nokia,ea0326gmp|\ - zbtlink,zbt-z8103ax) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1 - ;; comfast,cf-e393ax) ucidef_set_interfaces_lan_wan "lan1" eth1 ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 98b1023e3ee8cb..a16f5e7eb458ff 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -10,6 +10,13 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case "$board" in + abt,asr3000) + # Originally, phy1 is phy0 mac with LA bit set. However, this would conflict + # addresses on multiple VIFs with the other radio. Use label mac to set LA bit. + addr=$(cat /sys/class/net/eth1/address) + [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_setbit_la $addr > /sys${DEVPATH}/macaddress + ;; acer,predator-w6) key_path="/var/qcidata/data" [ "$PHYNBR" = "0" ] && cat $key_path/2gMAC > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 3b1b2f7fa69ac5..4005154db234b1 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -64,6 +64,22 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in + abt,asr3000|\ + bananapi,bpi-r3|\ + bananapi,bpi-r3-mini|\ + bananapi,bpi-r4|\ + bananapi,bpi-r4-poe|\ + cmcc,rax3000m|\ + jdcloud,re-cp-03|\ + mediatek,mt7988a-rfb|\ + nokia,ea0326gmp|\ + openwrt,one|\ + tplink,tl-xdr4288|\ + tplink,tl-xdr6086|\ + tplink,tl-xdr6088|\ + xiaomi,redmi-router-ax6000-ubootmod) + fit_do_upgrade "$1" + ;; acer,predator-w6|\ smartrg,sdg-8612|\ smartrg,sdg-8614|\ @@ -82,21 +98,6 @@ platform_do_upgrade() { CI_KERNPART="linux" nand_do_upgrade "$1" ;; - bananapi,bpi-r3|\ - bananapi,bpi-r3-mini|\ - bananapi,bpi-r4|\ - bananapi,bpi-r4-poe|\ - cmcc,rax3000m|\ - jdcloud,re-cp-03|\ - mediatek,mt7988a-rfb|\ - nokia,ea0326gmp|\ - openwrt,one|\ - tplink,tl-xdr4288|\ - tplink,tl-xdr6086|\ - tplink,tl-xdr6088|\ - xiaomi,redmi-router-ax6000-ubootmod) - fit_do_upgrade "$1" - ;; cudy,re3000-v1|\ cudy,wr3000-v1|\ yuncore,ax835) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 94b3098b3d1a8f..aa844671e34f5c 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -105,6 +105,30 @@ define Build/cetron-header rm $@.tmp endef +define Device/abt_asr3000 + DEVICE_VENDOR := ABT + DEVICE_MODEL := ASR3000 + DEVICE_DTS := mt7981b-abt-asr3000 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 + ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot abt_asr3000 +endef +TARGET_DEVICES += abt_asr3000 + define Device/acelink_ew-7886cax DEVICE_VENDOR := Acelink DEVICE_MODEL := EW-7886CAX From f84a9f7dc095967e41ced96e1ea5f9b2b9f40af6 Mon Sep 17 00:00:00 2001 From: Marco von Rosenberg Date: Sun, 31 Mar 2024 17:07:13 +0200 Subject: [PATCH 09/21] ath79: add support for Huawei AP6010DN Huawei AP6010DN is a dual-band, dual-radio 802.11a/b/g/n 2x2 MIMO enterprise access point with one Gigabit Ethernet port and PoE support. Hardware highlights: - CPU: AR9344 SoC at 480MHz - RAM: 128MB DDR2 - Flash: 32MB SPI-NOR - Wi-Fi 2.4GHz: AR9344-internal radio - Wi-Fi 5GHz: AR9580 PCIe WLAN SoC - Ethernet: 10/100/1000 Mbps Ethernet through Atheros AR8035 PHY - PoE: yes - Standalone 12V/2A power input - Serial console externally available through RJ45 port - External watchdog: CAT706SVI (1.6s timeout) Serial console: 9600n8 (9600 baud, no stop bits, no parity, 8 data bits) MAC addresses: Each device has 32 consecutive MAC addresses allocated by the vendor, which don't overlap between devices. This was confirmed with multiple devices with consecutive serial numbers. The MAC address range starts with the address on the label. To be able to distinguish between the interfaces, the following MAC address scheme is used: - eth0 = label MAC - radio0 (Wi-Fi 2.4GHz) = label MAC + 1 - radio1 (Wi-Fi 5GHz) = label MAC + 2 Installation: 0. Connect some sort of RJ45-to-USB adapter to "Console" port of the AP 1. Power up the AP 2. At prompt "Press f or F to stop Auto-Boot in 3 seconds", do what they say. Log in with default admin password "admin@huawei.com". 3. Boot the OpenWrt initramfs from TFTP using the hidden script "run ramboot". Replace IP address as needed: > setenv serverip 192.168.1.10 > setenv ipaddr 192.168.1.1 > setenv rambootfile openwrt-ath79-generic-huawei_ap6010dn-initramfs-kernel.bin > saveenv > run ramboot 4. Optional but recommended as the factory firmware cannot be downloaded publicly: Back up contents of "firmware" partition using the web interface or ssh: $ ssh root@192.168.1.1 cat /dev/mtd11 > huawei_ap6010dn_fw_backup.bin 5. Run sysupgrade using sysupgrade image. OpenWrt shall boot from flash afterwards. Return to factory firmware (using firmware upgrade package downloaded from non-public Huawei website): 1. Start a TFTP server in the directory where the firmware upgrade package is located 2. Boot to u-boot as described above 3. Install firmware upgrade package and format the config partitions: > update system FatAP6X10XN_SOMEVERSION.bin > format_fs Return to factory firmware (from previously created backup): 1. Copy over the firmware partition backup to /tmp, for example using scp 2. Use sysupgrade with force to restore the backup: sysupgrade -F huawei_ap6010dn_fw_backup.bin 3. Boot AP to U-Boot as described above Quirks and known issues: - The stock firmware has a semi dual boot concept where the primary kernel uses a squashfs as root partition and the secondary kernel uses an initramfs. This dual boot concept is circumvented on purpose to gain more flash space and since the stock firmware's flash layout isn't compatible with mtdsplit. - The external watchdog's timeout of 1.6s is very hard to satisfy during bootup. This is why the GPIO15 pin connected to the watchdog input is configured directly in the LZMA loader to output the AHB_CLK/2 signal which keeps the watchdog happy until the wdt-gpio kernel driver takes over. Because it would also take too long to read the whole kernel image from flash, the uImage header only includes the loader which then reads the kernel image from flash after GPIO15 is configured. Signed-off-by: Marco von Rosenberg Link: https://github.com/openwrt/openwrt/pull/15941 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-envtools/files/ath79 | 3 +- .../ath79/dts/ar9344_huawei_ap6010dn.dts | 243 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../base-files/lib/upgrade/platform.sh | 3 +- target/linux/ath79/image/generic.mk | 15 ++ .../ath79/image/lzma-loader/src/ar71xx_regs.h | 1 + .../linux/ath79/image/lzma-loader/src/board.c | 22 +- 7 files changed, 278 insertions(+), 10 deletions(-) create mode 100644 target/linux/ath79/dts/ar9344_huawei_ap6010dn.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 099aebcfa25952..55fcec26617b08 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -118,7 +118,8 @@ domywifi,dw33d) glinet,gl-ar150) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" ;; -huawei,ap5030dn) +huawei,ap5030dn|\ +huawei,ap6010dn) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000" ;; netgear,wndr3700|\ diff --git a/target/linux/ath79/dts/ar9344_huawei_ap6010dn.dts b/target/linux/ath79/dts/ar9344_huawei_ap6010dn.dts new file mode 100644 index 00000000000000..2f2e6e2331720c --- /dev/null +++ b/target/linux/ath79/dts/ar9344_huawei_ap6010dn.dts @@ -0,0 +1,243 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include +#include + +/ { + model = "Huawei AP6010DN"; + compatible = "huawei,ap6010dn", "qca,ar9344"; + + chosen { + bootargs = "console=ttyS0,9600n8"; + }; + + aliases { + led-boot = &led_function_green; + led-failsafe = &led_function_red; + led-running = &led_function_green; + led-upgrade = &led_function_red; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + led_function_green: led-status-green { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + led_function_red: led-status-red { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + }; + + keys { + compatible = "gpio-keys"; + + restart { + label = "reset"; + linux,code = ; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + watchdog { + pinctrl-names = "default"; + pinctrl-0 = <&wdt_gpio15>; + + compatible = "linux,wdt-gpio"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <100>; + always-running; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "firmware"; + reg = <0x0 0x1e00000>; + compatible = "openwrt,uimage", "denx,uimage"; + }; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot-a"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "BootupA"; + reg = <0x80000 0x20000>; + }; + + partition@a0000 { + label = "BootupB"; + reg = <0xa0000 0x20000>; + }; + + partition@c0000 { + label = "u-boot-env"; + reg = <0xc0000 0x20000>; + read-only; + }; + + partition@e0000 { + label = "BoardData"; + reg = <0xe0000 0x20000>; + read-only; + }; + + // In the vendor layout, there are the "SysImageA" (12 MiB) + // and the "ConfigA" (3 MiB) partitions here. + fwconcat0: partition@100000 { + label = "fwconcat0"; + reg = <0x100000 0xf00000>; + }; + + partition@1000000 { + label = "u-boot-b"; + reg = <0x1000000 0x80000>; + read-only; + }; + + partition@1080000 { + label = "ResultA"; + reg = <0x1080000 0x20000>; + read-only; + }; + + partition@10a0000 { + label = "ResultB"; + reg = <0x10a0000 0x20000>; + read-only; + }; + + // In the vendor layout, there are the "SysImageB" (12 MiB) + // and the "ConfigB" (3 MiB) partitions here. + fwconcat1: partition@10c0000 { + label = "fwconcat1"; + reg = <0x10c0000 0xf00000>; + }; + + art: partition@1fc0000 { + label = "art"; + reg = <0x1fc0000 0x40000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_2005b: macaddr@2005b { + compatible = "mac-base"; + reg = <0x2005b 0x6>; + #nvmem-cell-cells = <1>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x844>; + }; + }; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&macaddr_art_2005b 1>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + gpio-controller; + #gpio-cells = <2>; + + nvmem-cells = <&macaddr_art_2005b 2>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_2005b 0>; + nvmem-cell-names = "mac-address"; + + pll-data = <0x06000000 0x04000101 0x0c001313>; + phy-mode = "rgmii-id"; + phy-handle = <&phy>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxdv-delay = <3>; + rxd-delay = <3>; + }; +}; + +&mdio0 { + status = "okay"; + + phy: ethernet-phy@18 { + reg = <0x4>; + }; +}; + +&pinmux { + wdt_gpio15: pinmux_wdt_gpio15 { + pinctrl-single,bits = <0xc 0x0 0xFF000000>; + }; +}; + +&wdt { + status = "disabled"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 7905d6e496292c..ccb296a62afebb 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -52,6 +52,7 @@ ath79_setup_interfaces() glinet,gl-ar300m-lite|\ glinet,gl-usb150|\ hak5,wifi-pineapple-nano|\ + huawei,ap6010dn|\ meraki,mr16|\ netgear,ex7300|\ netgear,ex7300-v2|\ diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 076a785cbf3c47..c61c48b00e9780 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -68,7 +68,8 @@ platform_do_upgrade() { ROOTFS_FILE="root.squashfs" platform_do_upgrade_failsafe_datachk "$1" ;; - huawei,ap5030dn) + huawei,ap5030dn|\ + huawei,ap6010dn) # Store beginning address of the "firmware" partition # as KernelA address and KernelB address, each to BootupA & BootupB # This is the address from which the bootloader will try to load the kernel. diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index f6dba8604d085d..00aa6881567513 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1806,6 +1806,21 @@ define Device/huawei_ap5030dn endef TARGET_DEVICES += huawei_ap5030dn +define Device/huawei_ap6010dn + SOC := ar9344 + DEVICE_VENDOR := Huawei + DEVICE_MODEL := AP6010DN + LOADER_TYPE := bin + LOADER_FLASH_OFFS := 0x111DC0 + KERNEL_SIZE := 15360k + IMAGE_SIZE := 30720k + COMPILE := loader-$(1).bin + COMPILE/loader-$(1).bin := loader-okli-compile | pad-to 64k | uImage none + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 8128 + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | uImage none +endef +TARGET_DEVICES += huawei_ap6010dn + define Device/iodata_etg3-r SOC := ar9342 DEVICE_VENDOR := I-O DATA diff --git a/target/linux/ath79/image/lzma-loader/src/ar71xx_regs.h b/target/linux/ath79/image/lzma-loader/src/ar71xx_regs.h index e7d768397394be..9dc7c0f817ec84 100644 --- a/target/linux/ath79/image/lzma-loader/src/ar71xx_regs.h +++ b/target/linux/ath79/image/lzma-loader/src/ar71xx_regs.h @@ -670,6 +670,7 @@ #define AR934X_GPIO_FUNC_SPI_CS_0_EN BIT(13) #define AR934X_GPIO_OUT_GPIO 0x00 +#define AR934X_GPIO_OUTSEL_CLK_OBS4 0x14 #define QCA955X_GPIO_OUTSEL_CLK_OBS5 0x54 diff --git a/target/linux/ath79/image/lzma-loader/src/board.c b/target/linux/ath79/image/lzma-loader/src/board.c index 13926e9b1e6548..04aa348b1f2e0c 100644 --- a/target/linux/ath79/image/lzma-loader/src/board.c +++ b/target/linux/ath79/image/lzma-loader/src/board.c @@ -182,34 +182,40 @@ static inline void mr18_init(void) static inline void mr18_init(void) { } #endif -#ifdef CONFIG_BOARD_HUAWEI_AP5030DN -static inline void ap5030dn_init(void) +#if defined(CONFIG_BOARD_HUAWEI_AP5030DN) || defined(CONFIG_BOARD_HUAWEI_AP6010DN) +static inline void huawei_ap_init(void) { - const unsigned int ap5030dn_watchdog_gpio = 15; + const unsigned int watchdog_gpio = 15; unsigned int gpiobase, reg; gpiobase = KSEG1ADDR(AR71XX_GPIO_BASE); - printf("Huawei AP5030DN\n"); + printf("Huawei AP\n"); reg = READREG(gpiobase + AR71XX_GPIO_REG_OE); WRITEREG(gpiobase + AR71XX_GPIO_REG_OE, - reg & ~(1 << ap5030dn_watchdog_gpio)); + reg & ~(1 << watchdog_gpio)); /* Set GPIO15 MUX to output CLK_OBS5 (= CPU_CLK/4) - * to keep the watchdog happy until wdt-gpio takes over + * or CLK_OBS4 (= AHB_CLK/2) to keep the watchdog happy + * until wdt-gpio takes over */ reg = READREG(gpiobase + AR934X_GPIO_REG_OUT_FUNC3); +#if defined(CONFIG_BOARD_HUAWEI_AP5030DN) WRITEREG(gpiobase + AR934X_GPIO_REG_OUT_FUNC3, reg | (QCA955X_GPIO_OUTSEL_CLK_OBS5 << 24)); +#else if defined(CONFIG_BOARD_HUAWEI_AP6010DN) + WRITEREG(gpiobase + AR934X_GPIO_REG_OUT_FUNC3, + reg | (AR934X_GPIO_OUTSEL_CLK_OBS4 << 24)); +#endif } #else -static inline void ap5030dn_init(void) { } +static inline void huawei_ap_init(void) {} #endif void board_init(void) { tlwr1043nd_init(); mr18_init(); - ap5030dn_init(); + huawei_ap_init(); } From 0037100e129d3b2abedc08864c82230ab4565b21 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Sun, 14 Jul 2024 14:07:53 -0600 Subject: [PATCH 10/21] base-files: ipcalc.sh handle start and range being empty strings If we're being paranoid and quote all the arguments to ipcalc.sh, it's possible to pass in empty start and range arguments. This should be handled the same as their being absent. Signed-off-by: Philip Prindeville Link: https://github.com/openwrt/openwrt/pull/15946 Signed-off-by: Hauke Mehrtens --- package/base-files/files/bin/ipcalc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index ae7a5c9598814f..871a49ed6e7317 100755 --- a/package/base-files/files/bin/ipcalc.sh +++ b/package/base-files/files/bin/ipcalc.sh @@ -96,6 +96,7 @@ echo "COUNT=$count" # if there's no range, we're done [ $# -eq 0 ] && exit 0 +[ -z "$1$2" ] && exit 0 if [ "$prefix" -le 30 ]; then lower=$((network + 1)) From 573dd4946821c65241fb749dc25fa84bb849b848 Mon Sep 17 00:00:00 2001 From: Kristian Skramstad Date: Fri, 12 Jul 2024 08:47:23 +0200 Subject: [PATCH 11/21] ath79: qca9563: Amplifi Router HD: add DEVICE_VENDOR Ubiquiti In make menuconfig the name is [Amplifi Router HD], and is missing Ubiquiti. Lets fix that by adding DEVICE_VENDOR := Ubiquiti to generic-ubnt.mk so the name is: [Ubiquiti Amplifi Router HD]. Signed-off-by: Kristian Skramstad Link: https://github.com/openwrt/openwrt/pull/15932 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/image/generic-ubnt.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index f7bab4b69772cc..2faf51949acdd3 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -24,6 +24,7 @@ define Device/ubnt_amplifi-router-hd UBNT_TYPE := AFi-R UBNT_VERSION := 3.6.3 SOC := qca9563 + DEVICE_VENDOR := Ubiquiti DEVICE_MODEL := AmpliFi Router HD UBNT_CHIP := qca956x DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct kmod-usb2 From 7390642237f59e180617e316c4276f53b0c06daf Mon Sep 17 00:00:00 2001 From: Luca Piccirillo Date: Wed, 10 Jul 2024 18:48:39 +0200 Subject: [PATCH 12/21] treewide: match the COMFAST brand name across supported devices COMFAST CF-E393AX COMFAST CF-E390AX & CF-EW72 V2 COMFAST CF-WR617AC Signed-off-by: Luca Piccirillo Link: https://github.com/openwrt/openwrt/pull/14690 Signed-off-by: Hauke Mehrtens --- target/linux/mediatek/image/filogic.mk | 2 +- target/linux/ramips/image/mt7621.mk | 4 ++-- target/linux/ramips/image/mt76x8.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index aa844671e34f5c..74eaf06ea959bc 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -468,7 +468,7 @@ endef TARGET_DEVICES += cmcc_rax3000m define Device/comfast_cf-e393ax - DEVICE_VENDOR := Comfast + DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E393AX DEVICE_DTS := mt7981a-comfast-cf-e393ax DEVICE_DTS_DIR := ../dts diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 44672a95429b51..3f3d5a0e2b232d 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -604,7 +604,7 @@ define Device/comfast_cf-e390ax $(Device/dsa-migration) $(Device/uimage-lzma-loader) IMAGE_SIZE := 15808k - DEVICE_VENDOR := ComFast + DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E390AX DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools IMAGES += factory.bin @@ -618,7 +618,7 @@ define Device/comfast_cf-ew72-v2 $(Device/dsa-migration) $(Device/uimage-lzma-loader) IMAGE_SIZE := 15808k - DEVICE_VENDOR := ComFast + DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-EW72 V2 DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ -uboot-envtools diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 2ea948a5f9a66a..7b360c6088f249 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -135,7 +135,7 @@ TARGET_DEVICES += buffalo_wcr-1166ds define Device/comfast_cf-wr617ac IMAGE_SIZE := 7872k DTS := CF-WR617AC - DEVICE_VENDOR := Comfast + DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-WR617AC DEVICE_PACKAGES := kmod-mt76x2 kmod-rt2800-pci endef From 669470384e90e252b3161ee9c069a430d279d154 Mon Sep 17 00:00:00 2001 From: FUKAUMI Naoki Date: Thu, 11 Jul 2024 06:20:21 +0900 Subject: [PATCH 13/21] rockchip: make SATA(AHCI) really work on Radxa E25 kmod-ahci-dwc is required to use SATA(AHCI) on Radxa E25. Fixes: f7c732bf9e ("rockchip: add Radxa E25 board support") Signed-off-by: FUKAUMI Naoki Link: https://github.com/openwrt/openwrt/pull/15923 Signed-off-by: Hauke Mehrtens --- target/linux/rockchip/image/armv8.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index 3f1e6934d10753..2405c07d9c1903 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -111,7 +111,7 @@ define Device/radxa_e25 DEVICE_DTS := rockchip/rk3568-radxa-e25 BOOT_SCRIPT := radxa-e25 UBOOT_DEVICE_NAME := radxa-e25-rk3568 - DEVICE_PACKAGES := kmod-r8169 kmod-ata-ahci-platform + DEVICE_PACKAGES := kmod-r8169 kmod-ata-ahci-dwc endef TARGET_DEVICES += radxa_e25 From ba30cbef415dba6680df4f891617843553989e92 Mon Sep 17 00:00:00 2001 From: Eros Brigmann Date: Thu, 4 Jul 2024 20:10:25 +0200 Subject: [PATCH 14/21] ramips: add support for Wavlink WL-WN531G3-A2 This device is exactly the same as WL-WN531G3 but with different partition layout and different MAC layout. Labeled as Quantum D4G Rev.: A2. Hardware -------- SoC: Mediatek MT7620A RAM: 64MB FLASH: 8MB NOR (GigaDevice GD25Q64CS) ETH: - 2x 10/100/1000 Mbps Ethernet (RTL8211F) - 3x 10/100 Mbps Ethernet (integrated in SOC) WIFI: - 2.4GHz: 1x (integrated in SOC) (2x2:2) - 5GHz: 1x MT7612E (2x2:2) - 4 external antennas BTN: - 1x Reset button - 1x Touchlink button - 1x Turbo button - 1x Wps button - 1x ON/OFF switch LEDS: - 1x Red led (system status) - 1x Blue led (system status) - 5x Blue leds (ethernet ports) - 1x Power led - 1x Wifi led UART: - 57600-8-N-1 Everything works correctly. Installation ------------ Flash the initramfs image in the OEM firmware interface When Openwrt boots, flash the sysupgrade image otherwise you won't be able to keep configuration between reboots. Notes ----- 1) Router mac addresses: LAN XX:XX:XX:XX:XX:0F (factory @ 0x28) WAN XX:XX:XX:XX:XX:10 (factory @ 0x2e) WIFI 2G XX:XX:XX:XX:XX:11 (factory @ 0x04) WIFI 5G XX:XX:XX:XX:XX:12 (factory @ 0x8004) LABEL XX:XX:XX:XX:XX:11 Signed-off-by: Eros Brigmann Link: https://github.com/openwrt/openwrt/pull/15876 Signed-off-by: Hauke Mehrtens --- .../dts/mt7620a_wavlink_wl-wn531g3-a2.dts | 201 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 10 + .../mt7620/base-files/etc/board.d/02_network | 5 + 3 files changed, 216 insertions(+) create mode 100644 target/linux/ramips/dts/mt7620a_wavlink_wl-wn531g3-a2.dts diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn531g3-a2.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn531g3-a2.dts new file mode 100644 index 00000000000000..1a12005c923c38 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn531g3-a2.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7620a.dtsi" +#include +#include +#include + +/ { + compatible = "wavlink,wl-wn531g3", "ralink,mt7620a-soc"; + model = "Wavlink WL-WN531G3"; + + aliases { + led-boot = &led_status_blue; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + turbo { + label = "turbo"; + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + touchlink { + label = "touchlink"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: led_status_blue { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led_status_red { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii1_pins>, <&rgmii2_pins>, <&mdio_pins>; + + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; + + mediatek,portmap = "llllw"; + + port@4 { + status = "okay"; + phy-handle = <&phy4>; + phy-mode = "rgmii"; + + nvmem-cells = <&macaddr_factory_2e>; + nvmem-cell-names = "mac-address"; + }; + + port@5 { + status = "okay"; + phy-handle = <&phy5>; + phy-mode = "rgmii"; + }; + + mdio-bus { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + phy-mode = "rgmii"; + }; + + phy5: ethernet-phy@5 { + reg = <5>; + phy-mode = "rgmii"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_radio_8000>; + nvmem-cell-names = "eeprom"; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&gsw { + mediatek,port4-gmac; +}; + +&wmac { + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; +}; + +&state_default { + gpio { + groups = "i2c", "uartf"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 67deb8f0409d7a..51811a86ea0dca 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -1349,6 +1349,16 @@ define Device/wavlink_wl-wn531g3 endef TARGET_DEVICES += wavlink_wl-wn531g3 + +define Device/wavlink_wl-wn531g3-a2 + SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Wavlink + DEVICE_MODEL := WL-WN531G3-A2 + DEVICE_PACKAGES := kmod-mt76x2 kmod-phy-realtek kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += wavlink_wl-wn531g3-a2 + define Device/wavlink_wl-wn535k1 SOC := mt7620a IMAGE_SIZE := 7360k diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index d23ec7632722c5..577f77cb9339d4 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -257,6 +257,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "5:lan:1" "4:wan" "6@eth0" ;; + wavlink,wl-wn531g3-a2) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "5:lan:1" "4:wan" "6@eth0" + ;; wavlink,wl-wn535k1) ucidef_add_switch "switch0" \ "2:lan:2" "5:lan:1" "4:wan" "6@eth0" @@ -431,6 +435,7 @@ ramips_setup_macs() wan_mac=$(macaddr_add "$(mtd_get_mac_binary rom 0xf100)" 1) ;; wavlink,wl-wn531g3|\ + wavlink,wl-wn531g3-a2|\ zbtlink,zbt-we1026-5g-16m) label_mac=$(mtd_get_mac_binary factory 0x4) ;; From 403c17cadfd9183976bdf2317652efa720038518 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Sat, 6 Jul 2024 04:37:42 -0300 Subject: [PATCH 15/21] kernel: modules: video: add kmod-video-gspca-pac7302 Add the package for the Pixart PAC7302 USB Camera Driver kernel module. Signed-off-by: Luiz Angelo Daros de Luca Link: https://github.com/openwrt/openwrt/pull/15886 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/video.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index b59907c643f84c..bbfceb691b52a4 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -780,6 +780,21 @@ endef $(eval $(call KernelPackage,video-gspca-pac207)) +define KernelPackage/video-gspca-pac7302 + TITLE:=pac7302 webcam support + KCONFIG:=CONFIG_USB_GSPCA_PAC7302 + FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_pac7302.ko + AUTOLOAD:=$(call AutoProbe,gspca_pac7302) + $(call AddDepends/camera-gspca) +endef + +define KernelPackage/video-gspca-pac7302/description + The Pixart PAC7302 USB Camera Driver (pac7302) kernel module +endef + +$(eval $(call KernelPackage,video-gspca-pac7302)) + + define KernelPackage/video-gspca-pac7311 TITLE:=pac7311 webcam support KCONFIG:=CONFIG_USB_GSPCA_PAC7311 From f25cd55bd1d13d2b89fefd4b1a88198ece1f8bbf Mon Sep 17 00:00:00 2001 From: Borys Zhukov Date: Sun, 7 Jul 2024 18:54:07 -0400 Subject: [PATCH 16/21] ramips: add support for Netgear WAX214v2 Netgear WAX214v2 is an 802.11ax (Wi-Fi 6) wireless access point. Specifications: * SoC: MediaTek MT7621AT * RAM: 512 MiB * Flash: NAND 128 MiB (ESMT PSU1GA30DT) * Wi-Fi: 2.4/5 GHz 4T4R (MediaTek MT7915E) * Ethernet: 1x 10/100/1000 Mbps LAN * Switch: MediaTek MT7530 (SoC built-in) * LEDs/Keys * Power (green, blue, amber) * LAN (green, amber) * WLAN 2.4GHz (green, blue) * WLAN 5GHz (green, blue) * Reset button * USB: None * UART: Marked J1 on board, 115200 8N1 * Power * 12 VDC, 1.5 A * IEEE 802.3at (PoE+) Load addresses (same as Netgear WAX202): * stock * 0x80010000: FIT image * 0x81001000: kernel image -> entry * OpenWrt * 0x80010000: FIT image * 0x82000000: uncompressed kernel+relocate image * 0x80001000: relocated kernel image -> entry MAC addresses as verified by OEM firmware: vendor OpenWrt address eth0 lan label ra0 phy0 label + 2 rax0 phy1 label + 3 Installation: * Flash the factory image by TFTP to the bootloader. NMRP can be used to TFTP without opening the case. Revert to stock firmware: * Flash the stock firmware to the bootloader using TFTP/NMRP. References to WAX214v2 GPL source: https://www.downloads.netgear.com/files/GPL/WAX214v2-V1.0.1.5-gpl-src.tar.gz * openwrt/target/linux/ramips/dts/mt7621-ax-nand-wax214v2.dts DTS file for this device. Signed-off-by: Borys Zhukov Link: https://github.com/openwrt/openwrt/pull/14401 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-envtools/files/ramips | 4 + .../ramips/dts/mt7621_netgear_wax214v2.dts | 228 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 18 ++ .../mt7621/base-files/etc/board.d/02_network | 5 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 5 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 6 files changed, 261 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_netgear_wax214v2.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 3deb46c295704e..cca394a03b01bd 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -146,6 +146,10 @@ xiaomi,mi-router-cr6608|\ xiaomi,mi-router-cr6609) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" ;; +netgear,wax214v2) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" + ubootenv_add_uci_sys_config "/dev/mtd1" "0x20000" "0x8000" "0x20000" + ;; esac config_load ubootenv diff --git a/target/linux/ramips/dts/mt7621_netgear_wax214v2.dts b/target/linux/ramips/dts/mt7621_netgear_wax214v2.dts new file mode 100644 index 00000000000000..a9597119fa0bc7 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_netgear_wax214v2.dts @@ -0,0 +1,228 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "netgear,wax214v2", "mediatek,mt7621-soc"; + model = "Netgear WAX214v2"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_blue; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_green: power_green { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_power_blue: power_blue { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_power_amber: power_amber { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + wifin_green { + function = LED_FUNCTION_WLAN_2GHZ; + color = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + wifia_green { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "Config"; + reg = <0x80000 0x80000>; + }; + + partition@100000 { + label = "Factory"; + reg = <0x100000 0x80000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + precal_factory_e10: precal@e10 { + reg = <0xe10 0x19c10>; + }; + }; + }; + + partition@180000 { + label = "firmware"; + reg = <0x180000 0x2600000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x400000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x400000 0x2200000>; + }; + }; + + partition@2780000 { + label = "firmware_backup"; + reg = <0x2780000 0x2600000>; + read-only; + }; + + partition@4d80000 { + label = "CFG"; + reg = <0x4d80000 0x800000>; + read-only; + }; + + partition@5580000 { + label = "RAE"; + reg = <0x5580000 0x400000>; + read-only; + }; + + partition@5980000 { + label = "POT"; + reg = <0x5980000 0x100000>; + read-only; + }; + + partition@5a80000 { + label = "Language"; + reg = <0x5a80000 0x400000>; + read-only; + }; + + partition@5e80000 { + label = "Traffic"; + reg = <0x5e80000 0x200000>; + read-only; + }; + + partition@6080000 { + label = "Cert"; + reg = <0x6080000 0x100000>; + read-only; + }; + + partition@6180000 { + label = "NTGRcryptK"; + reg = <0x6180000 0x100000>; + read-only; + }; + + partition@6280000 { + label = "NTGRcryptD"; + reg = <0x6280000 0x500000>; + read-only; + }; + + partition@6780000 { + label = "LOG"; + reg = <0x6780000 0x100000>; + read-only; + }; + + partition@6880000 { + label = "User_data"; + reg = <0x6880000 0x640000>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>; + nvmem-cell-names = "eeprom", "precal"; + }; +}; + +&state_default { + gpio { + groups = "uart3", "uart2", "jtag"; + function = "gpio"; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 3f3d5a0e2b232d..f9c58fa1378a30 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2113,6 +2113,24 @@ define Device/netgear_wax202 endef TARGET_DEVICES += netgear_wax202 +define Device/netgear_wax214v2 + $(Device/nand) + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := WAX214v2 + DEVICE_PACKAGES := kmod-mt7915-firmware + NETGEAR_ENC_MODEL := WAX214v2 + NETGEAR_ENC_REGION := US + IMAGE_SIZE := 38912k + KERNEL_LOADADDR := 0x82000000 + KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \ + append-squashfs4-fakeroot + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$(KERNEL_SIZE) | \ + append-ubi | check-size | netgear-encrypted-factory +endef +TARGET_DEVICES += netgear_wax214v2 + define Device/netgear_wndr3700-v5 $(Device/dsa-migration) $(Device/netgear_sercomm_nor) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 386a3bb41d874f..1c5862f9238c7d 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -47,6 +47,7 @@ ramips_setup_interfaces() mikrotik,routerboard-m11g|\ netgear,eax12|\ netgear,ex6150|\ + netgear,wax214v2|\ sercomm,na502|\ sercomm,na502s|\ thunder,timecloud|\ @@ -325,6 +326,10 @@ ramips_setup_macs() wan_mac=$(macaddr_add "$lan_mac" 1) label_mac=$lan_mac ;; + netgear,wax214v2) + lan_mac=$(mtd_get_mac_ascii Config ethaddr) + label_mac=$lan_mac + ;; yuncore,ax820) label_mac=$(mtd_get_mac_binary Factory 0x4) ;; diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 9350d67466ac22..f8baf0046fa4a3 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -153,6 +153,11 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress ;; + netgear,wax214v2) + hw_mac_addr=$(mtd_get_mac_ascii Config ethaddr) + [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress + ;; mercusys,mr70x-v1|\ tplink,archer-ax23-v1) hw_mac_addr="$(mtd_get_mac_binary config 0x8)" diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 32dad729446737..193082e665941d 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -122,6 +122,7 @@ platform_do_upgrade() { netgear,wac104|\ netgear,wac124|\ netgear,wax202|\ + netgear,wax214v2|\ netis,wf2881|\ raisecom,msg1500-x-00|\ rostelecom,rt-fe-1a|\ From 6c45f3527fd3880e3a79f0bb5b12364fb7f54f53 Mon Sep 17 00:00:00 2001 From: Maxim Anisimov Date: Tue, 18 Jun 2024 16:09:35 +0300 Subject: [PATCH 17/21] ramips: add support for Keenetic KN-3510 Keenetic KN-3510 is a 2.4/5 Ghz band 11ax access point Specification: - System-On-Chip: MT7621AT - CPU/Speed: 880 MHz - Flash-Chip: Macronix MX30LF1G28AD-TI - Flash size: 128 MiB - RAM: 256 MiB - 2x 10/100/1000 Mbps Ethernet - PoE, 802.3af/at - 4x internal antennas - UART (J1) header on PCB (115200 8n1) - WiFi: MT7915 2x2 2.4G 573.5Mbps + 2x2 5G 1201Mbps - 2x LED, 2x button, 1x mode switch Notes: - The device supports dual boot mode - The firmware partitions were concatinated into one Flash instruction: The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot: 1. Configure PC with static IP 192.168.1.2/24 and tftp server. 2. Rename "openwrt-ramips-mt7621-keenetic_kn-3510-squashfs-factory.bin" to "KN-3510_recovery.bin" and place it in tftp server directory. 3. Connect PC with one of LAN ports, press the reset button, power up the router and keep button pressed until power led start blinking. 4. Router will download file from server, write it to flash and reboot Signed-off-by: Maxim Anisimov Link: https://github.com/openwrt/openwrt/pull/15744 Signed-off-by: Hauke Mehrtens --- .../ramips/dts/mt7621_keenetic_kn-3510.dts | 247 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 13 + .../mt7621/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 5 files changed, 266 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_keenetic_kn-3510.dts diff --git a/target/linux/ramips/dts/mt7621_keenetic_kn-3510.dts b/target/linux/ramips/dts/mt7621_keenetic_kn-3510.dts new file mode 100644 index 00000000000000..5a647d75e82d73 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_keenetic_kn-3510.dts @@ -0,0 +1,247 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "keenetic,kn-3510", "mediatek,mt7621-soc"; + model = "Keenetic KN-3510"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_green; + led-running = &led_status_green; + led-upgrade = &led_status_green; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + function = LED_FUNCTION_WPS; + color = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_status_green: led-1 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + fn1 { + label = "fn1"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&firmware1 &storage1 &firmware2 &storage2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x400000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x400000 0x0>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "uart3", "jtag"; + function = "gpio"; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u-config"; + reg = <0x80000 0x80000>; + read-only; + }; + + partition@100000 { + label = "rf-eeprom"; + reg = <0x100000 0x80000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_a: macaddr@a { + reg = <0xa 0x6>; + }; + + precal_factory_e10: precal@e10 { + reg = <0xe10 0x19c10>; + }; + }; + }; + + firmware1: partition@180000 { + label = "firmware_1"; + reg = <0x180000 0x1a40000>; + }; + + partition@1bc0000 { + label = "config_1"; + reg = <0x1bc0000 0x20000>; + read-only; + }; + + partition@1dc0000 { + label = "storage_legacy"; + reg = <0x1dc0000 0x20000>; + read-only; + }; + + partition@1fc0000 { + label = "dump"; + reg = <0x1fc0000 0x40000>; + read-only; + }; + + storage1: partition@2000000 { + label = "storage_a"; + reg = <0x2000000 0x1fc0000>; + }; + + partition@3fc0000 { + label = "u-state"; + reg = <0x3fc0000 0x80000>; + read-only; + }; + + partition@4040000 { + label = "u-config_res"; + reg = <0x4040000 0x80000>; + read-only; + }; + + partition@40c0000 { + label = "rf-eeprom_res"; + reg = <0x40c0000 0x80000>; + read-only; + }; + + firmware2: partition@4140000 { + label = "firmware_2"; + reg = <0x4140000 0x1a40000>; + }; + + partition@5b80000 { + label = "config_2"; + reg = <0x5d00000 0x20000>; + read-only; + }; + + storage2: partition@5d80000 { + label = "storage_b"; + reg = <0x5d80000 0x2200000>; + }; + }; +}; + +ðphy0 { + /delete-property/ interrupts; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + nvmem-cells = <&macaddr_factory_a>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@3 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>; + nvmem-cell-names = "eeprom", "precal"; + mediatek,disable-radar-background; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index f9c58fa1378a30..e5275bfeb7c0a6 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1650,6 +1650,19 @@ define Device/keenetic_kn-3010 endef TARGET_DEVICES += keenetic_kn-3010 +define Device/keenetic_kn-3510 + $(Device/nand) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 121088k + DEVICE_VENDOR := Keenetic + DEVICE_MODEL := KN-3510 + DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + check-size | zyimage -d 0x803510 -v "KN-3510" +endef +TARGET_DEVICES += keenetic_kn-3510 + define Device/lenovo_newifi-d1 $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 1c5862f9238c7d..accee97fb61e9a 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -67,6 +67,7 @@ ramips_setup_interfaces() ;; asiarf,ap7621-001|\ humax,e10|\ + keenetic,kn-3510|\ openfi,5pro|\ wavlink,ws-wn572hp3-4g|\ winstars,ws-wn583a6) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index f8baf0046fa4a3..91c17f8a778c2f 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -126,6 +126,10 @@ case "$board" in [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress ;; + keenetic,kn-3510) + [ "$PHYNBR" = "1" ] && \ + macaddr_setbit_la "$(mtd_get_mac_binary rf-eeprom 0x4)" > /sys${DEVPATH}/macaddress + ;; linksys,e5600|\ linksys,ea6350-v4|\ linksys,ea7300-v1|\ diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 193082e665941d..bad7e30ca65ebf 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -100,6 +100,7 @@ platform_do_upgrade() { iptime,ax2004m|\ iptime,t5004|\ jcg,q20|\ + keenetic,kn-3510|\ linksys,e5600|\ linksys,e7350|\ linksys,ea6350-v4|\ From 02db8a19cb8d3ad12332cb86e373adee443abc47 Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Wed, 21 Aug 2019 08:05:06 +0200 Subject: [PATCH 18/21] firmware: add Intel/Lantiq VRX518 ACA firmware package This firmware is used by the vrx518 ep driver. Signed-off-by: Martin Schiller [update for new license] Signed-off-by: Andre Heider Link: https://github.com/openwrt/openwrt/pull/15550 Signed-off-by: Hauke Mehrtens --- .../firmware/lantiq/vrx518_aca_fw/Makefile | 40 +++++++++++++++++++ package/kernel/lantiq/vrx518_ep/Makefile | 4 +- 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 package/firmware/lantiq/vrx518_aca_fw/Makefile diff --git a/package/firmware/lantiq/vrx518_aca_fw/Makefile b/package/firmware/lantiq/vrx518_aca_fw/Makefile new file mode 100644 index 00000000000000..6b2361ec1064e8 --- /dev/null +++ b/package/firmware/lantiq/vrx518_aca_fw/Makefile @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +include $(TOPDIR)/rules.mk + +PKG_NAME:=vrx518_aca_fw +PKG_VERSION:=1.5.0 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/intel/vrx518_aca_fw.git +PKG_SOURCE_VERSION:=c509b89c77c26a7df0f0999aabf78b82ca9c9ff0 +PKG_MIRROR_HASH:=fba91071f18599617434d93e78c67dad91b3e4c5811b77c15961e3a13b506d2e + +PKG_LICENSE:=MaxLinear-Software-License-Agreement +PKG_LICENSE_FILES:=platform/xrx500/LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=firmware + CATEGORY:=Firmware + TITLE:=VRX518 ACA firmware + URL:=http://www.intel.com + DEPENDS:=@TARGET_ipq40xx +endef + +define Package/$(PKG_NAME)/description + VRX518 ACA firmware +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/lib/firmware/09a9 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/platform/xrx500/LICENSE $(1)/lib/firmware/09a9/aca_fw.bin.LICENSE + $(INSTALL_DATA) $(PKG_BUILD_DIR)/platform/xrx500/aca_fw.bin $(1)/lib/firmware/09a9 +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/kernel/lantiq/vrx518_ep/Makefile b/package/kernel/lantiq/vrx518_ep/Makefile index b6477b19d6d2e2..7518080a807053 100644 --- a/package/kernel/lantiq/vrx518_ep/Makefile +++ b/package/kernel/lantiq/vrx518_ep/Makefile @@ -15,14 +15,12 @@ PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk -# TODO this driver depends on the vrx518 aca firmware, add this dependency if -# that ever gets a compatible license define KernelPackage/vrx518_ep SECTION:=sys CATEGORY:=Kernel modules SUBMENU:=Network Devices TITLE:=VRX518 EP Support - DEPENDS:=@TARGET_ipq40xx + DEPENDS:=@TARGET_ipq40xx +vrx518_aca_fw AUTOLOAD:=$(call AutoLoad,26,vrx518) FILES:=$(PKG_BUILD_DIR)/vrx518.ko endef From 07b0e6f3d9bc7c421784b1e5e92affd665b01c94 Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Wed, 21 Aug 2019 08:32:09 +0200 Subject: [PATCH 19/21] firmware: add Intel/Lantiq VRX518 PPE firmware package This firmware is used by the vrx518 tc driver. Signed-off-by: Martin Schiller [update for new license] Signed-off-by: Andre Heider Link: https://github.com/openwrt/openwrt/pull/15550 Signed-off-by: Hauke Mehrtens --- .../firmware/lantiq/vrx518_ppe_fw/Makefile | 40 +++++++++++++++++++ package/kernel/lantiq/vrx518_tc/Makefile | 4 +- 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 package/firmware/lantiq/vrx518_ppe_fw/Makefile diff --git a/package/firmware/lantiq/vrx518_ppe_fw/Makefile b/package/firmware/lantiq/vrx518_ppe_fw/Makefile new file mode 100644 index 00000000000000..4c50521fbe522e --- /dev/null +++ b/package/firmware/lantiq/vrx518_ppe_fw/Makefile @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +include $(TOPDIR)/rules.mk + +PKG_NAME:=vrx518_ppe_fw +PKG_VERSION:=1.3.7 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/intel/vrx518_ppe_fw.git +PKG_SOURCE_VERSION:=47c48d52ba59df733ab21fd0c18f6d1a7b0e7229 +PKG_MIRROR_HASH:=33dd15b6c6205b5031498aac9a5a4876f8217aefea06dc511ac60ca1343b50d1 + +PKG_LICENSE:=MaxLinear-Software-License-Agreement +PKG_LICENSE_FILES:=platform/xrx500/LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=firmware + CATEGORY:=Firmware + TITLE:=VRX518 PPE firmware + URL:=http://www.intel.com + DEPENDS:=@TARGET_ipq40xx +endef + +define Package/$(PKG_NAME)/description + VRX518 PPE firmware +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DATA) $(PKG_BUILD_DIR)/platform/xrx500/LICENSE $(1)/lib/firmware/ppe_fw.bin.LICENSE + $(INSTALL_DATA) $(PKG_BUILD_DIR)/platform/xrx500/ppe_fw.bin $(1)/lib/firmware/ +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/kernel/lantiq/vrx518_tc/Makefile b/package/kernel/lantiq/vrx518_tc/Makefile index b05fb4bb637e6c..a5718d9d5b2a2d 100644 --- a/package/kernel/lantiq/vrx518_tc/Makefile +++ b/package/kernel/lantiq/vrx518_tc/Makefile @@ -28,8 +28,6 @@ include $(INCLUDE_DIR)/package.mk PLAT_DIR:=dcdp PKG_EXTMOD_SUBDIRS:=$(PLAT_DIR) -# TODO this driver depends on the vrx518 ppe firmware, add this dependency if -# that ever gets a compatible license define KernelPackage/$(PKG_NAME) SECTION:=sys CATEGORY:=Kernel modules @@ -39,7 +37,7 @@ define KernelPackage/$(PKG_NAME) CONFIG_ATM_LANE=m \ CONFIG_ATM_MPOA=m \ CONFIG_ATM_MPOA_INTEL_DSL_PHY_SUPPORT=y - DEPENDS:=@TARGET_ipq40xx +kmod-vrx518_ep +kmod-crypto-md5 +kmod-atm +kmod-ipoa +br2684ctl + DEPENDS:=@TARGET_ipq40xx +kmod-vrx518_ep +vrx518_ppe_fw +kmod-crypto-md5 +kmod-atm +kmod-ipoa +br2684ctl AUTOLOAD:=$(call AutoLoad,27,vrx518_tc) FILES:=$(PKG_BUILD_DIR)/$(PLAT_DIR)/$(PKG_NAME).ko endef From 13eb1f564ad7d40ae6b02a7ec3c4a4c8b187f0ff Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Wed, 21 Aug 2019 09:04:15 +0200 Subject: [PATCH 20/21] firmware: add Intel/Lantiq VRX518 DSL firmware package This is required by the DSL CPE API driver. Signed-off-by: Martin Schiller [update for new license] Signed-off-by: Andre Heider Link: https://github.com/openwrt/openwrt/pull/15550 Signed-off-by: Hauke Mehrtens --- .../lantiq/dsl_vr11_firmware_xdsl/Makefile | 43 +++++++++++++++++++ package/kernel/lantiq/ltq-vdsl-vr11/Makefile | 4 +- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 package/firmware/lantiq/dsl_vr11_firmware_xdsl/Makefile diff --git a/package/firmware/lantiq/dsl_vr11_firmware_xdsl/Makefile b/package/firmware/lantiq/dsl_vr11_firmware_xdsl/Makefile new file mode 100644 index 00000000000000..777edb0e75156d --- /dev/null +++ b/package/firmware/lantiq/dsl_vr11_firmware_xdsl/Makefile @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dsl_vr11_firmware_xdsl +PKG_VERSION:=8.13.1.5.0.7 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/intel/dsl_vr11_firmware_xdsl.git +PKG_SOURCE_VERSION:=99cf1fe7a1711b9aa128eeb8419eab698448df9f +PKG_MIRROR_HASH:=7fb37723f8db2558d774ba972f011598d2399609158c5dbc287eca0873b040f1 + +PKG_LICENSE:=MaxLinear-Software-License-Agreement +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +ANNEX_A_VER:=8D1507_8D0901 + +define Package/$(PKG_NAME) + SECTION:=firmware + CATEGORY:=Firmware + TITLE:=VRX518 / VR11 CPE xDSL Annex A firmware + URL:=http://www.intel.com + DEPENDS:=@TARGET_ipq40xx +endef + +define Package/$(PKG_NAME)/description + VRX518 / VR11 CPE VDSL and ADSL Annex A firmware +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/lib/firmware/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE $(1)/lib/firmware/xcpe_$(ANNEX_A_VER).bin.LICENSE + $(INSTALL_DATA) $(PKG_BUILD_DIR)/xcpe_$(ANNEX_A_VER).bin $(1)/lib/firmware/ + ln -s xcpe_$(ANNEX_A_VER).bin $(1)/lib/firmware/vdsl.bin +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/kernel/lantiq/ltq-vdsl-vr11/Makefile b/package/kernel/lantiq/ltq-vdsl-vr11/Makefile index 0fa6011cfc6991..99d6e353761293 100644 --- a/package/kernel/lantiq/ltq-vdsl-vr11/Makefile +++ b/package/kernel/lantiq/ltq-vdsl-vr11/Makefile @@ -27,13 +27,11 @@ PKG_BUILD_FLAGS:=no-mold include $(INCLUDE_DIR)/package.mk -# TODO this driver depends on the vrx518 dsl firmware, add this dependency if -# that ever gets a compatible license define KernelPackage/ltq-vdsl-vr11 TITLE:=vdsl driver SECTION:=sys SUBMENU:=Network Devices - DEPENDS:=@TARGET_ipq40xx +kmod-ltq-vdsl-vr11-mei + DEPENDS:=@TARGET_ipq40xx +kmod-ltq-vdsl-vr11-mei +dsl_vr11_firmware_xdsl FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api) endef From 06b37a5856ac7d0a2ddc2c0745ac1da3a01688d6 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sun, 23 Jun 2024 21:46:46 +0200 Subject: [PATCH 21/21] sunxi: add csi video support for nanopi-neo-air add dtc configuration that declare CSI connection with ov5640 Signed-off-by: Michel Promonet Link: https://github.com/openwrt/openwrt/pull/15967 Signed-off-by: Hauke Mehrtens --- ...csi-video-support-for-nanopi-neo-air.patch | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 target/linux/sunxi/patches-6.6/451-sunxi-add-csi-video-support-for-nanopi-neo-air.patch diff --git a/target/linux/sunxi/patches-6.6/451-sunxi-add-csi-video-support-for-nanopi-neo-air.patch b/target/linux/sunxi/patches-6.6/451-sunxi-add-csi-video-support-for-nanopi-neo-air.patch new file mode 100644 index 00000000000000..c17d28c691d7c8 --- /dev/null +++ b/target/linux/sunxi/patches-6.6/451-sunxi-add-csi-video-support-for-nanopi-neo-air.patch @@ -0,0 +1,107 @@ +From 4c3a3af679bd59660ac80889b560bddaf475ba81 Mon Sep 17 00:00:00 2001 +From: Michel Promonet +Date: Sun, 21 Jul 2024 19:04:19 +0200 +Subject: [PATCH] sunxi: add csi video support for nanopi-neo-air + +--- + .../dts/allwinner/sun8i-h3-nanopi-neo-air.dts | 85 +++++++++++++++++++ + 1 file changed, 85 insertions(+) + +--- a/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-neo-air.dts ++++ b/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-neo-air.dts +@@ -77,6 +77,39 @@ + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ + }; ++ ++ cam_xclk: cam-xclk { ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-frequency = <24000000>; ++ clock-output-names = "cam-xclk"; ++ }; ++ ++ reg_cam_avdd: cam-avdd { ++ compatible = "regulator-fixed"; ++ regulator-name = "cam-avdd"; ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ vin-supply = <®_vcc3v3>; ++ }; ++ ++ reg_cam_dovdd: cam-dovdd { ++ compatible = "regulator-fixed"; ++ regulator-name = "cam-dovdd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <®_vcc3v3>; ++ }; ++ ++ reg_cam_dvdd: cam-dvdd { ++ compatible = "regulator-fixed"; ++ regulator-name = "cam-dvdd"; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ vin-supply = <®_vcc3v3>; ++ }; ++ ++ + }; + + &mmc0 { +@@ -141,3 +174,55 @@ + /* USB VBUS is always on */ + status = "okay"; + }; ++ ++&csi { ++ status = "okay"; ++ ++ port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ /* Parallel bus endpoint */ ++ csi_from_ov5640: endpoint { ++ remote-endpoint = <&ov5640_to_csi>; ++ bus-width = <8>; ++ data-shift = <2>; ++ hsync-active = <1>; /* Active high */ ++ vsync-active = <0>; /* Active low */ ++ data-active = <1>; /* Active high */ ++ pclk-sample = <1>; /* Rising */ ++ }; ++ }; ++}; ++ ++&i2c2 { ++ status = "okay"; ++ ++ ov5640: camera@3c { ++ compatible = "ovti,ov5640"; ++ reg = <0x3c>; ++ clocks = <&cam_xclk>; ++ clock-names = "xclk"; ++ ++ reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; ++ powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; ++ AVDD-supply = <®_cam_avdd>; ++ DOVDD-supply = <®_cam_dovdd>; ++ DVDD-supply = <®_cam_dvdd>; ++ ++ port { ++ ov5640_to_csi: endpoint { ++ remote-endpoint = <&csi_from_ov5640>; ++ bus-width = <8>; ++ data-shift = <2>; ++ hsync-active = <1>; /* Active high */ ++ vsync-active = <0>; /* Active low */ ++ data-active = <1>; /* Active high */ ++ pclk-sample = <1>; /* Rising */ ++ }; ++ }; ++ }; ++}; ++&i2c2_pins { ++ bias-pull-up; ++};