From 01b096a64bd69cc96303c3fe99a9d8d0038ba839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 2 Sep 2022 17:07:40 +0200 Subject: [PATCH 01/78] bcm4908: use upstream patches for Asus GT-AC5300 LEDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit d51e990ff81ad0335294749e8d2fc8e69ceb9179) --- ...-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch} | 5 ++++- ...m64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch} | 5 ++++- ...arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch} | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) rename target/linux/bcm4908/patches-5.4/{130-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch => 038-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch} (91%) rename target/linux/bcm4908/patches-5.4/{130-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch => 038-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch} (78%) rename target/linux/bcm4908/patches-5.4/{130-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch => 038-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch} (88%) diff --git a/target/linux/bcm4908/patches-5.4/130-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch similarity index 91% rename from target/linux/bcm4908/patches-5.4/130-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch rename to target/linux/bcm4908/patches-5.4/038-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch index be1efcde86..437249f2cb 100644 --- a/target/linux/bcm4908/patches-5.4/130-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch @@ -1,5 +1,6 @@ +From 456b6dd1baadd2da10e28ffd1717b06d1fa17a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Mon, 18 Jul 2022 13:16:05 +0200 +Date: Mon, 18 Jul 2022 15:20:58 +0200 Subject: [PATCH] arm64: dts: broadcom: bcm4908: add remaining LED pins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,6 +9,8 @@ Content-Transfer-Encoding: 8bit Include all 32 pins. Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220718132100.13277-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli --- .../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/target/linux/bcm4908/patches-5.4/130-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch similarity index 78% rename from target/linux/bcm4908/patches-5.4/130-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch rename to target/linux/bcm4908/patches-5.4/038-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch index 0ba3745798..c890340893 100644 --- a/target/linux/bcm4908/patches-5.4/130-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch @@ -1,5 +1,6 @@ +From 7de56b1dc1149c702d4cc1e89ccc251bfb2bc246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Mon, 18 Jul 2022 13:17:57 +0200 +Date: Mon, 18 Jul 2022 15:20:59 +0200 Subject: [PATCH] arm64: dts: broadcom: bcm4908: add LEDs controller block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -9,6 +10,8 @@ BCM4908 includes LEDs controller that supports multiple brightness levels & hardware blinking. Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220718132100.13277-2-zajec5@gmail.com +Signed-off-by: Florian Fainelli --- arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/linux/bcm4908/patches-5.4/130-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch similarity index 88% rename from target/linux/bcm4908/patches-5.4/130-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch rename to target/linux/bcm4908/patches-5.4/038-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch index 796395a017..3888efb66b 100644 --- a/target/linux/bcm4908/patches-5.4/130-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch @@ -1,5 +1,6 @@ +From 3bcae3396e986b4ab97a69e8de517e32f9691a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Mon, 18 Jul 2022 13:21:54 +0200 +Date: Mon, 18 Jul 2022 15:21:00 +0200 Subject: [PATCH] arm64: dts: broadcom: bcm4908: add Asus GT-AC5300 LEDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,6 +9,8 @@ Content-Transfer-Encoding: 8bit There are 5 software-controllable LEDs on PCB. Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220718132100.13277-3-zajec5@gmail.com +Signed-off-by: Florian Fainelli --- .../bcm4908/bcm4908-asus-gt-ac5300.dts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) From 940adf4b6725f834e6fade3ed0ddbcf14c4d6ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sat, 3 Sep 2022 20:41:00 +0200 Subject: [PATCH 02/78] bcm4908: fix Asus GT-AX6000 image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Include Linux DTB 2. Add 50991 variant (seems to differ by 1 PHY we don't support yet) Signed-off-by: Rafał Miłecki (cherry picked from commit b8f8c6f2dd8d47216117cb5b78184531ab21dddd) --- target/linux/bcm4908/config-5.4 | 2 +- target/linux/bcm4908/image/Makefile | 2 +- target/linux/bcm4908/image/bootfs-bcm4912.its | 35 +++++++++++++++++-- ...bcmbca-add-arch-bcmbca-machine-entry.patch | 31 ++++++++++++++++ 4 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 target/linux/bcm4908/patches-5.4/037-v5.20-0011-arm64-bcmbca-add-arch-bcmbca-machine-entry.patch diff --git a/target/linux/bcm4908/config-5.4 b/target/linux/bcm4908/config-5.4 index e051e900df..e6e40f96a9 100644 --- a/target/linux/bcm4908/config-5.4 +++ b/target/linux/bcm4908/config-5.4 @@ -1,5 +1,6 @@ CONFIG_64BIT=y CONFIG_ARCH_BCM4908=y +CONFIG_ARCH_BCMBCA=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_KEEP_MEMBLOCK=y @@ -203,7 +204,6 @@ CONFIG_QUEUED_SPINLOCKS=y CONFIG_RATIONAL=y CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y -CONFIG_REFCOUNT_FULL=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_RFS_ACCEL=y diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile index aba4d377f8..a6c31d50ee 100644 --- a/target/linux/bcm4908/image/Makefile +++ b/target/linux/bcm4908/image/Makefile @@ -90,7 +90,7 @@ TARGET_DEVICES += asus_gt-ac5300 define Device/asus_gt-ax6000 DEVICE_VENDOR := Asus DEVICE_MODEL := GT-AX6000 - DEVICE_DTS := broadcom/bcmbca/bcm4912-asus-gt-ax6000 + KERNEL := kernel-bin | bootfs IMAGES := pkgtb IMAGE/pkgtb := append-rootfs | pkgtb SOC := bcm4912 diff --git a/target/linux/bcm4908/image/bootfs-bcm4912.its b/target/linux/bcm4908/image/bootfs-bcm4912.its index 6f4548956c..3d671f9d00 100644 --- a/target/linux/bcm4908/image/bootfs-bcm4912.its +++ b/target/linux/bcm4908/image/bootfs-bcm4912.its @@ -12,9 +12,22 @@ data = /incbin/("${images_dir}/u-boot/u-boot-bcm4912.dtb"); }; - fdt_GTAX6000 { + fdt_uboot_GTAX6000 { description = "dtb"; data = /incbin/("${images_dir}/u-boot/GTAX6000.dtb"); + arch = "arm64"; + type = "flat_dt"; + compression = "none"; + + hash-1 { + algo = "sha256"; + }; + }; + + fdt_linux_GTAX6000 { + description = "dtb"; + data = /incbin/("${dts_dir}/broadcom/bcmbca/bcm4912-asus-gt-ax6000.dtb"); + arch = "arm64"; type = "flat_dt"; compression = "none"; @@ -27,8 +40,26 @@ configurations { conf_ub_GTAX6000 { description = "GTAX6000"; - fdt = "fdt_GTAX6000"; + fdt = "fdt_uboot_GTAX6000"; loadables = "atf", "uboot"; }; + + conf_lx_GTAX6000 { + description = "BRCM 63xxx linux"; + kernel = "kernel"; + fdt = "fdt_linux_GTAX6000"; + }; + + conf_ub_GTAX6000_50991 { + description = "GTAX6000_50991"; + fdt = "fdt_uboot_GTAX6000"; + loadables = "atf", "uboot"; + }; + + conf_lx_GTAX6000_50991 { + description = "BRCM 63xxx linux"; + kernel = "kernel"; + fdt = "fdt_linux_GTAX6000"; + }; }; }; diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0011-arm64-bcmbca-add-arch-bcmbca-machine-entry.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0011-arm64-bcmbca-add-arch-bcmbca-machine-entry.patch new file mode 100644 index 0000000000..1b9a32e30a --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0011-arm64-bcmbca-add-arch-bcmbca-machine-entry.patch @@ -0,0 +1,31 @@ +From fdcd652ce2b6b819f5c4dc3cead5215c84ee6933 Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 1 Jun 2022 15:56:50 -0700 +Subject: [PATCH] arm64: bcmbca: add arch bcmbca machine entry + +Add ARCH_BCMBCA config for Broadcom Broadband SoC chipsets + +Signed-off-by: William Zhang +Signed-off-by: Florian Fainelli +--- + arch/arm64/Kconfig.platforms | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/arch/arm64/Kconfig.platforms ++++ b/arch/arm64/Kconfig.platforms +@@ -59,6 +59,15 @@ config ARCH_BCM_IPROC + help + This enables support for Broadcom iProc based SoCs + ++config ARCH_BCMBCA ++ bool "Broadcom Broadband SoC" ++ help ++ Say Y if you intend to run the kernel on a Broadcom Broadband ARM-based ++ BCA chipset. ++ ++ This enables support for Broadcom BCA ARM-based broadband chipsets, ++ including the DSL, PON and Wireless family of chips. ++ + config ARCH_BERLIN + bool "Marvell Berlin SoC Family" + select DW_APB_ICTL From b01b9244b4bf9e95633e706a16a0fd8c309fcadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sat, 12 Nov 2022 10:42:51 +0100 Subject: [PATCH 03/78] kernel: update U-Boot nvmem driver to v6.2 release version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport queued patches that 1. Fix CRC32 calculation for redundant images 2. Fix CRC32 on big-endian 3. Fix parting images with Broadcom header Signed-off-by: Rafał Miłecki (cherry picked from commit 797177ad85cbf92b5c1e270751eaca9eb4f34f30) --- ...-fix-crc32_data_offset-on-redundant-.patch | 56 ++++++++++++++++ ...env-align-endianness-of-crc32-values.patch | 47 ++++++++++++++ ...boot-env-add-Broadcom-format-support.patch | 65 +++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 target/linux/generic/backport-5.4/822-v6.2-0001-nvmem-u-boot-env-fix-crc32_data_offset-on-redundant-.patch create mode 100644 target/linux/generic/backport-5.4/822-v6.2-0002-nvmem-u-boot-env-align-endianness-of-crc32-values.patch create mode 100644 target/linux/generic/backport-5.4/822-v6.2-0003-nvmem-u-boot-env-add-Broadcom-format-support.patch diff --git a/target/linux/generic/backport-5.4/822-v6.2-0001-nvmem-u-boot-env-fix-crc32_data_offset-on-redundant-.patch b/target/linux/generic/backport-5.4/822-v6.2-0001-nvmem-u-boot-env-fix-crc32_data_offset-on-redundant-.patch new file mode 100644 index 0000000000..69d5a1b845 --- /dev/null +++ b/target/linux/generic/backport-5.4/822-v6.2-0001-nvmem-u-boot-env-fix-crc32_data_offset-on-redundant-.patch @@ -0,0 +1,56 @@ +From 7a69ff9c9bde03a690ea783970f664782fc303d8 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 4 Nov 2022 17:52:03 +0100 +Subject: [PATCH] nvmem: u-boot-env: fix crc32_data_offset on redundant + u-boot-env + +The Western Digital MyBook Live (PowerPC 464/APM82181) +has a set of redundant u-boot-env. Loading up the driver +the following error: + +| u_boot_env: Invalid calculated CRC32: 0x4f8f2c86 (expected: 0x98b14514) +| u_boot_env: probe of partition@1e000 failed with error -22 + +Looking up the userspace libubootenv utilities source [0], +it looks like the "mark" or "flag" is not part of the +crc32 sum... which is unfortunate :( + +|static int libuboot_load(struct uboot_ctx *ctx) +|{ +|[...] +| if (ctx->redundant) { +| [...] +| offsetdata = offsetof(struct uboot_env_redund, data); +| [...] //-----^^ +| } +| usable_envsize = ctx->size - offsetdata; +| buf[0] = malloc(bufsize); +|[...] +| for (i = 0; i < copies; i++) { +| data = (uint8_t *)(buf[i] + offsetdata); +| uint32_t crc; +| +| ret = devread(ctx, i, buf[i]); +| [...] +| crc = *(uint32_t *)(buf[i] + offsetcrc); +| dev->crc = crc32(0, (uint8_t *)data, usable_envsize); +| + +[0] https://github.com/sbabic/libubootenv/blob/master/src/uboot_env.c#L951 +Fixes: d5542923f200 ("nvmem: add driver handling U-Boot environment variables") +Signed-off-by: Christian Lamparter +--- + drivers/nvmem/u-boot-env.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/u-boot-env.c ++++ b/drivers/nvmem/u-boot-env.c +@@ -135,7 +135,7 @@ static int u_boot_env_parse(struct u_boo + break; + case U_BOOT_FORMAT_REDUNDANT: + crc32_offset = offsetof(struct u_boot_env_image_redundant, crc32); +- crc32_data_offset = offsetof(struct u_boot_env_image_redundant, mark); ++ crc32_data_offset = offsetof(struct u_boot_env_image_redundant, data); + data_offset = offsetof(struct u_boot_env_image_redundant, data); + break; + } diff --git a/target/linux/generic/backport-5.4/822-v6.2-0002-nvmem-u-boot-env-align-endianness-of-crc32-values.patch b/target/linux/generic/backport-5.4/822-v6.2-0002-nvmem-u-boot-env-align-endianness-of-crc32-values.patch new file mode 100644 index 0000000000..7d6723bb8e --- /dev/null +++ b/target/linux/generic/backport-5.4/822-v6.2-0002-nvmem-u-boot-env-align-endianness-of-crc32-values.patch @@ -0,0 +1,47 @@ +From 0e71cac033bb7689c4dfa2e6814191337ef770f5 Mon Sep 17 00:00:00 2001 +From: INAGAKI Hiroshi +Date: Thu, 13 Oct 2022 00:51:33 +0900 +Subject: [PATCH] nvmem: u-boot-env: align endianness of crc32 values +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch fixes crc32 error on Big-Endianness system by conversion of +calculated crc32 value. + +Little-Endianness system: + + obtained crc32: Little +calculated crc32: Little + +Big-Endianness system: + + obtained crc32: Little +calculated crc32: Big + +log (APRESIA ApresiaLightGS120GT-SS, RTL8382M, Big-Endianness): + +[ 8.570000] u_boot_env 18001200.spi:flash@0:partitions:partition@c0000: Invalid calculated CRC32: 0x88cd6f09 (expected: 0x096fcd88) +[ 8.580000] u_boot_env: probe of 18001200.spi:flash@0:partitions:partition@c0000 failed with error -22 + +Fixes: f955dc1445069 ("nvmem: add driver handling U-Boot environment variables") + +Signed-off-by: INAGAKI Hiroshi +Acked-by: Rafał Miłecki +Tested-by: Christian Lamparter +Signed-off-by: Srinivas Kandagatla +--- + drivers/nvmem/u-boot-env.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/u-boot-env.c ++++ b/drivers/nvmem/u-boot-env.c +@@ -143,7 +143,7 @@ static int u_boot_env_parse(struct u_boo + crc32_data_len = priv->mtd->size - crc32_data_offset; + data_len = priv->mtd->size - data_offset; + +- calc = crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L; ++ calc = le32_to_cpu((__le32)crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L); + if (calc != crc32) { + dev_err(dev, "Invalid calculated CRC32: 0x%08x (expected: 0x%08x)\n", calc, crc32); + err = -EINVAL; diff --git a/target/linux/generic/backport-5.4/822-v6.2-0003-nvmem-u-boot-env-add-Broadcom-format-support.patch b/target/linux/generic/backport-5.4/822-v6.2-0003-nvmem-u-boot-env-add-Broadcom-format-support.patch new file mode 100644 index 0000000000..429b24f0f3 --- /dev/null +++ b/target/linux/generic/backport-5.4/822-v6.2-0003-nvmem-u-boot-env-add-Broadcom-format-support.patch @@ -0,0 +1,65 @@ +From 5b4eaafbeac472fc19049152f18e88aecb2b2829 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 17 Oct 2022 09:17:22 +0200 +Subject: [PATCH] nvmem: u-boot-env: add Broadcom format support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Broadcom uses U-Boot for a lot of their bcmbca familiy chipsets. They +decided to store U-Boot environment data inside U-Boot partition and to +use a custom header (with "uEnv" magic and env data length). + +Add support for Broadcom's specific binding and their custom format. + +Ref: 6b0584c19d87 ("dt-bindings: nvmem: u-boot,env: add Broadcom's variant binding") +Signed-off-by: Rafał Miłecki +Signed-off-by: Srinivas Kandagatla +--- + drivers/nvmem/u-boot-env.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/nvmem/u-boot-env.c ++++ b/drivers/nvmem/u-boot-env.c +@@ -16,6 +16,7 @@ + enum u_boot_env_format { + U_BOOT_FORMAT_SINGLE, + U_BOOT_FORMAT_REDUNDANT, ++ U_BOOT_FORMAT_BROADCOM, + }; + + struct u_boot_env { +@@ -40,6 +41,13 @@ struct u_boot_env_image_redundant { + uint8_t data[]; + } __packed; + ++struct u_boot_env_image_broadcom { ++ __le32 magic; ++ __le32 len; ++ __le32 crc32; ++ uint8_t data[0]; ++} __packed; ++ + static int u_boot_env_read(void *context, unsigned int offset, void *val, + size_t bytes) + { +@@ -138,6 +146,11 @@ static int u_boot_env_parse(struct u_boo + crc32_data_offset = offsetof(struct u_boot_env_image_redundant, data); + data_offset = offsetof(struct u_boot_env_image_redundant, data); + break; ++ case U_BOOT_FORMAT_BROADCOM: ++ crc32_offset = offsetof(struct u_boot_env_image_broadcom, crc32); ++ crc32_data_offset = offsetof(struct u_boot_env_image_broadcom, data); ++ data_offset = offsetof(struct u_boot_env_image_broadcom, data); ++ break; + } + crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset)); + crc32_data_len = priv->mtd->size - crc32_data_offset; +@@ -202,6 +215,7 @@ static const struct of_device_id u_boot_ + { .compatible = "u-boot,env", .data = (void *)U_BOOT_FORMAT_SINGLE, }, + { .compatible = "u-boot,env-redundant-bool", .data = (void *)U_BOOT_FORMAT_REDUNDANT, }, + { .compatible = "u-boot,env-redundant-count", .data = (void *)U_BOOT_FORMAT_REDUNDANT, }, ++ { .compatible = "brcm,env", .data = (void *)U_BOOT_FORMAT_BROADCOM, }, + {}, + }; + From 8a11563b06553118abb870461e07f47368666feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sat, 3 Sep 2022 14:31:29 +0200 Subject: [PATCH 04/78] base-files: support "metric" in board.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It allows prepopulating /etc/config/network interface-s with predefined metric. It may be useful for devices with multiple WAN ports. Signed-off-by: Rafał Miłecki (cherry picked from commit 7f443d2d9aa1170d6b68f0dc6d5b5552882ee327) --- package/base-files/files/bin/config_generate | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 596fcf41fa..38362813d1 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -96,7 +96,7 @@ generate_network() { json_select network json_select "$1" - json_get_vars device macaddr protocol ipaddr netmask vlan + json_get_vars device macaddr metric protocol ipaddr netmask vlan json_get_values ports ports json_select .. json_select .. @@ -154,6 +154,7 @@ generate_network() { set network.$1='interface' set network.$1.type='$type' set network.$1.device='$device' + set network.$1.metric='$metric' set network.$1.proto='none' EOF From 7492906d13f3f7a44ed750d99feebf90a9e353fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 2 Nov 2022 20:26:33 +0100 Subject: [PATCH 05/78] kernel: improve description of NTFS kernel packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps choosing the right NTFS driver from two available options. Signed-off-by: Rafał Miłecki (cherry picked from commit b066ad7d9aa5221bfd334a3017abe9bcd171b33f) --- package/kernel/linux/modules/fs.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index d43542b17e..d390e29a25 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -462,7 +462,7 @@ $(eval $(call KernelPackage,fs-nfsd)) define KernelPackage/fs-ntfs SUBMENU:=$(FS_MENU) - TITLE:=NTFS filesystem support + TITLE:=NTFS filesystem read-only (old driver) support KCONFIG:=CONFIG_NTFS_FS FILES:=$(LINUX_DIR)/fs/ntfs/ntfs.ko AUTOLOAD:=$(call AutoLoad,30,ntfs) @@ -470,7 +470,8 @@ define KernelPackage/fs-ntfs endef define KernelPackage/fs-ntfs/description - Kernel module for NTFS filesystem support + Kernel module for limited NTFS filesystem support. Support for writing + is extremely limited and disabled as a result. endef $(eval $(call KernelPackage,fs-ntfs)) From 660d8f40488715e68c2d8f9147d249fbd9a8ff78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 11 Nov 2022 14:54:46 +0100 Subject: [PATCH 06/78] bcm4908: update DTS files with the latest changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The most affecting change is move of files from bcm4908/ to the bcmbca/. That required updating few paths. Signed-off-by: Rafał Miłecki (cherry picked from commit 45ac906c6415cebd12281088da6b06668c057f0a) --- target/linux/bcm4908/image/Makefile | 6 +- target/linux/bcm4908/image/bootfs-bcm4908.its | 2 +- ...cmbca-update-BCM4908-board-dts-files.patch | 66 + ...ts-Move-BCM4908-dts-to-bcmbca-folder.patch | 2491 +++++++++++++++++ ...64-dts-Add-BCM4908-generic-board-dts.patch | 62 + ...om-bcmbca-bcm4908-add-TWD-block-time.patch | 31 + ...roadcom-bcmbca-bcm6858-add-TWD-block.patch | 46 + ...m-bcmbca-bcm4908-limit-amount-of-GP.patch} | 8 +- 8 files changed, 2704 insertions(+), 8 deletions(-) create mode 100644 target/linux/bcm4908/patches-5.4/038-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch create mode 100644 target/linux/bcm4908/patches-5.4/038-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch create mode 100644 target/linux/bcm4908/patches-5.4/038-v6.1-0006-arm64-dts-Add-BCM4908-generic-board-dts.patch create mode 100644 target/linux/bcm4908/patches-5.4/039-v6.2-0001-arm64-dts-broadcom-bcmbca-bcm4908-add-TWD-block-time.patch create mode 100644 target/linux/bcm4908/patches-5.4/039-v6.2-0002-arm64-dts-broadcom-bcmbca-bcm6858-add-TWD-block.patch rename target/linux/bcm4908/patches-5.4/{300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch => 300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch} (71%) diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile index a6c31d50ee..cdb6f3ea1f 100644 --- a/target/linux/bcm4908/image/Makefile +++ b/target/linux/bcm4908/image/Makefile @@ -77,7 +77,7 @@ endef define Device/asus_gt-ac5300 DEVICE_VENDOR := Asus DEVICE_MODEL := GT-AC5300 - DEVICE_DTS := broadcom/bcm4908/bcm4908-asus-gt-ac5300 + DEVICE_DTS := broadcom/bcmbca/bcm4908-asus-gt-ac5300 IMAGES := bin IMAGE/bin := append-ubi | bcm4908img | bcm4908asus ASUS_PRODUCTID := GT-AC5300 @@ -100,7 +100,7 @@ endef define Device/netgear_r8000p DEVICE_VENDOR := Netgear DEVICE_MODEL := R8000P - DEVICE_DTS := broadcom/bcm4908/bcm4906-netgear-r8000p + DEVICE_DTS := broadcom/bcmbca/bcm4906-netgear-r8000p IMAGES := bin IMAGE/chk := append-ubi | bcm4908img | netgear-chk NETGEAR_BOARD_ID := U12H359T00_NETGEAR @@ -112,7 +112,7 @@ define Device/tplink_archer-c2300-v1 DEVICE_VENDOR := TP-Link DEVICE_MODEL := Archer C2300 DEVICE_VARIANT := v1 - DEVICE_DTS := broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1 + DEVICE_DTS := broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1 IMAGES := bin IMAGE/bin := append-ubi | bcm4908img BROKEN := y diff --git a/target/linux/bcm4908/image/bootfs-bcm4908.its b/target/linux/bcm4908/image/bootfs-bcm4908.its index d5ac21fd6a..2086fc7ec9 100644 --- a/target/linux/bcm4908/image/bootfs-bcm4908.its +++ b/target/linux/bcm4908/image/bootfs-bcm4908.its @@ -25,7 +25,7 @@ fdt_linux_RAX220 { description = "dtb"; - data = /incbin/("${dts_dir}/broadcom/bcm4908/bcm4908-netgear-raxe500.dtb"); + data = /incbin/("${dts_dir}/broadcom/bcmbca/bcm4908-netgear-raxe500.dtb"); arch = "arm64"; type = "flat_dt"; compression = "none"; diff --git a/target/linux/bcm4908/patches-5.4/038-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch new file mode 100644 index 0000000000..d4b7a983de --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch @@ -0,0 +1,66 @@ +From 4fdcbde682291fba2c3f45a41decd656d92a314f Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 3 Aug 2022 10:54:49 -0700 +Subject: [PATCH] arm64: dts: bcmbca: update BCM4908 board dts files +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Append "brcm,bcmbca" to compatible strings based on the new bcmbca +binding rule for BCM4908 family based boards. + +Signed-off-by: William Zhang +Acked-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220803175455.47638-4-william.zhang@broadcom.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts | 2 +- + .../dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts | 2 +- + arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts | 2 +- + .../arm64/boot/dts/broadcom/bcm4908/bcm4908-netgear-raxe500.dts | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts +@@ -7,7 +7,7 @@ + #include "bcm4906.dtsi" + + / { +- compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908"; ++ compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; + model = "Netgear R8000P"; + + memory@0 { +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts +@@ -7,7 +7,7 @@ + #include "bcm4906.dtsi" + + / { +- compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908"; ++ compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; + model = "TP-Link Archer C2300 V1"; + + memory@0 { +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts +@@ -7,7 +7,7 @@ + #include "bcm4908.dtsi" + + / { +- compatible = "asus,gt-ac5300", "brcm,bcm4908"; ++ compatible = "asus,gt-ac5300", "brcm,bcm4908", "brcm,bcmbca"; + model = "Asus GT-AC5300"; + + memory@0 { +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-netgear-raxe500.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-netgear-raxe500.dts +@@ -3,7 +3,7 @@ + #include "bcm4908.dtsi" + + / { +- compatible = "netgear,raxe500", "brcm,bcm4908"; ++ compatible = "netgear,raxe500", "brcm,bcm4908", "brcm,bcmbca"; + model = "Netgear RAXE500"; + + memory@0 { diff --git a/target/linux/bcm4908/patches-5.4/038-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch new file mode 100644 index 0000000000..8363b2984c --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch @@ -0,0 +1,2491 @@ +From ded8f22945899f4e87dd6d952bbc4abce6e64b7e Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 3 Aug 2022 10:54:50 -0700 +Subject: [PATCH] arm64: dts: Move BCM4908 dts to bcmbca folder + +As part of ARCH_BCM4908 to ARCH_BCMBCA migration, move the BCM4908 dts +files to bcmbca folder and use CONFIG_ARCH_BCMBCA to build all the +BCM4908 board dts. Delete bcm4908 folder and its makefile as well. + +Signed-off-by: William Zhang +Link: https://lore.kernel.org/r/20220803175455.47638-5-william.zhang@broadcom.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/Makefile | 1 - + arch/arm64/boot/dts/broadcom/bcm4908/Makefile | 5 ----- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 4 ++++ + .../broadcom/{bcm4908 => bcmbca}/bcm4906-netgear-r8000p.dts | 0 + .../{bcm4908 => bcmbca}/bcm4906-tplink-archer-c2300-v1.dts | 0 + .../arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4906.dtsi | 0 + .../broadcom/{bcm4908 => bcmbca}/bcm4908-asus-gt-ac5300.dts | 0 + .../broadcom/{bcm4908 => bcmbca}/bcm4908-netgear-raxe500.dts | 0 + .../arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4908.dtsi | 0 + 9 files changed, 4 insertions(+), 6 deletions(-) + delete mode 100644 arch/arm64/boot/dts/broadcom/bcm4908/Makefile + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4906-netgear-r8000p.dts (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4906-tplink-archer-c2300-v1.dts (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4906.dtsi (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4908-asus-gt-ac5300.dts (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4908-netgear-raxe500.dts (100%) + rename arch/arm64/boot/dts/broadcom/{bcm4908 => bcmbca}/bcm4908.dtsi (100%) + +--- a/arch/arm64/boot/dts/broadcom/Makefile ++++ b/arch/arm64/boot/dts/broadcom/Makefile +@@ -4,7 +4,6 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rp + bcm2837-rpi-3-b-plus.dtb \ + bcm2837-rpi-cm3-io3.dtb + +-subdir-y += bcm4908 + subdir-y += bcmbca + subdir-y += northstar2 + subdir-y += stingray +--- a/arch/arm64/boot/dts/broadcom/bcm4908/Makefile ++++ /dev/null +@@ -1,5 +0,0 @@ +-# SPDX-License-Identifier: GPL-2.0 +-dtb-$(CONFIG_ARCH_BCM4908) += bcm4906-netgear-r8000p.dtb +-dtb-$(CONFIG_ARCH_BCM4908) += bcm4906-tplink-archer-c2300-v1.dtb +-dtb-$(CONFIG_ARCH_BCM4908) += bcm4908-asus-gt-ac5300.dtb +-dtb-$(CONFIG_ARCH_BCM4908) += bcm4908-netgear-raxe500.dtb +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -1,5 +1,9 @@ + # SPDX-License-Identifier: GPL-2.0 + dtb-$(CONFIG_ARCH_BCMBCA) += \ ++ bcm4906-netgear-r8000p.dtb \ ++ bcm4906-tplink-archer-c2300-v1.dtb \ ++ bcm4908-asus-gt-ac5300.dtb \ ++ bcm4908-netgear-raxe500.dtb \ + bcm4912-asus-gt-ax6000.dtb \ + bcm94912.dtb \ + bcm963158.dtb \ +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts ++++ /dev/null +@@ -1,157 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include +-#include +-#include +- +-#include "bcm4906.dtsi" +- +-/ { +- compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; +- model = "Netgear R8000P"; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00 0x00 0x00 0x20000000>; +- }; +- +- leds { +- compatible = "gpio-leds"; +- +- led-power-white { +- function = LED_FUNCTION_POWER; +- color = ; +- gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; +- }; +- +- led-power-amber { +- function = LED_FUNCTION_POWER; +- color = ; +- gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; +- }; +- +- led-wps { +- function = LED_FUNCTION_WPS; +- color = ; +- gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; +- }; +- +- led-2ghz { +- function = "2ghz"; +- color = ; +- gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; +- }; +- +- led-5ghz-1 { +- function = "5ghz-1"; +- color = ; +- gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; +- }; +- +- led-5ghz-2 { +- function = "5ghz-2"; +- color = ; +- gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb2 { +- function = "usb2"; +- color = ; +- gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb3 { +- function = "usb3"; +- color = ; +- gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; +- }; +- +- led-wifi { +- function = "wifi"; +- color = ; +- gpios = <&gpio0 56 GPIO_ACTIVE_LOW>; +- }; +- }; +-}; +- +-&enet { +- nvmem-cells = <&base_mac_addr>; +- nvmem-cell-names = "mac-address"; +-}; +- +-&usb_phy { +- brcm,ioc = <1>; +- status = "okay"; +-}; +- +-&ehci { +- status = "okay"; +-}; +- +-&ohci { +- status = "okay"; +-}; +- +-&xhci { +- status = "okay"; +-}; +- +-&ports { +- port@0 { +- label = "lan4"; +- }; +- +- port@1 { +- label = "lan3"; +- }; +- +- port@2 { +- label = "lan2"; +- }; +- +- port@3 { +- label = "lan1"; +- }; +- +- port@7 { +- reg = <7>; +- phy-mode = "internal"; +- phy-handle = <&phy12>; +- label = "wan"; +- }; +-}; +- +-&nandcs { +- nand-ecc-strength = <4>; +- nand-ecc-step-size = <512>; +- nand-on-flash-bbt; +- +- #address-cells = <1>; +- #size-cells = <0>; +- +- partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; +- +- partition@0 { +- compatible = "nvmem-cells"; +- label = "cferom"; +- reg = <0x0 0x100000>; +- +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0 0x0 0x100000>; +- +- base_mac_addr: mac@106a0 { +- reg = <0x106a0 0x6>; +- }; +- }; +- +- partition@100000 { +- compatible = "brcm,bcm4908-firmware"; +- label = "firmware"; +- reg = <0x100000 0x4400000>; +- }; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts ++++ /dev/null +@@ -1,182 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include +-#include +-#include +- +-#include "bcm4906.dtsi" +- +-/ { +- compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; +- model = "TP-Link Archer C2300 V1"; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00 0x00 0x00 0x20000000>; +- }; +- +- leds { +- compatible = "gpio-leds"; +- +- led-power { +- function = LED_FUNCTION_POWER; +- color = ; +- gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; +- }; +- +- led-2ghz { +- function = "2ghz"; +- color = ; +- gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; +- }; +- +- led-5ghz { +- function = "5ghz"; +- color = ; +- gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; +- }; +- +- led-wan-amber { +- function = LED_FUNCTION_WAN; +- color = ; +- gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; +- }; +- +- led-wan-blue { +- function = LED_FUNCTION_WAN; +- color = ; +- gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; +- }; +- +- led-lan { +- function = LED_FUNCTION_LAN; +- color = ; +- gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; +- }; +- +- led-wps { +- function = LED_FUNCTION_WPS; +- color = ; +- gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb2 { +- function = "usb2"; +- color = ; +- gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; +- }; +- +- led-usb3 { +- function = "usbd3"; +- color = ; +- gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; +- }; +- +- led-brightness { +- function = LED_FUNCTION_BACKLIGHT; +- color = ; +- gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; +- }; +- }; +- +- gpio-keys-polled { +- compatible = "gpio-keys-polled"; +- poll-interval = <100>; +- +- key-brightness { +- label = "LEDs"; +- linux,code = ; +- gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; +- }; +- +- key-wps { +- label = "WPS"; +- linux,code = ; +- gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; +- }; +- +- key-wifi { +- label = "WiFi"; +- linux,code = ; +- gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; +- }; +- +- key-restart { +- label = "Reset"; +- linux,code = ; +- gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; +- }; +- }; +-}; +- +-&usb_phy { +- brcm,ioc = <1>; +- status = "okay"; +-}; +- +-&ehci { +- status = "okay"; +-}; +- +-&ohci { +- status = "okay"; +-}; +- +-&xhci { +- status = "okay"; +-}; +- +-&ports { +- port@0 { +- label = "lan4"; +- }; +- +- port@1 { +- label = "lan3"; +- }; +- +- port@2 { +- label = "lan2"; +- }; +- +- port@3 { +- label = "lan1"; +- }; +- +- port@7 { +- reg = <7>; +- phy-mode = "internal"; +- phy-handle = <&phy12>; +- label = "wan"; +- }; +-}; +- +-&nandcs { +- nand-ecc-strength = <4>; +- nand-ecc-step-size = <512>; +- nand-on-flash-bbt; +- +- #address-cells = <1>; +- #size-cells = <0>; +- +- partitions { +- compatible = "brcm,bcm4908-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; +- +- partition@0 { +- label = "cferom"; +- reg = <0x0 0x100000>; +- }; +- +- partition@100000 { +- compatible = "brcm,bcm4908-firmware"; +- reg = <0x100000 0x3900000>; +- }; +- +- partition@5800000 { +- compatible = "brcm,bcm4908-firmware"; +- reg = <0x3a00000 0x3900000>; +- }; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi ++++ /dev/null +@@ -1,26 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include "bcm4908.dtsi" +- +-/ { +- cpus { +- /delete-node/ cpu@2; +- +- /delete-node/ cpu@3; +- }; +- +- timer { +- compatible = "arm,armv8-timer"; +- interrupts = , +- , +- , +- ; +- }; +- +- pmu { +- compatible = "arm,cortex-a53-pmu"; +- interrupts = , +- ; +- interrupt-affinity = <&cpu0>, <&cpu1>; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts ++++ /dev/null +@@ -1,207 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include +-#include +-#include +- +-#include "bcm4908.dtsi" +- +-/ { +- compatible = "asus,gt-ac5300", "brcm,bcm4908", "brcm,bcmbca"; +- model = "Asus GT-AC5300"; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00 0x00 0x00 0x40000000>; +- }; +- +- gpio-keys-polled { +- compatible = "gpio-keys-polled"; +- poll-interval = <100>; +- +- key-wifi { +- label = "WiFi"; +- linux,code = ; +- gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; +- }; +- +- key-wps { +- label = "WPS"; +- linux,code = ; +- gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; +- }; +- +- key-restart { +- label = "Reset"; +- linux,code = ; +- gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; +- }; +- +- key-brightness { +- label = "LEDs"; +- linux,code = ; +- gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; +- }; +- }; +-}; +- +-&enet { +- nvmem-cells = <&base_mac_addr>; +- nvmem-cell-names = "mac-address"; +-}; +- +-&usb_phy { +- brcm,ioc = <1>; +- status = "okay"; +-}; +- +-&ehci { +- status = "okay"; +-}; +- +-&ohci { +- status = "okay"; +-}; +- +-&xhci { +- status = "okay"; +-}; +- +-&ports { +- port@0 { +- label = "lan2"; +- }; +- +- port@1 { +- label = "lan1"; +- }; +- +- port@2 { +- label = "lan6"; +- }; +- +- port@3 { +- label = "lan5"; +- }; +- +- /* External BCM53134S switch */ +- port@7 { +- label = "sw"; +- reg = <7>; +- phy-mode = "rgmii"; +- +- fixed-link { +- speed = <1000>; +- full-duplex; +- }; +- }; +-}; +- +-&mdio { +- /* lan8 */ +- ethernet-phy@0 { +- reg = <0>; +- }; +- +- /* lan7 */ +- ethernet-phy@1 { +- reg = <1>; +- }; +- +- /* lan4 */ +- ethernet-phy@2 { +- reg = <2>; +- }; +- +- /* lan3 */ +- ethernet-phy@3 { +- reg = <3>; +- }; +-}; +- +-&leds { +- led-power@11 { +- reg = <0x11>; +- function = LED_FUNCTION_POWER; +- color = ; +- default-state = "on"; +- active-low; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_17_a>; +- }; +- +- led-wan-red@12 { +- reg = <0x12>; +- function = LED_FUNCTION_WAN; +- color = ; +- active-low; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_18_a>; +- }; +- +- led-wps@14 { +- reg = <0x14>; +- function = LED_FUNCTION_WPS; +- color = ; +- active-low; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_20_a>; +- }; +- +- led-wan-white@15 { +- reg = <0x15>; +- function = LED_FUNCTION_WAN; +- color = ; +- active-low; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_21_a>; +- }; +- +- led-lan@19 { +- reg = <0x19>; +- function = LED_FUNCTION_LAN; +- color = ; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_led_25_a>; +- }; +-}; +- +-&nandcs { +- nand-ecc-strength = <4>; +- nand-ecc-step-size = <512>; +- nand-on-flash-bbt; +- brcm,nand-has-wp; +- +- #address-cells = <1>; +- #size-cells = <0>; +- +- partitions { +- compatible = "brcm,bcm4908-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; +- +- partition@0 { +- compatible = "nvmem-cells"; +- label = "cferom"; +- reg = <0x0 0x100000>; +- +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0 0x0 0x100000>; +- +- base_mac_addr: mac@106a0 { +- reg = <0x106a0 0x6>; +- }; +- }; +- +- partition@100000 { +- compatible = "brcm,bcm4908-firmware"; +- reg = <0x100000 0x5700000>; +- }; +- +- partition@5800000 { +- compatible = "brcm,bcm4908-firmware"; +- reg = <0x5800000 0x5700000>; +- }; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-netgear-raxe500.dts ++++ /dev/null +@@ -1,50 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include "bcm4908.dtsi" +- +-/ { +- compatible = "netgear,raxe500", "brcm,bcm4908", "brcm,bcmbca"; +- model = "Netgear RAXE500"; +- +- memory@0 { +- device_type = "memory"; +- reg = <0x00 0x00 0x00 0x40000000>; +- }; +-}; +- +-&ehci { +- status = "okay"; +-}; +- +-&ohci { +- status = "okay"; +-}; +- +-&xhci { +- status = "okay"; +-}; +- +-&ports { +- port@0 { +- label = "lan4"; +- }; +- +- port@1 { +- label = "lan3"; +- }; +- +- port@2 { +- label = "lan2"; +- }; +- +- port@3 { +- label = "lan1"; +- }; +- +- port@7 { +- reg = <7>; +- phy-mode = "internal"; +- phy-handle = <&phy12>; +- label = "wan"; +- }; +-}; +--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi ++++ /dev/null +@@ -1,575 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +- +-#include +-#include +-#include +-#include +- +-/dts-v1/; +- +-/ { +- interrupt-parent = <&gic>; +- +- #address-cells = <2>; +- #size-cells = <2>; +- +- aliases { +- serial0 = &uart0; +- }; +- +- chosen { +- stdout-path = "serial0:115200n8"; +- }; +- +- cpus { +- #address-cells = <1>; +- #size-cells = <0>; +- +- cpu0: cpu@0 { +- device_type = "cpu"; +- compatible = "brcm,brahma-b53"; +- reg = <0x0>; +- enable-method = "spin-table"; +- cpu-release-addr = <0x0 0xfff8>; +- next-level-cache = <&l2>; +- }; +- +- cpu1: cpu@1 { +- device_type = "cpu"; +- compatible = "brcm,brahma-b53"; +- reg = <0x1>; +- enable-method = "spin-table"; +- cpu-release-addr = <0x0 0xfff8>; +- next-level-cache = <&l2>; +- }; +- +- cpu2: cpu@2 { +- device_type = "cpu"; +- compatible = "brcm,brahma-b53"; +- reg = <0x2>; +- enable-method = "spin-table"; +- cpu-release-addr = <0x0 0xfff8>; +- next-level-cache = <&l2>; +- }; +- +- cpu3: cpu@3 { +- device_type = "cpu"; +- compatible = "brcm,brahma-b53"; +- reg = <0x3>; +- enable-method = "spin-table"; +- cpu-release-addr = <0x0 0xfff8>; +- next-level-cache = <&l2>; +- }; +- +- l2: l2-cache0 { +- compatible = "cache"; +- }; +- }; +- +- axi@81000000 { +- compatible = "simple-bus"; +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0x00 0x00 0x81000000 0x4000>; +- +- gic: interrupt-controller@1000 { +- compatible = "arm,gic-400"; +- #interrupt-cells = <3>; +- #address-cells = <0>; +- interrupt-controller; +- reg = <0x1000 0x1000>, +- <0x2000 0x2000>; +- }; +- }; +- +- timer { +- compatible = "arm,armv8-timer"; +- interrupts = , +- , +- , +- ; +- }; +- +- pmu { +- compatible = "arm,cortex-a53-pmu"; +- interrupts = , +- , +- , +- ; +- interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; +- }; +- +- clocks { +- periph_clk: periph_clk { +- compatible = "fixed-clock"; +- #clock-cells = <0>; +- clock-frequency = <50000000>; +- clock-output-names = "periph"; +- }; +- }; +- +- soc { +- compatible = "simple-bus"; +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0x00 0x00 0x80000000 0x281000>; +- +- enet: ethernet@2000 { +- compatible = "brcm,bcm4908-enet"; +- reg = <0x2000 0x1000>; +- +- interrupts = , +- ; +- interrupt-names = "rx", "tx"; +- }; +- +- usb_phy: usb-phy@c200 { +- compatible = "brcm,bcm4908-usb-phy"; +- reg = <0xc200 0x100>; +- reg-names = "ctrl"; +- power-domains = <&pmb BCM_PMB_HOST_USB>; +- dr_mode = "host"; +- brcm,has-xhci; +- brcm,has-eohci; +- #phy-cells = <1>; +- status = "disabled"; +- }; +- +- ehci: usb@c300 { +- compatible = "generic-ehci"; +- reg = <0xc300 0x100>; +- interrupts = ; +- phys = <&usb_phy PHY_TYPE_USB2>; +- status = "disabled"; +- }; +- +- ohci: usb@c400 { +- compatible = "generic-ohci"; +- reg = <0xc400 0x100>; +- interrupts = ; +- phys = <&usb_phy PHY_TYPE_USB2>; +- status = "disabled"; +- }; +- +- xhci: usb@d000 { +- compatible = "generic-xhci"; +- reg = <0xd000 0x8c8>; +- interrupts = ; +- phys = <&usb_phy PHY_TYPE_USB3>; +- status = "disabled"; +- }; +- +- bus@80000 { +- compatible = "simple-bus"; +- #size-cells = <1>; +- #address-cells = <1>; +- ranges = <0 0x80000 0x50000>; +- +- ethernet-switch@0 { +- compatible = "brcm,bcm4908-switch"; +- reg = <0x0 0x40000>, +- <0x40000 0x110>, +- <0x40340 0x30>, +- <0x40380 0x30>, +- <0x40600 0x34>, +- <0x40800 0x208>; +- reg-names = "core", "reg", "intrl2_0", +- "intrl2_1", "fcb", "acb"; +- interrupts = , +- ; +- brcm,num-gphy = <5>; +- brcm,num-rgmii-ports = <2>; +- +- #address-cells = <1>; +- #size-cells = <0>; +- +- ports: ports { +- #address-cells = <1>; +- #size-cells = <0>; +- +- port@0 { +- reg = <0>; +- phy-mode = "internal"; +- phy-handle = <&phy8>; +- }; +- +- port@1 { +- reg = <1>; +- phy-mode = "internal"; +- phy-handle = <&phy9>; +- }; +- +- port@2 { +- reg = <2>; +- phy-mode = "internal"; +- phy-handle = <&phy10>; +- }; +- +- port@3 { +- reg = <3>; +- phy-mode = "internal"; +- phy-handle = <&phy11>; +- }; +- +- port@8 { +- reg = <8>; +- phy-mode = "internal"; +- ethernet = <&enet>; +- +- fixed-link { +- speed = <1000>; +- full-duplex; +- }; +- }; +- }; +- }; +- +- mdio: mdio@405c0 { +- compatible = "brcm,unimac-mdio"; +- reg = <0x405c0 0x8>; +- reg-names = "mdio"; +- #size-cells = <0>; +- #address-cells = <1>; +- +- phy8: ethernet-phy@8 { +- reg = <8>; +- }; +- +- phy9: ethernet-phy@9 { +- reg = <9>; +- }; +- +- phy10: ethernet-phy@a { +- reg = <10>; +- }; +- +- phy11: ethernet-phy@b { +- reg = <11>; +- }; +- +- phy12: ethernet-phy@c { +- reg = <12>; +- }; +- }; +- }; +- +- procmon: syscon@280000 { +- compatible = "simple-bus"; +- reg = <0x280000 0x1000>; +- ranges; +- +- #address-cells = <1>; +- #size-cells = <1>; +- +- pmb: power-controller@2800c0 { +- compatible = "brcm,bcm4908-pmb"; +- reg = <0x2800c0 0x40>; +- #power-domain-cells = <1>; +- }; +- }; +- }; +- +- bus@ff800000 { +- compatible = "simple-bus"; +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0x00 0x00 0xff800000 0x3000>; +- +- twd: timer-mfd@400 { +- compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon"; +- reg = <0x400 0x4c>; +- ranges = <0x0 0x400 0x4c>; +- +- #address-cells = <1>; +- #size-cells = <1>; +- +- watchdog@28 { +- compatible = "brcm,bcm6345-wdt"; +- reg = <0x28 0x8>; +- }; +- }; +- +- gpio0: gpio-controller@500 { +- compatible = "brcm,bcm6345-gpio"; +- reg-names = "dirout", "dat"; +- reg = <0x500 0x28>, <0x528 0x28>; +- +- #gpio-cells = <2>; +- gpio-controller; +- }; +- +- pinctrl@560 { +- compatible = "brcm,bcm4908-pinctrl"; +- reg = <0x560 0x10>; +- +- pins_led_0_a: led_0-a-pins { +- function = "led_0"; +- groups = "led_0_grp_a"; +- }; +- +- pins_led_1_a: led_1-a-pins { +- function = "led_1"; +- groups = "led_1_grp_a"; +- }; +- +- pins_led_2_a: led_2-a-pins { +- function = "led_2"; +- groups = "led_2_grp_a"; +- }; +- +- pins_led_3_a: led_3-a-pins { +- function = "led_3"; +- groups = "led_3_grp_a"; +- }; +- +- pins_led_4_a: led_4-a-pins { +- function = "led_4"; +- groups = "led_4_grp_a"; +- }; +- +- pins_led_5_a: led_5-a-pins { +- function = "led_5"; +- groups = "led_5_grp_a"; +- }; +- +- pins_led_6_a: led_6-a-pins { +- function = "led_6"; +- groups = "led_6_grp_a"; +- }; +- +- pins_led_7_a: led_7-a-pins { +- function = "led_7"; +- groups = "led_7_grp_a"; +- }; +- +- pins_led_8_a: led_8-a-pins { +- function = "led_8"; +- groups = "led_8_grp_a"; +- }; +- +- pins_led_9_a: led_9-a-pins { +- function = "led_9"; +- groups = "led_9_grp_a"; +- }; +- +- pins_led_10_a: led_10-a-pins { +- function = "led_10"; +- groups = "led_10_grp_a"; +- }; +- +- pins_led_11_a: led_11-a-pins { +- function = "led_11"; +- groups = "led_11_grp_a"; +- }; +- +- pins_led_12_a: led_12-a-pins { +- function = "led_12"; +- groups = "led_12_grp_a"; +- }; +- +- pins_led_13_a: led_13-a-pins { +- function = "led_13"; +- groups = "led_13_grp_a"; +- }; +- +- pins_led_14_a: led_14-a-pins { +- function = "led_14"; +- groups = "led_14_grp_a"; +- }; +- +- pins_led_15_a: led_15-a-pins { +- function = "led_15"; +- groups = "led_15_grp_a"; +- }; +- +- pins_led_16_a: led_16-a-pins { +- function = "led_16"; +- groups = "led_16_grp_a"; +- }; +- +- pins_led_17_a: led_17-a-pins { +- function = "led_17"; +- groups = "led_17_grp_a"; +- }; +- +- pins_led_18_a: led_18-a-pins { +- function = "led_18"; +- groups = "led_18_grp_a"; +- }; +- +- pins_led_19_a: led_19-a-pins { +- function = "led_19"; +- groups = "led_19_grp_a"; +- }; +- +- pins_led_20_a: led_20-a-pins { +- function = "led_20"; +- groups = "led_20_grp_a"; +- }; +- +- pins_led_21_a: led_21-a-pins { +- function = "led_21"; +- groups = "led_21_grp_a"; +- }; +- +- pins_led_22_a: led_22-a-pins { +- function = "led_22"; +- groups = "led_22_grp_a"; +- }; +- +- pins_led_23_a: led_23-a-pins { +- function = "led_23"; +- groups = "led_23_grp_a"; +- }; +- +- pins_led_24_a: led_24-a-pins { +- function = "led_24"; +- groups = "led_24_grp_a"; +- }; +- +- pins_led_25_a: led_25-a-pins { +- function = "led_25"; +- groups = "led_25_grp_a"; +- }; +- +- pins_led_26_a: led_26-a-pins { +- function = "led_26"; +- groups = "led_26_grp_a"; +- }; +- +- pins_led_27_a: led_27-a-pins { +- function = "led_27"; +- groups = "led_27_grp_a"; +- }; +- +- pins_led_28_a: led_28-a-pins { +- function = "led_28"; +- groups = "led_28_grp_a"; +- }; +- +- pins_led_29_a: led_29-a-pins { +- function = "led_29"; +- groups = "led_29_grp_a"; +- }; +- +- pins_led_30_a: led_30-a-pins { +- function = "led_30"; +- groups = "led_30_grp_a"; +- }; +- +- pins_led_31_a: led_31-a-pins { +- function = "led_31"; +- groups = "led_31_grp_a"; +- }; +- +- pins_hs_uart: hs_uart-pins { +- function = "hs_uart"; +- groups = "hs_uart_grp"; +- }; +- +- pins_i2c_a: i2c-a-pins { +- function = "i2c"; +- groups = "i2c_grp_a"; +- }; +- +- pins_i2c_b: i2c-b-pins { +- function = "i2c"; +- groups = "i2c_grp_b"; +- }; +- +- pins_i2s: i2s-pins { +- function = "i2s"; +- groups = "i2s_grp"; +- }; +- +- pins_nand_ctrl: nand_ctrl-pins { +- function = "nand_ctrl"; +- groups = "nand_ctrl_grp"; +- }; +- +- pins_nand_data: nand_data-pins { +- function = "nand_data"; +- groups = "nand_data_grp"; +- }; +- +- pins_emmc_ctrl: emmc_ctrl-pins { +- function = "emmc_ctrl"; +- groups = "emmc_ctrl_grp"; +- }; +- +- pins_usb0_pwr: usb0_pwr-pins { +- function = "usb0_pwr"; +- groups = "usb0_pwr_grp"; +- }; +- +- pins_usb1_pwr: usb1_pwr-pins { +- function = "usb1_pwr"; +- groups = "usb1_pwr_grp"; +- }; +- }; +- +- uart0: serial@640 { +- compatible = "brcm,bcm6345-uart"; +- reg = <0x640 0x18>; +- interrupts = ; +- clocks = <&periph_clk>; +- clock-names = "refclk"; +- status = "okay"; +- }; +- +- leds: leds@800 { +- compatible = "brcm,bcm4908-leds", "brcm,bcm63138-leds"; +- reg = <0x800 0xdc>; +- +- #address-cells = <1>; +- #size-cells = <0>; +- }; +- +- nand-controller@1800 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; +- reg = <0x1800 0x600>, <0x2000 0x10>; +- reg-names = "nand", "nand-int-base"; +- interrupts = ; +- interrupt-names = "nand"; +- status = "okay"; +- +- nandcs: nand@0 { +- compatible = "brcm,nandcs"; +- reg = <0>; +- }; +- }; +- +- i2c@2100 { +- compatible = "brcm,brcmper-i2c"; +- reg = <0x2100 0x58>; +- clock-frequency = <97500>; +- pinctrl-names = "default"; +- pinctrl-0 = <&pins_i2c_a>; +- status = "disabled"; +- }; +- +- misc@2600 { +- compatible = "brcm,misc", "simple-mfd"; +- reg = <0x2600 0xe4>; +- +- #address-cells = <1>; +- #size-cells = <1>; +- ranges = <0x00 0x2600 0xe4>; +- +- reset-controller@2644 { +- compatible = "brcm,bcm4908-misc-pcie-reset"; +- reg = <0x44 0x04>; +- #reset-cells = <1>; +- }; +- }; +- }; +- +- reboot { +- compatible = "syscon-reboot"; +- regmap = <&twd>; +- offset = <0x34>; +- mask = <1>; +- }; +-}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts +@@ -0,0 +1,157 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++#include ++ ++#include "bcm4906.dtsi" ++ ++/ { ++ compatible = "netgear,r8000p", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; ++ model = "Netgear R8000P"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x20000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-power-white { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-power-amber { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-wps { ++ function = LED_FUNCTION_WPS; ++ color = ; ++ gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2ghz { ++ function = "2ghz"; ++ color = ; ++ gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5ghz-1 { ++ function = "5ghz-1"; ++ color = ; ++ gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5ghz-2 { ++ function = "5ghz-2"; ++ color = ; ++ gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb2 { ++ function = "usb2"; ++ color = ; ++ gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb3 { ++ function = "usb3"; ++ color = ; ++ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-wifi { ++ function = "wifi"; ++ color = ; ++ gpios = <&gpio0 56 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&enet { ++ nvmem-cells = <&base_mac_addr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&usb_phy { ++ brcm,ioc = <1>; ++ status = "okay"; ++}; ++ ++&ehci { ++ status = "okay"; ++}; ++ ++&ohci { ++ status = "okay"; ++}; ++ ++&xhci { ++ status = "okay"; ++}; ++ ++&ports { ++ port@0 { ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ label = "lan1"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ phy-mode = "internal"; ++ phy-handle = <&phy12>; ++ label = "wan"; ++ }; ++}; ++ ++&nandcs { ++ nand-ecc-strength = <4>; ++ nand-ecc-step-size = <512>; ++ nand-on-flash-bbt; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "nvmem-cells"; ++ label = "cferom"; ++ reg = <0x0 0x100000>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0 0x0 0x100000>; ++ ++ base_mac_addr: mac@106a0 { ++ reg = <0x106a0 0x6>; ++ }; ++ }; ++ ++ partition@100000 { ++ compatible = "brcm,bcm4908-firmware"; ++ label = "firmware"; ++ reg = <0x100000 0x4400000>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-tplink-archer-c2300-v1.dts +@@ -0,0 +1,182 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++#include ++ ++#include "bcm4906.dtsi" ++ ++/ { ++ compatible = "tplink,archer-c2300-v1", "brcm,bcm4906", "brcm,bcm4908", "brcm,bcmbca"; ++ model = "TP-Link Archer C2300 V1"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x20000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2ghz { ++ function = "2ghz"; ++ color = ; ++ gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5ghz { ++ function = "5ghz"; ++ color = ; ++ gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-wan-amber { ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-wan-blue { ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-lan { ++ function = LED_FUNCTION_LAN; ++ color = ; ++ gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-wps { ++ function = LED_FUNCTION_WPS; ++ color = ; ++ gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb2 { ++ function = "usb2"; ++ color = ; ++ gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-usb3 { ++ function = "usbd3"; ++ color = ; ++ gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-brightness { ++ function = LED_FUNCTION_BACKLIGHT; ++ color = ; ++ gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-keys-polled { ++ compatible = "gpio-keys-polled"; ++ poll-interval = <100>; ++ ++ key-brightness { ++ label = "LEDs"; ++ linux,code = ; ++ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-wifi { ++ label = "WiFi"; ++ linux,code = ; ++ gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&usb_phy { ++ brcm,ioc = <1>; ++ status = "okay"; ++}; ++ ++&ehci { ++ status = "okay"; ++}; ++ ++&ohci { ++ status = "okay"; ++}; ++ ++&xhci { ++ status = "okay"; ++}; ++ ++&ports { ++ port@0 { ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ label = "lan1"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ phy-mode = "internal"; ++ phy-handle = <&phy12>; ++ label = "wan"; ++ }; ++}; ++ ++&nandcs { ++ nand-ecc-strength = <4>; ++ nand-ecc-step-size = <512>; ++ nand-on-flash-bbt; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ partitions { ++ compatible = "brcm,bcm4908-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "cferom"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ compatible = "brcm,bcm4908-firmware"; ++ reg = <0x100000 0x3900000>; ++ }; ++ ++ partition@5800000 { ++ compatible = "brcm,bcm4908-firmware"; ++ reg = <0x3a00000 0x3900000>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906.dtsi +@@ -0,0 +1,26 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "bcm4908.dtsi" ++ ++/ { ++ cpus { ++ /delete-node/ cpu@2; ++ ++ /delete-node/ cpu@3; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ ; ++ interrupt-affinity = <&cpu0>, <&cpu1>; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts +@@ -0,0 +1,207 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++#include ++ ++#include "bcm4908.dtsi" ++ ++/ { ++ compatible = "asus,gt-ac5300", "brcm,bcm4908", "brcm,bcmbca"; ++ model = "Asus GT-AC5300"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x40000000>; ++ }; ++ ++ gpio-keys-polled { ++ compatible = "gpio-keys-polled"; ++ poll-interval = <100>; ++ ++ key-wifi { ++ label = "WiFi"; ++ linux,code = ; ++ gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; ++ }; ++ ++ key-brightness { ++ label = "LEDs"; ++ linux,code = ; ++ gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&enet { ++ nvmem-cells = <&base_mac_addr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&usb_phy { ++ brcm,ioc = <1>; ++ status = "okay"; ++}; ++ ++&ehci { ++ status = "okay"; ++}; ++ ++&ohci { ++ status = "okay"; ++}; ++ ++&xhci { ++ status = "okay"; ++}; ++ ++&ports { ++ port@0 { ++ label = "lan2"; ++ }; ++ ++ port@1 { ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ label = "lan5"; ++ }; ++ ++ /* External BCM53134S switch */ ++ port@7 { ++ label = "sw"; ++ reg = <7>; ++ phy-mode = "rgmii"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++}; ++ ++&mdio { ++ /* lan8 */ ++ ethernet-phy@0 { ++ reg = <0>; ++ }; ++ ++ /* lan7 */ ++ ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ /* lan4 */ ++ ethernet-phy@2 { ++ reg = <2>; ++ }; ++ ++ /* lan3 */ ++ ethernet-phy@3 { ++ reg = <3>; ++ }; ++}; ++ ++&leds { ++ led-power@11 { ++ reg = <0x11>; ++ function = LED_FUNCTION_POWER; ++ color = ; ++ default-state = "on"; ++ active-low; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_17_a>; ++ }; ++ ++ led-wan-red@12 { ++ reg = <0x12>; ++ function = LED_FUNCTION_WAN; ++ color = ; ++ active-low; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_18_a>; ++ }; ++ ++ led-wps@14 { ++ reg = <0x14>; ++ function = LED_FUNCTION_WPS; ++ color = ; ++ active-low; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_20_a>; ++ }; ++ ++ led-wan-white@15 { ++ reg = <0x15>; ++ function = LED_FUNCTION_WAN; ++ color = ; ++ active-low; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_21_a>; ++ }; ++ ++ led-lan@19 { ++ reg = <0x19>; ++ function = LED_FUNCTION_LAN; ++ color = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_led_25_a>; ++ }; ++}; ++ ++&nandcs { ++ nand-ecc-strength = <4>; ++ nand-ecc-step-size = <512>; ++ nand-on-flash-bbt; ++ brcm,nand-has-wp; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ partitions { ++ compatible = "brcm,bcm4908-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "nvmem-cells"; ++ label = "cferom"; ++ reg = <0x0 0x100000>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0 0x0 0x100000>; ++ ++ base_mac_addr: mac@106a0 { ++ reg = <0x106a0 0x6>; ++ }; ++ }; ++ ++ partition@100000 { ++ compatible = "brcm,bcm4908-firmware"; ++ reg = <0x100000 0x5700000>; ++ }; ++ ++ partition@5800000 { ++ compatible = "brcm,bcm4908-firmware"; ++ reg = <0x5800000 0x5700000>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-netgear-raxe500.dts +@@ -0,0 +1,50 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "bcm4908.dtsi" ++ ++/ { ++ compatible = "netgear,raxe500", "brcm,bcm4908", "brcm,bcmbca"; ++ model = "Netgear RAXE500"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x40000000>; ++ }; ++}; ++ ++&ehci { ++ status = "okay"; ++}; ++ ++&ohci { ++ status = "okay"; ++}; ++ ++&xhci { ++ status = "okay"; ++}; ++ ++&ports { ++ port@0 { ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ label = "lan1"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ phy-mode = "internal"; ++ phy-handle = <&phy12>; ++ label = "wan"; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -0,0 +1,575 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++#include ++#include ++ ++/dts-v1/; ++ ++/ { ++ interrupt-parent = <&gic>; ++ ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ cpus { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ cpu0: cpu@0 { ++ device_type = "cpu"; ++ compatible = "brcm,brahma-b53"; ++ reg = <0x0>; ++ enable-method = "spin-table"; ++ cpu-release-addr = <0x0 0xfff8>; ++ next-level-cache = <&l2>; ++ }; ++ ++ cpu1: cpu@1 { ++ device_type = "cpu"; ++ compatible = "brcm,brahma-b53"; ++ reg = <0x1>; ++ enable-method = "spin-table"; ++ cpu-release-addr = <0x0 0xfff8>; ++ next-level-cache = <&l2>; ++ }; ++ ++ cpu2: cpu@2 { ++ device_type = "cpu"; ++ compatible = "brcm,brahma-b53"; ++ reg = <0x2>; ++ enable-method = "spin-table"; ++ cpu-release-addr = <0x0 0xfff8>; ++ next-level-cache = <&l2>; ++ }; ++ ++ cpu3: cpu@3 { ++ device_type = "cpu"; ++ compatible = "brcm,brahma-b53"; ++ reg = <0x3>; ++ enable-method = "spin-table"; ++ cpu-release-addr = <0x0 0xfff8>; ++ next-level-cache = <&l2>; ++ }; ++ ++ l2: l2-cache0 { ++ compatible = "cache"; ++ }; ++ }; ++ ++ axi@81000000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x00 0x00 0x81000000 0x4000>; ++ ++ gic: interrupt-controller@1000 { ++ compatible = "arm,gic-400"; ++ #interrupt-cells = <3>; ++ #address-cells = <0>; ++ interrupt-controller; ++ reg = <0x1000 0x1000>, ++ <0x2000 0x2000>; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; ++ }; ++ ++ clocks { ++ periph_clk: periph_clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <50000000>; ++ clock-output-names = "periph"; ++ }; ++ }; ++ ++ soc { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x00 0x00 0x80000000 0x281000>; ++ ++ enet: ethernet@2000 { ++ compatible = "brcm,bcm4908-enet"; ++ reg = <0x2000 0x1000>; ++ ++ interrupts = , ++ ; ++ interrupt-names = "rx", "tx"; ++ }; ++ ++ usb_phy: usb-phy@c200 { ++ compatible = "brcm,bcm4908-usb-phy"; ++ reg = <0xc200 0x100>; ++ reg-names = "ctrl"; ++ power-domains = <&pmb BCM_PMB_HOST_USB>; ++ dr_mode = "host"; ++ brcm,has-xhci; ++ brcm,has-eohci; ++ #phy-cells = <1>; ++ status = "disabled"; ++ }; ++ ++ ehci: usb@c300 { ++ compatible = "generic-ehci"; ++ reg = <0xc300 0x100>; ++ interrupts = ; ++ phys = <&usb_phy PHY_TYPE_USB2>; ++ status = "disabled"; ++ }; ++ ++ ohci: usb@c400 { ++ compatible = "generic-ohci"; ++ reg = <0xc400 0x100>; ++ interrupts = ; ++ phys = <&usb_phy PHY_TYPE_USB2>; ++ status = "disabled"; ++ }; ++ ++ xhci: usb@d000 { ++ compatible = "generic-xhci"; ++ reg = <0xd000 0x8c8>; ++ interrupts = ; ++ phys = <&usb_phy PHY_TYPE_USB3>; ++ status = "disabled"; ++ }; ++ ++ bus@80000 { ++ compatible = "simple-bus"; ++ #size-cells = <1>; ++ #address-cells = <1>; ++ ranges = <0 0x80000 0x50000>; ++ ++ ethernet-switch@0 { ++ compatible = "brcm,bcm4908-switch"; ++ reg = <0x0 0x40000>, ++ <0x40000 0x110>, ++ <0x40340 0x30>, ++ <0x40380 0x30>, ++ <0x40600 0x34>, ++ <0x40800 0x208>; ++ reg-names = "core", "reg", "intrl2_0", ++ "intrl2_1", "fcb", "acb"; ++ interrupts = , ++ ; ++ brcm,num-gphy = <5>; ++ brcm,num-rgmii-ports = <2>; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ports: ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ phy-mode = "internal"; ++ phy-handle = <&phy8>; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ phy-mode = "internal"; ++ phy-handle = <&phy9>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ phy-mode = "internal"; ++ phy-handle = <&phy10>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ phy-mode = "internal"; ++ phy-handle = <&phy11>; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ phy-mode = "internal"; ++ ethernet = <&enet>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ mdio: mdio@405c0 { ++ compatible = "brcm,unimac-mdio"; ++ reg = <0x405c0 0x8>; ++ reg-names = "mdio"; ++ #size-cells = <0>; ++ #address-cells = <1>; ++ ++ phy8: ethernet-phy@8 { ++ reg = <8>; ++ }; ++ ++ phy9: ethernet-phy@9 { ++ reg = <9>; ++ }; ++ ++ phy10: ethernet-phy@a { ++ reg = <10>; ++ }; ++ ++ phy11: ethernet-phy@b { ++ reg = <11>; ++ }; ++ ++ phy12: ethernet-phy@c { ++ reg = <12>; ++ }; ++ }; ++ }; ++ ++ procmon: syscon@280000 { ++ compatible = "simple-bus"; ++ reg = <0x280000 0x1000>; ++ ranges; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ pmb: power-controller@2800c0 { ++ compatible = "brcm,bcm4908-pmb"; ++ reg = <0x2800c0 0x40>; ++ #power-domain-cells = <1>; ++ }; ++ }; ++ }; ++ ++ bus@ff800000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x00 0x00 0xff800000 0x3000>; ++ ++ twd: timer-mfd@400 { ++ compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon"; ++ reg = <0x400 0x4c>; ++ ranges = <0x0 0x400 0x4c>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ watchdog@28 { ++ compatible = "brcm,bcm6345-wdt"; ++ reg = <0x28 0x8>; ++ }; ++ }; ++ ++ gpio0: gpio-controller@500 { ++ compatible = "brcm,bcm6345-gpio"; ++ reg-names = "dirout", "dat"; ++ reg = <0x500 0x28>, <0x528 0x28>; ++ ++ #gpio-cells = <2>; ++ gpio-controller; ++ }; ++ ++ pinctrl@560 { ++ compatible = "brcm,bcm4908-pinctrl"; ++ reg = <0x560 0x10>; ++ ++ pins_led_0_a: led_0-a-pins { ++ function = "led_0"; ++ groups = "led_0_grp_a"; ++ }; ++ ++ pins_led_1_a: led_1-a-pins { ++ function = "led_1"; ++ groups = "led_1_grp_a"; ++ }; ++ ++ pins_led_2_a: led_2-a-pins { ++ function = "led_2"; ++ groups = "led_2_grp_a"; ++ }; ++ ++ pins_led_3_a: led_3-a-pins { ++ function = "led_3"; ++ groups = "led_3_grp_a"; ++ }; ++ ++ pins_led_4_a: led_4-a-pins { ++ function = "led_4"; ++ groups = "led_4_grp_a"; ++ }; ++ ++ pins_led_5_a: led_5-a-pins { ++ function = "led_5"; ++ groups = "led_5_grp_a"; ++ }; ++ ++ pins_led_6_a: led_6-a-pins { ++ function = "led_6"; ++ groups = "led_6_grp_a"; ++ }; ++ ++ pins_led_7_a: led_7-a-pins { ++ function = "led_7"; ++ groups = "led_7_grp_a"; ++ }; ++ ++ pins_led_8_a: led_8-a-pins { ++ function = "led_8"; ++ groups = "led_8_grp_a"; ++ }; ++ ++ pins_led_9_a: led_9-a-pins { ++ function = "led_9"; ++ groups = "led_9_grp_a"; ++ }; ++ ++ pins_led_10_a: led_10-a-pins { ++ function = "led_10"; ++ groups = "led_10_grp_a"; ++ }; ++ ++ pins_led_11_a: led_11-a-pins { ++ function = "led_11"; ++ groups = "led_11_grp_a"; ++ }; ++ ++ pins_led_12_a: led_12-a-pins { ++ function = "led_12"; ++ groups = "led_12_grp_a"; ++ }; ++ ++ pins_led_13_a: led_13-a-pins { ++ function = "led_13"; ++ groups = "led_13_grp_a"; ++ }; ++ ++ pins_led_14_a: led_14-a-pins { ++ function = "led_14"; ++ groups = "led_14_grp_a"; ++ }; ++ ++ pins_led_15_a: led_15-a-pins { ++ function = "led_15"; ++ groups = "led_15_grp_a"; ++ }; ++ ++ pins_led_16_a: led_16-a-pins { ++ function = "led_16"; ++ groups = "led_16_grp_a"; ++ }; ++ ++ pins_led_17_a: led_17-a-pins { ++ function = "led_17"; ++ groups = "led_17_grp_a"; ++ }; ++ ++ pins_led_18_a: led_18-a-pins { ++ function = "led_18"; ++ groups = "led_18_grp_a"; ++ }; ++ ++ pins_led_19_a: led_19-a-pins { ++ function = "led_19"; ++ groups = "led_19_grp_a"; ++ }; ++ ++ pins_led_20_a: led_20-a-pins { ++ function = "led_20"; ++ groups = "led_20_grp_a"; ++ }; ++ ++ pins_led_21_a: led_21-a-pins { ++ function = "led_21"; ++ groups = "led_21_grp_a"; ++ }; ++ ++ pins_led_22_a: led_22-a-pins { ++ function = "led_22"; ++ groups = "led_22_grp_a"; ++ }; ++ ++ pins_led_23_a: led_23-a-pins { ++ function = "led_23"; ++ groups = "led_23_grp_a"; ++ }; ++ ++ pins_led_24_a: led_24-a-pins { ++ function = "led_24"; ++ groups = "led_24_grp_a"; ++ }; ++ ++ pins_led_25_a: led_25-a-pins { ++ function = "led_25"; ++ groups = "led_25_grp_a"; ++ }; ++ ++ pins_led_26_a: led_26-a-pins { ++ function = "led_26"; ++ groups = "led_26_grp_a"; ++ }; ++ ++ pins_led_27_a: led_27-a-pins { ++ function = "led_27"; ++ groups = "led_27_grp_a"; ++ }; ++ ++ pins_led_28_a: led_28-a-pins { ++ function = "led_28"; ++ groups = "led_28_grp_a"; ++ }; ++ ++ pins_led_29_a: led_29-a-pins { ++ function = "led_29"; ++ groups = "led_29_grp_a"; ++ }; ++ ++ pins_led_30_a: led_30-a-pins { ++ function = "led_30"; ++ groups = "led_30_grp_a"; ++ }; ++ ++ pins_led_31_a: led_31-a-pins { ++ function = "led_31"; ++ groups = "led_31_grp_a"; ++ }; ++ ++ pins_hs_uart: hs_uart-pins { ++ function = "hs_uart"; ++ groups = "hs_uart_grp"; ++ }; ++ ++ pins_i2c_a: i2c-a-pins { ++ function = "i2c"; ++ groups = "i2c_grp_a"; ++ }; ++ ++ pins_i2c_b: i2c-b-pins { ++ function = "i2c"; ++ groups = "i2c_grp_b"; ++ }; ++ ++ pins_i2s: i2s-pins { ++ function = "i2s"; ++ groups = "i2s_grp"; ++ }; ++ ++ pins_nand_ctrl: nand_ctrl-pins { ++ function = "nand_ctrl"; ++ groups = "nand_ctrl_grp"; ++ }; ++ ++ pins_nand_data: nand_data-pins { ++ function = "nand_data"; ++ groups = "nand_data_grp"; ++ }; ++ ++ pins_emmc_ctrl: emmc_ctrl-pins { ++ function = "emmc_ctrl"; ++ groups = "emmc_ctrl_grp"; ++ }; ++ ++ pins_usb0_pwr: usb0_pwr-pins { ++ function = "usb0_pwr"; ++ groups = "usb0_pwr_grp"; ++ }; ++ ++ pins_usb1_pwr: usb1_pwr-pins { ++ function = "usb1_pwr"; ++ groups = "usb1_pwr_grp"; ++ }; ++ }; ++ ++ uart0: serial@640 { ++ compatible = "brcm,bcm6345-uart"; ++ reg = <0x640 0x18>; ++ interrupts = ; ++ clocks = <&periph_clk>; ++ clock-names = "refclk"; ++ status = "okay"; ++ }; ++ ++ leds: leds@800 { ++ compatible = "brcm,bcm4908-leds", "brcm,bcm63138-leds"; ++ reg = <0x800 0xdc>; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ ++ nand-controller@1800 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.1", "brcm,brcmnand"; ++ reg = <0x1800 0x600>, <0x2000 0x10>; ++ reg-names = "nand", "nand-int-base"; ++ interrupts = ; ++ interrupt-names = "nand"; ++ status = "okay"; ++ ++ nandcs: nand@0 { ++ compatible = "brcm,nandcs"; ++ reg = <0>; ++ }; ++ }; ++ ++ i2c@2100 { ++ compatible = "brcm,brcmper-i2c"; ++ reg = <0x2100 0x58>; ++ clock-frequency = <97500>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pins_i2c_a>; ++ status = "disabled"; ++ }; ++ ++ misc@2600 { ++ compatible = "brcm,misc", "simple-mfd"; ++ reg = <0x2600 0xe4>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x00 0x2600 0xe4>; ++ ++ reset-controller@2644 { ++ compatible = "brcm,bcm4908-misc-pcie-reset"; ++ reg = <0x44 0x04>; ++ #reset-cells = <1>; ++ }; ++ }; ++ }; ++ ++ reboot { ++ compatible = "syscon-reboot"; ++ regmap = <&twd>; ++ offset = <0x34>; ++ mask = <1>; ++ }; ++}; diff --git a/target/linux/bcm4908/patches-5.4/038-v6.1-0006-arm64-dts-Add-BCM4908-generic-board-dts.patch b/target/linux/bcm4908/patches-5.4/038-v6.1-0006-arm64-dts-Add-BCM4908-generic-board-dts.patch new file mode 100644 index 0000000000..b19c5d33b4 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/038-v6.1-0006-arm64-dts-Add-BCM4908-generic-board-dts.patch @@ -0,0 +1,62 @@ +From 72e0bdb6d7edb1785d58f2e8e7c80e1d2f93a319 Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 3 Aug 2022 10:54:51 -0700 +Subject: [PATCH] arm64: dts: Add BCM4908 generic board dts + +Add generic bare bone bcm94908.dts file to support any 4908 based +design. It supports cpu subsystem, memory and an uart console. This can +be useful for board bring-up and cpu subsystem and memory related kernel +test as well. + +Signed-off-by: William Zhang +Link: https://lore.kernel.org/r/20220803175455.47638-6-william.zhang@broadcom.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 1 + + .../boot/dts/broadcom/bcmbca/bcm94908.dts | 30 +++++++++++++++++++ + 2 files changed, 31 insertions(+) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_BCMBCA) += \ + bcm4906-tplink-archer-c2300-v1.dtb \ + bcm4908-asus-gt-ac5300.dtb \ + bcm4908-netgear-raxe500.dtb \ ++ bcm94908.dtb \ + bcm4912-asus-gt-ax6000.dtb \ + bcm94912.dtb \ + bcm963158.dtb \ +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dts +@@ -0,0 +1,30 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4908.dtsi" ++ ++/ { ++ model = "Broadcom BCM94908 Reference Board"; ++ compatible = "brcm,bcm94908", "brcm,bcm4908", "brcm,bcmbca"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x08000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.4/039-v6.2-0001-arm64-dts-broadcom-bcmbca-bcm4908-add-TWD-block-time.patch b/target/linux/bcm4908/patches-5.4/039-v6.2-0001-arm64-dts-broadcom-bcmbca-bcm4908-add-TWD-block-time.patch new file mode 100644 index 0000000000..a3f49ca440 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/039-v6.2-0001-arm64-dts-broadcom-bcmbca-bcm4908-add-TWD-block-time.patch @@ -0,0 +1,31 @@ +From 68064196cffea33f090bd2e8d81cd5e20107ecf1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 3 Nov 2022 11:53:16 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: add TWD block timer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BCM4908 TWD contains block with 4 timers. Add binding for it. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20221103105316.21294-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -283,6 +283,11 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ timer@0 { ++ compatible = "brcm,bcm63138-timer"; ++ reg = <0x0 0x28>; ++ }; ++ + watchdog@28 { + compatible = "brcm,bcm6345-wdt"; + reg = <0x28 0x8>; diff --git a/target/linux/bcm4908/patches-5.4/039-v6.2-0002-arm64-dts-broadcom-bcmbca-bcm6858-add-TWD-block.patch b/target/linux/bcm4908/patches-5.4/039-v6.2-0002-arm64-dts-broadcom-bcmbca-bcm6858-add-TWD-block.patch new file mode 100644 index 0000000000..e8e81ae544 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/039-v6.2-0002-arm64-dts-broadcom-bcmbca-bcm6858-add-TWD-block.patch @@ -0,0 +1,46 @@ +From 4f9fb09175e87a233787a2dee1e5dabb14deb022 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 3 Nov 2022 12:00:15 +0100 +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm6858: add TWD block +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BCM6858 contains TWD block with timers, watchdog, and reset subblocks. +Describe it. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20221103110015.21761-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../boot/dts/broadcom/bcmbca/bcm6858.dtsi | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +@@ -109,6 +109,25 @@ + #size-cells = <1>; + ranges = <0x0 0x0 0xff800000 0x62000>; + ++ twd: timer-mfd@400 { ++ compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon"; ++ reg = <0x400 0x4c>; ++ ranges = <0x0 0x400 0x4c>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ timer@0 { ++ compatible = "brcm,bcm63138-timer"; ++ reg = <0x0 0x28>; ++ }; ++ ++ watchdog@28 { ++ compatible = "brcm,bcm6345-wdt"; ++ reg = <0x28 0x8>; ++ }; ++ }; ++ + uart0: serial@640 { + compatible = "brcm,bcm6345-uart"; + reg = <0x640 0x18>; diff --git a/target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch b/target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch similarity index 71% rename from target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch rename to target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch index 93c89ffa30..bc0743c800 100644 --- a/target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch +++ b/target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcmbca-bcm4908-limit-amount-of-GP.patch @@ -1,6 +1,6 @@ From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 15 Feb 2021 22:01:03 +0100 -Subject: [PATCH] arm64: dts: broadcom: bcm4908: limit amount of GPIOs +Subject: [PATCH] arm64: dts: broadcom: bcmbca: bcm4908: limit amount of GPIOs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,9 +10,9 @@ Linux driver can't handle more than 64 GPIOs Signed-off-by: Rafał Miłecki --- ---- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi -+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi -@@ -292,7 +292,7 @@ +--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +@@ -297,7 +297,7 @@ gpio0: gpio-controller@500 { compatible = "brcm,bcm6345-gpio"; reg-names = "dirout", "dat"; From 06bec8462570adc81020c3b5dd22fab25eae5060 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 3 Dec 2022 21:34:02 +0100 Subject: [PATCH 07/78] mac80211: Update to version 5.10.157 Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 6 +++--- .../patches/ath/404-regd_no_assoc_hints.patch | 4 ++-- .../ath/930-ath10k_add_tpt_led_trigger.patch | 4 ++-- .../975-ath10k-use-tpt-trigger-by-default.patch | 2 +- ...st-tx-power-reduction-for-US-regulatory-d.patch | 8 ++++---- .../kernel/mac80211/patches/brcm/998-survey.patch | 4 ++-- ...2x00-define-RF5592-in-init_eeprom-routine.patch | 2 +- .../610-rt2x00-change-led-polarity-from-OF.patch | 2 +- ...x00-add-support-for-external-PA-on-MT7620.patch | 8 ++++---- .../982-rt2x00-add-rf-self-txdc-calibration.patch | 4 ++-- .../rt2x00/983-rt2x00-add-r-calibration.patch | 4 ++-- .../rt2x00/984-rt2x00-add-rxdcoc-calibration.patch | 4 ++-- .../rt2x00/985-rt2x00-add-rxiq-calibration.patch | 4 ++-- .../986-rt2x00-add-TX-LOFT-calibration.patch | 4 ++-- ...t7620-differentiate-based-on-SoC-CHIP_VER.patch | 14 +++++++------- ...x00-save-survey-for-every-channel-visited.patch | 2 +- .../patches/subsys/150-disable_addr_notifier.patch | 2 +- .../385-mac80211-add-ieee80211_set_sar_specs.patch | 4 ++-- ...mac80211-add-support-for-BSS-color-change.patch | 8 ++++---- ...-align-some-HE-capabilities-with-the-spec.patch | 6 +++--- ...fix-spelling-of-A-MSDU-in-HE-capabilities.patch | 8 ++++---- ...ign-HE-capabilities-A-MPDU-Length-Exponen.patch | 8 ++++---- .../patches/subsys/397-disable-mbssid.patch | 8 ++++---- .../500-mac80211_configure_antenna_gain.patch | 2 +- 24 files changed, 61 insertions(+), 61 deletions(-) diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 014512c67b..e2505924cf 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=5.10.149-1 +PKG_VERSION:=5.10.157-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.149/ -PKG_HASH:=80a68a78c9b18513bad0bbd0cb70907eadbfd9bba44c075a94f0795fd7f7be2a +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.157/ +PKG_HASH:=1ce937c49f2b39be00768fba83e214aad6612d469c92ccd06dc17b14e6cf3a64 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch index dfe324caf8..bacaf92b5e 100644 --- a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch +++ b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -3257,6 +3257,8 @@ void regulatory_hint_country_ie(struct w +@@ -3263,6 +3263,8 @@ void regulatory_hint_country_ie(struct w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request = NULL, *lr; @@ -9,7 +9,7 @@ /* IE len must be evenly divisible by 2 */ if (country_ie_len & 0x01) return; -@@ -3508,6 +3510,7 @@ static bool is_wiphy_all_set_reg_flag(en +@@ -3514,6 +3516,7 @@ static bool is_wiphy_all_set_reg_flag(en void regulatory_hint_disconnect(void) { diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch index 8da72a4fe1..2fc83182b6 100644 --- a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -9748,6 +9748,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -9752,6 +9752,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -10097,6 +10112,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -10101,6 +10116,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch index 005feda798..ef98539f99 100644 --- a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -10114,7 +10114,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -10118,7 +10118,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch index 1f19765891..f5c1fb2a2b 100644 --- a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch +++ b/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch @@ -28,7 +28,7 @@ Forwarded: no --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -1010,6 +1010,40 @@ static inline int ath10k_vdev_setup_sync +@@ -1017,6 +1017,40 @@ static inline int ath10k_vdev_setup_sync return ar->last_wmi_vdev_start_status; } @@ -69,7 +69,7 @@ Forwarded: no static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id) { struct cfg80211_chan_def *chandef = NULL; -@@ -1042,7 +1076,8 @@ static int ath10k_monitor_vdev_start(str +@@ -1049,7 +1083,8 @@ static int ath10k_monitor_vdev_start(str arg.channel.min_power = 0; arg.channel.max_power = channel->max_power * 2; arg.channel.max_reg_power = channel->max_reg_power * 2; @@ -79,7 +79,7 @@ Forwarded: no reinit_completion(&ar->vdev_setup_done); reinit_completion(&ar->vdev_delete_done); -@@ -1488,7 +1523,8 @@ static int ath10k_vdev_start_restart(str +@@ -1495,7 +1530,8 @@ static int ath10k_vdev_start_restart(str arg.channel.min_power = 0; arg.channel.max_power = chandef->chan->max_power * 2; arg.channel.max_reg_power = chandef->chan->max_reg_power * 2; @@ -89,7 +89,7 @@ Forwarded: no if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { arg.ssid = arvif->u.ap.ssid; -@@ -3259,7 +3295,8 @@ static int ath10k_update_channel_list(st +@@ -3266,7 +3302,8 @@ static int ath10k_update_channel_list(st ch->min_power = 0; ch->max_power = channel->max_power * 2; ch->max_reg_power = channel->max_reg_power * 2; diff --git a/package/kernel/mac80211/patches/brcm/998-survey.patch b/package/kernel/mac80211/patches/brcm/998-survey.patch index 25a12c783e..beaf1ac872 100644 --- a/package/kernel/mac80211/patches/brcm/998-survey.patch +++ b/package/kernel/mac80211/patches/brcm/998-survey.patch @@ -100,7 +100,7 @@ .add_key = brcmf_cfg80211_add_key, --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -1356,6 +1356,8 @@ int brcmf_attach(struct device *dev) +@@ -1357,6 +1357,8 @@ int brcmf_attach(struct device *dev) /* Link to bus module */ drvr->hdrlen = 0; @@ -109,7 +109,7 @@ /* Attach and link in the protocol */ ret = brcmf_proto_attach(drvr); -@@ -1438,6 +1440,12 @@ void brcmf_detach(struct device *dev) +@@ -1439,6 +1441,12 @@ void brcmf_detach(struct device *dev) if (drvr == NULL) return; diff --git a/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch b/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch index a50a195285..13298d3ce8 100644 --- a/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch +++ b/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch @@ -40,7 +40,7 @@ Signed-off-by: Tomislav Požega --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -9416,6 +9416,8 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9442,6 +9442,8 @@ static int rt2800_init_eeprom(struct rt2 rf = RF3853; else if (rt2x00_rt(rt2x00dev, RT5350)) rf = RF5350; diff --git a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch index 039c6f6afc..87f1ab4681 100644 --- a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch +++ b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch @@ -8,7 +8,7 @@ #include "rt2x00.h" #include "rt2800lib.h" -@@ -9530,6 +9531,17 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9556,6 +9557,17 @@ static int rt2800_init_eeprom(struct rt2 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); diff --git a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch index 20452cd8a7..3de562df8c 100644 --- a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch @@ -30,8 +30,8 @@ Signed-off-by: Tomislav Po=C5=BEega * EEPROM LNA --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -4356,6 +4356,45 @@ static void rt2800_config_channel(struct - rt2800_iq_calibrate(rt2x00dev, rf->channel); +@@ -4360,6 +4360,45 @@ static void rt2800_config_channel(struct + rt2800_iq_calibrate(rt2x00dev, rf->channel); } + if (rt2x00_rt(rt2x00dev, RT6352)) { @@ -76,7 +76,7 @@ Signed-off-by: Tomislav Po=C5=BEega bbp = rt2800_bbp_read(rt2x00dev, 4); rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf)); rt2800_bbp_write(rt2x00dev, 4, bbp); -@@ -9559,7 +9598,8 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9585,7 +9624,8 @@ static int rt2800_init_eeprom(struct rt2 */ eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1); @@ -86,7 +86,7 @@ Signed-off-by: Tomislav Po=C5=BEega if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352)) __set_bit(CAPABILITY_EXTERNAL_PA_TX0, -@@ -9570,6 +9610,18 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9596,6 +9636,18 @@ static int rt2800_init_eeprom(struct rt2 &rt2x00dev->cap_flags); } diff --git a/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch b/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch index 6be847478e..8064c4fe3a 100644 --- a/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8419,6 +8419,56 @@ static void rt2800_init_rfcsr_5592(struc +@@ -8445,6 +8445,56 @@ static void rt2800_init_rfcsr_5592(struc rt2800_led_open_drain_enable(rt2x00dev); } @@ -57,7 +57,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9026,6 +9076,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9052,6 +9102,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); diff --git a/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch b/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch index 3ed0ff7ef5..539a1b53b3 100644 --- a/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8469,6 +8469,155 @@ static void rt2800_rf_self_txdc_cal(stru +@@ -8495,6 +8495,155 @@ static void rt2800_rf_self_txdc_cal(stru rt2x00_info(rt2x00dev, "RF Tx self calibration end\n"); } @@ -156,7 +156,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9076,6 +9225,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9102,6 +9251,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); diff --git a/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch b/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch index 77be986d18..a45e7aec32 100644 --- a/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8618,6 +8618,70 @@ static void rt2800_r_calibration(struct +@@ -8644,6 +8644,70 @@ static void rt2800_r_calibration(struct rt2800_register_write(rt2x00dev, PWR_PIN_CFG, MAC_PWR_PIN_CFG); } @@ -71,7 +71,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9227,6 +9291,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9253,6 +9317,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_r_calibration(rt2x00dev); rt2800_rf_self_txdc_cal(rt2x00dev); diff --git a/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch b/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch index 7352ad036c..bc03d720be 100644 --- a/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8682,6 +8682,384 @@ static void rt2800_rxdcoc_calibration(st +@@ -8708,6 +8708,384 @@ static void rt2800_rxdcoc_calibration(st rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, saverfb0r2); } @@ -385,7 +385,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9294,6 +9672,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9320,6 +9698,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rxdcoc_calibration(rt2x00dev); rt2800_bw_filter_calibration(rt2x00dev, true); rt2800_bw_filter_calibration(rt2x00dev, false); diff --git a/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch b/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch index fe0961baa7..bd664d044e 100644 --- a/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -9060,6 +9060,943 @@ restore_value: +@@ -9086,6 +9086,943 @@ restore_value: rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl); } @@ -944,7 +944,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9672,6 +10609,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9698,6 +10635,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rxdcoc_calibration(rt2x00dev); rt2800_bw_filter_calibration(rt2x00dev, true); rt2800_bw_filter_calibration(rt2x00dev, false); diff --git a/package/kernel/mac80211/patches/rt2x00/991-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch b/package/kernel/mac80211/patches/rt2x00/991-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch index 3de00b2267..a724232c44 100644 --- a/package/kernel/mac80211/patches/rt2x00/991-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch +++ b/package/kernel/mac80211/patches/rt2x00/991-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch @@ -121,12 +121,12 @@ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl); rt2800_vco_calibration(rt2x00dev); -@@ -5887,18 +5898,33 @@ static int rt2800_init_registers(struct +@@ -5892,18 +5903,33 @@ static int rt2800_init_registers(struct } else if (rt2x00_rt(rt2x00dev, RT5350)) { rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); } else if (rt2x00_rt(rt2x00dev, RT6352)) { - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401); -- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000); +- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001); - rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); - rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000); - rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0); @@ -150,7 +150,7 @@ + 0x00550055); + } else { + rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401); -+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000); ++ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001); + rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); + rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000); + rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0); @@ -167,7 +167,7 @@ reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1); rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0); rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg); -@@ -7042,14 +7068,16 @@ static void rt2800_init_bbp_6352(struct +@@ -7068,14 +7094,16 @@ static void rt2800_init_bbp_6352(struct rt2800_bbp_write(rt2x00dev, 188, 0x00); rt2800_bbp_write(rt2x00dev, 189, 0x00); @@ -192,7 +192,7 @@ /* BBP for G band GLRT function (BBP_128 ~ BBP_221) */ rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00); -@@ -10388,31 +10416,36 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10414,31 +10442,36 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write(rt2x00dev, 42, 0x5B); rt2800_rfcsr_write(rt2x00dev, 43, 0x00); @@ -254,7 +254,7 @@ /* Initialize RF channel register to default value */ rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03); -@@ -10478,63 +10511,71 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10504,63 +10537,71 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5); @@ -383,7 +383,7 @@ /* Initialize RF DC calibration register to default value */ rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47); -@@ -10597,12 +10638,17 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10623,12 +10664,17 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00); diff --git a/package/kernel/mac80211/patches/rt2x00/992-rt2x00-save-survey-for-every-channel-visited.patch b/package/kernel/mac80211/patches/rt2x00/992-rt2x00-save-survey-for-every-channel-visited.patch index 31a7baeee7..b73af6e8c6 100644 --- a/package/kernel/mac80211/patches/rt2x00/992-rt2x00-save-survey-for-every-channel-visited.patch +++ b/package/kernel/mac80211/patches/rt2x00/992-rt2x00-save-survey-for-every-channel-visited.patch @@ -28,7 +28,7 @@ static unsigned int rt2800_hw_beacon_base(struct rt2x00_dev *rt2x00dev, unsigned int index) { -@@ -12199,26 +12213,30 @@ int rt2800_get_survey(struct ieee80211_h +@@ -12225,26 +12239,30 @@ int rt2800_get_survey(struct ieee80211_h { struct rt2x00_dev *rt2x00dev = hw->priv; struct ieee80211_conf *conf = &hw->conf; diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch index 8d086625e4..27c5048de9 100644 --- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch @@ -52,7 +52,7 @@ fail_ifa: #endif wiphy_unregister(local->hw.wiphy); -@@ -1365,10 +1365,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1367,10 +1367,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch b/package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch index c351bc812a..2d93f1e248 100644 --- a/package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch +++ b/package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch @@ -25,7 +25,7 @@ Signed-off-by: Johannes Berg struct ieee80211_sta *sta, bool enabled); --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -4136,6 +4136,17 @@ static int ieee80211_reset_tid_config(st +@@ -4133,6 +4133,17 @@ static int ieee80211_reset_tid_config(st return ret; } @@ -43,7 +43,7 @@ Signed-off-by: Johannes Berg const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, -@@ -4239,4 +4250,5 @@ const struct cfg80211_ops mac80211_confi +@@ -4236,4 +4247,5 @@ const struct cfg80211_ops mac80211_confi .probe_mesh_link = ieee80211_probe_mesh_link, .set_tid_config = ieee80211_set_tid_config, .reset_tid_config = ieee80211_reset_tid_config, diff --git a/package/kernel/mac80211/patches/subsys/388-mac80211-add-support-for-BSS-color-change.patch b/package/kernel/mac80211/patches/subsys/388-mac80211-add-support-for-BSS-color-change.patch index 60e1c8f3c6..efb974ddd6 100644 --- a/package/kernel/mac80211/patches/subsys/388-mac80211-add-support-for-BSS-color-change.patch +++ b/package/kernel/mac80211/patches/subsys/388-mac80211-add-support-for-BSS-color-change.patch @@ -179,7 +179,7 @@ Signed-off-by: Johannes Berg if (err < 0) { kfree(sdata->u.ap.next_beacon); return err; -@@ -3428,6 +3436,15 @@ static int ieee80211_set_csa_beacon(stru +@@ -3425,6 +3433,15 @@ static int ieee80211_set_csa_beacon(stru return 0; } @@ -195,7 +195,7 @@ Signed-off-by: Johannes Berg static int __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_csa_settings *params) -@@ -3496,6 +3513,10 @@ __ieee80211_channel_switch(struct wiphy +@@ -3493,6 +3510,10 @@ __ieee80211_channel_switch(struct wiphy goto out; } @@ -206,7 +206,7 @@ Signed-off-by: Johannes Berg err = ieee80211_set_csa_beacon(sdata, params, &changed); if (err) { ieee80211_vif_unreserve_chanctx(sdata); -@@ -4147,6 +4168,196 @@ static int ieee80211_set_sar_specs(struc +@@ -4144,6 +4165,196 @@ static int ieee80211_set_sar_specs(struc return local->ops->set_sar_specs(&local->hw, sar); } @@ -403,7 +403,7 @@ Signed-off-by: Johannes Berg const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, -@@ -4251,4 +4462,5 @@ const struct cfg80211_ops mac80211_confi +@@ -4248,4 +4459,5 @@ const struct cfg80211_ops mac80211_confi .set_tid_config = ieee80211_set_tid_config, .reset_tid_config = ieee80211_reset_tid_config, .set_sar_specs = ieee80211_set_sar_specs, diff --git a/package/kernel/mac80211/patches/subsys/391-wireless-align-some-HE-capabilities-with-the-spec.patch b/package/kernel/mac80211/patches/subsys/391-wireless-align-some-HE-capabilities-with-the-spec.patch index 031669b961..1d9416c239 100644 --- a/package/kernel/mac80211/patches/subsys/391-wireless-align-some-HE-capabilities-with-the-spec.patch +++ b/package/kernel/mac80211/patches/subsys/391-wireless-align-some-HE-capabilities-with-the-spec.patch @@ -12,7 +12,7 @@ Signed-off-by: Johannes Berg --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -3633,7 +3633,7 @@ ath11k_mac_filter_he_cap_mesh(struct iee +@@ -3648,7 +3648,7 @@ ath11k_mac_filter_he_cap_mesh(struct iee IEEE80211_HE_MAC_CAP4_BQR; he_cap_elem->mac_cap_info[4] &= ~m; @@ -21,7 +21,7 @@ Signed-off-by: Johannes Berg IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU | IEEE80211_HE_MAC_CAP5_PUNCTURED_SOUNDING | IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX; -@@ -3643,7 +3643,7 @@ ath11k_mac_filter_he_cap_mesh(struct iee +@@ -3658,7 +3658,7 @@ ath11k_mac_filter_he_cap_mesh(struct iee IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO; he_cap_elem->phy_cap_info[2] &= ~m; @@ -30,7 +30,7 @@ Signed-off-by: Johannes Berg IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK | IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK; he_cap_elem->phy_cap_info[3] &= ~m; -@@ -3655,13 +3655,13 @@ ath11k_mac_filter_he_cap_mesh(struct iee +@@ -3670,13 +3670,13 @@ ath11k_mac_filter_he_cap_mesh(struct iee he_cap_elem->phy_cap_info[5] &= ~m; m = IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU | diff --git a/package/kernel/mac80211/patches/subsys/392-wireless-fix-spelling-of-A-MSDU-in-HE-capabilities.patch b/package/kernel/mac80211/patches/subsys/392-wireless-fix-spelling-of-A-MSDU-in-HE-capabilities.patch index e90177e379..e2811302c6 100644 --- a/package/kernel/mac80211/patches/subsys/392-wireless-fix-spelling-of-A-MSDU-in-HE-capabilities.patch +++ b/package/kernel/mac80211/patches/subsys/392-wireless-fix-spelling-of-A-MSDU-in-HE-capabilities.patch @@ -75,7 +75,7 @@ Signed-off-by: Johannes Berg --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -2759,7 +2759,7 @@ static const struct ieee80211_sband_ifty +@@ -2764,7 +2764,7 @@ static const struct ieee80211_sband_ifty .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL | IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, @@ -84,7 +84,7 @@ Signed-off-by: Johannes Berg .phy_cap_info[1] = IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | -@@ -2803,7 +2803,7 @@ static const struct ieee80211_sband_ifty +@@ -2808,7 +2808,7 @@ static const struct ieee80211_sband_ifty .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL | IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, @@ -93,7 +93,7 @@ Signed-off-by: Johannes Berg .phy_cap_info[1] = IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | -@@ -2849,7 +2849,7 @@ static const struct ieee80211_sband_ifty +@@ -2854,7 +2854,7 @@ static const struct ieee80211_sband_ifty .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL | IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, @@ -102,7 +102,7 @@ Signed-off-by: Johannes Berg .phy_cap_info[0] = IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G | -@@ -2897,7 +2897,7 @@ static const struct ieee80211_sband_ifty +@@ -2902,7 +2902,7 @@ static const struct ieee80211_sband_ifty .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL | IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, diff --git a/package/kernel/mac80211/patches/subsys/393-wireless-align-HE-capabilities-A-MPDU-Length-Exponen.patch b/package/kernel/mac80211/patches/subsys/393-wireless-align-HE-capabilities-A-MPDU-Length-Exponen.patch index ecd544324c..9327fa1173 100644 --- a/package/kernel/mac80211/patches/subsys/393-wireless-align-HE-capabilities-A-MPDU-Length-Exponen.patch +++ b/package/kernel/mac80211/patches/subsys/393-wireless-align-HE-capabilities-A-MPDU-Length-Exponen.patch @@ -47,7 +47,7 @@ Signed-off-by: Johannes Berg .mac_cap_info[5] = --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -2758,7 +2758,7 @@ static const struct ieee80211_sband_ifty +@@ -2763,7 +2763,7 @@ static const struct ieee80211_sband_ifty IEEE80211_HE_MAC_CAP2_ACK_EN, .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL | @@ -56,7 +56,7 @@ Signed-off-by: Johannes Berg .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU, .phy_cap_info[1] = IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | -@@ -2802,7 +2802,7 @@ static const struct ieee80211_sband_ifty +@@ -2807,7 +2807,7 @@ static const struct ieee80211_sband_ifty IEEE80211_HE_MAC_CAP2_ACK_EN, .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL | @@ -65,7 +65,7 @@ Signed-off-by: Johannes Berg .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU, .phy_cap_info[1] = IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | -@@ -2848,7 +2848,7 @@ static const struct ieee80211_sband_ifty +@@ -2853,7 +2853,7 @@ static const struct ieee80211_sband_ifty IEEE80211_HE_MAC_CAP2_ACK_EN, .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL | @@ -74,7 +74,7 @@ Signed-off-by: Johannes Berg .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU, .phy_cap_info[0] = IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | -@@ -2896,7 +2896,7 @@ static const struct ieee80211_sband_ifty +@@ -2901,7 +2901,7 @@ static const struct ieee80211_sband_ifty IEEE80211_HE_MAC_CAP2_ACK_EN, .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL | diff --git a/package/kernel/mac80211/patches/subsys/397-disable-mbssid.patch b/package/kernel/mac80211/patches/subsys/397-disable-mbssid.patch index c4a8d30d7c..1582be891b 100644 --- a/package/kernel/mac80211/patches/subsys/397-disable-mbssid.patch +++ b/package/kernel/mac80211/patches/subsys/397-disable-mbssid.patch @@ -10,7 +10,7 @@ continue; --- a/net/wireless/scan.c +++ b/net/wireless/scan.c -@@ -2010,6 +2010,7 @@ static const struct element +@@ -2012,6 +2012,7 @@ static const struct element const struct element *next_mbssid; const struct element *next_sub; @@ -18,7 +18,7 @@ next_mbssid = cfg80211_find_elem(WLAN_EID_MULTIPLE_BSSID, mbssid_end, ielen - (mbssid_end - ie)); -@@ -2091,6 +2092,7 @@ static void cfg80211_parse_mbssid_data(s +@@ -2093,6 +2094,7 @@ static void cfg80211_parse_mbssid_data(s u16 capability; struct cfg80211_bss *bss; @@ -26,7 +26,7 @@ if (!non_tx_data) return; if (!cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ie, ielen)) -@@ -2251,6 +2253,7 @@ cfg80211_update_notlisted_nontrans(struc +@@ -2253,6 +2255,7 @@ cfg80211_update_notlisted_nontrans(struc const struct cfg80211_bss_ies *old; size_t cpy_len; @@ -34,7 +34,7 @@ lockdep_assert_held(&wiphy_to_rdev(wiphy)->bss_lock); ie = mgmt->u.probe_resp.variable; -@@ -2468,6 +2471,7 @@ cfg80211_inform_bss_frame_data(struct wi +@@ -2470,6 +2473,7 @@ cfg80211_inform_bss_frame_data(struct wi res = cfg80211_inform_single_bss_frame_data(wiphy, data, mgmt, len, gfp); diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index 4a0bb1a933..fe23a289d3 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -77,7 +77,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -4413,6 +4426,7 @@ const struct cfg80211_ops mac80211_confi +@@ -4410,6 +4423,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, From 8035ac01950758d96b92085b9f213b12e4039691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 29 Aug 2021 22:53:55 +0200 Subject: [PATCH 08/78] bcm53xx: backport the latest upstream DT changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This includes: 1. BCM5301X changes from 5.14 and queued 5.15 stuff 2. NSP changes from 5.11 - 5.15 for kernel 5.10 Signed-off-by: Rafał Miłecki (cherry picked from commit bce00f47e5d67e5a33e9d7fa137cbe0a5d3d334b) --- ...NSP-Update-ethernet-switch-node-name.patch | 32 ++ ...-Ethernet-switch-SGMII-register-name.patch | 26 ++ ...a-SRAB-compatible-string-for-each-bo.patch | 77 ++++ ...rovide-defaults-ports-container-node.patch | 99 +++++ ...s-NSP-add-device-names-to-compatible.patch | 97 +++++ ...RM-dts-NSP-enable-DMA-on-bcm988312hr.patch | 29 ++ ...dts-NSP-disable-qspi-node-by-default.patch | 113 +++++ ...dts-NSP-add-MDIO-bus-controller-node.patch | 30 ++ ...P-Move-USB3-PHY-to-internal-MDIO-bus.patch | 85 ++++ ...SP-Add-common-bindings-for-MX64-MX65.patch | 148 +++++++ ...ts-NSP-Add-Ax-stepping-modifications.patch | 90 ++++ ...-Add-DT-files-for-Meraki-MX64-series.patch | 340 +++++++++++++++ ...-Add-DT-files-for-Meraki-MX65-series.patch | 386 ++++++++++++++++++ ...10-ARM-dts-BCM5301X-Fix-nodes-names.patch} | 0 ...M-dts-BCM5301X-Fix-MDIO-mux-binding.patch} | 0 ...dts-BCM5301X-Fix-memory-nodes-names.patch} | 0 16 files changed, 1552 insertions(+) create mode 100644 target/linux/bcm53xx/patches-5.4/034-v5.11-0013-ARM-dts-NSP-Update-ethernet-switch-node-name.patch create mode 100644 target/linux/bcm53xx/patches-5.4/034-v5.11-0014-ARM-dts-NSP-Fix-Ethernet-switch-SGMII-register-name.patch create mode 100644 target/linux/bcm53xx/patches-5.4/034-v5.11-0015-ARM-dts-NSP-Add-a-SRAB-compatible-string-for-each-bo.patch create mode 100644 target/linux/bcm53xx/patches-5.4/034-v5.11-0016-ARM-dts-NSP-Provide-defaults-ports-container-node.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-NSP-add-device-names-to-compatible.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-NSP-enable-DMA-on-bcm988312hr.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-NSP-disable-qspi-node-by-default.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0004-ARM-dts-NSP-add-MDIO-bus-controller-node.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0005-ARM-dts-NSP-Move-USB3-PHY-to-internal-MDIO-bus.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0006-ARM-dts-NSP-Add-common-bindings-for-MX64-MX65.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0007-ARM-dts-NSP-Add-Ax-stepping-modifications.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0008-ARM-dts-NSP-Add-DT-files-for-Meraki-MX64-series.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.15-0009-ARM-dts-NSP-Add-DT-files-for-Meraki-MX65-series.patch rename target/linux/bcm53xx/patches-5.4/{037-v5.15-0001-ARM-dts-BCM5301X-Fix-nodes-names.patch => 037-v5.15-0010-ARM-dts-BCM5301X-Fix-nodes-names.patch} (100%) rename target/linux/bcm53xx/patches-5.4/{037-v5.15-0002-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch => 037-v5.15-0011-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch} (100%) rename target/linux/bcm53xx/patches-5.4/{037-v5.15-0003-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch => 037-v5.15-0012-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch} (100%) diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0013-ARM-dts-NSP-Update-ethernet-switch-node-name.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0013-ARM-dts-NSP-Update-ethernet-switch-node-name.patch new file mode 100644 index 0000000000..3828bb57c4 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0013-ARM-dts-NSP-Update-ethernet-switch-node-name.patch @@ -0,0 +1,32 @@ +From fd66cd0d79cb836badecb91fdd19afd32afbb443 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 9 Nov 2020 12:02:08 -0800 +Subject: [PATCH 13/16] ARM: dts: NSP: Update ethernet switch node name + +Update the switch unit name from srab to ethernet-switch, allowing us +to fix warnings such as: + + CHECK arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dt.yaml + arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dt.yaml: + srab@18007000: $nodename:0: 'srab@18007000' does not match + '^(ethernet-)?switch(@.*)?$' + From schema: + Documentation/devicetree/bindings/net/dsa/b53.yaml + +Reviewed-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -383,7 +383,7 @@ + clock-names = "apb_pclk"; + }; + +- srab: srab@36000 { ++ srab: ethernet-switch@36000 { + compatible = "brcm,nsp-srab"; + reg = <0x36000 0x1000>, + <0x3f308 0x8>, diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0014-ARM-dts-NSP-Fix-Ethernet-switch-SGMII-register-name.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0014-ARM-dts-NSP-Fix-Ethernet-switch-SGMII-register-name.patch new file mode 100644 index 0000000000..e8313d89b2 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0014-ARM-dts-NSP-Fix-Ethernet-switch-SGMII-register-name.patch @@ -0,0 +1,26 @@ +From 8b0235d1deace8f1bd8cdd149d698fee3974fdf4 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 9 Nov 2020 12:06:15 -0800 +Subject: [PATCH 14/16] ARM: dts: NSP: Fix Ethernet switch SGMII register name + +The register name should be "sgmii_config", not "sgmii", this is not a +functional change since no code is currently looking for that register +by name (or at all). + +Reviewed-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -388,7 +388,7 @@ + reg = <0x36000 0x1000>, + <0x3f308 0x8>, + <0x3f410 0xc>; +- reg-names = "srab", "mux_config", "sgmii"; ++ reg-names = "srab", "mux_config", "sgmii_config"; + interrupts = , + , + , diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0015-ARM-dts-NSP-Add-a-SRAB-compatible-string-for-each-bo.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0015-ARM-dts-NSP-Add-a-SRAB-compatible-string-for-each-bo.patch new file mode 100644 index 0000000000..a0be53ac28 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0015-ARM-dts-NSP-Add-a-SRAB-compatible-string-for-each-bo.patch @@ -0,0 +1,77 @@ +From 42791b317db4cda36751f57bada27857849811d3 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 9 Nov 2020 17:41:32 -0800 +Subject: [PATCH 15/16] ARM: dts: NSP: Add a SRAB compatible string for each + board + +Provide a valid compatible string for the Ethernet switch node based on +the board including the switch. This allows us to have sane defaults and +silences the following warnings: + + arch/arm/boot/dts/bcm958522er.dt.yaml: + ethernet-switch@36000: compatible: 'oneOf' conditional failed, +one + must be fixed: + ['brcm,bcm5301x-srab'] is too short + 'brcm,bcm5325' was expected + 'brcm,bcm53115' was expected + 'brcm,bcm53125' was expected + 'brcm,bcm53128' was expected + 'brcm,bcm5365' was expected + 'brcm,bcm5395' was expected + 'brcm,bcm5389' was expected + 'brcm,bcm5397' was expected + 'brcm,bcm5398' was expected + 'brcm,bcm11360-srab' was expected + 'brcm,bcm5301x-srab' is not one of ['brcm,bcm53010-srab', + 'brcm,bcm53011-srab', 'brcm,bcm53012-srab', 'brcm,bcm53018-srab', + 'brcm,bcm53019-srab'] + 'brcm,bcm5301x-srab' is not one of ['brcm,bcm11404-srab', + 'brcm,bcm11407-srab', 'brcm,bcm11409-srab', 'brcm,bcm58310-srab', + 'brcm,bcm58311-srab', 'brcm,bcm58313-srab'] + 'brcm,bcm5301x-srab' is not one of ['brcm,bcm58522-srab', + 'brcm,bcm58523-srab', 'brcm,bcm58525-srab', 'brcm,bcm58622-srab', + 'brcm,bcm58623-srab', 'brcm,bcm58625-srab', 'brcm,bcm88312-srab'] + 'brcm,bcm5301x-srab' is not one of ['brcm,bcm3384-switch', + 'brcm,bcm6328-switch', 'brcm,bcm6368-switch'] + From schema: + Documentation/devicetree/bindings/net/dsa/b53.yaml + +Reviewed-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958522er.dts | 4 ++++ + arch/arm/boot/dts/bcm958525er.dts | 4 ++++ + arch/arm/boot/dts/bcm958525xmc.dts | 4 ++++ + 3 files changed, 12 insertions(+) + +--- a/arch/arm/boot/dts/bcm958522er.dts ++++ b/arch/arm/boot/dts/bcm958522er.dts +@@ -174,3 +174,7 @@ + &xhci { + status = "okay"; + }; ++ ++&srab { ++ compatible = "brcm,bcm58522-srab", "brcm,nsp-srab"; ++}; +--- a/arch/arm/boot/dts/bcm958525er.dts ++++ b/arch/arm/boot/dts/bcm958525er.dts +@@ -186,3 +186,7 @@ + &xhci { + status = "okay"; + }; ++ ++&srab { ++ compatible = "brcm,bcm58525-srab", "brcm,nsp-srab"; ++}; +--- a/arch/arm/boot/dts/bcm958525xmc.dts ++++ b/arch/arm/boot/dts/bcm958525xmc.dts +@@ -206,3 +206,7 @@ + &xhci { + status = "okay"; + }; ++ ++&srab { ++ compatible = "brcm,bcm58525-srab", "brcm,nsp-srab"; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0016-ARM-dts-NSP-Provide-defaults-ports-container-node.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0016-ARM-dts-NSP-Provide-defaults-ports-container-node.patch new file mode 100644 index 0000000000..714e09ed06 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0016-ARM-dts-NSP-Provide-defaults-ports-container-node.patch @@ -0,0 +1,99 @@ +From 51e40c25aa18d926a8eb1c07289d01611b21123a Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 9 Nov 2020 17:44:33 -0800 +Subject: [PATCH 16/16] ARM: dts: NSP: Provide defaults ports container node + +Provide an empty 'ports' container node with the correct #address-cells +and #size-cells properties. This silences the following warning: + +arch/arm/boot/dts/bcm958522er.dt.yaml: +ethernet-switch@36000: 'oneOf' conditional failed, one must be fixed: + 'ports' is a required property + 'ethernet-ports' is a required property + From schema: +Documentation/devicetree/bindings/net/dsa/b53.yaml + +Reviewed-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 4 ++++ + arch/arm/boot/dts/bcm958622hr.dts | 3 --- + arch/arm/boot/dts/bcm958623hr.dts | 3 --- + arch/arm/boot/dts/bcm958625hr.dts | 3 --- + arch/arm/boot/dts/bcm958625k.dts | 3 --- + arch/arm/boot/dts/bcm988312hr.dts | 3 --- + 6 files changed, 4 insertions(+), 15 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -418,6 +418,10 @@ + status = "disabled"; + + /* ports are defined in board DTS */ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; + }; + + i2c0: i2c@38000 { +--- a/arch/arm/boot/dts/bcm958622hr.dts ++++ b/arch/arm/boot/dts/bcm958622hr.dts +@@ -172,9 +172,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; +--- a/arch/arm/boot/dts/bcm958623hr.dts ++++ b/arch/arm/boot/dts/bcm958623hr.dts +@@ -176,9 +176,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; +--- a/arch/arm/boot/dts/bcm958625hr.dts ++++ b/arch/arm/boot/dts/bcm958625hr.dts +@@ -196,9 +196,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; +--- a/arch/arm/boot/dts/bcm958625k.dts ++++ b/arch/arm/boot/dts/bcm958625k.dts +@@ -212,9 +212,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; +--- a/arch/arm/boot/dts/bcm988312hr.dts ++++ b/arch/arm/boot/dts/bcm988312hr.dts +@@ -184,9 +184,6 @@ + status = "okay"; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + label = "port0"; + reg = <0>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-NSP-add-device-names-to-compatible.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-NSP-add-device-names-to-compatible.patch new file mode 100644 index 0000000000..c994953d4d --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-NSP-add-device-names-to-compatible.patch @@ -0,0 +1,97 @@ +From 465078bfdf5271601f098450ae2fc974865c59fd Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Thu, 10 Jun 2021 21:35:10 +0100 +Subject: [PATCH] ARM: dts: NSP: add device names to compatible + +Currently only the SoC type and platform are specified for all NSP +devices. This patch adds the device names. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958522er.dts | 2 +- + arch/arm/boot/dts/bcm958525er.dts | 2 +- + arch/arm/boot/dts/bcm958525xmc.dts | 2 +- + arch/arm/boot/dts/bcm958622hr.dts | 2 +- + arch/arm/boot/dts/bcm958625hr.dts | 2 +- + arch/arm/boot/dts/bcm958625k.dts | 2 +- + arch/arm/boot/dts/bcm988312hr.dts | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +--- a/arch/arm/boot/dts/bcm958522er.dts ++++ b/arch/arm/boot/dts/bcm958522er.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958522ER)"; +- compatible = "brcm,bcm58522", "brcm,nsp"; ++ compatible = "brcm,bcm958522er", "brcm,bcm58522", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958525er.dts ++++ b/arch/arm/boot/dts/bcm958525er.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958525ER)"; +- compatible = "brcm,bcm58525", "brcm,nsp"; ++ compatible = "brcm,bcm958525er", "brcm,bcm58525", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958525xmc.dts ++++ b/arch/arm/boot/dts/bcm958525xmc.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus XMC (BCM958525xmc)"; +- compatible = "brcm,bcm58525", "brcm,nsp"; ++ compatible = "brcm,bcm958525xmc", "brcm,bcm58525", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958622hr.dts ++++ b/arch/arm/boot/dts/bcm958622hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958622HR)"; +- compatible = "brcm,bcm58622", "brcm,nsp"; ++ compatible = "brcm,bcm958622hr", "brcm,bcm58622", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958625hr.dts ++++ b/arch/arm/boot/dts/bcm958625hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958625HR)"; +- compatible = "brcm,bcm58625", "brcm,nsp"; ++ compatible = "brcm,bcm958625hr", "brcm,bcm58625", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm958625k.dts ++++ b/arch/arm/boot/dts/bcm958625k.dts +@@ -36,7 +36,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958625K)"; +- compatible = "brcm,bcm58625", "brcm,nsp"; ++ compatible = "brcm,bcm958625k", "brcm,bcm58625", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/arch/arm/boot/dts/bcm988312hr.dts ++++ b/arch/arm/boot/dts/bcm988312hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM988312HR)"; +- compatible = "brcm,bcm88312", "brcm,nsp"; ++ compatible = "brcm,bcm988312hr", "brcm,bcm88312", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-NSP-enable-DMA-on-bcm988312hr.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-NSP-enable-DMA-on-bcm988312hr.patch new file mode 100644 index 0000000000..d84124d2dd --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-NSP-enable-DMA-on-bcm988312hr.patch @@ -0,0 +1,29 @@ +From 1b90dde4278a7b459979706b572785bc3a10bbb5 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Thu, 10 Jun 2021 21:35:12 +0100 +Subject: [PATCH] ARM: dts: NSP: enable DMA on bcm988312hr + +The previous patch "ARM: dts: NSP: Disable PL330 by default, add +dma-coherent property" set the DMAC to disabled by default, requiring it +to be manually enabled on each device. The bcm988312hr was mistakenly +omitted. This patch adds it back. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm988312hr.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm/boot/dts/bcm988312hr.dts ++++ b/arch/arm/boot/dts/bcm988312hr.dts +@@ -58,6 +58,10 @@ + + /* USB 3 support needed to be complete */ + ++&dma { ++ status = "okay"; ++}; ++ + &amac0 { + status = "okay"; + }; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-NSP-disable-qspi-node-by-default.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-NSP-disable-qspi-node-by-default.patch new file mode 100644 index 0000000000..df49700829 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-NSP-disable-qspi-node-by-default.patch @@ -0,0 +1,113 @@ +From 091a12b1814142eac16a115dab206f735b5476a9 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 13 Jun 2021 10:46:34 +0100 +Subject: [PATCH] ARM: dts: NSP: disable qspi node by default + +The QSPI bus is enabled by default, however this may not used on all +devices. This patch disables by default, requiring it to be explicitly +enabled where required. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 1 + + arch/arm/boot/dts/bcm958522er.dts | 1 + + arch/arm/boot/dts/bcm958525er.dts | 1 + + arch/arm/boot/dts/bcm958525xmc.dts | 1 + + arch/arm/boot/dts/bcm958622hr.dts | 1 + + arch/arm/boot/dts/bcm958623hr.dts | 1 + + arch/arm/boot/dts/bcm958625hr.dts | 1 + + arch/arm/boot/dts/bcm958625k.dts | 1 + + arch/arm/boot/dts/bcm988312hr.dts | 1 + + 9 files changed, 9 insertions(+) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -308,6 +308,7 @@ + num-cs = <2>; + #address-cells = <1>; + #size-cells = <0>; ++ status = "disabled"; + }; + + xhci: usb@29000 { +--- a/arch/arm/boot/dts/bcm958522er.dts ++++ b/arch/arm/boot/dts/bcm958522er.dts +@@ -130,6 +130,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958525er.dts ++++ b/arch/arm/boot/dts/bcm958525er.dts +@@ -130,6 +130,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958525xmc.dts ++++ b/arch/arm/boot/dts/bcm958525xmc.dts +@@ -146,6 +146,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958622hr.dts ++++ b/arch/arm/boot/dts/bcm958622hr.dts +@@ -134,6 +134,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958623hr.dts ++++ b/arch/arm/boot/dts/bcm958623hr.dts +@@ -138,6 +138,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958625hr.dts ++++ b/arch/arm/boot/dts/bcm958625hr.dts +@@ -150,6 +150,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958625k.dts ++++ b/arch/arm/boot/dts/bcm958625k.dts +@@ -149,6 +149,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm988312hr.dts ++++ b/arch/arm/boot/dts/bcm988312hr.dts +@@ -138,6 +138,7 @@ + }; + + &qspi { ++ status = "okay"; + bspi-sel = <0>; + flash: m25p80@0 { + #address-cells = <1>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0004-ARM-dts-NSP-add-MDIO-bus-controller-node.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0004-ARM-dts-NSP-add-MDIO-bus-controller-node.patch new file mode 100644 index 0000000000..35f6e801a1 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0004-ARM-dts-NSP-add-MDIO-bus-controller-node.patch @@ -0,0 +1,30 @@ +From 236b31b1d84eb0e4f10c5f113a2675529456f919 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 13 Jun 2021 10:46:36 +0100 +Subject: [PATCH] ARM: dts: NSP: add MDIO bus controller node + +This patch adds the node for the MDIO bus controller, present on the NSP +SoC. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -361,6 +361,13 @@ + status = "disabled"; + }; + ++ mdio: mdio@32000 { ++ compatible = "brcm,iproc-mdio"; ++ reg = <0x32000 0x8>; ++ #size-cells = <0>; ++ #address-cells = <1>; ++ }; ++ + rng: rng@33000 { + compatible = "brcm,bcm-nsp-rng"; + reg = <0x33000 0x14>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0005-ARM-dts-NSP-Move-USB3-PHY-to-internal-MDIO-bus.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0005-ARM-dts-NSP-Move-USB3-PHY-to-internal-MDIO-bus.patch new file mode 100644 index 0000000000..9b62cb3028 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0005-ARM-dts-NSP-Move-USB3-PHY-to-internal-MDIO-bus.patch @@ -0,0 +1,85 @@ +From 1c615401bddb1be21e1d375aaa071680f40f1ae2 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 13 Jun 2021 10:46:37 +0100 +Subject: [PATCH] ARM: dts: NSP: Move USB3 PHY to internal MDIO bus + +This patch largely replicates Vivek Unune's patch "ARM: dts: +BCM5301X:Make usb3 phy use mdio phy driver"[1] for the NSP platform, +whereby we need to create an mdio-mux to facilitate switches +configured via external MDIO, in this case on the Meraki MX65. + +However in doing so, we are creating an overlap with usb3_phy's +ccb-mii range. To resolve this, usb3_phy should be moved to a child +node of the internal MDIO bus. The result is heavily based upon Vivek's +patch. This has also been cross-referenced with Yendapally Reddy's +earlier work which utilised the subsequently dropped brcm,nsp-usb3-phy +driver: "[PATCH v2 4/4] arm: dts: nsp: Add USB nodes to device tree" +[2]. Finally, this change provides conformance to the bcm-ns-usb3-phy +documentation, utilising the required usb3-dmp-syscon property. Note +that support for the deprecated ccb-mii bindings has been dropped as of +"phy: phy-bcm-ns-usb3: drop support for deprecated DT binding"[3]. + +[1] https://lore.kernel.org/patchwork/patch/933971/ +[2] https://www.spinics.net/lists/arm-kernel/msg555132.html +[3] https://lore.kernel.org/linux-devicetree/20201113113423.9466-1-zajec5@gmail.com/ + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 38 +++++++++++++++++++++++++++------- + 1 file changed, 31 insertions(+), 7 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -368,6 +368,35 @@ + #address-cells = <1>; + }; + ++ mdio-mux@32000 { ++ compatible = "mdio-mux-mmioreg"; ++ reg = <0x32000 0x4>; ++ mux-mask = <0x200>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mdio-parent-bus = <&mdio>; ++ ++ mdio_int: mdio@0 { ++ reg = <0x0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ usb3_phy: usb3-phy@10 { ++ compatible = "brcm,ns-bx-usb3-phy"; ++ reg = <0x10>; ++ usb3-dmp-syscon = <&usb3_dmp>; ++ #phy-cells = <0>; ++ status = "disabled"; ++ }; ++ }; ++ ++ mdio_ext: mdio@200 { ++ reg = <0x200>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ }; ++ + rng: rng@33000 { + compatible = "brcm,bcm-nsp-rng"; + reg = <0x33000 0x14>; +@@ -526,13 +555,8 @@ + }; + }; + +- usb3_phy: usb3-phy@104000 { +- compatible = "brcm,ns-bx-usb3-phy"; +- reg = <0x104000 0x1000>, +- <0x032000 0x1000>; +- reg-names = "dmp", "ccb-mii"; +- #phy-cells = <0>; +- status = "disabled"; ++ usb3_dmp: syscon@104000 { ++ reg = <0x104000 0x1000>; + }; + }; + diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0006-ARM-dts-NSP-Add-common-bindings-for-MX64-MX65.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0006-ARM-dts-NSP-Add-common-bindings-for-MX64-MX65.patch new file mode 100644 index 0000000000..aebf62af9b --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0006-ARM-dts-NSP-Add-common-bindings-for-MX64-MX65.patch @@ -0,0 +1,148 @@ +From f111016a8293b968f05450fec83020c94d0f88c2 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 6 Aug 2021 21:44:32 +0100 +Subject: [PATCH] ARM: dts: NSP: Add common bindings for MX64/MX65 + +These bindings are required for all Meraki MX64/MX65 devices. These +common bindings include memory (2GB), PWM LEDs, AMAC, I2C (AT24), NAND +partitions, EHCI, OHCI and pinctrl. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + .../dts/bcm958625-meraki-mx6x-common.dtsi | 129 ++++++++++++++++++ + 1 file changed, 129 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi + +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi +@@ -0,0 +1,129 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Common Bindings for Cisco Meraki MX64 (Kingpin) and MX65 (Alamo) devices. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++#include "bcm-nsp.dtsi" ++#include ++#include ++#include ++ ++/ { ++ pwm-leds { ++ compatible = "pwm-leds"; ++ ++ led-1 { ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ pwms = <&pwm 1 50000>; ++ max-brightness = <255>; ++ }; ++ ++ led-2 { ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ pwms = <&pwm 2 50000>; ++ max-brightness = <255>; ++ }; ++ ++ led-3 { ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ pwms = <&pwm 3 50000>; ++ max-brightness = <255>; ++ }; ++ }; ++}; ++ ++&amac2 { ++ status = "okay"; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ at24@50 { ++ compatible = "atmel,24c64"; ++ reg = <0x50>; ++ pagesize = <32>; ++ read-only; ++ }; ++}; ++ ++&nand_controller { ++ nand@0 { ++ compatible = "brcm,nandcs"; ++ reg = <0>; ++ nand-on-flash-bbt; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ nand-ecc-strength = <24>; ++ nand-ecc-step-size = <1024>; ++ ++ brcm,nand-oob-sector-size = <27>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0 0x80000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "shmoo"; ++ reg = <0x80000 0x80000>; ++ read-only; ++ }; ++ ++ partition@100000 { ++ label = "bootkernel1"; ++ reg = <0x100000 0x300000>; ++ }; ++ ++ partition@400000 { ++ label = "nvram"; ++ reg = <0x400000 0x100000>; ++ }; ++ ++ partition@500000 { ++ label = "bootkernel2"; ++ reg = <0x500000 0x300000>; ++ }; ++ ++ partition@800000 { ++ label = "ubi"; ++ reg = <0x800000 0x3f700000>; ++ }; ++ }; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&pinctrl { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm_leds>; ++ ++ pwm_leds: pwm_leds { ++ function = "pwm"; ++ groups = "pwm1_grp", "pwm2_grp", "pwm3_grp"; ++ }; ++}; ++ ++&pwm { ++ status = "okay"; ++ #pwm-cells = <2>; ++}; ++ ++&uart0 { ++ clock-frequency = <62500000>; ++ status = "okay"; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0007-ARM-dts-NSP-Add-Ax-stepping-modifications.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0007-ARM-dts-NSP-Add-Ax-stepping-modifications.patch new file mode 100644 index 0000000000..39a69bd9a8 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0007-ARM-dts-NSP-Add-Ax-stepping-modifications.patch @@ -0,0 +1,90 @@ +From 2addf9266a1d0f4ba59c9868b3effcd50de441a4 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 6 Aug 2021 21:44:33 +0100 +Subject: [PATCH] ARM: dts: NSP: Add Ax stepping modifications + +While uncommon, some Ax NSP SoCs exist in the wild. This stepping +requires a modified secondary CPU boot-reg and removal of DMA coherency +properties. Without these modifications, the secondary CPU will be +inactive and many peripherals will exhibit undefined behaviour. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp-ax.dtsi | 70 +++++++++++++++++++++++++++++++ + 1 file changed, 70 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm-nsp-ax.dtsi + +--- /dev/null ++++ b/arch/arm/boot/dts/bcm-nsp-ax.dtsi +@@ -0,0 +1,70 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Broadcom Northstar Plus Ax stepping-specific bindings. ++ * Notable differences from B0+ are the secondary-boot-reg and ++ * lack of DMA coherency. ++ */ ++ ++&cpu1 { ++ secondary-boot-reg = <0xffff042c>; ++}; ++ ++&dma { ++ /delete-property/ dma-coherent; ++}; ++ ++&sdio { ++ /delete-property/ dma-coherent; ++}; ++ ++&amac0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&amac1 { ++ /delete-property/ dma-coherent; ++}; ++ ++&amac2 { ++ /delete-property/ dma-coherent; ++}; ++ ++&ehci0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&mailbox { ++ /delete-property/ dma-coherent; ++}; ++ ++&xhci { ++ /delete-property/ dma-coherent; ++}; ++ ++&ehci0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&ohci0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&i2c0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&sata { ++ /delete-property/ dma-coherent; ++}; ++ ++&pcie0 { ++ /delete-property/ dma-coherent; ++}; ++ ++&pcie1 { ++ /delete-property/ dma-coherent; ++}; ++ ++&pcie2 { ++ /delete-property/ dma-coherent; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0008-ARM-dts-NSP-Add-DT-files-for-Meraki-MX64-series.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0008-ARM-dts-NSP-Add-DT-files-for-Meraki-MX64-series.patch new file mode 100644 index 0000000000..1960f90c68 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0008-ARM-dts-NSP-Add-DT-files-for-Meraki-MX64-series.patch @@ -0,0 +1,340 @@ +From 3f902645280baf0d7dab57c227cc14f43edb45ef Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 6 Aug 2021 21:44:34 +0100 +Subject: [PATCH] ARM: dts: NSP: Add DT files for Meraki MX64 series + +MX64 & MX64W Hardware info: + - CPU: Broadcom BCM58625 Cortex A9 @ 1200Mhz + - RAM: 2 GB (4 x 4Gb SK Hynix H5TC4G83CFR) + - Storage: 1 GB (Micron MT29F8G08ABACA) + - Networking: BCM58625 internal switch (5x 1GbE ports) + - USB: 1x USB2.0 + - Serial: Internal header + - WLAN(MX64W only): 2x Broadcom BCM43520KMLG on the PCI bus + +This patch adds the Meraki MX64 series-specific bindings. Since some +devices make use of the older A0 SoC, changes need to be made to +accommodate this case, including removal of coherency options and +modification to the secondary-boot-reg. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 4 + + .../boot/dts/bcm958625-meraki-kingpin.dtsi | 163 ++++++++++++++++++ + .../arm/boot/dts/bcm958625-meraki-mx64-a0.dts | 25 +++ + arch/arm/boot/dts/bcm958625-meraki-mx64.dts | 24 +++ + .../boot/dts/bcm958625-meraki-mx64w-a0.dts | 33 ++++ + arch/arm/boot/dts/bcm958625-meraki-mx64w.dts | 32 ++++ + 6 files changed, 281 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx64-a0.dts + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx64.dts + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx64w-a0.dts + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx64w.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -148,6 +148,10 @@ dtb-$(CONFIG_ARCH_BCM_NSP) += \ + bcm958525xmc.dtb \ + bcm958622hr.dtb \ + bcm958623hr.dtb \ ++ bcm958625-meraki-mx64.dtb \ ++ bcm958625-meraki-mx64-a0.dtb \ ++ bcm958625-meraki-mx64w.dtb \ ++ bcm958625-meraki-mx64w-a0.dtb \ + bcm958625hr.dtb \ + bcm988312hr.dtb \ + bcm958625k.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi +@@ -0,0 +1,163 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64 series (Kingpin). ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++#include "bcm958625-meraki-mx6x-common.dtsi" ++ ++/ { ++ ++ keys { ++ compatible = "gpio-keys-polled"; ++ autorepeat; ++ poll-interval = <20>; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpioa 6 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ /* green:lan1-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <0>; ++ color = ; ++ gpios = <&gpioa 19 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-1 { ++ /* green:lan1-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <1>; ++ color = ; ++ gpios = <&gpioa 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2 { ++ /* green:lan2-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <2>; ++ color = ; ++ gpios = <&gpioa 24 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-3 { ++ /* green:lan2-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <3>; ++ color = ; ++ gpios = <&gpioa 20 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-4 { ++ /* green:lan3-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <4>; ++ color = ; ++ gpios = <&gpioa 26 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5 { ++ /* green:lan3-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <5>; ++ color = ; ++ gpios = <&gpioa 25 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-6 { ++ /* green:lan4-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <6>; ++ color = ; ++ gpios = <&gpioa 28 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-7 { ++ /* green:lan4-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <7>; ++ color = ; ++ gpios = <&gpioa 27 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-8 { ++ /* green:wan-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <8>; ++ color = ; ++ gpios = <&gpioa 30 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-9 { ++ /* green:wan-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <9>; ++ color = ; ++ gpios = <&gpioa 29 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-a { ++ /* amber:power */ ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ }; ++ ++ led-b { ++ /* white:status */ ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&gpioa 31 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; ++ ++&srab { ++ compatible = "brcm,bcm58625-srab", "brcm,nsp-srab"; ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ label = "lan1"; ++ reg = <0>; ++ }; ++ ++ port@1 { ++ label = "lan2"; ++ reg = <1>; ++ }; ++ ++ port@2 { ++ label = "lan3"; ++ reg = <2>; ++ }; ++ ++ port@3 { ++ label = "lan4"; ++ reg = <3>; ++ }; ++ ++ port@4 { ++ label = "wan"; ++ reg = <4>; ++ }; ++ ++ port@8 { ++ ethernet = <&amac2>; ++ reg = <8>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx64-a0.dts +@@ -0,0 +1,25 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64 with A0 SoC. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-kingpin.dtsi" ++#include "bcm-nsp-ax.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX64(A0)"; ++ compatible = "meraki,mx64-a0", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx64.dts +@@ -0,0 +1,24 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64 with B0+ SoC. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-kingpin.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX64"; ++ compatible = "meraki,mx64", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx64w-a0.dts +@@ -0,0 +1,33 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64W with A0 SoC. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-kingpin.dtsi" ++#include "bcm-nsp-ax.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX64W(A0)"; ++ compatible = "meraki,mx64w-a0", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&pcie1 { ++ status = "okay"; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx64w.dts +@@ -0,0 +1,32 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX64W with B0+ SoC. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-kingpin.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX64W"; ++ compatible = "meraki,mx64w", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&pcie1 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0009-ARM-dts-NSP-Add-DT-files-for-Meraki-MX65-series.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0009-ARM-dts-NSP-Add-DT-files-for-Meraki-MX65-series.patch new file mode 100644 index 0000000000..aa431b97cc --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.15-0009-ARM-dts-NSP-Add-DT-files-for-Meraki-MX65-series.patch @@ -0,0 +1,386 @@ +From 702a8f4744ed5b480f2b2411858184afdb10f9fd Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 6 Aug 2021 21:44:35 +0100 +Subject: [PATCH] ARM: dts: NSP: Add DT files for Meraki MX65 series + +MX65 & MX65W Hardware info: + - CPU: Broadcom BCM58625 Cortex A9 @ 1200Mhz + - RAM: 2 GB (4 x 4Gb SK Hynix H5TC4G83CFR) + - Storage: 1 GB (Micron MT29F8G08ABACA) + - Networking: BCM58625 switch (2x 1GbE ports) + 2x Qualcomm QCA8337 switches (10x 1GbE ports total) + - PSE: Broadcom BCM59111KMLG connected to LAN ports 11 & 12 + - USB: 1x USB2.0 + - Serial: Internal header + - WLAN(MX65W Only): 2x Broadcom BCM43520KMLG on the PCI bus. + +Note that a driver and firmware image for the BCM59111 PSE has been +released under GPL, but this is not present in the kernel. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 2 + + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 279 ++++++++++++++++++ + arch/arm/boot/dts/bcm958625-meraki-mx65.dts | 24 ++ + arch/arm/boot/dts/bcm958625-meraki-mx65w.dts | 32 ++ + 4 files changed, 337 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx65.dts + create mode 100644 arch/arm/boot/dts/bcm958625-meraki-mx65w.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -152,6 +152,8 @@ dtb-$(CONFIG_ARCH_BCM_NSP) += \ + bcm958625-meraki-mx64-a0.dtb \ + bcm958625-meraki-mx64w.dtb \ + bcm958625-meraki-mx64w-a0.dtb \ ++ bcm958625-meraki-mx65.dtb \ ++ bcm958625-meraki-mx65w.dtb \ + bcm958625hr.dtb \ + bcm988312hr.dtb \ + bcm958625k.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -0,0 +1,279 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX65 series (Alamo). ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++#include "bcm958625-meraki-mx6x-common.dtsi" ++ ++/ { ++ keys { ++ compatible = "gpio-keys-polled"; ++ autorepeat; ++ poll-interval = <20>; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpioa 8 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ /* green:wan1-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <0>; ++ color = ; ++ gpios = <&gpioa 25 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-1 { ++ /* green:wan1-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <1>; ++ color = ; ++ gpios = <&gpioa 24 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2 { ++ /* green:wan2-left */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <2>; ++ color = ; ++ gpios = <&gpioa 27 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-3 { ++ /* green:wan2-right */ ++ function = LED_FUNCTION_ACTIVITY; ++ function-enumerator = <3>; ++ color = ; ++ gpios = <&gpioa 26 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-4 { ++ /* amber:power */ ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpioa 3 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ led-5 { ++ /* white:status */ ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&gpioa 31 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ mdio-mii-mux { ++ compatible = "mdio-mux-mmioreg"; ++ reg = <0x1803f1c0 0x4>; ++ mux-mask = <0x2000>; ++ mdio-parent-bus = <&mdio_ext>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mdio@0 { ++ reg = <0x0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy_port6: phy@0 { ++ reg = <0>; ++ }; ++ ++ phy_port7: phy@1 { ++ reg = <1>; ++ }; ++ ++ phy_port8: phy@2 { ++ reg = <2>; ++ }; ++ ++ phy_port9: phy@3 { ++ reg = <3>; ++ }; ++ ++ phy_port10: phy@4 { ++ reg = <4>; ++ }; ++ ++ switch@10 { ++ compatible = "qca,qca8337"; ++ reg = <0x10>; ++ dsa,member = <1 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ port@0 { ++ reg = <0>; ++ ethernet = <&sgmii1>; ++ phy-mode = "sgmii"; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ phy-handle = <&phy_port6>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan9"; ++ phy-handle = <&phy_port7>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan10"; ++ phy-handle = <&phy_port8>; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan11"; ++ phy-handle = <&phy_port9>; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "lan12"; ++ phy-handle = <&phy_port10>; ++ }; ++ }; ++ }; ++ }; ++ ++ mdio-mii@2000 { ++ reg = <0x2000>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy_port1: phy@0 { ++ reg = <0>; ++ }; ++ ++ phy_port2: phy@1 { ++ reg = <1>; ++ }; ++ ++ phy_port3: phy@2 { ++ reg = <2>; ++ }; ++ ++ phy_port4: phy@3 { ++ reg = <3>; ++ }; ++ ++ phy_port5: phy@4 { ++ reg = <4>; ++ }; ++ ++ switch@10 { ++ compatible = "qca,qca8337"; ++ reg = <0x10>; ++ dsa,member = <2 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ port@0 { ++ reg = <0>; ++ ethernet = <&sgmii0>; ++ phy-mode = "sgmii"; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ phy-handle = <&phy_port1>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ phy-handle = <&phy_port2>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan5"; ++ phy-handle = <&phy_port3>; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan6"; ++ phy-handle = <&phy_port4>; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "lan7"; ++ phy-handle = <&phy_port5>; ++ }; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++&srab { ++ compatible = "brcm,bcm58625-srab", "brcm,nsp-srab"; ++ status = "okay"; ++ dsa,member = <0 0>; ++ ++ ports { ++ port@0 { ++ label = "wan1"; ++ reg = <0>; ++ }; ++ ++ port@1 { ++ label = "wan2"; ++ reg = <1>; ++ }; ++ ++ sgmii0: port@4 { ++ label = "sw0"; ++ reg = <4>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ sgmii1: port@5 { ++ label = "sw1"; ++ reg = <5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@8 { ++ ethernet = <&amac2>; ++ reg = <8>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx65.dts +@@ -0,0 +1,24 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX65. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-alamo.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX65"; ++ compatible = "meraki,mx65", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx65w.dts +@@ -0,0 +1,32 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindings for Cisco Meraki MX65W. ++ * ++ * Copyright (C) 2020-2021 Matthew Hagan ++ */ ++ ++/dts-v1/; ++ ++#include "bcm958625-meraki-alamo.dtsi" ++ ++/ { ++ model = "Cisco Meraki MX65W"; ++ compatible = "meraki,mx65w", "brcm,bcm58625", "brcm,nsp"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@60000000 { ++ device_type = "memory"; ++ reg = <0x60000000 0x80000000>; ++ }; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&pcie1 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-BCM5301X-Fix-nodes-names.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0010-ARM-dts-BCM5301X-Fix-nodes-names.patch similarity index 100% rename from target/linux/bcm53xx/patches-5.4/037-v5.15-0001-ARM-dts-BCM5301X-Fix-nodes-names.patch rename to target/linux/bcm53xx/patches-5.4/037-v5.15-0010-ARM-dts-BCM5301X-Fix-nodes-names.patch diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0011-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch similarity index 100% rename from target/linux/bcm53xx/patches-5.4/037-v5.15-0002-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch rename to target/linux/bcm53xx/patches-5.4/037-v5.15-0011-ARM-dts-BCM5301X-Fix-MDIO-mux-binding.patch diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch b/target/linux/bcm53xx/patches-5.4/037-v5.15-0012-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch similarity index 100% rename from target/linux/bcm53xx/patches-5.4/037-v5.15-0003-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch rename to target/linux/bcm53xx/patches-5.4/037-v5.15-0012-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch From 1ba74c168b79a14a4e9b0be7c2f145b8febfbc30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 30 Aug 2021 08:54:29 +0200 Subject: [PATCH 09/78] bcm53xx: backport missed DT patch cleaning up CRU block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 8a4d4d4243357b28722e3327e2c7c7b4ceb288ec) --- ...01X-Move-CRU-devices-to-the-CRU-node.patch | 85 +++++++++++++++++++ ...01X-Update-Ethernet-switch-node-name.patch | 4 +- ...-Add-a-default-compatible-for-switch.patch | 2 +- ...-Provide-defaults-ports-container-no.patch | 2 +- ...RM-dts-BCM5301X-Fix-NAND-nodes-names.patch | 2 +- ...s-BCM5301X-Fix-pinmux-subnodes-names.patch | 2 +- 6 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 target/linux/bcm53xx/patches-5.4/034-v5.11-0007-ARM-dts-BCM5301X-Move-CRU-devices-to-the-CRU-node.patch diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0007-ARM-dts-BCM5301X-Move-CRU-devices-to-the-CRU-node.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0007-ARM-dts-BCM5301X-Move-CRU-devices-to-the-CRU-node.patch new file mode 100644 index 0000000000..3c3db540d0 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0007-ARM-dts-BCM5301X-Move-CRU-devices-to-the-CRU-node.patch @@ -0,0 +1,85 @@ +From 776461b1795b4dc4084894cf53399044aafa1d21 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 11 Nov 2020 15:55:38 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Move CRU devices to the CRU node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Clocks and thermal blocks are part of the CRU ("Clock and Reset Unit" or +"Central Resource Unit"). + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 51 +++++++++++++++++---------------- + 1 file changed, 26 insertions(+), 25 deletions(-) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -430,6 +430,26 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ lcpll0: lcpll0@100 { ++ #clock-cells = <1>; ++ compatible = "brcm,nsp-lcpll0"; ++ reg = <0x100 0x14>; ++ clocks = <&osc>; ++ clock-output-names = "lcpll0", "pcie_phy", ++ "sdio", "ddr_phy"; ++ }; ++ ++ genpll: genpll@140 { ++ #clock-cells = <1>; ++ compatible = "brcm,nsp-genpll"; ++ reg = <0x140 0x24>; ++ clocks = <&osc>; ++ clock-output-names = "genpll", "phy", ++ "ethernetclk", ++ "usbclk", "iprocfast", ++ "sata1", "sata2"; ++ }; ++ + pinctrl: pin-controller@1c0 { + compatible = "brcm,bcm4708-pinmux"; + reg = <0x1c0 0x24>; +@@ -456,32 +476,13 @@ + function = "uart1"; + }; + }; +- }; +- }; + +- lcpll0: lcpll0@1800c100 { +- #clock-cells = <1>; +- compatible = "brcm,nsp-lcpll0"; +- reg = <0x1800c100 0x14>; +- clocks = <&osc>; +- clock-output-names = "lcpll0", "pcie_phy", "sdio", +- "ddr_phy"; +- }; +- +- genpll: genpll@1800c140 { +- #clock-cells = <1>; +- compatible = "brcm,nsp-genpll"; +- reg = <0x1800c140 0x24>; +- clocks = <&osc>; +- clock-output-names = "genpll", "phy", "ethernetclk", +- "usbclk", "iprocfast", "sata1", +- "sata2"; +- }; +- +- thermal: thermal@1800c2c0 { +- compatible = "brcm,ns-thermal"; +- reg = <0x1800c2c0 0x10>; +- #thermal-sensor-cells = <0>; ++ thermal: thermal@2c0 { ++ compatible = "brcm,ns-thermal"; ++ reg = <0x2c0 0x10>; ++ #thermal-sensor-cells = <0>; ++ }; ++ }; + }; + + srab: srab@18007000 { diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0010-ARM-dts-BCM5301X-Update-Ethernet-switch-node-name.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0010-ARM-dts-BCM5301X-Update-Ethernet-switch-node-name.patch index 00a5d08f0d..b3a774e340 100644 --- a/target/linux/bcm53xx/patches-5.4/034-v5.11-0010-ARM-dts-BCM5301X-Update-Ethernet-switch-node-name.patch +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0010-ARM-dts-BCM5301X-Update-Ethernet-switch-node-name.patch @@ -21,8 +21,8 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -484,7 +484,7 @@ - #thermal-sensor-cells = <0>; +@@ -485,7 +485,7 @@ + }; }; - srab: srab@18007000 { diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch index 044504796c..677e94f271 100644 --- a/target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch @@ -71,7 +71,7 @@ Signed-off-by: Florian Fainelli +}; --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -485,7 +485,7 @@ +@@ -486,7 +486,7 @@ }; srab: ethernet-switch@18007000 { diff --git a/target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch b/target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch index e05ce88304..6e4f5f7bb8 100644 --- a/target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch +++ b/target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch @@ -155,7 +155,7 @@ Signed-off-by: Florian Fainelli label = "lan4"; --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -491,6 +491,10 @@ +@@ -492,6 +492,10 @@ status = "disabled"; /* ports are defined in board DTS */ diff --git a/target/linux/bcm53xx/patches-5.4/036-v5.14-0001-ARM-dts-BCM5301X-Fix-NAND-nodes-names.patch b/target/linux/bcm53xx/patches-5.4/036-v5.14-0001-ARM-dts-BCM5301X-Fix-NAND-nodes-names.patch index ac45409c63..48cceee743 100644 --- a/target/linux/bcm53xx/patches-5.4/036-v5.14-0001-ARM-dts-BCM5301X-Fix-NAND-nodes-names.patch +++ b/target/linux/bcm53xx/patches-5.4/036-v5.14-0001-ARM-dts-BCM5301X-Fix-NAND-nodes-names.patch @@ -53,7 +53,7 @@ Signed-off-by: Florian Fainelli #address-cells = <1>; --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -502,7 +502,7 @@ +@@ -503,7 +503,7 @@ reg = <0x18004000 0x14>; }; diff --git a/target/linux/bcm53xx/patches-5.4/036-v5.14-0002-ARM-dts-BCM5301X-Fix-pinmux-subnodes-names.patch b/target/linux/bcm53xx/patches-5.4/036-v5.14-0002-ARM-dts-BCM5301X-Fix-pinmux-subnodes-names.patch index aad9aef4a3..d8a4f87c38 100644 --- a/target/linux/bcm53xx/patches-5.4/036-v5.14-0002-ARM-dts-BCM5301X-Fix-pinmux-subnodes-names.patch +++ b/target/linux/bcm53xx/patches-5.4/036-v5.14-0002-ARM-dts-BCM5301X-Fix-pinmux-subnodes-names.patch @@ -28,7 +28,7 @@ Signed-off-by: Florian Fainelli }; --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -440,18 +440,18 @@ +@@ -460,18 +460,18 @@ function = "spi"; }; From 94c2ceed9e9ffaca875f696ff721f947258ba831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 7 Sep 2021 13:22:41 +0200 Subject: [PATCH 10/78] bcm53xx: specify switch ports for more devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit ae33ce2af2b273332017d0b49e37c4224e40a62a) --- ...-Specify-switch-ports-for-more-devic.patch | 289 +++++++++ ...-Specify-switch-ports-for-remaining-.patch | 575 ++++++++++++++++++ 2 files changed, 864 insertions(+) create mode 100644 target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch create mode 100644 target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch diff --git a/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch b/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch new file mode 100644 index 0000000000..211de34af7 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch @@ -0,0 +1,289 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 7 Sep 2021 07:51:17 +0200 +Subject: [PATCH next] ARM: dts: BCM5301X: Specify switch ports for more + devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Those are remaining models I have that didn't have ports yet. All +tested. + +Signed-off-by: Rafał Miłecki +--- + arch/arm/boot/dts/bcm4708-netgear-r6250.dts | 37 ++++++++++++++++ + .../boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 37 ++++++++++++++++ + arch/arm/boot/dts/bcm4709-netgear-r8000.dts | 42 +++++++++++++++++++ + arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts | 42 +++++++++++++++++++ + arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | 37 ++++++++++++++++ + arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | 37 ++++++++++++++++ + 6 files changed, 232 insertions(+) + +--- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +@@ -94,3 +94,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan1"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +@@ -117,3 +117,40 @@ + }; + }; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -187,3 +187,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -118,3 +118,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan1"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts +@@ -68,3 +68,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan4"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan1"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts +@@ -68,3 +68,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan4"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan1"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch new file mode 100644 index 0000000000..0c8a5c63cd --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -0,0 +1,575 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] ARM: dts: BCM5301X: Specify switch ports for remaining + devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki +--- + +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +@@ -93,3 +93,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +@@ -83,3 +83,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +@@ -149,3 +149,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +@@ -46,3 +46,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +@@ -42,3 +42,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +@@ -86,3 +86,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts ++++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +@@ -77,3 +77,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -68,6 +68,38 @@ + status = "okay"; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ label = "cpu"; ++ ethernet = <&gmac1>; ++ }; ++ }; ++}; ++ + &nandcs { + partitions { + compatible = "fixed-partitions"; +--- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts ++++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +@@ -132,3 +132,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -49,3 +49,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +@@ -106,3 +106,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts ++++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +@@ -94,3 +94,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -38,6 +38,38 @@ + status = "okay"; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &nandcs { + partitions { + compatible = "fixed-partitions"; From 494b889af8e374a33748a03404bb990faaa889f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 22 Sep 2021 22:01:10 +0200 Subject: [PATCH 11/78] bcm53xx: backport early DT patches queued for 5.16 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 366be2183e90b6ea8110d7236f8a93c8028573f8) --- ...SP-Add-bcm958623hr-board-name-to-dts.patch | 27 ++ ...-ARM-dts-NSP-Fix-MDIO-mux-node-names.patch | 47 ++++ ...s-NSP-Fix-MX64-MX65-eeprom-node-name.patch | 28 ++ ...M-dts-NSP-Fix-MX65-MDIO-mux-warnings.patch | 52 ++++ ...Specify-switch-ports-for-more-devic.patch} | 7 +- ...-Describe-on-SoC-BCM53125-rev-4-swit.patch | 44 ++++ ...-BCM53573-Add-Tenda-AC9-switch-ports.patch | 59 +++++ ...Specify-switch-ports-for-Meraki-MR32.patch | 57 +++++ ...3016-MR32-get-mac-address-from-nvmem.patch | 41 +++ ...ts-BCM5301X-Add-DT-for-Asus-RT-AC88U.patch | 242 ++++++++++++++++++ ...RM-BCM5301X-Add-DT-for-Netgear-R7900.patch | 2 +- 11 files changed, 602 insertions(+), 4 deletions(-) create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0013-ARM-dts-NSP-Add-bcm958623hr-board-name-to-dts.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0015-ARM-dts-NSP-Fix-MDIO-mux-node-names.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0016-ARM-dts-NSP-Fix-MX64-MX65-eeprom-node-name.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0017-ARM-dts-NSP-Fix-MX65-MDIO-mux-warnings.patch rename target/linux/bcm53xx/patches-5.4/{130-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch => 037-v5.16-0018-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch} (94%) create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0020-ARM-dts-BCM53573-Add-Tenda-AC9-switch-ports.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0021-ARM-BCM53016-Specify-switch-ports-for-Meraki-MR32.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0022-ARM-BCM53016-MR32-get-mac-address-from-nvmem.patch create mode 100644 target/linux/bcm53xx/patches-5.4/037-v5.16-0023-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC88U.patch diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0013-ARM-dts-NSP-Add-bcm958623hr-board-name-to-dts.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0013-ARM-dts-NSP-Add-bcm958623hr-board-name-to-dts.patch new file mode 100644 index 0000000000..c5f28474e3 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0013-ARM-dts-NSP-Add-bcm958623hr-board-name-to-dts.patch @@ -0,0 +1,27 @@ +From 695717eb4c61173d05a277e37132b5e2c6531bf1 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 29 Aug 2021 22:37:47 +0000 +Subject: [PATCH] ARM: dts: NSP: Add bcm958623hr board name to dts + +This board was previously added to +Documentation/devicetree/bindings/arm/bcm/brcm,nsp.yaml +however the dts file was not updated to reflect this change. This patch +corrects bcm958623hr.dts by adding the board name to the compatible. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958623hr.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm958623hr.dts ++++ b/arch/arm/boot/dts/bcm958623hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Plus SVK (BCM958623HR)"; +- compatible = "brcm,bcm58623", "brcm,nsp"; ++ compatible = "brcm,bcm958623hr", "brcm,bcm58623", "brcm,nsp"; + + chosen { + stdout-path = "serial0:115200n8"; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0015-ARM-dts-NSP-Fix-MDIO-mux-node-names.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0015-ARM-dts-NSP-Fix-MDIO-mux-node-names.patch new file mode 100644 index 0000000000..0d9311114f --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0015-ARM-dts-NSP-Fix-MDIO-mux-node-names.patch @@ -0,0 +1,47 @@ +From 38f8111369f318a538e9d4d89d8e48030c22fb40 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 29 Aug 2021 22:37:49 +0000 +Subject: [PATCH] ARM: dts: NSP: Fix MDIO mux node names + +While functional, the mdio-mux-mmioreg binding does not conform to +Documentation/devicetree/bindings/net/mdio-mux-mmioreg.yaml in that an +mdio-mux compatible is also required. Without this the following output +is observed when running dtbs_check: + +mdio-mux@32000: compatible: ['mdio-mux-mmioreg'] is too short + +This change brings conformance to this requirement and corresponds +likewise to Rafal Milecki's change to the BCM5301x platform[1]. + +[1] https://lore.kernel.org/linux-arm-kernel/20210822191256.3715003-1-f.fainelli@gmail.com/T/ + +Signed-off-by: Matthew Hagan +Reviewed-by: Andrew Lunn +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -369,7 +369,7 @@ + }; + + mdio-mux@32000 { +- compatible = "mdio-mux-mmioreg"; ++ compatible = "mdio-mux-mmioreg", "mdio-mux"; + reg = <0x32000 0x4>; + mux-mask = <0x200>; + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -72,7 +72,7 @@ + }; + + mdio-mii-mux { +- compatible = "mdio-mux-mmioreg"; ++ compatible = "mdio-mux-mmioreg", "mdio-mux"; + reg = <0x1803f1c0 0x4>; + mux-mask = <0x2000>; + mdio-parent-bus = <&mdio_ext>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0016-ARM-dts-NSP-Fix-MX64-MX65-eeprom-node-name.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0016-ARM-dts-NSP-Fix-MX64-MX65-eeprom-node-name.patch new file mode 100644 index 0000000000..4cffad1f4e --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0016-ARM-dts-NSP-Fix-MX64-MX65-eeprom-node-name.patch @@ -0,0 +1,28 @@ +From 56e4e548427240d85fd220460d0ab5987e1dec00 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 29 Aug 2021 22:37:50 +0000 +Subject: [PATCH] ARM: dts: NSP: Fix MX64/MX65 eeprom node name + +Running dtbs_check yields the following message when checking the +MX64/MX65 devicetree: +at24@50: $nodename:0: 'at24@50' does not match '^eeprom@[0-9a-f]{1,2}$' + +This patch fixes the issue by renaming the at24 node appropriately. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi +@@ -48,7 +48,7 @@ + &i2c0 { + status = "okay"; + +- at24@50 { ++ eeprom@50 { + compatible = "atmel,24c64"; + reg = <0x50>; + pagesize = <32>; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0017-ARM-dts-NSP-Fix-MX65-MDIO-mux-warnings.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0017-ARM-dts-NSP-Fix-MX65-MDIO-mux-warnings.patch new file mode 100644 index 0000000000..cad7388685 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0017-ARM-dts-NSP-Fix-MX65-MDIO-mux-warnings.patch @@ -0,0 +1,52 @@ +From f5fc9044e5d45a4d97b5240c8723f4677f647c9f Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Sun, 29 Aug 2021 22:37:51 +0000 +Subject: [PATCH] ARM: dts: NSP: Fix MX65 MDIO mux warnings + +The naming of this node is based upon that of the initial EA9500 dts[1]. +However this does not conform with the mdio-mux format, yielding the +following message when running dtbs_check: +mdio-mii-mux: $nodename:0: 'mdio-mii-mux' does not match '^mdio-mux[\\-@]?' + +Secondly, this node should be moved to within the axi node and given the +appropriate unit address. This also requires exposing the axi node via a +label in bcm-nsp.dtsi. This fixes the following warning: +Warning (unit_address_vs_reg): /mdio-mii-mux: node has a reg or ranges property, but no unit name + +[1]https://patchwork.ozlabs.org/project/linux-imx/patch/20180618174159.86150-1-npcomplete13@gmail.com/#1941353 + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 6 ++++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -166,7 +166,7 @@ + }; + }; + +- axi@18000000 { ++ axi: axi@18000000 { + compatible = "simple-bus"; + ranges = <0x00000000 0x18000000 0x0011c40c>; + #address-cells = <1>; +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -70,10 +70,12 @@ + gpios = <&gpioa 31 GPIO_ACTIVE_HIGH>; + }; + }; ++}; + +- mdio-mii-mux { ++&axi { ++ mdio-mux@3f1c0 { + compatible = "mdio-mux-mmioreg", "mdio-mux"; +- reg = <0x1803f1c0 0x4>; ++ reg = <0x3f1c0 0x4>; + mux-mask = <0x2000>; + mdio-parent-bus = <&mdio_ext>; + #address-cells = <1>; diff --git a/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0018-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch similarity index 94% rename from target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch rename to target/linux/bcm53xx/patches-5.4/037-v5.16-0018-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch index 211de34af7..b309771369 100644 --- a/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0018-ARM-dts-BCM5301X-Specify-switch-ports-for-more-devic.patch @@ -1,7 +1,7 @@ +From 225ffaf3d0e00daa2d0c7b68e8fd731ebbde3c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Tue, 7 Sep 2021 07:51:17 +0200 -Subject: [PATCH next] ARM: dts: BCM5301X: Specify switch ports for more - devices +Date: Tue, 7 Sep 2021 08:00:48 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Specify switch ports for more devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,6 +10,7 @@ Those are remaining models I have that didn't have ports yet. All tested. Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli --- arch/arm/boot/dts/bcm4708-netgear-r6250.dts | 37 ++++++++++++++++ .../boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 37 ++++++++++++++++ diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch new file mode 100644 index 0000000000..3a5438c228 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch @@ -0,0 +1,44 @@ +From 9fb90ae6cae7f8fe4fbf626945f32cd9da2c3892 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 20 Sep 2021 16:10:23 +0200 +Subject: [PATCH] ARM: dts: BCM53573: Describe on-SoC BCM53125 rev 4 switch +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BCM53573 family SoC have Ethernet switch connected to the first Ethernet +controller (accessible over MDIO). + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53573.dtsi | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/arch/arm/boot/dts/bcm53573.dtsi ++++ b/arch/arm/boot/dts/bcm53573.dtsi +@@ -180,6 +180,24 @@ + + gmac0: ethernet@5000 { + reg = <0x5000 0x1000>; ++ ++ mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ switch: switch@1e { ++ compatible = "brcm,bcm53125"; ++ reg = <0x1e>; ++ ++ status = "disabled"; ++ ++ /* ports are defined in board DTS */ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ }; ++ }; + }; + + gmac1: ethernet@b000 { diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0020-ARM-dts-BCM53573-Add-Tenda-AC9-switch-ports.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0020-ARM-dts-BCM53573-Add-Tenda-AC9-switch-ports.patch new file mode 100644 index 0000000000..c6d995723c --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0020-ARM-dts-BCM53573-Add-Tenda-AC9-switch-ports.patch @@ -0,0 +1,59 @@ +From 64612828628cca6e3992e421f45c242dc6625647 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 20 Sep 2021 16:10:24 +0200 +Subject: [PATCH] ARM: dts: BCM53573: Add Tenda AC9 switch ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This router has 1 WAN and 4 LAN ports. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 37 ++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +--- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts ++++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts +@@ -105,3 +105,40 @@ + }; + }; + }; ++ ++&switch { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0021-ARM-BCM53016-Specify-switch-ports-for-Meraki-MR32.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0021-ARM-BCM53016-Specify-switch-ports-for-Meraki-MR32.patch new file mode 100644 index 0000000000..a65b1992ea --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0021-ARM-BCM53016-Specify-switch-ports-for-Meraki-MR32.patch @@ -0,0 +1,57 @@ +From 6abc4ca5a28070945e0d68cb4160b309bfbf4b8b Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 18 Sep 2021 19:29:30 +0200 +Subject: [PATCH] ARM: BCM53016: Specify switch ports for Meraki MR32 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +the switch identifies itself as a BCM53012 (rev 5)... +This patch has been tested & verified on OpenWrt's +snapshot with Linux 5.10 (didn't test any older kernels). +The MR32 is able to "talk to the network" as before with +OpenWrt's SWITCHDEV b53 driver. + +| b53-srab-switch 18007000.ethernet-switch: found switch: BCM53012, rev 5 +| libphy: dsa slave smi: probed +| b53-srab-switch 18007000.ethernet-switch poe (uninitialized): +| PHY [dsa-0.0:00] driver [Generic PHY] (irq=POLL) +| b53-srab-switch 18007000.ethernet-switch: Using legacy PHYLIB callbacks. +| Please migrate to PHYLINK! +| DSA: tree 0 setup + +Reported-by: Rafał Miłecki +Signed-off-by: Christian Lamparter +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -195,3 +195,25 @@ + }; + }; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "poe"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ ++ fixed-link { ++ speed = <1000>; ++ duplex-full; ++ }; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0022-ARM-BCM53016-MR32-get-mac-address-from-nvmem.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0022-ARM-BCM53016-MR32-get-mac-address-from-nvmem.patch new file mode 100644 index 0000000000..70a18822a9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0022-ARM-BCM53016-MR32-get-mac-address-from-nvmem.patch @@ -0,0 +1,41 @@ +From 477ffdbdf389cc91294d66e251cc6f856da5820c Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 18 Sep 2021 19:29:31 +0200 +Subject: [PATCH] ARM: BCM53016: MR32: get mac-address from nvmem + +The MAC-Address of the MR32's sole ethernet port is +located in offset 0x66 of the attached AT24C64 eeprom. + +Signed-off-by: Christian Lamparter +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -110,6 +110,12 @@ + reg = <0x50>; + pagesize = <32>; + read-only; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ mac_address: mac-address@66 { ++ reg = <0x66 0x6>; ++ }; + }; + }; + }; +@@ -133,6 +139,11 @@ + */ + }; + ++&gmac0 { ++ nvmem-cell-names = "mac-address"; ++ nvmem-cells = <&mac_address>; ++}; ++ + &gmac1 { + status = "disabled"; + }; diff --git a/target/linux/bcm53xx/patches-5.4/037-v5.16-0023-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC88U.patch b/target/linux/bcm53xx/patches-5.4/037-v5.16-0023-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC88U.patch new file mode 100644 index 0000000000..6fc447b602 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/037-v5.16-0023-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC88U.patch @@ -0,0 +1,242 @@ +From beff77b93452cd2057c859694709dd34a181488f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Tue, 21 Sep 2021 20:19:01 +0800 +Subject: [PATCH] ARM: dts: BCM5301X: Add DT for Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Hardware Info +------------- + +Processor - Broadcom BCM4709C0KFEBG dual-core @ 1.4 GHz +Switch - BCM53012 in BCM4709C0KFEBG & external RTL8365MB +DDR3 RAM - 512 MB +Flash - 128 MB (ESMT F59L1G81LA-25T) +2.4GHz - BCM4366 4×4 2.4/5G single chip 802.11ac SoC +5GHz - BCM4366 4×4 2.4/5G single chip 802.11ac SoC +Ports - 8 Ports, 1 WAN Ports + +Tested on OpenWrt on kernel 5.10 built with DSA driver. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 200 +++++++++++++++++++ + 2 files changed, 201 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -108,6 +108,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4709-netgear-r7000.dtb \ + bcm4709-netgear-r8000.dtb \ + bcm4709-tplink-archer-c9-v1.dtb \ ++ bcm47094-asus-rt-ac88u.dtb \ + bcm47094-dlink-dir-885l.dtb \ + bcm47094-linksys-panamera.dtb \ + bcm47094-luxul-abr-4500.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -0,0 +1,200 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Copyright (C) 2021 Arınç ÜNAL ++ */ ++ ++/dts-v1/; ++ ++#include "bcm47094.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++ ++/ { ++ compatible = "asus,rt-ac88u", "brcm,bcm47094", "brcm,bcm4708"; ++ model = "Asus RT-AC88U"; ++ ++ chosen { ++ bootargs = "earlycon"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x18000000>; ++ }; ++ ++ nvram@1c080000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1c080000 0x00180000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ power { ++ label = "white:power"; ++ gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ wan-red { ++ label = "red:wan"; ++ gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ lan { ++ label = "white:lan"; ++ gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2 { ++ label = "white:usb2"; ++ gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ehci_port2>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ usb3 { ++ label = "white:usb3"; ++ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ehci_port1>, <&xhci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ wps { ++ label = "white:wps"; ++ gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; ++ }; ++ ++ reset { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "Wi-Fi"; ++ linux,code = ; ++ gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led { ++ label = "Backlight"; ++ linux,code = ; ++ gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&srab { ++ compatible = "brcm,bcm53012-srab", "brcm,bcm5301x-srab"; ++ status = "okay"; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan4"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan1"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ sw0_p5: port@5 { ++ reg = <5>; ++ label = "extsw"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ ethernet = <&gmac1>; ++ label = "cpu"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ ethernet = <&gmac2>; ++ label = "cpu"; ++ status = "disabled"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&nandcs { ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "boot"; ++ reg = <0x00000000 0x00080000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "nvram"; ++ reg = <0x00080000 0x00180000>; ++ }; ++ ++ partition@200000 { ++ label = "firmware"; ++ reg = <0x00200000 0x07e00000>; ++ compatible = "brcm,trx"; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch index b0800e50ae..7c67605a88 100644 --- a/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch +++ b/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch @@ -16,7 +16,7 @@ Signed-off-by: Rafał Miłecki + bcm4709-netgear-r7900.dtb \ bcm4709-netgear-r8000.dtb \ bcm4709-tplink-archer-c9-v1.dtb \ - bcm47094-dlink-dir-885l.dtb \ + bcm47094-asus-rt-ac88u.dtb \ --- /dev/null +++ b/arch/arm/boot/dts/bcm4709-netgear-r7900.dts @@ -0,0 +1,42 @@ From 37d535129be0244c11a4f61ef6beb3eadd9dc161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 4 Nov 2021 07:00:21 +0100 Subject: [PATCH 12/78] bcm53xx: add first 5.17 DTS changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 1ee6d3d24e328e29fcf068e90953c760305462d4) --- ...-add-qca8k-falling-edge-PLL-properti.patch | 42 +++++++ ...-remove-unnecessary-address-size-cel.patch | 29 +++++ ...-define-RTL8365MB-switch-on-Asus-RT-.patch | 104 ++++++++++++++++++ 3 files changed, 175 insertions(+) create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0001-ARM-dts-NSP-MX65-add-qca8k-falling-edge-PLL-properti.patch create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0002-ARM-dts-BCM5301X-remove-unnecessary-address-size-cel.patch create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0003-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0001-ARM-dts-NSP-MX65-add-qca8k-falling-edge-PLL-properti.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0001-ARM-dts-NSP-MX65-add-qca8k-falling-edge-PLL-properti.patch new file mode 100644 index 0000000000..a0be1eda4d --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0001-ARM-dts-NSP-MX65-add-qca8k-falling-edge-PLL-properti.patch @@ -0,0 +1,42 @@ +From 58d3d07985c1adab31a3ed76360d016bb1c5b358 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Fri, 15 Oct 2021 23:50:22 +0100 +Subject: [PATCH] ARM: dts: NSP: MX65: add qca8k falling-edge, PLL properties + +This patch enables two properties for the QCA8337 switches on the MX65. + +Set the SGMII transmit clock to falling edge +"qca,sgmii-txclk-falling-edge" to conform to the OEM configuration [1]. + +The new explicit PLL enable option "qca,sgmii-enable-pll" is required +[2]. + +[1] https://git.kernel.org/netdev/net-next/c/6c43809bf1be +[2] https://git.kernel.org/netdev/net-next/c/bbc4799e8bb6 + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -118,6 +118,8 @@ + reg = <0>; + ethernet = <&sgmii1>; + phy-mode = "sgmii"; ++ qca,sgmii-enable-pll; ++ qca,sgmii-txclk-falling-edge; + fixed-link { + speed = <1000>; + full-duplex; +@@ -194,6 +196,8 @@ + reg = <0>; + ethernet = <&sgmii0>; + phy-mode = "sgmii"; ++ qca,sgmii-enable-pll; ++ qca,sgmii-txclk-falling-edge; + fixed-link { + speed = <1000>; + full-duplex; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0002-ARM-dts-BCM5301X-remove-unnecessary-address-size-cel.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0002-ARM-dts-BCM5301X-remove-unnecessary-address-size-cel.patch new file mode 100644 index 0000000000..3c3725adec --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0002-ARM-dts-BCM5301X-remove-unnecessary-address-size-cel.patch @@ -0,0 +1,29 @@ +From 835992e7eca4b29a87c204cefff2f7863fd087f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Wed, 27 Oct 2021 00:57:03 +0800 +Subject: [PATCH] ARM: dts: BCM5301X: remove unnecessary address & size cells + from Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Remove the unnecessary #address-cells & #size-cells in the gpio-keys node +from the device tree of Asus RT-AC88U. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 2 -- + 1 file changed, 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -68,8 +68,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + wps { + label = "WPS"; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0003-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0003-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch new file mode 100644 index 0000000000..562d5a22c7 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0003-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch @@ -0,0 +1,104 @@ +From b6c99228c8edc5e67d8229ba1c5f76cce210ddfc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Wed, 27 Oct 2021 00:57:06 +0800 +Subject: [PATCH] ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define the Realtek RTL8365MB switch without interrupt support on the device +tree of Asus RT-AC88U. + +Signed-off-by: Arınç ÜNAL +Acked-by: Alvin Šipraga +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 77 ++++++++++++++++++++ + 1 file changed, 77 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -93,6 +93,83 @@ + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + }; ++ ++ switch { ++ compatible = "realtek,rtl8365mb"; ++ /* 7 = MDIO (has input reads), 6 = MDC (clock, output only) */ ++ mdc-gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>; ++ mdio-gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; ++ reset-gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; ++ realtek,disable-leds; ++ dsa,member = <1 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ phy-handle = <ðphy0>; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan6"; ++ phy-handle = <ðphy1>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan7"; ++ phy-handle = <ðphy2>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan8"; ++ phy-handle = <ðphy3>; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ ethernet = <&sw0_p5>; ++ phy-mode = "rgmii"; ++ tx-internal-delay-ps = <2000>; ++ rx-internal-delay-ps = <2000>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ }; ++ ++ mdio { ++ compatible = "realtek,smi-mdio"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethphy0: ethernet-phy@0 { ++ reg = <0>; ++ }; ++ ++ ethphy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ ethphy2: ethernet-phy@2 { ++ reg = <2>; ++ }; ++ ++ ethphy3: ethernet-phy@3 { ++ reg = <3>; ++ }; ++ }; ++ }; + }; + + &srab { From 35e470ad0a4080f44f1be888bf552441df0f5d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 18 Nov 2021 16:34:55 +0100 Subject: [PATCH 13/78] bcm53xx: use more upsteam DT patches from 5.16 / 5.17 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 5901917b936d93c8facda6dfec4c5d77f666cbac) --- ...2-convert-to-Broadcom-iProc-I2C-Driv.patch | 104 ++++++++++++++++++ ...CM5301X-update-CRU-block-description.patch | 60 ++++++++++ 2 files changed, 164 insertions(+) create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0004-ARM-BCM53016-MR32-convert-to-Broadcom-iProc-I2C-Driv.patch create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0005-ARM-dts-BCM5301X-update-CRU-block-description.patch diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0004-ARM-BCM53016-MR32-convert-to-Broadcom-iProc-I2C-Driv.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0004-ARM-BCM53016-MR32-convert-to-Broadcom-iProc-I2C-Driv.patch new file mode 100644 index 0000000000..fae0f02cdf --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0004-ARM-BCM53016-MR32-convert-to-Broadcom-iProc-I2C-Driv.patch @@ -0,0 +1,104 @@ +From de7880016665afe7fa7d40e1fafa859260d53ba1 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 28 Oct 2021 09:03:44 +0200 +Subject: [PATCH] ARM: BCM53016: MR32: convert to Broadcom iProc I2C Driver +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +replaces the bit-banged i2c-gpio provided i2c functionality +with the hardware in the SoC. + +During review of the MR32, Florian Fainelli pointed out that the +SoC has a real I2C-controller. Furthermore, the connected pins +(SDA and SCL) would line up perfectly for use. Back then I couldn't +get it working though and I left it with i2c-gpio (which worked). + +Now we know the reason: the interrupt was incorrectly specified. +(Hence, this patch depends on Florian Fainelli's +"ARM: dts: BCM5301X: Fix I2C controller interrupt" patch). + +Cc: Florian Fainelli +Cc: Rafał Miłecki +Cc: Matthew Hagan +Signed-off-by: Christian Lamparter +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 62 ++++++++++------------ + 1 file changed, 28 insertions(+), 34 deletions(-) + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -84,40 +84,6 @@ + max-brightness = <255>; + }; + }; +- +- i2c { +- /* +- * The platform provided I2C does not budge. +- * This is a replacement until I can figure +- * out what are the missing bits... +- */ +- +- compatible = "i2c-gpio"; +- sda-gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; +- scl-gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>; +- i2c-gpio,delay-us = <10>; /* close to 100 kHz */ +- #address-cells = <1>; +- #size-cells = <0>; +- +- current_sense: ina219@45 { +- compatible = "ti,ina219"; +- reg = <0x45>; +- shunt-resistor = <60000>; /* = 60 mOhms */ +- }; +- +- eeprom: eeprom@50 { +- compatible = "atmel,24c64"; +- reg = <0x50>; +- pagesize = <32>; +- read-only; +- #address-cells = <1>; +- #size-cells = <1>; +- +- mac_address: mac-address@66 { +- reg = <0x66 0x6>; +- }; +- }; +- }; + }; + + &uart0 { +@@ -228,3 +194,31 @@ + }; + }; + }; ++ ++&i2c0 { ++ status = "okay"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinmux_i2c>; ++ ++ clock-frequency = <100000>; ++ ++ current_sense: ina219@45 { ++ compatible = "ti,ina219"; ++ reg = <0x45>; ++ shunt-resistor = <60000>; /* = 60 mOhms */ ++ }; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c64"; ++ reg = <0x50>; ++ pagesize = <32>; ++ read-only; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ mac_address: mac-address@66 { ++ reg = <0x66 0x6>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0005-ARM-dts-BCM5301X-update-CRU-block-description.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0005-ARM-dts-BCM5301X-update-CRU-block-description.patch new file mode 100644 index 0000000000..0a817e8fd1 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0005-ARM-dts-BCM5301X-update-CRU-block-description.patch @@ -0,0 +1,60 @@ +From 31fd9b79dc580301c53a001482755ba7e88c2809 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 29 Oct 2021 18:05:23 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: update CRU block description +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This describes CRU in a way matching documentation and fixes: + +arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml: cru@100: $nodename:0: 'cru@100' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$' + From schema: /lib/python3.6/site-packages/dtschema/schemas/simple-bus.yaml + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -423,14 +423,14 @@ + #address-cells = <1>; + #size-cells = <1>; + +- cru@100 { +- compatible = "simple-bus"; ++ cru-bus@100 { ++ compatible = "brcm,ns-cru", "simple-mfd"; + reg = <0x100 0x1a4>; + ranges; + #address-cells = <1>; + #size-cells = <1>; + +- lcpll0: lcpll0@100 { ++ lcpll0: clock-controller@100 { + #clock-cells = <1>; + compatible = "brcm,nsp-lcpll0"; + reg = <0x100 0x14>; +@@ -439,7 +439,7 @@ + "sdio", "ddr_phy"; + }; + +- genpll: genpll@140 { ++ genpll: clock-controller@140 { + #clock-cells = <1>; + compatible = "brcm,nsp-genpll"; + reg = <0x140 0x24>; +@@ -450,6 +450,11 @@ + "sata1", "sata2"; + }; + ++ syscon@180 { ++ compatible = "brcm,cru-clkset", "syscon"; ++ reg = <0x180 0x4>; ++ }; ++ + pinctrl: pin-controller@1c0 { + compatible = "brcm,bcm4708-pinmux"; + reg = <0x1c0 0x24>; From d0748065daec4d95d7d8fa908d4c7c0c72853731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 23 Nov 2021 10:14:22 +0100 Subject: [PATCH 14/78] bcm53xx: use new USB 2.0 PHY binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes: [ 10.440495] bcm_ns_usb2 1800c000.usb2-phy: can't request region for resource [mem 0x1800c000-0x1800cfff] [ 10.450039] bcm_ns_usb2 1800c000.usb2-phy: Failed to map DMU regs [ 10.456183] bcm_ns_usb2: probe of 1800c000.usb2-phy failed with error -16 caused by conflict in allocating resources. Fixes: 44ce70f0e209c ("bcm53xx: drop downstream patch that now breaks pinctrl driver") Signed-off-by: Rafał Miłecki (cherry picked from commit 1d7c1a41987ae463700224c08a3629e4086a8f39) --- ...support-updated-DT-binding-with-PHY-.patch | 131 ++++++++++++++++++ ...-use-non-deprecated-USB-2.0-PHY-bind.patch | 52 +++++++ 2 files changed, 183 insertions(+) create mode 100644 target/linux/bcm53xx/patches-5.4/070-v5.17-phy-bcm-ns-usb2-support-updated-DT-binding-with-PHY-.patch create mode 100644 target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch diff --git a/target/linux/bcm53xx/patches-5.4/070-v5.17-phy-bcm-ns-usb2-support-updated-DT-binding-with-PHY-.patch b/target/linux/bcm53xx/patches-5.4/070-v5.17-phy-bcm-ns-usb2-support-updated-DT-binding-with-PHY-.patch new file mode 100644 index 0000000000..464849bc69 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/070-v5.17-phy-bcm-ns-usb2-support-updated-DT-binding-with-PHY-.patch @@ -0,0 +1,131 @@ +From d3bc6269e21fc474763708e79c7a118740befb94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 26 Oct 2021 11:37:16 +0200 +Subject: [PATCH] phy: bcm-ns-usb2: support updated DT binding with PHY reg + space +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Updated DT binding maps just a PHY's register space instead of the whole +DMU block. Accessing a common CRU reg is handled using syscon & +regmap. + +The old binding has been deprecated and remains supported as a fallback +method. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20211026093716.5567-1-zajec5@gmail.com +Signed-off-by: Vinod Koul +--- + drivers/phy/broadcom/phy-bcm-ns-usb2.c | 52 +++++++++++++++++++++----- + 1 file changed, 43 insertions(+), 9 deletions(-) + +--- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c ++++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c +@@ -9,17 +9,23 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + #include ++#include + #include + + struct bcm_ns_usb2 { + struct device *dev; + struct clk *ref_clk; + struct phy *phy; ++ struct regmap *clkset; ++ void __iomem *base; ++ ++ /* Deprecated binding */ + void __iomem *dmu; + }; + +@@ -27,7 +33,6 @@ static int bcm_ns_usb2_phy_init(struct p + { + struct bcm_ns_usb2 *usb2 = phy_get_drvdata(phy); + struct device *dev = usb2->dev; +- void __iomem *dmu = usb2->dmu; + u32 ref_clk_rate, usb2ctl, usb_pll_ndiv, usb_pll_pdiv; + int err = 0; + +@@ -44,7 +49,10 @@ static int bcm_ns_usb2_phy_init(struct p + goto err_clk_off; + } + +- usb2ctl = readl(dmu + BCMA_DMU_CRU_USB2_CONTROL); ++ if (usb2->base) ++ usb2ctl = readl(usb2->base); ++ else ++ usb2ctl = readl(usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL); + + if (usb2ctl & BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_PDIV_MASK) { + usb_pll_pdiv = usb2ctl; +@@ -58,15 +66,24 @@ static int bcm_ns_usb2_phy_init(struct p + usb_pll_ndiv = (1920000000 * usb_pll_pdiv) / ref_clk_rate; + + /* Unlock DMU PLL settings with some magic value */ +- writel(0x0000ea68, dmu + BCMA_DMU_CRU_CLKSET_KEY); ++ if (usb2->clkset) ++ regmap_write(usb2->clkset, 0, 0x0000ea68); ++ else ++ writel(0x0000ea68, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY); + + /* Write USB 2.0 PLL control setting */ + usb2ctl &= ~BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_MASK; + usb2ctl |= usb_pll_ndiv << BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_SHIFT; +- writel(usb2ctl, dmu + BCMA_DMU_CRU_USB2_CONTROL); ++ if (usb2->base) ++ writel(usb2ctl, usb2->base); ++ else ++ writel(usb2ctl, usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL); + + /* Lock DMU PLL settings */ +- writel(0x00000000, dmu + BCMA_DMU_CRU_CLKSET_KEY); ++ if (usb2->clkset) ++ regmap_write(usb2->clkset, 0, 0x00000000); ++ else ++ writel(0x00000000, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY); + + err_clk_off: + clk_disable_unprepare(usb2->ref_clk); +@@ -91,11 +108,28 @@ static int bcm_ns_usb2_probe(struct plat + return -ENOMEM; + usb2->dev = dev; + +- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmu"); +- usb2->dmu = devm_ioremap_resource(dev, res); +- if (IS_ERR(usb2->dmu)) { +- dev_err(dev, "Failed to map DMU regs\n"); +- return PTR_ERR(usb2->dmu); ++ if (of_find_property(dev->of_node, "brcm,syscon-clkset", NULL)) { ++ usb2->base = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(usb2->base)) { ++ dev_err(dev, "Failed to map control reg\n"); ++ return PTR_ERR(usb2->base); ++ } ++ ++ usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node, ++ "brcm,syscon-clkset"); ++ if (IS_ERR(usb2->clkset)) { ++ dev_err(dev, "Failed to lookup clkset regmap\n"); ++ return PTR_ERR(usb2->clkset); ++ } ++ } else { ++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmu"); ++ usb2->dmu = devm_ioremap_resource(dev, res); ++ if (IS_ERR(usb2->dmu)) { ++ dev_err(dev, "Failed to map DMU regs\n"); ++ return PTR_ERR(usb2->dmu); ++ } ++ ++ dev_warn(dev, "using deprecated DT binding\n"); + } + + usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk"); diff --git a/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch b/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch new file mode 100644 index 0000000000..e50bcd9f25 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch @@ -0,0 +1,52 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 23 Nov 2021 09:55:06 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: use non-deprecated USB 2.0 PHY binding +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The new binding covers a single reg and uses syscon to reference shared +register. + +References: 55b9b741712d ("dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block") +Signed-off-by: Rafał Miłecki +--- + arch/arm/boot/dts/bcm5301x.dtsi | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -148,15 +148,6 @@ + }; + }; + +- usb2_phy: usb2-phy@1800c000 { +- compatible = "brcm,ns-usb2-phy"; +- reg = <0x1800c000 0x1000>; +- reg-names = "dmu"; +- #phy-cells = <0>; +- clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>; +- clock-names = "phy-ref-clk"; +- }; +- + axi@18000000 { + compatible = "brcm,bus-axi"; + reg = <0x18000000 0x1000>; +@@ -450,7 +441,16 @@ + "sata1", "sata2"; + }; + +- syscon@180 { ++ usb2_phy: phy@164 { ++ compatible = "brcm,ns-usb2-phy"; ++ reg = <0x164 0x4>; ++ brcm,syscon-clkset = <&cru_clkset>; ++ clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>; ++ clock-names = "phy-ref-clk"; ++ #phy-cells = <0>; ++ }; ++ ++ cru_clkset: syscon@180 { + compatible = "brcm,cru-clkset", "syscon"; + reg = <0x180 0x4>; + }; From 93ebd966fee4e459d2ddd897cf6d03b2afdad32d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 30 Mar 2022 16:05:55 +0200 Subject: [PATCH 15/78] bcm53xx: backport DT changes from 5.17 & 5.18 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit a721fb9f839b3ca71da275a1c99620ef9342fb28) --- ...use-non-deprecated-USB-2.0-PHY-bind.patch} | 4 +- ...ts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch | 42 +++++++ ...08-ARM-dts-NSP-Rename-SATA-unit-name.patch | 25 ++++ ...-correct-RX-delay-and-enable-flow-co.patch | 45 ++++++++ ...CM5301X-define-RTL8365MB-switch-on-A.patch | 109 ++++++++++++++++++ ...-define-RTL8365MB-switch-on-Asus-RT-.patch | 103 +++++++++++++++++ ...NSP-MX6X-get-mac-address-from-eeprom.patch | 40 +++++++ ...-NSP-MX6X-correct-LED-function-types.patch | 62 ++++++++++ ...-Add-Ethernet-MAC-address-to-Luxul-X.patch | 42 +++++++ 9 files changed, 471 insertions(+), 1 deletion(-) rename target/linux/bcm53xx/patches-5.4/{130-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch => 038-v5.17-0006-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch} (89%) create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0009-ARM-dts-BCM5301X-correct-RX-delay-and-enable-flow-co.patch create mode 100644 target/linux/bcm53xx/patches-5.4/038-v5.17-0010-Revert-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-A.patch create mode 100644 target/linux/bcm53xx/patches-5.4/039-v5.18-0001-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch create mode 100644 target/linux/bcm53xx/patches-5.4/039-v5.18-0002-ARM-dts-NSP-MX6X-get-mac-address-from-eeprom.patch create mode 100644 target/linux/bcm53xx/patches-5.4/039-v5.18-0003-ARM-dts-NSP-MX6X-correct-LED-function-types.patch create mode 100644 target/linux/bcm53xx/patches-5.4/039-v5.18-0004-ARM-dts-BCM5301X-Add-Ethernet-MAC-address-to-Luxul-X.patch diff --git a/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0006-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch similarity index 89% rename from target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch rename to target/linux/bcm53xx/patches-5.4/038-v5.17-0006-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch index e50bcd9f25..e01927bedf 100644 --- a/target/linux/bcm53xx/patches-5.4/130-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0006-ARM-dts-BCM5301X-use-non-deprecated-USB-2.0-PHY-bind.patch @@ -1,5 +1,6 @@ +From 1a46061a2a4130a08841941ce6dcaa32be2ce312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Tue, 23 Nov 2021 09:55:06 +0100 +Date: Tue, 23 Nov 2021 10:03:33 +0100 Subject: [PATCH] ARM: dts: BCM5301X: use non-deprecated USB 2.0 PHY binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -10,6 +11,7 @@ register. References: 55b9b741712d ("dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block") Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli --- arch/arm/boot/dts/bcm5301x.dtsi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch new file mode 100644 index 0000000000..730b989808 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch @@ -0,0 +1,42 @@ +From 69c4e53bdd055ecc27761f6971a50c631ff9072e Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 2 Dec 2021 15:16:27 -0800 +Subject: [PATCH] ARM: dts: NSP: Fixed iProc PCIe MSI sub-node + +Rename the msi controller unit name to 'msi' to avoid collisions with +the 'msi-controller' boolean property. + +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -587,7 +587,7 @@ + status = "disabled"; + + msi-parent = <&msi0>; +- msi0: msi-controller { ++ msi0: msi { + compatible = "brcm,iproc-msi"; + msi-controller; + interrupt-parent = <&gic>; +@@ -624,7 +624,7 @@ + status = "disabled"; + + msi-parent = <&msi1>; +- msi1: msi-controller { ++ msi1: msi { + compatible = "brcm,iproc-msi"; + msi-controller; + interrupt-parent = <&gic>; +@@ -661,7 +661,7 @@ + status = "disabled"; + + msi-parent = <&msi2>; +- msi2: msi-controller { ++ msi2: msi { + compatible = "brcm,iproc-msi"; + msi-controller; + interrupt-parent = <&gic>; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch new file mode 100644 index 0000000000..fd90fbf1f6 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch @@ -0,0 +1,25 @@ +From 9a68c53f875e88edd3403c001ad85f4ac0ed3486 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 7 Dec 2021 10:19:09 -0800 +Subject: [PATCH] ARM: dts: NSP: Rename SATA unit name + +Rename the SATA controller unit name from ahci to sata in preparation +for adding the Broadcom SATA3 controller YAML binding which will bring +validation. + +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm-nsp.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm-nsp.dtsi ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi +@@ -534,7 +534,7 @@ + }; + }; + +- sata: ahci@41000 { ++ sata: sata@41000 { + compatible = "brcm,bcm-nsp-ahci"; + reg-names = "ahci", "top-ctrl"; + reg = <0x41000 0x1000>, <0x40020 0x1c>; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0009-ARM-dts-BCM5301X-correct-RX-delay-and-enable-flow-co.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0009-ARM-dts-BCM5301X-correct-RX-delay-and-enable-flow-co.patch new file mode 100644 index 0000000000..e81ec169b9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0009-ARM-dts-BCM5301X-correct-RX-delay-and-enable-flow-co.patch @@ -0,0 +1,45 @@ +From 5e33f1c4a7cb914a003a304ab8eef705b17aabb7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 17 Dec 2021 00:03:19 +0800 +Subject: [PATCH] ARM: dts: BCM5301X: correct RX delay and enable flow control + on Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The current 'rx-internal-delay-ps' property value on the Realtek switch +node, 2000, will be divided by 300, resulting in 6.66, which will be +rounded to the closest step value, 7. Change it to 2100 to be accurate. +See ef136837aaf6 ("net: dsa: rtl8365mb: set RGMII RX delay in steps of +0.3 ns") for reference. + +Flow control needs to be enabled on both sides of the internal and +external switch. It is already enabled on the CPU port of the Realtek +switch so we also enable it on the external switch port of the Broadcom +switch as well. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -138,7 +138,7 @@ + ethernet = <&sw0_p5>; + phy-mode = "rgmii"; + tx-internal-delay-ps = <2000>; +- rx-internal-delay-ps = <2000>; ++ rx-internal-delay-ps = <2100>; + + fixed-link { + speed = <1000>; +@@ -213,6 +213,7 @@ + fixed-link { + speed = <1000>; + full-duplex; ++ pause; + }; + }; + diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0010-Revert-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-A.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0010-Revert-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-A.patch new file mode 100644 index 0000000000..3d814b1252 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0010-Revert-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-A.patch @@ -0,0 +1,109 @@ +From 8b0c59c622dc4dab970ec63264fb5b152944ac80 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 23 Dec 2021 00:17:17 +0100 +Subject: [PATCH] Revert "ARM: dts: BCM5301X: define RTL8365MB switch on Asus + RT-AC88U" + +This reverts commit 3d2d52a0d1835b56f6bd67d268f6c39df0e41692, it caused +a build regression: + +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:109.4-14: Warning (reg_format): /switch/ports:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:106.9-149.5: Warning (avoid_default_addr_size): /switch/ports: Relying on default #address-cells value +arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:106.9-149.5: Warning (avoid_default_addr_size): /switch/ports: Relying on default #size-cells value + +Reported-by: Stephen Rothwell +Signed-off-by: Arnd Bergmann +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 77 -------------------- + 1 file changed, 77 deletions(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -93,83 +93,6 @@ + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + }; +- +- switch { +- compatible = "realtek,rtl8365mb"; +- /* 7 = MDIO (has input reads), 6 = MDC (clock, output only) */ +- mdc-gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>; +- mdio-gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; +- reset-gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; +- realtek,disable-leds; +- dsa,member = <1 0>; +- +- ports { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <0>; +- +- port@0 { +- reg = <0>; +- label = "lan5"; +- phy-handle = <ðphy0>; +- }; +- +- port@1 { +- reg = <1>; +- label = "lan6"; +- phy-handle = <ðphy1>; +- }; +- +- port@2 { +- reg = <2>; +- label = "lan7"; +- phy-handle = <ðphy2>; +- }; +- +- port@3 { +- reg = <3>; +- label = "lan8"; +- phy-handle = <ðphy3>; +- }; +- +- port@6 { +- reg = <6>; +- label = "cpu"; +- ethernet = <&sw0_p5>; +- phy-mode = "rgmii"; +- tx-internal-delay-ps = <2000>; +- rx-internal-delay-ps = <2100>; +- +- fixed-link { +- speed = <1000>; +- full-duplex; +- pause; +- }; +- }; +- }; +- +- mdio { +- compatible = "realtek,smi-mdio"; +- #address-cells = <1>; +- #size-cells = <0>; +- +- ethphy0: ethernet-phy@0 { +- reg = <0>; +- }; +- +- ethphy1: ethernet-phy@1 { +- reg = <1>; +- }; +- +- ethphy2: ethernet-phy@2 { +- reg = <2>; +- }; +- +- ethphy3: ethernet-phy@3 { +- reg = <3>; +- }; +- }; +- }; + }; + + &srab { diff --git a/target/linux/bcm53xx/patches-5.4/039-v5.18-0001-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch b/target/linux/bcm53xx/patches-5.4/039-v5.18-0001-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch new file mode 100644 index 0000000000..77d3420ff8 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/039-v5.18-0001-ARM-dts-BCM5301X-define-RTL8365MB-switch-on-Asus-RT-.patch @@ -0,0 +1,103 @@ +From 441d531ec9b766f49e01c107a3043235daa4493f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Sun, 2 Jan 2022 23:33:04 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define the Realtek RTL8365MB switch without interrupt support on the device +tree of Asus RT-AC88U. + +Signed-off-by: Arınç ÜNAL +Acked-by: Alvin Šipraga +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 76 ++++++++++++++++++++ + 1 file changed, 76 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -93,6 +93,82 @@ + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + }; ++ ++ switch { ++ compatible = "realtek,rtl8365mb"; ++ /* 7 = MDIO (has input reads), 6 = MDC (clock, output only) */ ++ mdc-gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>; ++ mdio-gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; ++ reset-gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; ++ realtek,disable-leds; ++ dsa,member = <1 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ phy-handle = <ðphy0>; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan6"; ++ phy-handle = <ðphy1>; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan7"; ++ phy-handle = <ðphy2>; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan8"; ++ phy-handle = <ðphy3>; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ ethernet = <&sw0_p5>; ++ phy-mode = "rgmii"; ++ tx-internal-delay-ps = <2000>; ++ rx-internal-delay-ps = <2100>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ }; ++ ++ mdio { ++ compatible = "realtek,smi-mdio"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethphy0: ethernet-phy@0 { ++ reg = <0>; ++ }; ++ ++ ethphy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ ethphy2: ethernet-phy@2 { ++ reg = <2>; ++ }; ++ ++ ethphy3: ethernet-phy@3 { ++ reg = <3>; ++ }; ++ }; ++ }; + }; + + &srab { diff --git a/target/linux/bcm53xx/patches-5.4/039-v5.18-0002-ARM-dts-NSP-MX6X-get-mac-address-from-eeprom.patch b/target/linux/bcm53xx/patches-5.4/039-v5.18-0002-ARM-dts-NSP-MX6X-get-mac-address-from-eeprom.patch new file mode 100644 index 0000000000..19cf1fe952 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/039-v5.18-0002-ARM-dts-NSP-MX6X-get-mac-address-from-eeprom.patch @@ -0,0 +1,40 @@ +From 66848aff05f669e95795b5f3a163f4762781333e Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Wed, 23 Feb 2022 23:50:39 +0000 +Subject: [PATCH] ARM: dts: NSP: MX6X: get mac-address from eeprom + +The MAC address on the MX64/MX65 series is located on the AT24 EEPROM. +This is the same as other Meraki devices such as the MR32 [1]. + +[1] https://lore.kernel.org/linux-arm-kernel/fa8271d02ef74a687f365cebe5c55ec846963ab7.1631986106.git.chunkeey@gmail.com/ + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi +@@ -39,6 +39,8 @@ + + &amac2 { + status = "okay"; ++ nvmem-cells = <&mac_address>; ++ nvmem-cell-names = "mac-address"; + }; + + &ehci0 { +@@ -53,6 +55,12 @@ + reg = <0x50>; + pagesize = <32>; + read-only; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ mac_address: mac-address@66 { ++ reg = <0x66 0x6>; ++ }; + }; + }; + diff --git a/target/linux/bcm53xx/patches-5.4/039-v5.18-0003-ARM-dts-NSP-MX6X-correct-LED-function-types.patch b/target/linux/bcm53xx/patches-5.4/039-v5.18-0003-ARM-dts-NSP-MX6X-correct-LED-function-types.patch new file mode 100644 index 0000000000..2da45ff9da --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/039-v5.18-0003-ARM-dts-NSP-MX6X-correct-LED-function-types.patch @@ -0,0 +1,62 @@ +From 482c85c7fc95c572d368b2214b9e9d2c4a2e5789 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Wed, 23 Feb 2022 23:50:40 +0000 +Subject: [PATCH] ARM: dts: NSP: MX6X: correct LED function types + +Currently, the amber LED will remain always on. This is due to a +misinterpretation of the LED sub-node properties, where-by "default-state" +was used to indicate the initial state when powering on the device. When in +use, however, this resulted in the amber LED always being on. Instead change +this to only indicate a fault state. + +Assign LED_FUNCTION_POWER to the green PWM LED. + +These changes bring the MX64/65 in line with the MR32's devicetree. + +Signed-off-by: Matthew Hagan +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 3 +-- + arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi | 3 +-- + arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi | 2 +- + 3 files changed, 3 insertions(+), 5 deletions(-) + +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -57,10 +57,9 @@ + + led-4 { + /* amber:power */ +- function = LED_FUNCTION_POWER; ++ function = LED_FUNCTION_FAULT; + color = ; + gpios = <&gpioa 3 GPIO_ACTIVE_HIGH>; +- default-state = "on"; + }; + + led-5 { +--- a/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi +@@ -106,10 +106,9 @@ + + led-a { + /* amber:power */ +- function = LED_FUNCTION_POWER; ++ function = LED_FUNCTION_FAULT; + color = ; + gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; +- default-state = "on"; + }; + + led-b { +--- a/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-mx6x-common.dtsi +@@ -22,7 +22,7 @@ + }; + + led-2 { +- function = LED_FUNCTION_INDICATOR; ++ function = LED_FUNCTION_POWER; + color = ; + pwms = <&pwm 2 50000>; + max-brightness = <255>; diff --git a/target/linux/bcm53xx/patches-5.4/039-v5.18-0004-ARM-dts-BCM5301X-Add-Ethernet-MAC-address-to-Luxul-X.patch b/target/linux/bcm53xx/patches-5.4/039-v5.18-0004-ARM-dts-BCM5301X-Add-Ethernet-MAC-address-to-Luxul-X.patch new file mode 100644 index 0000000000..c70fbc398b --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/039-v5.18-0004-ARM-dts-BCM5301X-Add-Ethernet-MAC-address-to-Luxul-X.patch @@ -0,0 +1,42 @@ +From c8442f0fb09ca3d842b9b23d1d0650f649fd10f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 28 Feb 2022 10:52:07 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Add Ethernet MAC address to Luxul + XWR-3150 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Luxul XWR-3150 stores MAC as NVRAM variable. Add NVMEM cell for it and +reference it in the Ethernet interface node. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts +@@ -25,6 +25,9 @@ + nvram@1eff0000 { + compatible = "brcm,nvram"; + reg = <0x1eff0000 0x10000>; ++ ++ et0macaddr: et0macaddr { ++ }; + }; + + leds { +@@ -72,6 +75,11 @@ + }; + }; + ++&gmac0 { ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &usb3 { + vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>; + }; From 40c0d28e84a548212f14749708b5b55ebfcb9b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 10 Nov 2022 09:28:23 +0100 Subject: [PATCH 16/78] bcm53xx: update DTS files with the latest changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 8cdafa149eda4e343905ccf00cad34ff2b52c85b) --- ...ts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch | 6 +- ...08-ARM-dts-NSP-Rename-SATA-unit-name.patch | 2 +- ...301X-Update-pin-controller-node-name.patch | 32 + ...M5301X-Fix-DTC-warning-for-NAND-node.patch | 31 + ...-Remove-cell-properties-from-srab-po.patch | 40 + ...-Add-rgmii-to-port-5-of-Broadcom-swi.patch | 29 + ...-Retrieve-gmac1-MAC-address-from-NVR.patch | 43 + ...-Fix-compatible-strings-for-BCM53012.patch | 65 ++ ...-Disable-gmac0-and-enable-port-8-on-.patch | 39 + ...BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch | 300 ++++++ ...CM5301X-Fix-DTC-warning-for-NAND-nod.patch | 32 + ...-align-gpio-key-node-names-with-dtsc.patch | 912 ++++++++++++++++++ ...roadcom-correct-gpio-keys-properties.patch | 108 +++ ...-Correct-description-of-TP-Link-part.patch | 99 ++ ...4-Add-devicetree-for-D-Link-DIR-890L.patch | 242 +++++ ...-Add-devicetree-for-D-Link-DWL-8610A.patch | 165 ++++ ...-Specify-switch-ports-for-remaining-.patch | 144 ++- ...RM-BCM5301X-Add-DT-for-Netgear-R7900.patch | 2 +- ...power-button-for-Buffalo-WZR-1750DHP.patch | 4 +- .../331-Meraki-MR32-Status-LEDs.patch | 2 +- 20 files changed, 2285 insertions(+), 12 deletions(-) create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0001-ARM-dts-BCM5301X-Update-pin-controller-node-name.patch create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0002-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-node.patch create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0003-ARM-dts-BCM5301X-Remove-cell-properties-from-srab-po.patch create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0004-ARM-dts-BCM5301X-Add-rgmii-to-port-5-of-Broadcom-swi.patch create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0005-ARM-dts-BCM5301X-Retrieve-gmac1-MAC-address-from-NVR.patch create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0006-ARM-dts-BCM5301X-Fix-compatible-strings-for-BCM53012.patch create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0007-ARM-dts-BCM5301X-Disable-gmac0-and-enable-port-8-on-.patch create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0008-ARM-dts-BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch create mode 100644 target/linux/bcm53xx/patches-5.4/040-v5.19-0009-Revert-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-nod.patch create mode 100644 target/linux/bcm53xx/patches-5.4/041-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch create mode 100644 target/linux/bcm53xx/patches-5.4/041-v6.0-0002-ARM-dts-broadcom-correct-gpio-keys-properties.patch create mode 100644 target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch create mode 100644 target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch create mode 100644 target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch index 730b989808..1d28476bc6 100644 --- a/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0007-ARM-dts-NSP-Fixed-iProc-PCIe-MSI-sub-node.patch @@ -13,7 +13,7 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm-nsp.dtsi +++ b/arch/arm/boot/dts/bcm-nsp.dtsi -@@ -587,7 +587,7 @@ +@@ -585,7 +585,7 @@ status = "disabled"; msi-parent = <&msi0>; @@ -22,7 +22,7 @@ Signed-off-by: Florian Fainelli compatible = "brcm,iproc-msi"; msi-controller; interrupt-parent = <&gic>; -@@ -624,7 +624,7 @@ +@@ -622,7 +622,7 @@ status = "disabled"; msi-parent = <&msi1>; @@ -31,7 +31,7 @@ Signed-off-by: Florian Fainelli compatible = "brcm,iproc-msi"; msi-controller; interrupt-parent = <&gic>; -@@ -661,7 +661,7 @@ +@@ -659,7 +659,7 @@ status = "disabled"; msi-parent = <&msi2>; diff --git a/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch b/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch index fd90fbf1f6..887e0da059 100644 --- a/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch +++ b/target/linux/bcm53xx/patches-5.4/038-v5.17-0008-ARM-dts-NSP-Rename-SATA-unit-name.patch @@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm-nsp.dtsi +++ b/arch/arm/boot/dts/bcm-nsp.dtsi -@@ -534,7 +534,7 @@ +@@ -532,7 +532,7 @@ }; }; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0001-ARM-dts-BCM5301X-Update-pin-controller-node-name.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0001-ARM-dts-BCM5301X-Update-pin-controller-node-name.patch new file mode 100644 index 0000000000..690abb9270 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0001-ARM-dts-BCM5301X-Update-pin-controller-node-name.patch @@ -0,0 +1,32 @@ +From 130b5e32ba9d2d2313e39cf3f6d0729bff02b76a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 30 Mar 2022 14:05:27 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Update pin controller node name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: cru-bus@100: 'pin-controller@1c0' does not match any of the regexes: '^clock-controller@[a-f0-9]+$', '^phy@[a-f0-9]+$', '^pinctrl@[a-f0-9]+$', '^syscon@[a-f0-9]+$', '^thermal@[a-f0-9]+$' + From schema: Documentation/devicetree/bindings/mfd/brcm,cru.yaml +arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pin-controller@1c0: $nodename:0: 'pin-controller@1c0' does not match '^(pinctrl|pinmux)(@[0-9a-f]+)?$' + From schema: Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml + +Ref: e7391b021e3f ("dt-bindings: mfd: brcm,cru: Rename pinctrl node") +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -455,7 +455,7 @@ + reg = <0x180 0x4>; + }; + +- pinctrl: pin-controller@1c0 { ++ pinctrl: pinctrl@1c0 { + compatible = "brcm,bcm4708-pinmux"; + reg = <0x1c0 0x24>; + reg-names = "cru_gpio_control"; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0002-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-node.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0002-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-node.patch new file mode 100644 index 0000000000..e61fef8aab --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0002-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-node.patch @@ -0,0 +1,31 @@ +From 90103611d573c5c238350f9b1d7cb682c62f5681 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 1 Apr 2022 13:19:58 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Fix DTC warning for NAND node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Remove the unnecessary #address-cells and #size-cells properties on the +nand@0 node to fix the warning below. + +Warning (avoid_unnecessary_addr_size): /nand-controller@18028000/nand@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property + +Signed-off-by: Arınç ÜNAL +Acked-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | 2 -- + 1 file changed, 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi ++++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi +@@ -10,8 +10,6 @@ + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; +- #address-cells = <1>; +- #size-cells = <1>; + + partitions { + compatible = "brcm,bcm947xx-cfe-partitions"; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0003-ARM-dts-BCM5301X-Remove-cell-properties-from-srab-po.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0003-ARM-dts-BCM5301X-Remove-cell-properties-from-srab-po.patch new file mode 100644 index 0000000000..6ef8720b1d --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0003-ARM-dts-BCM5301X-Remove-cell-properties-from-srab-po.patch @@ -0,0 +1,40 @@ +From e5ff0a7aab3ef5dd8ec7636b936c95179aa5ddfa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 1 Apr 2022 13:19:59 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Remove cell properties from srab ports on + Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Remove #address-cells and #size-cells properties from the ports node of +&srab. They are already defined on bcm5301x.dtsi, there's no need to define +them again. + +Signed-off-by: Arınç ÜNAL +Acked-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* +- * Copyright (C) 2021 Arınç ÜNAL ++ * Copyright (C) 2021-2022 Arınç ÜNAL + */ + + /dts-v1/; +@@ -177,9 +177,6 @@ + dsa,member = <0 0>; + + ports { +- #address-cells = <1>; +- #size-cells = <0>; +- + port@0 { + reg = <0>; + label = "lan4"; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0004-ARM-dts-BCM5301X-Add-rgmii-to-port-5-of-Broadcom-swi.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0004-ARM-dts-BCM5301X-Add-rgmii-to-port-5-of-Broadcom-swi.patch new file mode 100644 index 0000000000..aa192b3a11 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0004-ARM-dts-BCM5301X-Add-rgmii-to-port-5-of-Broadcom-swi.patch @@ -0,0 +1,29 @@ +From 4b7a67420a34ebd8fbf0111221a8bfd8001d418d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 1 Apr 2022 13:20:00 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Add rgmii to port@5 of Broadcom switch on + Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define phy-mode of the Broadcom switch's port@5 as rgmii. This doesn't seem +to matter but let's explicitly define it since phy-mode as rgmii is defined +on the other side which is port@6 of the Realtek switch. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -205,6 +205,7 @@ + sw0_p5: port@5 { + reg = <5>; + label = "extsw"; ++ phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0005-ARM-dts-BCM5301X-Retrieve-gmac1-MAC-address-from-NVR.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0005-ARM-dts-BCM5301X-Retrieve-gmac1-MAC-address-from-NVR.patch new file mode 100644 index 0000000000..4c0858be0a --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0005-ARM-dts-BCM5301X-Retrieve-gmac1-MAC-address-from-NVR.patch @@ -0,0 +1,43 @@ +From 7f7f8c7b9f3cbae1355fb3b0ce4ea9d6f1552521 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Fri, 1 Apr 2022 13:20:01 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Retrieve gmac1 MAC address from NVRAM on + Asus RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The et1macaddr NVRAM variable contains a MAC address for gmac1 on Asus +RT-AC88U. Add NVMEM cell for it and reference it in the gmac1 node. + +Signed-off-by: Arınç ÜNAL +Acked-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -25,6 +25,9 @@ + nvram@1c080000 { + compatible = "brcm,nvram"; + reg = <0x1c080000 0x00180000>; ++ ++ et1macaddr: et1macaddr { ++ }; + }; + + leds { +@@ -239,6 +242,11 @@ + }; + }; + ++&gmac1 { ++ nvmem-cells = <&et1macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &usb2 { + vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; + }; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0006-ARM-dts-BCM5301X-Fix-compatible-strings-for-BCM53012.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0006-ARM-dts-BCM5301X-Fix-compatible-strings-for-BCM53012.patch new file mode 100644 index 0000000000..59e99dae62 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0006-ARM-dts-BCM5301X-Fix-compatible-strings-for-BCM53012.patch @@ -0,0 +1,65 @@ +From 69bb5c6f3f41fe6baa86a775c8a3e69dd27f85d6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Sat, 2 Apr 2022 23:46:21 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Fix compatible strings for BCM53012 and + BCM53016 SoC +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix compatible strings for devicetrees using the BCM53012 and BCM53016 SoC. + +Signed-off-by: Arınç ÜNAL +Acked-by: Krzysztof Kozlowski +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 2 +- + arch/arm/boot/dts/bcm953012er.dts | 2 +- + arch/arm/boot/dts/bcm953012hr.dts | 2 +- + arch/arm/boot/dts/bcm953012k.dts | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -13,7 +13,7 @@ + #include + + / { +- compatible = "meraki,mr32", "brcm,brcm53016", "brcm,bcm4708"; ++ compatible = "meraki,mr32", "brcm,bcm53016", "brcm,bcm4708"; + model = "Meraki MR32"; + + chosen { +--- a/arch/arm/boot/dts/bcm953012er.dts ++++ b/arch/arm/boot/dts/bcm953012er.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar Enterprise Router (BCM953012ER)"; +- compatible = "brcm,bcm953012er", "brcm,brcm53012", "brcm,bcm4708"; ++ compatible = "brcm,bcm953012er", "brcm,bcm53012", "brcm,bcm4708"; + + memory@0 { + device_type = "memory"; +--- a/arch/arm/boot/dts/bcm953012hr.dts ++++ b/arch/arm/boot/dts/bcm953012hr.dts +@@ -37,7 +37,7 @@ + + / { + model = "NorthStar HR (BCM953012HR)"; +- compatible = "brcm,bcm953012hr", "brcm,brcm53012", "brcm,bcm4708"; ++ compatible = "brcm,bcm953012hr", "brcm,bcm53012", "brcm,bcm4708"; + + aliases { + ethernet0 = &gmac0; +--- a/arch/arm/boot/dts/bcm953012k.dts ++++ b/arch/arm/boot/dts/bcm953012k.dts +@@ -36,7 +36,7 @@ + + / { + model = "NorthStar SVK (BCM953012K)"; +- compatible = "brcm,bcm953012k", "brcm,brcm53012", "brcm,bcm4708"; ++ compatible = "brcm,bcm953012k", "brcm,bcm53012", "brcm,bcm4708"; + + aliases { + serial0 = &uart0; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0007-ARM-dts-BCM5301X-Disable-gmac0-and-enable-port-8-on-.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0007-ARM-dts-BCM5301X-Disable-gmac0-and-enable-port-8-on-.patch new file mode 100644 index 0000000000..f75a53777f --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0007-ARM-dts-BCM5301X-Disable-gmac0-and-enable-port-8-on-.patch @@ -0,0 +1,39 @@ +From b9cff8783439ff1803709128af3a0e04c5f5f047 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Sun, 10 Apr 2022 12:44:55 +0300 +Subject: [PATCH] ARM: dts: BCM5301X: Disable gmac0 and enable port@8 on Asus + RT-AC88U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Disable gmac0 which is not connected to any switch MAC. Enable port@8 of +the Broadcom switch which is connected to gmac2. + +Signed-off-by: Arınç ÜNAL +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -232,7 +232,6 @@ + reg = <8>; + ethernet = <&gmac2>; + label = "cpu"; +- status = "disabled"; + + fixed-link { + speed = <1000>; +@@ -242,6 +241,10 @@ + }; + }; + ++&gmac0 { ++ status = "disabled"; ++}; ++ + &gmac1 { + nvmem-cells = <&et1macaddr>; + nvmem-cell-names = "mac-address"; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0008-ARM-dts-BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0008-ARM-dts-BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch new file mode 100644 index 0000000000..959dda35b8 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0008-ARM-dts-BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch @@ -0,0 +1,300 @@ +From 417aea4436bb658d8c5c4dcd0e3c255931d0ee96 Mon Sep 17 00:00:00 2001 +From: SHIMAMOTO Takayoshi +Date: Fri, 22 Apr 2022 00:10:54 +0900 +Subject: [PATCH] ARM: dts: BCM5301X: Add DT for WZR-1166DHP,DHP2 + +Buffalo WZR-1166DHP/WZR-1166DHP2 wireless router with + + - BCM4708A0 + - 128MiB NAND flash + - 2T2R 11ac/a/b/g/n Wi-Fi + - 4x 10/100/1000M ethernet switch + - 1x USB 3.0 port + + WZR-1166DHP and WZR-1166DHP2 have different memory capacity. + + WZR-1166DHP + - 512 MiB DDR2 SDRAM + + WZR-1166DHP2 + - 256 MiB DDR2 SDRAM + + These hardware components are very similar to the WZR-1750DHP + except for the number of antennas. + +Signed-off-by: SHIMAMOTO Takayoshi +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 2 + + .../bcm4708-buffalo-wzr-1166dhp-common.dtsi | 192 ++++++++++++++++++ + .../boot/dts/bcm4708-buffalo-wzr-1166dhp.dts | 26 +++ + .../boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts | 26 +++ + 4 files changed, 246 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi + create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp.dts + create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -89,6 +89,8 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4708-asus-rt-ac56u.dtb \ + bcm4708-asus-rt-ac68u.dtb \ + bcm4708-buffalo-wzr-1750dhp.dtb \ ++ bcm4708-buffalo-wzr-1166dhp.dtb \ ++ bcm4708-buffalo-wzr-1166dhp2.dtb \ + bcm4708-linksys-ea6300-v1.dtb \ + bcm4708-linksys-ea6500-v2.dtb \ + bcm4708-luxul-xap-1510.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi +@@ -0,0 +1,192 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Broadcom BCM470X / BCM5301X ARM platform code. ++ * DTS for Buffalo WZR-1166DHP and WZR-1166DHP2 ++ * ++ * Copyright (C) 2014 Rafał Miłecki ++ * Copyright (C) 2022 SHIMAMOTO Takayoshi ++ */ ++ ++ ++#include "bcm4708.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++#include ++ ++/ { ++ spi { ++ compatible = "spi-gpio"; ++ num-chipselects = <1>; ++ gpio-sck = <&chipcommon 7 0>; ++ gpio-mosi = <&chipcommon 4 0>; ++ cs-gpios = <&chipcommon 6 0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ hc595: gpio_spi@0 { ++ compatible = "fairchild,74hc595"; ++ reg = <0>; ++ registers-number = <1>; ++ spi-max-frequency = <100000>; ++ ++ gpio-controller; ++ #gpio-cells = <2>; ++ ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ usb { ++ /* label = "bcm53xx:blue:usb"; */ ++ function = LED_FUNCTION_USB; ++ color = ; ++ gpios = <&hc595 0 GPIO_ACTIVE_HIGH>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>, ++ <&xhci_port1>, <&ohci_port2>, ++ <&ehci_port2>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ power0 { ++ /* label = "bcm53xx:red:power"; */ ++ function = LED_FUNCTION_FAULT; ++ color = ; ++ gpios = <&hc595 1 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ power1 { ++ /* label = "bcm53xx:white:power"; */ ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&hc595 2 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ router0 { ++ /* label = "bcm53xx:blue:router"; */ ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&hc595 3 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ router1 { ++ /* label = "bcm53xx:amber:router"; */ ++ function = LED_FUNCTION_STATUS; ++ color = ; ++ gpios = <&hc595 4 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ /* label = "bcm53xx:blue:wan"; */ ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&hc595 5 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ wireless0 { ++ /* label = "bcm53xx:blue:wireless"; */ ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&hc595 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wireless1 { ++ /* label = "bcm53xx:amber:wireless"; */ ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&hc595 7 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ aoss { ++ label = "AOSS"; ++ linux,code = ; ++ gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ /* Commit mode set by switch? */ ++ mode { ++ label = "Mode"; ++ linux,code = ; ++ gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; ++ }; ++ ++ /* Switch: AP mode */ ++ sw_ap { ++ label = "AP"; ++ linux,code = ; ++ gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; ++ }; ++ ++ eject { ++ label = "USB eject"; ++ linux,code = ; ++ gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3 { ++ vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_LOW>; ++}; ++ ++&spi_nor { ++ status = "okay"; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp.dts +@@ -0,0 +1,26 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindigs for Buffalo WZR-1166DHP ++ * ++ * Copyright (C) 2022 SHIMAMOTO Takayoshi ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4708-buffalo-wzr-1166dhp-common.dtsi" ++ ++/ { ++ compatible = "buffalo,wzr-1166dhp", "brcm,bcm4708"; ++ model = "Buffalo WZR-1166DHP"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x18000000>; ++ }; ++ ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts +@@ -0,0 +1,26 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device Tree Bindigs for Buffalo WZR-1166DHP2 ++ * ++ * Copyright (C) 2022 SHIMAMOTO Takayoshi ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4708-buffalo-wzr-1166dhp-common.dtsi" ++ ++/ { ++ compatible = "buffalo,wzr-1166dhp2", "brcm,bcm4708"; ++ model = "Buffalo WZR-1166DHP2"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; ++ }; ++ ++}; diff --git a/target/linux/bcm53xx/patches-5.4/040-v5.19-0009-Revert-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-nod.patch b/target/linux/bcm53xx/patches-5.4/040-v5.19-0009-Revert-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-nod.patch new file mode 100644 index 0000000000..cc7e9741a7 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/040-v5.19-0009-Revert-ARM-dts-BCM5301X-Fix-DTC-warning-for-NAND-nod.patch @@ -0,0 +1,32 @@ +From 18176b9d82eebaf4408dc0440f54d57a8cbced83 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 13 May 2022 11:11:07 +0200 +Subject: [PATCH] Revert "ARM: dts: BCM5301X: Fix DTC warning for NAND node" + +This reverts commit 90103611d573, which caused a new DTC warning + +arch/arm/boot/dts/bcm953012hr.dts:57.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@0:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm953012hr.dts:62.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@200000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm953012hr.dts:66.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@600000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm953012hr.dts:70.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@1000000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) +arch/arm/boot/dts/bcm953012hr.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm953012hr.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm953012hr.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' +arch/arm/boot/dts/bcm953012hr.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' + +Signed-off-by: Arnd Bergmann +--- + arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi ++++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi +@@ -10,6 +10,8 @@ + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; ++ #address-cells = <1>; ++ #size-cells = <1>; + + partitions { + compatible = "brcm,bcm947xx-cfe-partitions"; diff --git a/target/linux/bcm53xx/patches-5.4/041-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch b/target/linux/bcm53xx/patches-5.4/041-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch new file mode 100644 index 0000000000..33d675297e --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/041-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch @@ -0,0 +1,912 @@ +From c5aec5611aec8fb1ca68f68e41acaefccfc93c16 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Thu, 9 Jun 2022 13:39:30 +0200 +Subject: [PATCH] ARM: dts: broadcom: align gpio-key node names with dtschema + +The node names should be generic and DT schema expects certain pattern +(e.g. with key/button/switch). + +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts | 6 +++--- + arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts | 8 ++++---- + .../boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi | 10 +++++----- + arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts | 10 +++++----- + arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts | 4 ++-- + arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts | 4 ++-- + arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts | 2 +- + arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts | 2 +- + arch/arm/boot/dts/bcm4708-netgear-r6250.dts | 6 +++--- + arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts | 6 +++--- + arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts | 6 +++--- + arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts | 4 ++-- + arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 8 ++++---- + arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts | 2 +- + arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts | 2 +- + arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | 2 +- + arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | 4 ++-- + arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | 4 ++-- + arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts | 12 ++++++------ + arch/arm/boot/dts/bcm4709-linksys-ea9200.dts | 4 ++-- + arch/arm/boot/dts/bcm4709-netgear-r7000.dts | 6 +++--- + arch/arm/boot/dts/bcm4709-netgear-r8000.dts | 8 ++++---- + arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | 4 ++-- + arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++---- + arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts | 6 +++--- + arch/arm/boot/dts/bcm47094-linksys-panamera.dts | 6 +++--- + arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts | 2 +- + arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts | 2 +- + arch/arm/boot/dts/bcm47094-netgear-r8500.dts | 8 ++++---- + arch/arm/boot/dts/bcm47094-phicomm-k3.dts | 2 +- + arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts | 2 +- + arch/arm/boot/dts/bcm47189-luxul-xap-810.dts | 2 +- + arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 6 +++--- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 2 +- + arch/arm/boot/dts/bcm911360_entphn.dts | 4 ++-- + arch/arm/boot/dts/bcm947189acdbmr.dts | 4 ++-- + arch/arm/boot/dts/bcm953012er.dts | 4 ++-- + arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi | 2 +- + arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi | 2 +- + 43 files changed, 97 insertions(+), 97 deletions(-) + +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +@@ -70,19 +70,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +@@ -54,25 +54,25 @@ + gpio-keys { + compatible = "gpio-keys"; + +- brightness { ++ button-brightness { + label = "Backlight"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi +@@ -104,33 +104,33 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- aoss { ++ button-aoss { + label = "AOSS"; + linux,code = ; + gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>; + }; + + /* Commit mode set by switch? */ +- mode { ++ button-mode { + label = "Mode"; + linux,code = ; + gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; + }; + + /* Switch: AP mode */ +- sw_ap { ++ button-sw-ap { + label = "AP"; + linux,code = ; + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; + }; + +- eject { ++ button-eject { + label = "USB eject"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +@@ -100,33 +100,33 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- aoss { ++ button-aoss { + label = "AOSS"; + linux,code = ; + gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>; + }; + + /* Commit mode set by switch? */ +- mode { ++ button-mode { + label = "Mode"; + linux,code = ; + gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; + }; + + /* Switch: AP mode */ +- sw_ap { ++ button-sw-ap { + label = "AP"; + linux,code = ; + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; + }; + +- eject { ++ button-eject { + label = "USB eject"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +@@ -29,13 +29,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +@@ -25,13 +25,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts +@@ -45,7 +45,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts +@@ -52,7 +52,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +@@ -63,19 +63,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +@@ -59,19 +59,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts ++++ b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts +@@ -94,19 +94,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts ++++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +@@ -60,13 +60,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +@@ -91,26 +91,26 @@ + gpio-keys { + compatible = "gpio-keys"; + +- aoss { ++ button-aoss { + label = "AOSS"; + linux,code = ; + gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + + /* Switch device mode? */ +- mode { ++ button-mode { + label = "Mode"; + linux,code = ; + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; + }; + +- eject { ++ button-eject { + label = "USB eject"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +@@ -96,7 +96,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts +@@ -45,7 +45,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts +@@ -94,7 +94,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts ++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +@@ -77,13 +77,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -50,13 +50,13 @@ + #address-cells = <1>; + #size-cells = <0>; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts ++++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +@@ -80,39 +80,39 @@ + #address-cells = <1>; + #size-cells = <0>; + +- power { ++ button-power { + label = "Power"; + linux,code = ; + gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; + }; + +- aoss { ++ button-aoss { + label = "AOSS"; + linux,code = ; + gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; + }; + + /* Commit mode set by switch? */ +- mode { ++ button-mode { + label = "Mode"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; + }; + + /* Switch: AP mode */ +- sw_ap { ++ button-sw-ap { + label = "AP"; + linux,code = ; + gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; + }; + +- eject { ++ button-eject { + label = "USB eject"; + linux,code = ; + gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -32,13 +32,13 @@ + #address-cells = <1>; + #size-cells = <0>; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +@@ -75,19 +75,19 @@ + #address-cells = <1>; + #size-cells = <0>; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -102,25 +102,25 @@ + #address-cells = <1>; + #size-cells = <0>; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; + }; + +- brightness { ++ button-brightness { + label = "Backlight"; + linux,code = ; + gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -80,13 +80,13 @@ + #address-cells = <1>; + #size-cells = <0>; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts ++++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +@@ -72,25 +72,25 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; + }; + +- reset { ++ button-reset { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; + }; + +- wifi { ++ button-wifi { + label = "Wi-Fi"; + linux,code = ; + gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>; + }; + +- led { ++ button-led { + label = "Backlight"; + linux,code = ; + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -86,20 +86,20 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + + /* Switch: router / extender */ +- extender { ++ button-extender { + label = "Extender"; + linux,code = ; + gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts ++++ b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts +@@ -30,19 +30,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>; + }; + +- reset { ++ button-reset { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts +@@ -49,7 +49,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts +@@ -43,7 +43,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts +@@ -49,7 +49,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +@@ -37,7 +37,7 @@ + #address-cells = <1>; + #size-cells = <0>; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts +@@ -89,7 +89,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts +@@ -67,7 +67,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts ++++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +@@ -65,25 +65,25 @@ + gpio-keys { + compatible = "gpio-keys"; + +- brightness { ++ button-brightness { + label = "Backlight"; + linux,code = ; + gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; + }; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -22,7 +22,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts ++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +@@ -39,7 +39,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts ++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +@@ -49,7 +49,7 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts ++++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts +@@ -59,19 +59,19 @@ + gpio-keys { + compatible = "gpio-keys"; + +- rfkill { ++ button-rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -50,7 +50,7 @@ + #address-cells = <1>; + #size-cells = <0>; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm911360_entphn.dts ++++ b/arch/arm/boot/dts/bcm911360_entphn.dts +@@ -47,10 +47,10 @@ + stdout-path = "serial0:115200n8"; + }; + +- gpio_keys { ++ gpio-keys { + compatible = "gpio-keys"; + +- hook { ++ button-hook { + label = "HOOK"; + linux,code = ; + gpios = <&gpio_asiu 48 0>; +--- a/arch/arm/boot/dts/bcm947189acdbmr.dts ++++ b/arch/arm/boot/dts/bcm947189acdbmr.dts +@@ -44,13 +44,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; + }; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm953012er.dts ++++ b/arch/arm/boot/dts/bcm953012er.dts +@@ -47,13 +47,13 @@ + gpio-keys { + compatible = "gpio-keys"; + +- wps { ++ button-wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; + }; + +- restart { ++ button-restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi +@@ -13,7 +13,7 @@ + autorepeat; + poll-interval = <20>; + +- reset { ++ button-reset { + label = "reset"; + linux,code = ; + gpios = <&gpioa 8 GPIO_ACTIVE_LOW>; +--- a/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi ++++ b/arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi +@@ -14,7 +14,7 @@ + autorepeat; + poll-interval = <20>; + +- reset { ++ button-reset { + label = "reset"; + linux,code = ; + gpios = <&gpioa 6 GPIO_ACTIVE_LOW>; diff --git a/target/linux/bcm53xx/patches-5.4/041-v6.0-0002-ARM-dts-broadcom-correct-gpio-keys-properties.patch b/target/linux/bcm53xx/patches-5.4/041-v6.0-0002-ARM-dts-broadcom-correct-gpio-keys-properties.patch new file mode 100644 index 0000000000..7bded431b0 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/041-v6.0-0002-ARM-dts-broadcom-correct-gpio-keys-properties.patch @@ -0,0 +1,108 @@ +From d634a6969c03803a945fdc2bccbe7d813420e569 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Thu, 9 Jun 2022 13:39:31 +0200 +Subject: [PATCH] ARM: dts: broadcom: correct gpio-keys properties + +gpio-keys children do not use unit addresses. + +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | 2 -- + arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts | 2 -- + arch/arm/boot/dts/bcm4709-linksys-ea9200.dts | 2 -- + arch/arm/boot/dts/bcm4709-netgear-r7000.dts | 2 -- + arch/arm/boot/dts/bcm4709-netgear-r8000.dts | 2 -- + arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | 2 -- + arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts | 2 -- + arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 2 -- + 8 files changed, 16 deletions(-) + +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -47,8 +47,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-wps { + label = "WPS"; +--- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts ++++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +@@ -77,8 +77,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-power { + label = "Power"; +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -29,8 +29,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-wps { + label = "WPS"; +--- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +@@ -72,8 +72,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-wps { + label = "WPS"; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -99,8 +99,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-rfkill { + label = "WiFi"; +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -77,8 +77,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-wps { + label = "WPS"; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +@@ -34,8 +34,6 @@ + + gpio-keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-restart { + label = "Reset"; +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -47,8 +47,6 @@ + + keys { + compatible = "gpio-keys"; +- #address-cells = <1>; +- #size-cells = <0>; + + button-restart { + label = "Reset"; diff --git a/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch new file mode 100644 index 0000000000..4c4ed036b9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch @@ -0,0 +1,99 @@ +From c8ee9f119bfb4244f76c9971c341ec06b49332cd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 8 Nov 2022 12:07:08 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Correct description of TP-Link partitions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +TP-Link routers have flash space partitioned according to the partitions +table. It may look like fixed partitioning but those partitions can be +actually reorganized. New can be added (or some removed), offsets and +sizes may change. + +Fix DT to use binding for the TP-Link SafeLoader partitioning method. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20221108110708.13693-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../boot/dts/bcm47081-tplink-archer-c5-v2.dts | 25 ++++--------------- + .../boot/dts/bcm4709-tplink-archer-c9-v1.dts | 25 ++++--------------- + 2 files changed, 10 insertions(+), 40 deletions(-) + +--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts ++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +@@ -95,30 +95,15 @@ + status = "okay"; + + partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; ++ compatible = "tplink,safeloader-partitions"; ++ partitions-table-offset = <0xe50000>; + +- boot@0 { +- label = "boot"; +- reg = <0x000000 0x040000>; +- read-only; +- }; +- +- os-image@100000 { +- label = "os-image"; +- reg = <0x040000 0x200000>; ++ partition-os-image { + compatible = "brcm,trx"; + }; + +- rootfs@240000 { +- label = "rootfs"; +- reg = <0x240000 0xc00000>; +- }; +- +- nvram@ff0000 { +- label = "nvram"; +- reg = <0xff0000 0x010000>; ++ partition-file-system { ++ linux,rootfs; + }; + }; + }; +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -104,30 +104,15 @@ + status = "okay"; + + partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; ++ compatible = "tplink,safeloader-partitions"; ++ partitions-table-offset = <0xe50000>; + +- boot@0 { +- label = "boot"; +- reg = <0x000000 0x040000>; +- read-only; +- }; +- +- os-image@100000 { +- label = "os-image"; +- reg = <0x040000 0x200000>; ++ partition-os-image { + compatible = "brcm,trx"; + }; + +- rootfs@240000 { +- label = "rootfs"; +- reg = <0x240000 0xc00000>; +- }; +- +- nvram@ff0000 { +- label = "nvram"; +- reg = <0xff0000 0x010000>; ++ partition-file-system { ++ linux,rootfs; + }; + }; + }; diff --git a/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch new file mode 100644 index 0000000000..3e3b4f84f6 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch @@ -0,0 +1,242 @@ +From b1ba87897ceda8e49a47aa92832dd7bff8583e21 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Mon, 7 Nov 2022 14:41:04 +0100 +Subject: [PATCH] ARM: dts: bcm47094: Add devicetree for D-Link DIR-890L + +This adds a device tree for the D-Link DIR-890L. This device +is very similar to D-Link DIR-885L, the differences are detailed +as a comment in the DTS file. + +Signed-off-by: Linus Walleij +Link: https://lore.kernel.org/r/20221107134104.1422169-2-linus.walleij@linaro.org +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts | 211 ++++++++++++++++++ + 2 files changed, 212 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -112,6 +112,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4709-tplink-archer-c9-v1.dtb \ + bcm47094-asus-rt-ac88u.dtb \ + bcm47094-dlink-dir-885l.dtb \ ++ bcm47094-dlink-dir-890l.dtb \ + bcm47094-linksys-panamera.dtb \ + bcm47094-luxul-abr-4500.dtb \ + bcm47094-luxul-xap-1610.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts +@@ -0,0 +1,211 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device tree for D-Link DIR-890L ++ * D-Link calls this board "WRGAC36" ++ * this router has the same looks and form factor as D-Link DIR-885L. ++ * ++ * Some differences from DIR-885L include a separate USB2 port, separate LEDs ++ * for USB2 and USB3, a separate VCC supply for the USB2 slot and no ++ * router/extender switch is mounted (there is an empty mount point on the ++ * PCB) so this device is a pure router. Also the LAN ports are in the right ++ * order. ++ * ++ * Based on the device tree for DIR-885L ++ * Copyright (C) 2016 Rafał Miłecki ++ * Copyright (C) 2022 Linus Walleij ++ */ ++ ++/dts-v1/; ++ ++#include "bcm47094.dtsi" ++#include "bcm5301x-nand-cs0-bch1.dtsi" ++ ++/ { ++ compatible = "dlink,dir-890l", "brcm,bcm47094", "brcm,bcm4708"; ++ model = "D-Link DIR-890L"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200 earlycon"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; ++ }; ++ ++ leds { ++ /* ++ * LED information is derived from the boot log which ++ * conveniently lists all the LEDs. ++ */ ++ compatible = "gpio-leds"; ++ ++ power-white { ++ label = "bcm53xx:white:power"; ++ gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ wan-white { ++ label = "bcm53xx:white:wan"; ++ gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ power-amber { ++ label = "bcm53xx:amber:power"; ++ gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wan-amber { ++ label = "bcm53xx:amber:wan"; ++ gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb3-white { ++ label = "bcm53xx:white:usb3"; ++ gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&xhci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ usb2-white { ++ label = "bcm53xx:white:usb2"; ++ gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ 2ghz { ++ label = "bcm53xx:white:2ghz"; ++ gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; ++ }; ++ ++ 5ghz { ++ label = "bcm53xx:white:5ghz"; ++ gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ button-wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; ++ }; ++ ++ /* Called "factory reset" in the vendor dmesg */ ++ button-restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ /* ++ * The flash memory is memory mapped at 0x1e000000-0x1fffffff ++ * 64KB blocks; total size 2MB, same that can be ++ * found attached to the spi_nor SPI controller. ++ */ ++ nvram@1e1f0000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e1f0000 0x00010000>; ++ ++ et0macaddr: et0macaddr { ++ }; ++ }; ++}; ++ ++&gmac2 { ++ /* ++ * The NVRAM curiously does not contain a MAC address ++ * for et2 so since that is the only ethernet interface ++ * actually in use on the platform, we use this et0 MAC ++ * address for et2. ++ */ ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&spi_nor { ++ status = "okay"; ++}; ++ ++&nandcs { ++ /* Spansion S34ML01G2, 128MB with 128KB erase blocks */ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ /* ++ * This is called "nflash" in the vendor kernel with ++ * "upgrade" and "rootfs" (probably using OpenWrt ++ * splitpart). We call it "firmware" like standard tools ++ * assume. The CFE loader contains incorrect information ++ * about TRX partitions, ignore this, there are no TRX ++ * partitions: this device uses SEAMA. ++ */ ++ firmware@0 { ++ label = "firmware"; ++ reg = <0x00000000 0x08000000>; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpios = <&chipcommon 21 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3 { ++ vcc-gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ phy-mode = "rgmii"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch new file mode 100644 index 0000000000..6102963f82 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/042-v6.1-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch @@ -0,0 +1,165 @@ +From 9f66e1dd82e3186aee95282657512ca2aef1afe0 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Wed, 19 Oct 2022 21:34:49 +0200 +Subject: [PATCH] ARM: dts: bcm53016: Add devicetree for D-Link DWL-8610AP + +This adds a device tree for the BCM53016-based D-Link DWL-8610AP +access point wireless router. + +The TRX-format partitions had to be named "firmware" due to +an OpenWrt patch that only accepts parting such nodes if they +are named "firmware". + +Signed-off-by: Linus Walleij +Link: https://lore.kernel.org/r/20221019193449.3036010-2-linus.walleij@linaro.org +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + .../boot/dts/bcm53016-dlink-dwl-8610ap.dts | 131 ++++++++++++++++++ + 2 files changed, 132 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm53016-dlink-dwl-8610ap.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -122,6 +122,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm47094-luxul-xwr-3150-v1.dtb \ + bcm47094-netgear-r8500.dtb \ + bcm47094-phicomm-k3.dtb \ ++ bcm53016-dlink-dwl-8610ap.dtb \ + bcm53016-meraki-mr32.dtb \ + bcm94708.dtb \ + bcm94709.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm53016-dlink-dwl-8610ap.dts +@@ -0,0 +1,131 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/dts-v1/; ++ ++#include "bcm4709.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++#include ++#include ++ ++/ { ++ model = "D-Link DWL-8610AP"; ++ compatible = "dlink,dwl-8610ap", "brcm,bcm53016", "brcm,bcm4708"; ++ ++ memory@0 { ++ device_type = "memory"; ++ /* 512 MB RAM in 2 x Macronix D9PSH chips */ ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ }; ++ ++ diag { ++ /* Actually "diag" unclear what this means */ ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ wlan-2g { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wlan-5g { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ ++ button-reset { ++ debounce-interval = <100>; ++ wakeup-source; ++ linux,code = ; ++ label = "reset"; ++ /* This GPIO is actually stored in NVRAM, but it's not gonna change */ ++ gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ /* ++ * Flash memory at 0x1e000000-0x1fffffff ++ * Macronix 32 64KB blocks; total size 2MB, same that can be ++ * found attached to the spi_nor SPI controller. ++ */ ++ nvram@1e080000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e080000 0x00020000>; ++ ++ et0macaddr: et0macaddr { ++ }; ++ ++ et1macaddr: et1macaddr { ++ }; ++ }; ++}; ++ ++&gmac0 { ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&gmac1 { ++ nvmem-cells = <&et1macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&spi_nor { ++ /* Serial SPI NOR Flash MX 25L1606E */ ++ status = "okay"; ++}; ++ ++&nandcs { ++ /* ++ * Spansion S34ML01G100TFI00 128 MB NAND Flash memory ++ * ++ * This ECC is a bit unorthodox but it is what the stock firmware ++ * is using, so to be able to mount the original partitions ++ * this is necessary. ++ */ ++ nand-ecc-strength = <5>; ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ /* This is named nflash1.trx in CFE */ ++ trx@0 { ++ label = "firmware"; ++ reg = <0x00000000 0x02800000>; ++ compatible = "brcm,trx"; ++ }; ++ ++ /* This is named nflash1.trx2 in CFE */ ++ trx2@2800000 { ++ label = "firmware2"; ++ reg = <0x02800000 0x02800000>; ++ compatible = "brcm,trx"; ++ }; ++ ++ /* This is named nflash1.rwfs in CFE */ ++ free@5000000 { ++ label = "free"; ++ reg = <0x05000000 0x03000000>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch index 0c8a5c63cd..0fb29e99d3 100644 --- a/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch +++ b/target/linux/bcm53xx/patches-5.4/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -311,7 +311,7 @@ Signed-off-by: Rafał Miłecki +}; --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts -@@ -68,6 +68,38 @@ +@@ -66,6 +66,38 @@ status = "okay"; }; @@ -352,7 +352,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts -@@ -132,3 +132,40 @@ +@@ -130,3 +130,40 @@ &usb3_phy { status = "okay"; }; @@ -395,7 +395,7 @@ Signed-off-by: Rafał Miłecki +}; --- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -@@ -49,3 +49,45 @@ +@@ -47,3 +47,45 @@ &usb3_phy { status = "okay"; }; @@ -443,7 +443,7 @@ Signed-off-by: Rafał Miłecki +}; --- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts -@@ -106,3 +106,40 @@ +@@ -104,3 +104,40 @@ &usb3_phy { status = "okay"; }; @@ -573,3 +573,139 @@ Signed-off-by: Rafał Miłecki &nandcs { partitions { compatible = "fixed-partitions"; +--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts ++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +@@ -91,6 +91,43 @@ + }; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &spi_nor { + status = "okay"; + +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -100,6 +100,43 @@ + vcc-gpio = <&chipcommon 12 GPIO_ACTIVE_HIGH>; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &spi_nor { + status = "okay"; + +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +@@ -107,3 +107,41 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ diff --git a/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch index 7c67605a88..60fc630a49 100644 --- a/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch +++ b/target/linux/bcm53xx/patches-5.4/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch @@ -9,7 +9,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -106,6 +106,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ +@@ -108,6 +108,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ bcm4709-buffalo-wxr-1900dhp.dtb \ bcm4709-linksys-ea9200.dtb \ bcm4709-netgear-r7000.dtb \ diff --git a/target/linux/bcm53xx/patches-5.4/311-ARM-BCM5301X-Add-power-button-for-Buffalo-WZR-1750DHP.patch b/target/linux/bcm53xx/patches-5.4/311-ARM-BCM5301X-Add-power-button-for-Buffalo-WZR-1750DHP.patch index b3cb5de048..9e7398c66d 100644 --- a/target/linux/bcm53xx/patches-5.4/311-ARM-BCM5301X-Add-power-button-for-Buffalo-WZR-1750DHP.patch +++ b/target/linux/bcm53xx/patches-5.4/311-ARM-BCM5301X-Add-power-button-for-Buffalo-WZR-1750DHP.patch @@ -9,12 +9,12 @@ Signed-off-by: Felix Fietkau gpio-keys { compatible = "gpio-keys"; -+ power { ++ button-power { + label = "Power"; + linux,code = ; + gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; + }; + - restart { + button-restart { label = "Reset"; linux,code = ; diff --git a/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch b/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch index fb78ee93c4..92a71e58fe 100644 --- a/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch +++ b/target/linux/bcm53xx/patches-5.4/331-Meraki-MR32-Status-LEDs.patch @@ -17,7 +17,7 @@ Signed-off-by: Christian Lamparter }; leds { -@@ -68,7 +69,7 @@ +@@ -66,7 +67,7 @@ max-brightness = <255>; }; From 88e8ca256bc92765fcd34c7e371163ac38b623f6 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 28 Nov 2022 21:05:54 +0100 Subject: [PATCH 17/78] layerscape: fix compilation error for missing define of dwc quirk Add missing define for dwc quirk patch required to fix compilation error for layerscape target. This was wrongly dropped in a kernel bump. Fixes: 8e5de897691a ("kernel: bump 5.4 to 5.4.213") Signed-off-by: Christian Marangi --- ...dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch index 0e2942a3bc..be6b077e0b 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch @@ -64,8 +64,12 @@ Reviewed-by: Peter Chen --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c -@@ -11,6 +11,44 @@ +@@ -9,8 +9,48 @@ + #include + ++#include "../host/xhci.h" ++ #include "core.h" +#define XHCI_HCSPARAMS1 0x4 @@ -109,7 +113,7 @@ Reviewed-by: Peter Chen static int dwc3_host_get_irq(struct dwc3 *dwc) { struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); -@@ -50,6 +88,13 @@ int dwc3_host_init(struct dwc3 *dwc) +@@ -50,6 +90,13 @@ int dwc3_host_init(struct dwc3 *dwc) struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); int prop_idx = 0; From 1392bec7de92888af06d98d11d306241b2e1f68f Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 29 Nov 2022 16:35:48 +0100 Subject: [PATCH 18/78] procd: add patch to fix compilation error procd complain for an unused verbose variable causing compilation error. Fix this by setting the variable static following upstream procd changes. This is a variant of 0ee73b2c86a853ae3274c7080e2dcd36b81aa1fa that introduced major change and fixed the verbose variable to static. Signed-off-by: Christian Marangi --- ...tion-error-caused-by-unused-variable.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch diff --git a/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch b/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch new file mode 100644 index 0000000000..6c1a21ebea --- /dev/null +++ b/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch @@ -0,0 +1,36 @@ +From 2ddf0005298e08ba1e358d95be6b826c56a7d1fc Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 29 Nov 2022 16:33:23 +0100 +Subject: [PATCH] uxc: fix compilation error caused by unused variable + +Fix compilation error caused by unused verbose variable. + +Signed-off-by: Christian Marangi +--- + uxc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/uxc.c b/uxc.c +index eb40eb2..b22d838 100644 +--- a/uxc.c ++++ b/uxc.c +@@ -80,6 +80,8 @@ static struct blob_buf conf; + static struct blob_buf state; + static struct ubus_context *ctx; + ++static bool verbose = false; ++ + static int usage(void) { + printf("syntax: uxc [parameters ...]\n"); + printf("commands:\n"); +@@ -724,7 +726,6 @@ int main(int argc, char **argv) + char *pidfile = NULL; + bool autostart = false; + bool force = false; +- bool verbose = false; + int signal = SIGTERM; + int c; + +-- +2.37.2 + From 360d756fbf01e0a051ff47223523deffae647afa Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 6 Sep 2022 16:48:37 +0200 Subject: [PATCH 19/78] build: make find_md5 reproducible with AUTOREMOVE While experimenting with the AUTOREMOVE option in search of a way to use prebuilt host tools in different buildroot, it was discovered that the md5 generated by find_md5 in depends.mk is not reproducible. Currently the hash is generated by the path of the file in addition to the file mod time. Out of confusion, probably, there was an idea that such command was used on the package build_dir. Reality is that this command is run on the package files. (Makefile, patches, src) This is problematic because the package Makefile (for example) change at each git clone and base the hash on the Makefile mtime doesn't really reflect if the Makefile actually changes across a buildroot or not. A better approach is to generate an hash of each file and then generate an hash on the sort hash list. This way we remove the problem of git clone setting a wrong mtime while keeping the integrity of checking if a file changed for the package as any change will result in a different hash. Introduce a new kind of find_md5 function, find_md5_reproducible that apply this new logic and limit it only with AUTOREMOVE option set to prevent any kind of slowdown due to additional hash generation. (cherry picked from commit 53a08e37437972ba0a8fbf953a93a70a6b784ef4) [ reworked mkhash to old implementation ] Signed-off-by: Christian Marangi --- include/depends.mk | 1 + include/host-build.mk | 2 +- include/kernel-build.mk | 2 +- include/package.mk | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/depends.mk b/include/depends.mk index 0080b97876..7b87f2643f 100644 --- a/include/depends.mk +++ b/include/depends.mk @@ -12,6 +12,7 @@ DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*" find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | mkhash md5 +find_md5_reproducible=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -print0 | xargs -0 mkhash md5 | sort | mkhash md5 define rdep .PRECIOUS: $(2) diff --git a/include/host-build.mk b/include/host-build.mk index e4a5c48e72..36b3fed1f3 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/depends.mk include $(INCLUDE_DIR)/quilt.mk BUILD_TYPES += host -HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) +HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST)) diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 66a9f64c80..1f440f9ee0 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -10,7 +10,7 @@ ifneq ($(DUMP),1) endif KERNEL_FILE_DEPENDS=$(GENERIC_BACKPORT_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR) -STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,$(KERNEL_FILE_DEPENDS),))) +STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),$(KERNEL_FILE_DEPENDS),))) STAMP_CONFIGURED:=$(LINUX_DIR)/.configured include $(INCLUDE_DIR)/download.mk include $(INCLUDE_DIR)/quilt.mk diff --git a/include/package.mk b/include/package.mk index db0a869dab..389ba4243b 100644 --- a/include/package.mk +++ b/include/package.mk @@ -84,7 +84,7 @@ ifneq ($(PREV_STAMP_PREPARED),) STAMP_PREPARED:=$(PREV_STAMP_PREPARED) CONFIG_AUTOREBUILD:= else - STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS))) + STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS))) endif STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS))) STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_* From 654e0242e426423409a704bfc5f72b64ebd8d283 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 3 Jul 2022 02:06:21 +0200 Subject: [PATCH 20/78] rules_mk: don't include wrapped bin with external toolchains Don't add wrapped bin to the TARGET_PATH as it does cause compilation error. cmake.mk will use the "command -v" and will use the wrapped bin instead of the external toolchain bin as they have the same name and command will select the first result. Signed-off-by: Christian Marangi (cherry picked from commit a90eabf60255773231ed0259e5da5eb6a36fe9ce) --- rules.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.mk b/rules.mk index 7c83d90eda..9c694e17ce 100644 --- a/rules.mk +++ b/rules.mk @@ -212,7 +212,6 @@ ifndef DUMP ifneq ($(TOOLCHAIN_LIB_DIRS),) TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS)) endif - TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(TARGET_PATH) endif endif endif From 56fd8355b078d8c9e1eb0bc0ea20900e7b46fe93 Mon Sep 17 00:00:00 2001 From: Vincent Wiemann Date: Mon, 28 Dec 2020 16:00:13 +0100 Subject: [PATCH 21/78] rules_mk: use gcc versions for external toolchain When using the OpenWrt toolchain as an external toolchain the build failed due to missing LTO support. By choosing the GCC wrappers of the tools this commit makes sure that the LTO-enabled executables are being used. Signed-off-by: Vincent Wiemann [ wrap the commit description to 72 char ] Signed-off-by: Christian Marangi (cherry picked from commit 2555ffb4536e2727465e9a0d426ad3c4f1ef003a) --- rules.mk | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/rules.mk b/rules.mk index 9c694e17ce..631e07af00 100644 --- a/rules.mk +++ b/rules.mk @@ -245,20 +245,13 @@ HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if $(IS_PACKAGE_BUILD),-I$(STAGIN HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS) HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib) -ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) - TARGET_AR:=$(TARGET_CROSS)gcc-ar - TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib - TARGET_NM:=$(TARGET_CROSS)gcc-nm -else - TARGET_AR:=$(TARGET_CROSS)ar - TARGET_RANLIB:=$(TARGET_CROSS)ranlib - TARGET_NM:=$(TARGET_CROSS)nm -endif - BUILD_KEY=$(TOPDIR)/key-build FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot +TARGET_AR:=$(TARGET_CROSS)gcc-ar +TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib +TARGET_NM:=$(TARGET_CROSS)gcc-nm TARGET_CC:=$(TARGET_CROSS)gcc TARGET_CXX:=$(TARGET_CROSS)g++ KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh From 629199f6c8e0dc36484dd17e971f8c1c88b705b1 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 12 Sep 2022 00:31:43 +0200 Subject: [PATCH 22/78] toolchain: Include ./include/fortify for external musl toolchain When building with an external toolcahin with musl also include ./include/fortify by default. This is also done when we build with the internal toolchain using musl libc. Without this extra include the fortify source feature is not working when using an external musl toolchain. All binaries were compiled without fortify source when an external musl toolchain was used. All binaries release done by the OpenWrt project use the internal toolcahin where fortify source is working. Signed-off-by: Hauke Mehrtens (cherry picked from commit 3053045093a5c89dad970b7db3ed9f2a5be993f6) Signed-off-by: Christian Marangi --- toolchain/Config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchain/Config.in b/toolchain/Config.in index 6dda9af92d..c30928854b 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -135,6 +135,7 @@ menuconfig EXTERNAL_TOOLCHAIN string prompt "Toolchain include path" if DEVEL depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "./usr/include ./include/fortify ./include" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL default "./usr/include ./include" help Specify additional directories searched for header files (override From fd7e8e4e7520ac7531c1008a83557c7a04860da5 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 30 Sep 2022 19:36:06 +0200 Subject: [PATCH 23/78] scripts/ext-tools: introduce new script to install prebuilt tools Add a simple script to make it easier to install a prebuilt tools tar. Currently it will be used by our tools container and kernel workflow on github. Simple script that take a tar that contains prebuilt host tools, extract them and refresh the timestamps to skip recompilation of such host tools. By default it refresh timestamps of build_dir/host and staging_dir/host/stamp. Signed-off-by: Christian Marangi (cherry picked from commit 5428bdc2dfaa45bc7adc89c3b9224da7d21961d0) --- scripts/ext-tools.sh | 98 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 scripts/ext-tools.sh diff --git a/scripts/ext-tools.sh b/scripts/ext-tools.sh new file mode 100755 index 0000000000..bf56f4d9ed --- /dev/null +++ b/scripts/ext-tools.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +TOOLS_TAR="" +HOST_BUILD_DIR=$(pwd)/"build_dir/host" +HOST_STAGING_DIR_STAMP=$(pwd)/"staging_dir/host/stamp" + +refresh_timestamps() { + find "$1" -not -type l -print0 | xargs -0 touch +} + +extract_prebuilt_tar() { + tar -xf "$1" +} + +install_prebuilt_tools() { + extract_prebuilt_tar "$TOOLS_TAR" + + if [ ! -d "$HOST_BUILD_DIR" ]; then + echo "Can't find Host Build Dir "$HOST_BUILD_DIR"" >&2 + exit 1 + fi + + refresh_timestamps "$HOST_BUILD_DIR" + sleep 1 + + if [ ! -d "$HOST_STAGING_DIR_STAMP" ]; then + echo "Can't find Host Staging Dir Stamp "$HOST_STAGING_DIR_STAMP"" >&2 + exit 1 + fi + + refresh_timestamps "$HOST_STAGING_DIR_STAMP" + + return 0 +} + +while [ -n "$1" ]; do + arg="$1"; shift + case "$arg" in + --host-build-dir) + [ -d "$1" ] || { + echo "Directory '$1' does not exist." >&2 + exit 1 + } + HOST_BUILD_DIR="$(cd "$1"; pwd)"; shift + ;; + + --host-staging-dir-stamp) + [ -d "$1" ] || { + echo "Directory '$1' does not exist." >&2 + exit 1 + } + HOST_STAGING_DIR_STAMP="$(cd "$1"; pwd)"; shift + ;; + + --tools) + [ -f "$1" ] || { + echo "Tools tar file '$1' does not exist." >&2 + exit 1 + } + TOOLS_TAR="$1"; shift + install_prebuilt_tools + + exit $? + ;; + + -h|--help) + me="$(basename "$0")" + echo -e "\nUsage:\n" >&2 + echo -e " $me --host-build-dir {directory}" >&2 + echo -e " Set to refresh timestamp of this build directory" >&2 + echo -e " with --tools." >&2 + echo -e " THIS OPTION MUST BE SET BEFORE --tools." >&2 + echo -e " If not provided the default directory is:" >&2 + echo -e " $(pwd)/build_dir/host\n" >&2 + echo -e " $me --host-staging-dir-stamp {directory}" >&2 + echo -e " Set to refresh staging timestamp present in this" >&2 + echo -e " directory with --tools." >&2 + echo -e " THIS OPTION MUST BE SET BEFORE --tools." >&2 + echo -e " If not provided the default directory is:" >&2 + echo -e " $(pwd)/staging_dir/host/stamp\n" >&2 + echo -e " $me --tools {tar}" >&2 + echo -e " Install the prebuilt tools present in the passed" >&2 + echo -e " tar and prepare them." >&2 + echo -e " To correctly use them it's needed to update the." >&2 + echo -e " timestamp of each tools to skip recompilation.\n" >&2 + echo -e " $me --help" >&2 + echo -e " Display this help text and exit.\n\n" >&2 + exit 1 + ;; + + *) + echo "Unknown argument '$arg'" >&2 + exec $0 --help + ;; + esac +done + +exec $0 --help From 997ab5437386493aab1ffa9a9e99061a6a4cba4b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Sep 2021 17:58:59 -0400 Subject: [PATCH 24/78] scripts: fix various typos This only affects typos in comments or user-facing output. Signed-off-by: Josh Soref [only picks changes to scripts, drop "commandline" replacement, fix case for "arbitrary", improve commit message] Signed-off-by: Adrian Schmutzler (cherry picked from commit 08622de7d66eb90038de54f34ab2fe2308424fd0) Signed-off-by: Christian Marangi --- scripts/checkpatch.pl | 2 +- scripts/dl_github_archive.py | 4 ++-- scripts/ext-toolchain.sh | 2 +- scripts/json_overview_image_info.py | 2 +- scripts/linksys-image.sh | 4 ++-- scripts/pad_image | 2 +- scripts/sign_images.sh | 4 ++-- scripts/size_compare.sh | 4 ++-- scripts/slugimage.pl | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 81b1ffcb56..2adc5efec5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4697,7 +4697,7 @@ sub process { ## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { ## ## # Remove any bracketed sections to ensure we do not -## # falsly report the parameters of functions. +## # falsely report the parameters of functions. ## my $ln = $line; ## while ($ln =~ s/\([^\(\)]*\)//g) { ## } diff --git a/scripts/dl_github_archive.py b/scripts/dl_github_archive.py index 59fd7067be..b992227dc9 100755 --- a/scripts/dl_github_archive.py +++ b/scripts/dl_github_archive.py @@ -207,7 +207,7 @@ class GitHubCommitTsCache(object): class DownloadGitHubTarball(object): - """Download and repack archive tarabll from GitHub. + """Download and repack archive tarball from GitHub. Compared with the method of packing after cloning the whole repo, this method is more friendly to users with fragile internet connection. @@ -220,7 +220,7 @@ class DownloadGitHubTarball(object): - GitHub archives do not contain source codes for submodules. - - GitHub archives seem to respect .gitattributes and ignore pathes with + - GitHub archives seem to respect .gitattributes and ignore paths with export-ignore attributes. For the first two issues, the method will fail loudly to allow fallback to diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index ee7d9532f5..4da287591a 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -569,7 +569,7 @@ while [ -n "$1" ]; do echo -e " Most commands also take a --cflags parameter which " >&2 echo -e " is used to specify C flags to be passed to the " >&2 echo -e " cross compiler when performing tests." >&2 - echo -e " This paremter may be repeated multiple times." >&2 + echo -e " This parameter may be repeated multiple times." >&2 exit 1 ;; diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index db47fd9e42..89b7d4fe20 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -7,7 +7,7 @@ from sys import argv import json if len(argv) != 2: - print("JSON info files script requires ouput file as argument") + print("JSON info files script requires output file as argument") exit(1) output_path = Path(argv[1]) diff --git a/scripts/linksys-image.sh b/scripts/linksys-image.sh index 36a676d964..c3baf44844 100755 --- a/scripts/linksys-image.sh +++ b/scripts/linksys-image.sh @@ -11,11 +11,11 @@ # This is appended to the factory image and is tested by the Linksys Upgrader - as observed in civic. # The footer is 256 bytes. The format is: # .LINKSYS. This is detected by the Linksys upgrader before continuing with upgrade. (9 bytes) -# The version number of upgrade. Not checked so use arbitary value (8 bytes) +# The version number of upgrade. Not checked so use arbitrary value (8 bytes) # Model of target device, padded (0x20) to (15 bytes) # CRC checksum of the image to flash (8 byte) # Padding (0x20) (7 bytes) -# Signature of signer. Not checked so use Arbitary value (16 bytes) +# Signature of signer. Not checked so use arbitrary value (16 bytes) # Padding (0x00) (192 bytes) # 0x0A (1 byte) diff --git a/scripts/pad_image b/scripts/pad_image index b1941a28d8..871063af34 100755 --- a/scripts/pad_image +++ b/scripts/pad_image @@ -2,7 +2,7 @@ function usage { echo "Usage: prepare_image image_type kernel_image rootfs_image header_size" - echo "Padd root and kernel image to the correct size and append the jffs2 start marker as needed" + echo "Pad root and kernel image to the correct size and append the jffs2 start marker as needed" exit 1 } diff --git a/scripts/sign_images.sh b/scripts/sign_images.sh index c41b21e091..f37c2f5016 100755 --- a/scripts/sign_images.sh +++ b/scripts/sign_images.sh @@ -3,12 +3,12 @@ # directory where search for images TOP_DIR="${TOP_DIR:-./bin/targets}" # key to sign images -BUILD_KEY="${BUILD_KEY:-key-build}" # TODO unifiy naming? +BUILD_KEY="${BUILD_KEY:-key-build}" # TODO unify naming? # remove other signatures (added e.g. by buildbot) REMOVE_OTER_SIGNATURES="${REMOVE_OTER_SIGNATURES:-1}" # find all sysupgrade images in TOP_DIR -# factory images don't need signatures as non OpenWrt system doen't check them anyway +# factory images don't need signatures as non OpenWrt system doesn't check them anyway for image in $(find $TOP_DIR -type f -name "*-sysupgrade.bin"); do # check if image actually support metadata if fwtool -i /dev/null "$image"; then diff --git a/scripts/size_compare.sh b/scripts/size_compare.sh index 8b047a451e..a5cc3337c7 100755 --- a/scripts/size_compare.sh +++ b/scripts/size_compare.sh @@ -7,9 +7,9 @@ ### ### The script compares locally compiled package with the package indexes ### available upstream. This way the storage impact of optimizations or -### feature modifiactions is easy to see. +### feature modifications is easy to see. ### -### If no environmental variables are set the scritp reads the current +### If no environmental variables are set the script reads the current ### .config file. The evaluated env variables are the following: ### ### TARGET SUBTARGET ARCH PACKAGES BIN_DIR BASE_URL CHECK_INSTALLED diff --git a/scripts/slugimage.pl b/scripts/slugimage.pl index 8c0654d4f6..366b239e96 100755 --- a/scripts/slugimage.pl +++ b/scripts/slugimage.pl @@ -772,7 +772,7 @@ sub writeOutFirmware { $_->{'name'}, $filename); } - # If the next parition is before the end of the current image, then rewind. + # If the next partition is before the end of the current image, then rewind. elsif ($_->{'offset'} < $end_point) { $debug and printf("Rewound %s before <%s> in \"%s\"\n", (($end_point - $_->{'offset'}) >= $block_size ? @@ -971,7 +971,7 @@ if (!GetOptions("d|debug" => \$debug, print " [-b|--redboot] Input/Output RedBoot filename\n"; print " [-s|--sysconf] Input/Output SysConf filename\n"; print " [-L|--loader] Second stage boot loader filename\n"; - print " [-k|--kernel] Input/Ouptut Kernel filename\n"; + print " [-k|--kernel] Input/Output Kernel filename\n"; print " [-r|--ramdisk] Input/Output Ramdisk filename(s)\n"; print " [-f|--fisdir] Input/Output FIS directory filename\n"; print " [-m|--microcode] Input/Output Microcode filename\n"; From 1e764ea7df11e1d51e60336f420ca73480b8c055 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 3 Jul 2022 02:20:11 +0200 Subject: [PATCH 25/78] scripts: ext-toolchain: fix wrong prefix in print_config generation The parsed prefix in print_config is wrong and this produce broken generated .config that won't work with any external toolchain. Currently the prefix from a CC of 'arm-openwrt-linux-muslgnueabi-gcc-12.1.0' produce a prefix 'arm-openwrt-linux-muslgnueabi-gcc-' This is wrong as the real prefix should be 'arm-openwrt-linux-muslgnueabi-' This is probably caused by a change in how the toolchain is now handled that now append also the gcc version. Probably in ancient days the version wasn't part of the name and the prefix generation stripped the '-gcc' instead of the gcc version. Fix this and correctly strip the gcc version and the gcc suffix to correctly call toolchain bins. Signed-off-by: Christian Marangi (cherry picked from commit 53c293262fce844c8291ab82e6726a8489d3c57b) --- scripts/ext-toolchain.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index 4da287591a..b52f170b32 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -281,8 +281,11 @@ print_config() { local mksubtarget local target="$("$CC" $CFLAGS -dumpmachine)" + local version="$("$CC" $CFLAGS -dumpversion)" local cpuarch="${target%%-*}" - local prefix="${CC##*/}"; prefix="${prefix%-*}-" + + # get CC; strip version; strip gcc and add - suffix + local prefix="${CC##*/}"; prefix="${prefix%-$version}"; prefix="${prefix%-*}-" local config="${0%/scripts/*}/.config" # if no target specified, print choice list and exit From ed785589ea9a11d526a01067b79af4fe1b5dd5b7 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 4 Jul 2022 18:22:18 +0200 Subject: [PATCH 26/78] scripts: ext-toolchain: add option to overwrite config It can be useful to overwrite an already generated config. Option are simply added at the end of the config and make defconfig will overwrite the relevant option with the new one. Signed-off-by: Christian Marangi (cherry picked from commit f4dd18ca39c42a324e34633c8ee553717531bc3b) --- scripts/ext-toolchain.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index b52f170b32..c9ceb150c1 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -50,6 +50,7 @@ BIN_SPECS=" gdbserver: gdbserver " +OVERWRITE_CONFIG="" test_c() { cat <<-EOT | "${CC:-false}" $CFLAGS -o /dev/null -x c - 2>/dev/null @@ -320,9 +321,13 @@ print_config() { fi # bail out if there is a .config already - if [ -f "${0%/scripts/*}/.config" ]; then - echo "There already is a .config file, refusing to overwrite!" >&2 - return 1 + if [ -f "$config" ]; then + if [ "$OVERWRITE_CONFIG" == "" ]; then + echo "There already is a .config file, refusing to overwrite!" >&2 + return 1 + else + echo "There already is a .config file, trying to overwrite!" + fi fi case "$mktarget" in */*) @@ -330,8 +335,11 @@ print_config() { mktarget="${mktarget%/*}" ;; esac + if [ ! -f "$config" ]; then + touch "$config" + fi - echo "CONFIG_TARGET_${mktarget}=y" > "$config" + echo "CONFIG_TARGET_${mktarget}=y" >> "$config" if [ -n "$mksubtarget" ]; then echo "CONFIG_TARGET_${mktarget}_${mksubtarget}=y" >> "$config" @@ -532,6 +540,10 @@ while [ -n "$1" ]; do exit $? ;; + --overwrite-config) + OVERWRITE_CONFIG=y + ;; + --config) if probe_cc; then print_config "$1" @@ -573,6 +585,8 @@ while [ -n "$1" ]; do echo -e " is used to specify C flags to be passed to the " >&2 echo -e " cross compiler when performing tests." >&2 echo -e " This parameter may be repeated multiple times." >&2 + echo -e " Use --overwrite-config before --config to overwrite" >&2 + echo -e " an already present config with the required changes.">&2 exit 1 ;; From 1f5b8a32e4a07b5ca55b0fce73ade5e026d4e584 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 17 Jul 2022 17:53:58 +0200 Subject: [PATCH 27/78] scripts: ext-toolchain: actually probe libc type on config generation Currently we never call probe_cc before config generation, this cause the script to never actually detect the correct libc type. Call probe_cc before config generation to correctl set the .config file. Signed-off-by: Christian Marangi (cherry picked from commit ddeabc75ebe3151ff7da302cb1aae702b3ad7eba) --- scripts/ext-toolchain.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index c9ceb150c1..1ef3f42c50 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -546,6 +546,7 @@ while [ -n "$1" ]; do --config) if probe_cc; then + probe_libc print_config "$1" exit $? fi From 462c5653e18f0bd2c9ec66a2b154bf26d8f4aa1d Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 17 Jul 2022 17:56:36 +0200 Subject: [PATCH 28/78] scripts: ext-toolchain: add support for info.mk in probe_cc Openwrt generate info.mk that contains the libc type. For probe_cc check if the file exist and parse directly it for LIBC type. Signed-off-by: Christian Marangi (cherry picked from commit 75311977f5ff64b491cb57ac713d75e0e410d786) --- scripts/ext-toolchain.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index 1ef3f42c50..1f8eca3076 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -463,6 +463,13 @@ probe_cpp() { } probe_libc() { + if [ -f $TOOLCHAIN/info.mk ]; then + LIBC_TYPE=$(grep LIBC_TYPE $TOOLCHAIN/info.mk | sed 's/LIBC_TYPE=//') + return 0 + fi + + echo "Warning! Can't find info.mk, trying to detect with alternative way." + if [ -z "$LIBC_TYPE" ]; then if test_uclibc; then LIBC_TYPE="uclibc" From fd90eed40ce6828a1bbd11d1a394e7c6368d0577 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 17 Jul 2022 17:56:59 +0200 Subject: [PATCH 29/78] scripts: ext-toolchain: add support for musl Openwrt now supports only glibc and musl. Add support for musl and rework the libc check to handle the new config flags and correctly compile package basend on that. Signed-off-by: Christian Marangi (cherry picked from commit 7be01fe13b4517e5edb8a4818f437d60144cdcb4) --- scripts/ext-toolchain.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index 1f8eca3076..fe1024c18e 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -369,8 +369,18 @@ print_config() { echo "CONFIG_TOOLCHAIN_PREFIX=\"$prefix\"" >> "$config" echo "CONFIG_TARGET_NAME=\"$target\"" >> "$config" - if [ "$LIBC_TYPE" != glibc ]; then - echo "CONFIG_TOOLCHAIN_LIBC=\"$LIBC_TYPE\"" >> "$config" + if [ -f "$config" ]; then + sed -i '/CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL/d' "$config" + sed -i '/CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC/d' "$config" + fi + + if [ "$LIBC_TYPE" == glibc ]; then + echo "CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC=y" >> "$config" + elif [ "$LIBC_TYPE" == musl ]; then + echo "CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL=y" >> "$config" + else + echo "Can't detect LIBC type. Aborting!" >&2 + return 1 fi local lib From 09f4533d6d07eb7afd922ced0f4461e61d07a999 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 27 Jan 2022 10:25:19 +0100 Subject: [PATCH 30/78] CI: add formal checks The formal checks verify the following things: - Commits does not contain any merge commits - Signed by a real name - Commit titles starts with an `:` - Author name matches signed of name - Commit message is not empty Signed-off-by: Paul Spooren (cherry picked from commit 3dc38823a2994639500ca201ac16928b7bf0bd8a) --- .github/workflows/ci_helpers.sh | 26 ++++++++++++ .github/workflows/formal.yml | 70 +++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .github/workflows/ci_helpers.sh create mode 100644 .github/workflows/formal.yml diff --git a/.github/workflows/ci_helpers.sh b/.github/workflows/ci_helpers.sh new file mode 100644 index 0000000000..2f9daf81e2 --- /dev/null +++ b/.github/workflows/ci_helpers.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +color_out() { + printf "\e[0;$1m%s\e[0;0m\n" "$2" +} + +success() { + color_out 32 "$1" +} + +info() { + color_out 36 "$1" +} + +err() { + color_out 31 "$1" +} + +warn() { + color_out 33 "$1" +} + +err_die() { + err "$1" + exit 1 +} diff --git a/.github/workflows/formal.yml b/.github/workflows/formal.yml new file mode 100644 index 0000000000..74e8fd6942 --- /dev/null +++ b/.github/workflows/formal.yml @@ -0,0 +1,70 @@ +name: Test Formalities + +on: + pull_request: + +jobs: + build: + name: Test Formalities + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Determine branch name + run: | + BRANCH="${GITHUB_BASE_REF#refs/heads/}" + echo "Building for $BRANCH" + echo "BRANCH=$BRANCH" >> $GITHUB_ENV + + - name: Test formalities + run: | + source .github/workflows/ci_helpers.sh + + RET=0 + for commit in $(git rev-list HEAD ^origin/$BRANCH); do + info "=== Checking commit '$commit'" + if git show --format='%P' -s $commit | grep -qF ' '; then + err "Pull request should not include merge commits" + RET=1 + fi + + author="$(git show -s --format=%aN $commit)" + if echo $author | grep -q '\S\+\s\+\S\+'; then + success "Author name ($author) seems ok" + else + err "Author name ($author) need to be your real name 'firstname lastname'" + RET=1 + fi + + subject="$(git show -s --format=%s $commit)" + if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then + success "Commit subject line seems ok ($subject)" + else + err "Commit subject line MUST start with ': ' ($subject)" + RET=1 + fi + + body="$(git show -s --format=%b $commit)" + sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)" + if echo "$body" | grep -qF "$sob"; then + success "Signed-off-by match author" + else + err "Signed-off-by is missing or doesn't match author (should be '$sob')" + RET=1 + fi + + if echo "$body" | grep -v "Signed-off-by:"; then + success "A commit message exists" + else + err "Missing commit message. Please describe your changes" + RET=1 + fi + done + + exit $RET From 6d4d665147b2e9628494a64612c510f641d11337 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 23 Feb 2022 19:51:43 +0100 Subject: [PATCH 31/78] CI: allow dots in commit subject area Due to a limited grep pattern, subjects containing dots like `image.mk` were falsely reported as problematic. Extend pattern to allow dots. Signed-off-by: Paul Spooren (cherry picked from commit fb5d0dc362e5206dbedb694dbe27953582eb887b) --- .github/workflows/formal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/formal.yml b/.github/workflows/formal.yml index 74e8fd6942..5046b5a180 100644 --- a/.github/workflows/formal.yml +++ b/.github/workflows/formal.yml @@ -43,7 +43,7 @@ jobs: fi subject="$(git show -s --format=%s $commit)" - if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then + if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_\.-]\+: ' -e '^Revert '; then success "Commit subject line seems ok ($subject)" else err "Commit subject line MUST start with ': ' ($subject)" From 9c4d81ec5e7340be08f4a0bae031bfee4e64bc14 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Fri, 25 Feb 2022 12:28:46 +0100 Subject: [PATCH 32/78] CI: build changes in tools/ on ubuntu/macos This commits adds GitHub CI to check that all tools compile on both Ubuntu and macOS. Since running in parrallel this should also detect badly set depdendencies within tools/Makefile. Signed-off-by: Paul Spooren (cherry picked from commit fb830fd894f7ae5ad23f712ebf50808f8be2a1f7) --- .github/workflows/tools.yml | 129 ++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 .github/workflows/tools.yml diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml new file mode 100644 index 0000000000..153db73625 --- /dev/null +++ b/.github/workflows/tools.yml @@ -0,0 +1,129 @@ +name: Build host tools + +on: + pull_request: + paths: + - 'tools/**' + +jobs: + build: + name: Build tools on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: False + matrix: + os: + - ubuntu-latest + - macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + path: openwrt + + - name: Setup MacOS + if: ${{ matrix.os == 'macos-latest' }} + run: | + echo "WORKPATH=/Volumes/OpenWrt/openwrt/" >> "$GITHUB_ENV" + hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage + hdiutil attach OpenWrt.sparseimage + mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/ + cd "$WORKPATH" + + brew install \ + autoconf \ + automake \ + coreutils \ + diffutils \ + findutils \ + gawk \ + gettext \ + git-extras \ + gmp \ + gnu-getopt \ + gnu-sed \ + gnu-tar \ + grep \ + libidn2 \ + libunistring \ + m4 \ + make \ + mpfr \ + ncurses \ + openssl@1.1 \ + pcre \ + pkg-config \ + quilt \ + readline \ + wget \ + zstd + + echo "/bin" >> "$GITHUB_PATH" + echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH" + echo "/usr/bin" >> "$GITHUB_PATH" + echo "/usr/local/bin" >> "$GITHUB_PATH" + echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH" + echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH" + echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH" + echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH" + echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH" + echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH" + echo "/usr/sbin" >> "$GITHUB_PATH" + pwd + + - name: Setup Ubuntu + if: ${{ matrix.os == 'ubuntu-latest' }} + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get -y install \ + build-essential \ + ccache \ + clang-12 \ + ecj \ + fastjar \ + file \ + g++ \ + gawk \ + gettext \ + git \ + java-propose-classpath \ + libelf-dev \ + libncurses-dev \ + libssl-dev \ + mkisofs \ + python3 \ + python3-dev \ + python3-distutils \ + python3-setuptools \ + qemu-utils \ + rsync \ + subversion \ + swig \ + unzip \ + wget \ + xsltproc \ + zlib1g-dev + echo "WORKPATH=$GITHUB_WORKSPACE/openwrt/" >> "$GITHUB_ENV" + cd "$WORKPATH" + pwd + + - name: Make prereq + run: | + cd "$WORKPATH" + pwd + make defconfig + + - name: Build tools + run: | + cd "$WORKPATH" + make tools/install -j$(nproc) BUILD_LOG=1 + + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }}-logs + path: "$WORKPATH/logs" From d3a8cacfcc893b507450495375715b3f4244ef8b Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 9 Mar 2022 13:30:21 +0100 Subject: [PATCH 33/78] CI: move logs/ to GITHUB_WORKSPACE Artifacts can only be uploaded from inside the GITHUB_WORKSPACE. While the Linux CI jobs run inside that per default, a special case-sensitive mount outside the GITHUB_WORKSPACE is used for macOS builds. To make log artifacts work for both macOS and Linux, move logs/ folder to GITHUB_WORKSPACE on failures. Signed-off-by: Paul Spooren (cherry picked from commit a5eeac8033786a7a04b7569175e41e415b6579c0) --- .github/workflows/tools.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 153db73625..76cbd30db7 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -121,9 +121,14 @@ jobs: cd "$WORKPATH" make tools/install -j$(nproc) BUILD_LOG=1 + - name: Move logs to GITHUB_WORKSPACE + if: failure() + run: | + cp -r "$WORKPATH/logs" "$GITHUB_WORKSPACE" + - name: Upload logs if: failure() uses: actions/upload-artifact@v2 with: name: ${{ matrix.os }}-logs - path: "$WORKPATH/logs" + path: "logs" From cf2b72ed7fc608495a9b0d4fa4d557665760477b Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 30 Mar 2022 01:43:17 +0100 Subject: [PATCH 34/78] CI: usability improvements for tools * Always store build logs * Store .config as an artifact * Rename job to `tools-{ os }` for log archive without spaces * Run CI job on changes to the CI file itself Signed-off-by: Paul Spooren (cherry picked from commit 80f79beb952dcb87d967a130d326cb1dd5a077ed) --- .github/workflows/tools.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 76cbd30db7..be967833cb 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -4,10 +4,11 @@ on: pull_request: paths: - 'tools/**' + - '.github/workflows/tools.yml' jobs: build: - name: Build tools on ${{ matrix.os }} + name: tools-${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: False @@ -122,13 +123,22 @@ jobs: make tools/install -j$(nproc) BUILD_LOG=1 - name: Move logs to GITHUB_WORKSPACE - if: failure() + if: always() run: | cp -r "$WORKPATH/logs" "$GITHUB_WORKSPACE" + cp -r "$WORKPATH/.config" "$GITHUB_WORKSPACE/config" + - name: Upload logs - if: failure() + if: always() uses: actions/upload-artifact@v2 with: name: ${{ matrix.os }}-logs path: "logs" + + - name: Upload config + if: always() + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }}-config + path: "config" From e1e47d598415493d4e3636f8329008fd2997a96f Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 9 Mar 2022 18:22:22 +0100 Subject: [PATCH 35/78] CI: add Kernel compile tests Add Github Actions yaml script to build test kernel PR changes for each target. Signed-off-by: Paul Spooren [ add commit description ] Signed-off-by: Christian Marangi (cherry picked from commit c17c931a90e5cb9613875a42ef8eace46be539f3) --- .github/workflows/kernel.yml | 143 +++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 .github/workflows/kernel.yml diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml new file mode 100644 index 0000000000..268c703baf --- /dev/null +++ b/.github/workflows/kernel.yml @@ -0,0 +1,143 @@ +name: Build Kernel + +on: + pull_request: + paths: + - 'include/kernel-*' + - 'package/kernel/**' +jobs: + determine_targets: + name: Set targets + runs-on: ubuntu-latest + outputs: + target: ${{ steps.find_targets.outputs.target }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set targets + id: find_targets + run: | + export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \ + | sort -u -t '/' -k1,1 \ + | awk '{ print $1 }')" + + JSON='[' + FIRST=1 + for TARGET in $TARGETS; do + [[ $FIRST -ne 1 ]] && JSON="$JSON"',' + JSON="$JSON"'"'"${TARGET}"'"' + FIRST=0 + done + JSON="$JSON"']' + + echo -e "\n---- targets ----\n" + echo "$JSON" + echo -e "\n---- targets ----\n" + + echo "::set-output name=target::$JSON" + + build: + name: Build Kernel with external toolchain + needs: determine_targets + runs-on: ubuntu-latest + strategy: + fail-fast: False + matrix: + target: ${{fromJson(needs.determine_targets.outputs.target)}} + + steps: + - name: Checkout master directory + uses: actions/checkout@v2 + with: + path: openwrt + + - name: Setup Ubuntu + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get -y install \ + build-essential \ + ccache \ + clang-12 \ + ecj \ + fastjar \ + file \ + g++ \ + gawk \ + gettext \ + git \ + java-propose-classpath \ + libelf-dev \ + libncurses-dev \ + libssl-dev \ + mkisofs \ + python3 \ + python3-dev \ + python3-distutils \ + python3-setuptools \ + qemu-utils \ + rsync \ + subversion \ + swig \ + unzip \ + wget \ + xsltproc \ + zlib1g-dev + + - name: Initialization environment + run: | + TARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 1) + SUBTARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 2) + echo "TARGET=$TARGET" >> "$GITHUB_ENV" + echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" + + - name: Update & Install feeds + run: | + cd openwrt + ./scripts/feeds update -a + ./scripts/feeds install -a + + - name: Setup external toolchain + run: | + cd openwrt + TOOLCHAIN_FILE=$(curl "https://downloads.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ + | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') + + echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" + + wget -O - https://downloads.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ + | tar --xz -xf - + + - name: Configure external toolchain + run: | + cd openwrt + ./scripts/ext-toolchain.sh \ + --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ + --config ${{ env.TARGET }}/${{ env.SUBTARGET }} + + make defconfig + + - name: Build tools + run: | + cd openwrt + make tools/install -j$(nproc) BUILD_LOG=1 + + - name: Build toolchain + run: | + cd openwrt + make toolchain/install -j$(nproc) BUILD_LOG=1 + + - name: Build Kernel + run: | + cd openwrt + make target/compile -j$(nproc) BUILD_LOG=1 + + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v2 + with: + name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs + path: "openwrt/logs" From 73e37f276354ec7dfd15b29c7ae0ecb7c817f80d Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 20 Mar 2022 15:31:24 +0000 Subject: [PATCH 36/78] CI: run inside the buildbot docker container Run github actions insider buildbot docker container. Signed-off-by: Paul Spooren [ run container under buildbot user ] Signed-off-by: Christian Marangi (cherry picked from commit 8a77adb0485aeb40f6550eb7fcdb461b3eaffe58) --- .github/workflows/kernel.yml | 70 +++++++++++++----------------------- 1 file changed, 24 insertions(+), 46 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 268c703baf..f7e5d542b4 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -47,45 +47,17 @@ jobs: matrix: target: ${{fromJson(needs.determine_targets.outputs.target)}} + container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1 + steps: - name: Checkout master directory uses: actions/checkout@v2 with: path: openwrt - - name: Setup Ubuntu - env: - DEBIAN_FRONTEND: noninteractive + - name: Fix permission run: | - sudo apt-get update - sudo apt-get -y install \ - build-essential \ - ccache \ - clang-12 \ - ecj \ - fastjar \ - file \ - g++ \ - gawk \ - gettext \ - git \ - java-propose-classpath \ - libelf-dev \ - libncurses-dev \ - libssl-dev \ - mkisofs \ - python3 \ - python3-dev \ - python3-distutils \ - python3-setuptools \ - qemu-utils \ - rsync \ - subversion \ - swig \ - unzip \ - wget \ - xsltproc \ - zlib1g-dev + chown -R buildbot:buildbot openwrt - name: Initialization environment run: | @@ -95,25 +67,31 @@ jobs: echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" - name: Update & Install feeds + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt run: | - cd openwrt ./scripts/feeds update -a ./scripts/feeds install -a - - name: Setup external toolchain + - name: Parse toolchain file + working-directory: openwrt run: | - cd openwrt TOOLCHAIN_FILE=$(curl "https://downloads.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" - + + - name: Download external toolchain + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | wget -O - https://downloads.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ | tar --xz -xf - - name: Configure external toolchain + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt run: | - cd openwrt ./scripts/ext-toolchain.sh \ --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ --config ${{ env.TARGET }}/${{ env.SUBTARGET }} @@ -121,19 +99,19 @@ jobs: make defconfig - name: Build tools - run: | - cd openwrt - make tools/install -j$(nproc) BUILD_LOG=1 + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make tools/install -j$(nproc) BUILD_LOG=1 - name: Build toolchain - run: | - cd openwrt - make toolchain/install -j$(nproc) BUILD_LOG=1 + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make toolchain/install -j$(nproc) BUILD_LOG=1 - name: Build Kernel - run: | - cd openwrt - make target/compile -j$(nproc) BUILD_LOG=1 + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make target/compile -j$(nproc) BUILD_LOG=1 - name: Upload logs if: failure() From 1cf24edac7eae8a26cc58c1d21588d8e69d533fb Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 7 Aug 2022 18:18:40 +0200 Subject: [PATCH 37/78] CI: kernel: Trigger workflow for more directories Trigger the kernel build workflow also for more directories. Signed-off-by: Hauke Mehrtens (cherry picked from commit 546822775cd988360964687c0cb430d67bd5c617) --- .github/workflows/kernel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index f7e5d542b4..bffa1f04b8 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -3,8 +3,10 @@ name: Build Kernel on: pull_request: paths: + - '.github/workflows/kernel.yml' - 'include/kernel-*' - 'package/kernel/**' + - 'target/linux/generic/**' jobs: determine_targets: name: Set targets From ae63723f0ad5392378d06b29cb800266c3ed6858 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 7 Aug 2022 18:21:44 +0200 Subject: [PATCH 38/78] CI: kernel: Use downloads.cdn.openwrt.org Use downloads.cdn.openwrt.org to download the toolchain. This should reduce the load on the servers. Signed-off-by: Hauke Mehrtens (cherry picked from commit 7b4daf00766620faac8212b46259064ca6e2c716) --- .github/workflows/kernel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index bffa1f04b8..108edf2460 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -78,7 +78,7 @@ jobs: - name: Parse toolchain file working-directory: openwrt run: | - TOOLCHAIN_FILE=$(curl "https://downloads.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ + TOOLCHAIN_FILE=$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" @@ -87,7 +87,7 @@ jobs: shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | - wget -O - https://downloads.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ + wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ | tar --xz -xf - - name: Configure external toolchain From fde584a3ec82cad9f9d04f99220d30d7a01bfde7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 7 Aug 2022 18:22:52 +0200 Subject: [PATCH 39/78] CI: kernel: Show used OpenWrt configuration Show the configuration used to build OpenWrt before starting the build. This should make it easier for people to reproduce problems when it fails. Signed-off-by: Hauke Mehrtens (cherry picked from commit 43afaf6149129a72a8f3e5d3d0d545e54ac81b3a) --- .github/workflows/kernel.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 108edf2460..37fba2f4ec 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -100,6 +100,11 @@ jobs: make defconfig + - name: Show configuration + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: ./scripts/diffconfig.sh + - name: Build tools shell: su buildbot -c "sh -e {0}" working-directory: openwrt From 93d67c96a6c0e9a2280fea9859853d73816fe49b Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 8 Aug 2022 20:26:18 +0200 Subject: [PATCH 40/78] CI: kernel: Checkout feeds from github Instead of cloning the feeds from the default location at git.openwrt.org use the github action to clone them directly from github. We saw some error messages when cloning from git.openwrt.org, probably related to some rate limiting applied. Cloning from github within a github action should work more stable. The "./scripts/feeds update -a" script will use the already checked out feed repositories and not clone them again from git.openwrt.org, but it will also not change the branch name. Signed-off-by: Hauke Mehrtens (cherry picked from commit b120e78917099d46a25cc521998b917fdf08e388) --- .github/workflows/kernel.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 37fba2f4ec..addedb91fe 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -57,6 +57,30 @@ jobs: with: path: openwrt + - name: Checkout packages feed + uses: actions/checkout@v2 + with: + repository: openwrt/packages + path: openwrt/feeds/packages + + - name: Checkout luci feed + uses: actions/checkout@v2 + with: + repository: openwrt/luci + path: openwrt/feeds/luci + + - name: Checkout routing feed + uses: actions/checkout@v2 + with: + repository: openwrt/routing + path: openwrt/feeds/routing + + - name: Checkout telephony feed + uses: actions/checkout@v2 + with: + repository: openwrt/telephony + path: openwrt/feeds/telephony + - name: Fix permission run: | chown -R buildbot:buildbot openwrt From 5978ab409c6be3190f4d1c053dfe31cdea387754 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 8 Aug 2022 22:57:59 +0200 Subject: [PATCH 41/78] CI: kernel: Build all kernel modules Activate building all kernel modules. This builds all kernel modules from the core packages and the feeds. Signed-off-by: Hauke Mehrtens (cherry picked from commit fed325f4633cb302a5f43c42285e8ab0fd144262) --- .github/workflows/kernel.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index addedb91fe..05bc6ed8ee 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -118,8 +118,11 @@ jobs: shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | + echo CONFIG_ALL_KMODS=y >> .config + ./scripts/ext-toolchain.sh \ --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ + --overwrite-config \ --config ${{ env.TARGET }}/${{ env.SUBTARGET }} make defconfig From 8dc0a963a80b94bc53251202f5deafdbfcab575a Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 9 Sep 2022 21:09:30 +0200 Subject: [PATCH 42/78] CI: kernel: Cache external toolchain Cache external toolchain for each target to remove load from openwrt cdn server and make the external toolchain setup quicker. Signed-off-by: Christian Marangi (cherry picked from commit f522c27385d6f94e5dbcc3e84968f0e38609ff1c) --- .github/workflows/kernel.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 05bc6ed8ee..43f843b256 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -102,12 +102,23 @@ jobs: - name: Parse toolchain file working-directory: openwrt run: | - TOOLCHAIN_FILE=$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ - | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') + TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ + | grep ".*openwrt-toolchain.*tar.xz")" + TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') + TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" + echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" + + - name: Cache external toolchain + id: cache-external-toolchain + uses: actions/cache@v3 + with: + path: openwrt/${{ env.TOOLCHAIN_FILE }} + key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} - name: Download external toolchain + if: ${{ steps.cache-external-toolchain.outputs.cache-hit != 'true' }} shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | From 3082e83596df58f3c95dd9628c32959eb1cb0f8a Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 10 Sep 2022 21:18:10 +0200 Subject: [PATCH 43/78] CI: package kmods in kernel workflow Actually package kmods in kernel workflow to catch dependency error and other problem that may arise from kmods packaging. Signed-off-by: Christian Marangi (cherry picked from commit 0c45db5560df47a0344a21c2443a4f2889c42ac8) --- .github/workflows/kernel.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 43f843b256..4f8c6b9317 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -158,6 +158,11 @@ jobs: working-directory: openwrt run: make target/compile -j$(nproc) BUILD_LOG=1 + - name: Build Kernel Kmods + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make package/linux/compile -j$(nproc) BUILD_LOG=1 + - name: Upload logs if: failure() uses: actions/upload-artifact@v2 From 8496275f83fda227f9b9c8d706ca18d1d3733c77 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Mon, 20 Jun 2022 13:13:30 +0200 Subject: [PATCH 44/78] CI: include automatic Pull Request Labeler This adds GitHub CI action which makes use of 'Labeler', allowing automatic labeling of new PRs, based on the modified files paths. Below labels are supported and more can be added later: - 'target/*' - 'target/imagebuilder' - 'kernel' - 'core packages' - 'build/scripts/tools' - 'toolchain' - 'GitHub/CI' For more information: https://github.com/marketplace/actions/labeler Signed-off-by: Piotr Dymacz (cherry picked from commit 4f42566d47999c392c8ea41dc27215b43ed9ee40) --- .github/labeler.yml | 103 ++++++++++++++++++++++++++++++++++ .github/workflows/labeler.yml | 12 ++++ 2 files changed, 115 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..0910d37bd5 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,103 @@ +# target/* +"target/airoha": + - "target/linux/airoha/**" +"target/apm821xx": + - "target/linux/apm821xx/**" +"target/archs38": + - "target/linux/archs38/**" +"target/armvirt": + - "target/linux/armvirt/**" +"target/at91": + - "target/linux/at91/**" +"target/ath25": + - "target/linux/ath25/**" +"target/ath79": + - "target/linux/ath79/**" +"target/bcm27xx": + - "target/linux/bcm27xx/**" +"target/bcm47xx": + - "target/linux/bcm47xx/**" +"target/bcm4908": + - "target/linux/bcm4908/**" +"target/bcm53xx": + - "target/linux/bcm53xx/**" +"target/bcm63xx": + - "target/linux/bcm63xx/**" +"target/bmips": + - "target/linux/bmips/**" +"target/gemini": + - "target/linux/gemini/**" +"target/imx": + - "target/linux/imx/**" +"target/ipq40xx": + - "target/linux/ipq40xx/**" +"target/ipq806x": + - "target/linux/ipq806x/**" +"target/kirkwood": + - "target/linux/kirkwood/**" +"target/lantiq": + - "target/linux/lantiq/**" +"target/layerscape": + - "target/linux/layerscape/**" +"target/malta": + - "target/linux/malta/**" +"target/mediatek": + - "target/linux/mediatek/**" +"target/mpc85xx": + - "target/linux/mpc85xx/**" +"target/mvebu": + - "target/linux/mvebu/**" +"target/mxs": + - "target/linux/mxs/**" +"target/octeon": + - "target/linux/octeon/**" +"target/octeontx": + - "target/linux/octeontx/**" +"target/omap": + - "target/linux/omap/**" +"target/oxnas": + - "target/linux/oxnas/**" +"target/pistachio": + - "target/linux/pistachio/**" +"target/qoriq": + - "target/linux/qoriq/**" +"target/ramips": + - "target/linux/ramips/**" +"target/realtek": + - "target/linux/realtek/**" +"target/rockchip": + - "target/linux/rockchip/**" +"target/sunxi": + - "target/linux/sunxi/**" +"target/tegra": + - "target/linux/tegra/**" +"target/uml": + - "target/linux/uml/**" +"target/x86": + - "target/linux/x86/**" +"target/zynq": + - "target/linux/zynq/**" +# target/imagebuilder +"target/imagebuilder": + - "target/imagebuilder/**" +# kernel +"kernel": + - "target/linux/generic/**" + - "target/linux/**/config-*" + - "target/linux/**/patches-*" + - "target/linux/**/files/**" + - "package/kernel/linux/**" +# core packages +"core packages": + - "package/**" +# build/scripts/tools +"build/scripts/tools": + - "include/**" + - "scripts/**" + - "tools/**" +# toolchain +"toolchain": + - "toolchain/**" +# GitHub/CI +"GitHub/CI": + - ".github/**" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000..6bcdf51a89 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,12 @@ +name: 'Pull Request Labeler' +on: + - pull_request_target + +jobs: + labeler: + name: Pull Request Labeler + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v4.0.1 + with: + repo-token: '${{ secrets.GITHUB_TOKEN }}' From 3a9f927c2f74bce2f8b6c1fe654db3ef2cabae0a Mon Sep 17 00:00:00 2001 From: Alex Low Date: Mon, 19 Sep 2022 12:20:37 +0200 Subject: [PATCH 45/78] build: harden GitHub workflow permissions Grant pull-requests write permission to the labeler workflow and read-only to everything else. Signed-off-by: Alex Low [ wrap to 80 columns and fix wrong author as requested by author itself ] Signed-off-by: Christian Marangi (cherry picked from commit 715259940776843d8799bc39de8eb50eb764189b) --- .github/workflows/formal.yml | 3 +++ .github/workflows/kernel.yml | 4 ++++ .github/workflows/labeler.yml | 7 +++++++ .github/workflows/tools.yml | 3 +++ 4 files changed, 17 insertions(+) diff --git a/.github/workflows/formal.yml b/.github/workflows/formal.yml index 5046b5a180..1256481637 100644 --- a/.github/workflows/formal.yml +++ b/.github/workflows/formal.yml @@ -3,6 +3,9 @@ name: Test Formalities on: pull_request: +permissions: + contents: read + jobs: build: name: Test Formalities diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 4f8c6b9317..62e0952f19 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -7,6 +7,10 @@ on: - 'include/kernel-*' - 'package/kernel/**' - 'target/linux/generic/**' + +permissions: + contents: read + jobs: determine_targets: name: Set targets diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 6bcdf51a89..420617809b 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -2,8 +2,15 @@ name: 'Pull Request Labeler' on: - pull_request_target +permissions: + contents: read + jobs: labeler: + permissions: + contents: read # to determine modified files (actions/labeler) + pull-requests: write # to add labels to PRs (actions/labeler) + name: Pull Request Labeler runs-on: ubuntu-latest steps: diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index be967833cb..4e423fdd62 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -6,6 +6,9 @@ on: - 'tools/**' - '.github/workflows/tools.yml' +permissions: + contents: read + jobs: build: name: tools-${{ matrix.os }} From 2e298230340d038a8738e6b9e263dcf9f3aa662f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 5 Sep 2022 09:04:27 +0200 Subject: [PATCH 46/78] ci: move scripts into separate directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So it's clean and tidy. Signed-off-by: Petr Štetiar (cherry picked from commit 63ed733d30153667d7d645ab0ee3f5614089c759) --- .github/workflows/formal.yml | 2 +- .github/workflows/{ => scripts}/ci_helpers.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{ => scripts}/ci_helpers.sh (100%) diff --git a/.github/workflows/formal.yml b/.github/workflows/formal.yml index 1256481637..8df31d1751 100644 --- a/.github/workflows/formal.yml +++ b/.github/workflows/formal.yml @@ -27,7 +27,7 @@ jobs: - name: Test formalities run: | - source .github/workflows/ci_helpers.sh + source .github/workflows/scripts/ci_helpers.sh RET=0 for commit in $(git rev-list HEAD ^origin/$BRANCH); do diff --git a/.github/workflows/ci_helpers.sh b/.github/workflows/scripts/ci_helpers.sh similarity index 100% rename from .github/workflows/ci_helpers.sh rename to .github/workflows/scripts/ci_helpers.sh From 01000b0cece7eb9fd84a56d696b9fccdddecae8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 22 Aug 2022 15:05:01 +0200 Subject: [PATCH 47/78] ci: show build failures directly in job log output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of waiting for complete workflow finish, then downloading the artifacts, unpacking them and inspecting them, lets try to make the build failure immediately visible in the log output: ====== Make errors from logs/target/linux/compile.txt ====== * Legacy (non-UHI/non-FIT) Boards * Support MIPS SEAD-3 boards (LEGACY_BOARD_SEAD3) [N/y/?] (NEW) Error in reading or end of file. make[6]: *** [scripts/kconfig/Makefile:77: syncconfig] Error 1 make[5]: *** [Makefile:616: syncconfig] Error 2 make[4]: *** [Makefile:736: include/config/auto.conf.cmd] Error 2 make[3]: *** [Makefile:24: build_dir/target-mipsel-openwrt-linux-musl_musl/linux-ramips_mt7620/linux-5.15.62/.modules] Error 2 make[2]: *** [Makefile:11: compile] Error 2 time: target/linux/compile#30.09#11.30#37.92 Signed-off-by: Petr Štetiar (cherry picked from commit f4ca4187cde01a3e412f10657bec0790d3a4cd94) --- .github/workflows/kernel.yml | 8 ++++---- .github/workflows/scripts/show_build_failures.sh | 15 +++++++++++++++ .github/workflows/tools.yml | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100755 .github/workflows/scripts/show_build_failures.sh diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 62e0952f19..5afd546394 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -150,22 +150,22 @@ jobs: - name: Build tools shell: su buildbot -c "sh -e {0}" working-directory: openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 + run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - name: Build toolchain shell: su buildbot -c "sh -e {0}" working-directory: openwrt - run: make toolchain/install -j$(nproc) BUILD_LOG=1 + run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - name: Build Kernel shell: su buildbot -c "sh -e {0}" working-directory: openwrt - run: make target/compile -j$(nproc) BUILD_LOG=1 + run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - name: Build Kernel Kmods shell: su buildbot -c "sh -e {0}" working-directory: openwrt - run: make package/linux/compile -j$(nproc) BUILD_LOG=1 + run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - name: Upload logs if: failure() diff --git a/.github/workflows/scripts/show_build_failures.sh b/.github/workflows/scripts/show_build_failures.sh new file mode 100755 index 0000000000..14f699c93d --- /dev/null +++ b/.github/workflows/scripts/show_build_failures.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +original_exit_code="${ret:-1}" +log_dir_path="${1:-logs}" +context="${2:-10}" + +show_make_build_errors() { + grep -slr 'make\[[[:digit:]]\].*Error [[:digit:]]$' "$log_dir_path" | while IFS= read -r log_file; do + printf "====== Make errors from %s ======\n" "$log_file"; + grep -r -C"$context" 'make\[[[:digit:]]\].*Error [[:digit:]]$' "$log_file" ; + done +} + +show_make_build_errors +exit "$original_exit_code" diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 4e423fdd62..b97f0599e2 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -123,7 +123,7 @@ jobs: - name: Build tools run: | cd "$WORKPATH" - make tools/install -j$(nproc) BUILD_LOG=1 + make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - name: Move logs to GITHUB_WORKSPACE if: always() From 6f9067e9d472c7cbda4acb16da88313450302de8 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 20 Mar 2022 20:02:08 +0000 Subject: [PATCH 48/78] CI: use buildbot container for building Instead of using a fresh Linux installation which is setup every time use the Buildbot container which is used for our own Buildbot infrastructure, too. While at it also tidy up the workflow to make it more consistent with other workflow. Signed-off-by: Paul Spooren Co-Developed-by: Christian Marangi Signed-off-by: Christian Marangi (cherry picked from commit 3b23227d43ec720f810e6e261945530f7bc549f0) --- .github/workflows/tools.yml | 125 ++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 71 deletions(-) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index b97f0599e2..52999758cf 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -10,31 +10,25 @@ permissions: contents: read jobs: - build: - name: tools-${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: False - matrix: - os: - - ubuntu-latest - - macos-latest + build-macos-latest: + runs-on: macos-latest + steps: - name: Checkout uses: actions/checkout@v2 with: - fetch-depth: 0 path: openwrt - name: Setup MacOS - if: ${{ matrix.os == 'macos-latest' }} run: | - echo "WORKPATH=/Volumes/OpenWrt/openwrt/" >> "$GITHUB_ENV" + echo "WORKPATH=/Volumes/OpenWrt" >> "$GITHUB_ENV" hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage hdiutil attach OpenWrt.sparseimage mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/ - cd "$WORKPATH" + - name: Install required prereq on MacOS + working-directory: ${{ env.WORKPATH }}/openwrt + run: | brew install \ autoconf \ automake \ @@ -74,74 +68,63 @@ jobs: echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH" echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH" echo "/usr/sbin" >> "$GITHUB_PATH" - pwd - - - name: Setup Ubuntu - if: ${{ matrix.os == 'ubuntu-latest' }} - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo apt-get update - sudo apt-get -y install \ - build-essential \ - ccache \ - clang-12 \ - ecj \ - fastjar \ - file \ - g++ \ - gawk \ - gettext \ - git \ - java-propose-classpath \ - libelf-dev \ - libncurses-dev \ - libssl-dev \ - mkisofs \ - python3 \ - python3-dev \ - python3-distutils \ - python3-setuptools \ - qemu-utils \ - rsync \ - subversion \ - swig \ - unzip \ - wget \ - xsltproc \ - zlib1g-dev - echo "WORKPATH=$GITHUB_WORKSPACE/openwrt/" >> "$GITHUB_ENV" - cd "$WORKPATH" - pwd - name: Make prereq - run: | - cd "$WORKPATH" - pwd - make defconfig - - - name: Build tools - run: | - cd "$WORKPATH" - make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Move logs to GITHUB_WORKSPACE - if: always() - run: | - cp -r "$WORKPATH/logs" "$GITHUB_WORKSPACE" - cp -r "$WORKPATH/.config" "$GITHUB_WORKSPACE/config" + working-directory: ${{ env.WORKPATH }}/openwrt + run: make defconfig + - name: Build tools MacOS + working-directory: ${{ env.WORKPATH }}/openwrt + run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - name: Upload logs if: always() uses: actions/upload-artifact@v2 with: - name: ${{ matrix.os }}-logs - path: "logs" + name: macos-latest-logs + path: ${{ env.WORKPATH }}/openwrt/logs - name: Upload config if: always() uses: actions/upload-artifact@v2 with: - name: ${{ matrix.os }}-config - path: "config" + name: macos-latest-config + path: ${{ env.WORKPATH }}/openwrt/.config + + build-linux-buildbot: + runs-on: ubuntu-latest + container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: 'openwrt' + + - name: Fix permission + run: | + chown -R buildbot:buildbot openwrt + + - name: Make prereq + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make defconfig + + - name: Build tools BuildBot Container + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Upload logs + if: always() + uses: actions/upload-artifact@v2 + with: + name: linux-buildbot-logs + path: openwrt/logs + + - name: Upload config + if: always() + uses: actions/upload-artifact@v2 + with: + name: linux-buildbot-config + path: openwrt/.config From ec55b1217a14a32c99f5209b625c32df0e40970f Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 8 Aug 2022 23:37:54 +0200 Subject: [PATCH 49/78] CI: create Docker container containing compiled tools Currently each Kernel compilation takes about 30 minutes of which 20 minutes are used to compile our tools. While the toolchain is downloaded and instantly ready the tools are missing. This commit starts uploading a Docker container including compiled tools which are ready to use. It is automatically updated whenever any tools are changed. Signed-off-by: Paul Spooren Co-Developed-by: Christian Marangi Signed-off-by: Christian Marangi (cherry picked from commit 25b65f548dfd93cae87781276bfff9a27cd3ebd4) --- .github/workflows/Dockerfile.tools | 3 ++ .github/workflows/tools.yml | 64 ++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/Dockerfile.tools diff --git a/.github/workflows/Dockerfile.tools b/.github/workflows/Dockerfile.tools new file mode 100644 index 0000000000..c2ae7dc896 --- /dev/null +++ b/.github/workflows/Dockerfile.tools @@ -0,0 +1,3 @@ +FROM registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1 + +COPY --chown=buildbot:buildbot tools.tar /tools.tar diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 52999758cf..54b7a01fe5 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -5,12 +5,17 @@ on: paths: - 'tools/**' - '.github/workflows/tools.yml' + push: + paths: + - 'tools/**' + - '.github/workflows/tools.yml' permissions: contents: read jobs: build-macos-latest: + if: github.event_name != 'push' runs-on: macos-latest steps: @@ -105,6 +110,15 @@ jobs: run: | chown -R buildbot:buildbot openwrt + - name: Set AUTOREMOVE config for tools container + if: github.event_name == 'push' + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + touch .config + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config + - name: Make prereq shell: su buildbot -c "sh -e {0}" working-directory: openwrt @@ -128,3 +142,53 @@ jobs: with: name: linux-buildbot-config path: openwrt/.config + + - name: Archive prebuilt tools + if: github.event_name == 'push' + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: tar --mtime=now -cf tools.tar staging_dir/host build_dir/host dl + + - name: Upload prebuilt tools + if: github.event_name == 'push' + uses: actions/upload-artifact@v2 + with: + name: linux-buildbot-prebuilt-tools + path: openwrt/tools.tar + retention-days: 1 + + push-tools-container: + needs: build-linux-buildbot + runs-on: ubuntu-latest + if: github.event_name == 'push' + + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: 'openwrt' + + - name: Download prebuilt tools from build job + uses: actions/download-artifact@v2 + with: + name: linux-buildbot-prebuilt-tools + path: openwrt + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: openwrt + push: true + tags: ghcr.io/${{ github.repository_owner }}/tools:latest + file: openwrt/.github/workflows/Dockerfile.tools From f4db2752500bb4fcc8a1bad586b192dc186d30a1 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 5 Sep 2022 23:18:00 +0200 Subject: [PATCH 50/78] CI: use tools:latest container to speedup kernel workflow Use tools:latest container with prebuilt host tools to speedup kernel compilation in kernel workflow. Signed-off-by: Christian Marangi (cherry picked from commit 5d09118f8e60fa151e03916f255f5511e197af68) --- .github/workflows/kernel.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 5afd546394..5589610d08 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -53,7 +53,11 @@ jobs: matrix: target: ${{fromJson(needs.determine_targets.outputs.target)}} - container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1 + container: ghcr.io/${{ github.repository_owner }}/tools:latest + + permissions: + contents: read + packages: read steps: - name: Checkout master directory @@ -129,19 +133,24 @@ jobs: wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ | tar --xz -xf - + - name: Extract prebuilt tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: ./scripts/ext-tools.sh --tools /tools.tar + - name: Configure external toolchain shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | echo CONFIG_ALL_KMODS=y >> .config + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config ./scripts/ext-toolchain.sh \ --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ --overwrite-config \ --config ${{ env.TARGET }}/${{ env.SUBTARGET }} - make defconfig - - name: Show configuration shell: su buildbot -c "sh -e {0}" working-directory: openwrt From 3ba78a839a1cd8ab140896c6c6efc55fbc09948f Mon Sep 17 00:00:00 2001 From: Edward Chow Date: Mon, 3 Oct 2022 19:39:58 +0800 Subject: [PATCH 51/78] CI: Add workaround for github uppercase usernames The workflow defined in tools.yml and kernel.yml used to fail on forked repositories of contributers whose github username contains uppercase letters. A workaround mentioned in https://github.com/orgs/community/discussions/27086 and https://stackoverflow.com/questions/70326569/ is applied. Signed-off-by: Edward Chow (cherry picked from commit c27b43956407f3adc3cc2693792acd6b40a01877) --- .github/workflows/kernel.yml | 10 +++++++++- .github/workflows/tools.yml | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 5589610d08..6c8ad68438 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -17,11 +17,19 @@ jobs: runs-on: ubuntu-latest outputs: target: ${{ steps.find_targets.outputs.target }} + owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} steps: - name: Checkout uses: actions/checkout@v2 + - name: Set lower case owner name + id: lower_owner + run: | + OWNER_LC=$(echo "${{ github.repository_owner }}" \ + | tr '[:upper:]' '[:lower:]') + echo "::set-output name=owner_lc::$OWNER_LC" + - name: Set targets id: find_targets run: | @@ -53,7 +61,7 @@ jobs: matrix: target: ${{fromJson(needs.determine_targets.outputs.target)}} - container: ghcr.io/${{ github.repository_owner }}/tools:latest + container: ghcr.io/${{ needs.determine_targets.outputs.owner_lc }}/tools:latest permissions: contents: read diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 54b7a01fe5..573bb468b9 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -167,6 +167,12 @@ jobs: packages: write steps: + - name: Set lower case owner name + env: + OWNER: ${{ github.repository_owner }} + run: | + echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV" + - name: Checkout uses: actions/checkout@v2 with: @@ -190,5 +196,5 @@ jobs: with: context: openwrt push: true - tags: ghcr.io/${{ github.repository_owner }}/tools:latest + tags: ghcr.io/${{ env.OWNER_LC }}/tools:latest file: openwrt/.github/workflows/Dockerfile.tools From c95622ac6ef071361d32a79d05e10a155f0f75c0 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 4 Oct 2022 18:38:57 +0200 Subject: [PATCH 52/78] CI: tools: compile tools with ccache support for tools container Enable ccache support for tools container, useful to speedup other workflow even more. Signed-off-by: Christian Marangi (cherry picked from commit 2781e3839e7f4f6132a2737ee9f988f40fa58d99) --- .github/workflows/tools.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 573bb468b9..f483615363 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -110,7 +110,7 @@ jobs: run: | chown -R buildbot:buildbot openwrt - - name: Set AUTOREMOVE config for tools container + - name: Set configs for tools container if: github.event_name == 'push' shell: su buildbot -c "sh -e {0}" working-directory: openwrt @@ -118,6 +118,7 @@ jobs: touch .config echo CONFIG_DEVEL=y >> .config echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config - name: Make prereq shell: su buildbot -c "sh -e {0}" From 9718dffd27ea9c15d30958eafef593aab929b7e8 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 4 Oct 2022 18:43:38 +0200 Subject: [PATCH 53/78] CI: kernel: use ccache to speedup workflow Use ccache to speedup kernel compilation. Ccache dir is cached across each build test. To refresh ccache directory we generate an hash of the kernel include files, that includes the kernel versions of every kernel supported and the kernel compile includes. Signed-off-by: Christian Marangi (cherry picked from commit 137ba15e6ef31534a2002a02e69b774232f0b040) --- .github/workflows/kernel.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 6c8ad68438..0ba8c27e2e 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -18,6 +18,7 @@ jobs: outputs: target: ${{ steps.find_targets.outputs.target }} owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} + ccache_hash: ${{ steps.ccache_hash.outputs.ccache_hash }} steps: - name: Checkout @@ -30,6 +31,13 @@ jobs: | tr '[:upper:]' '[:lower:]') echo "::set-output name=owner_lc::$OWNER_LC" + - name: Generate ccache hash + id: ccache_hash + run: | + CCACHE_HASH=$(md5sum include/kernel-* | awk '{ print $1 }' \ + | md5sum | awk '{ print $1 }') + echo "::set-output name=ccache_hash::$CCACHE_HASH" + - name: Set targets id: find_targets run: | @@ -133,6 +141,14 @@ jobs: path: openwrt/${{ env.TOOLCHAIN_FILE }} key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} + - name: Cache ccache + uses: actions/cache@v3 + with: + path: openwrt/.ccache + key: ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-${{ needs.determine_targets.outputs.ccache_hash }} + restore-keys: | + ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}- + - name: Download external toolchain if: ${{ steps.cache-external-toolchain.outputs.cache-hit != 'true' }} shell: su buildbot -c "sh -e {0}" @@ -153,6 +169,7 @@ jobs: echo CONFIG_ALL_KMODS=y >> .config echo CONFIG_DEVEL=y >> .config echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config ./scripts/ext-toolchain.sh \ --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ From 305688f5372b0e884b5a479cf151d746617db32b Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 8 Oct 2022 19:25:54 +0200 Subject: [PATCH 54/78] CI: kernel: generate ccache cache on kernel push To actually use ccache cache on kernel test from pr, the kernel workflow has to be run first from a push action. This will permit as a side effect to test merged commits and catch commit that may cause regression in kernel compilation even outside the github system. Signed-off-by: Christian Marangi (cherry picked from commit 23e946d1aded1fc21125704c0819146d5772d72b) --- .github/workflows/kernel.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 0ba8c27e2e..25d6d265eb 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -7,6 +7,12 @@ on: - 'include/kernel-*' - 'package/kernel/**' - 'target/linux/generic/**' + push: + paths: + - '.github/workflows/kernel.yml' + - 'include/kernel-*' + - 'package/kernel/**' + - 'target/linux/generic/**' permissions: contents: read From 2454da3d5e0e2ac02f206923e09019e4ec74d60e Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 12 Oct 2022 15:24:11 +0200 Subject: [PATCH 55/78] CI: bump actions/checkout action to v3 Bump actions/checkout action to v3 on every workflow to mute node deprecation warning. Signed-off-by: Christian Marangi (cherry picked from commit 87c69d73bb4021bf3a26217b3a652ce262637b1e) --- .github/workflows/formal.yml | 2 +- .github/workflows/kernel.yml | 12 ++++++------ .github/workflows/tools.yml | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/formal.yml b/.github/workflows/formal.yml index 8df31d1751..8083c5832c 100644 --- a/.github/workflows/formal.yml +++ b/.github/workflows/formal.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 25d6d265eb..f29b18d910 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set lower case owner name id: lower_owner @@ -83,30 +83,30 @@ jobs: steps: - name: Checkout master directory - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: openwrt - name: Checkout packages feed - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: openwrt/packages path: openwrt/feeds/packages - name: Checkout luci feed - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: openwrt/luci path: openwrt/feeds/luci - name: Checkout routing feed - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: openwrt/routing path: openwrt/feeds/routing - name: Checkout telephony feed - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: openwrt/telephony path: openwrt/feeds/telephony diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index f483615363..2661782f42 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: openwrt @@ -102,7 +102,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: 'openwrt' @@ -175,7 +175,7 @@ jobs: echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV" - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: 'openwrt' From c4345c7a7d3cb64f4b07a9b2cb3a7c959c54052b Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 12 Oct 2022 16:48:46 +0200 Subject: [PATCH 56/78] CI: bump actions/download,upload-artifact action to v3 Bump actions/download,upload-artifact action to v3 on every workflow to mute node deprecation warning. Signed-off-by: Christian Marangi (cherry picked from commit 77b24012db1d696ca87c03fa1bb8bdf2606119e7) --- .github/workflows/kernel.yml | 2 +- .github/workflows/tools.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index f29b18d910..d8f98c531d 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -209,7 +209,7 @@ jobs: - name: Upload logs if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs path: "openwrt/logs" diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 2661782f42..def01678c6 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -84,14 +84,14 @@ jobs: - name: Upload logs if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: macos-latest-logs path: ${{ env.WORKPATH }}/openwrt/logs - name: Upload config if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: macos-latest-config path: ${{ env.WORKPATH }}/openwrt/.config @@ -132,14 +132,14 @@ jobs: - name: Upload logs if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: linux-buildbot-logs path: openwrt/logs - name: Upload config if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: linux-buildbot-config path: openwrt/.config @@ -152,7 +152,7 @@ jobs: - name: Upload prebuilt tools if: github.event_name == 'push' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: linux-buildbot-prebuilt-tools path: openwrt/tools.tar @@ -180,7 +180,7 @@ jobs: path: 'openwrt' - name: Download prebuilt tools from build job - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: linux-buildbot-prebuilt-tools path: openwrt From 3e41081eff490ef12cd00c4a5b06292947ac25a1 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 12 Oct 2022 16:49:46 +0200 Subject: [PATCH 57/78] CI: labeler: target major version of labeler action Target major version of labeler to include minor fixes and use always the latest major version with included fixes. Signed-off-by: Christian Marangi (cherry picked from commit 5fb7232bc0592cb2e1818fa47dfaecc291c8514e) --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 420617809b..b67265ca80 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -14,6 +14,6 @@ jobs: name: Pull Request Labeler runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4.0.1 + - uses: actions/labeler@v4 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' From 5872b1bfd09b7a43b8fa1ca0e977d20818192cbe Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 15 Oct 2022 10:56:46 +0200 Subject: [PATCH 58/78] CI: kernel: check if patch are refreshed for each target Enforce refreshed patch for each target with kernel pr tests. Signed-off-by: Christian Marangi (cherry picked from commit 689cfaeb7c37d7199f6e552bf32b0f996ea3040a) --- .github/workflows/kernel.yml | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index d8f98c531d..b9605b0deb 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -213,3 +213,74 @@ jobs: with: name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs path: "openwrt/logs" + + check-patch: + name: Check Kernel patches + needs: determine_targets + runs-on: ubuntu-latest + strategy: + fail-fast: False + matrix: + target: ${{fromJson(needs.determine_targets.outputs.target)}} + + container: ghcr.io/${{ needs.determine_targets.outputs.owner_lc }}/tools:latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout master directory + uses: actions/checkout@v3 + with: + path: openwrt + + - name: Fix permission + run: | + chown -R buildbot:buildbot openwrt + + - name: Initialization environment + run: | + TARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 1) + SUBTARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 2) + echo "TARGET=$TARGET" >> "$GITHUB_ENV" + echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" + + - name: Extract prebuilt tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: ./scripts/ext-tools.sh --tools /tools.tar + + - name: Setup Config + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_ALL_KMODS=y >> .config + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config + + echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config + echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config + + make defconfig + + - name: Build tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Refresh Kernel patches + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + make target/linux/refresh V=s + + . .github/workflows/scripts/ci_helpers.sh + + if git diff --name-only --exit-code; then + success "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} seems ok" + else + err "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} require refresh. (run 'make target/linux/refresh' and force push this pr)" + exit 1 + fi From 44609906109fae04b33ff67c5fbe651f566ef7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 19 Oct 2022 23:02:43 +0200 Subject: [PATCH 59/78] ci: kernel: trigger build check on changes in kernel.mk as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we can QA more parts of kernel build process. Signed-off-by: Petr Štetiar (cherry picked from commit 5e31c82bb506bff9c60c4d01791bea7a29e4a020) --- .github/workflows/kernel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index b9605b0deb..c8d30c0758 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -4,13 +4,13 @@ on: pull_request: paths: - '.github/workflows/kernel.yml' - - 'include/kernel-*' + - 'include/kernel*' - 'package/kernel/**' - 'target/linux/generic/**' push: paths: - '.github/workflows/kernel.yml' - - 'include/kernel-*' + - 'include/kernel*' - 'package/kernel/**' - 'target/linux/generic/**' From 1ae19596b88c452a53a43c3e325102755e87278e Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 21 Oct 2022 16:09:19 +0200 Subject: [PATCH 60/78] CI: kernel: fix deprecation of set-output From [0], github deprecated set-output with a better approach of appending variables to $GITHUB_OUTPUT [0] https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ Signed-off-by: Christian Marangi (cherry picked from commit 6d4bcadaa343cb969f370631a5ed5338306c056e) --- .github/workflows/kernel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index c8d30c0758..773e843bfd 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -35,14 +35,14 @@ jobs: run: | OWNER_LC=$(echo "${{ github.repository_owner }}" \ | tr '[:upper:]' '[:lower:]') - echo "::set-output name=owner_lc::$OWNER_LC" + echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT - name: Generate ccache hash id: ccache_hash run: | CCACHE_HASH=$(md5sum include/kernel-* | awk '{ print $1 }' \ | md5sum | awk '{ print $1 }') - echo "::set-output name=ccache_hash::$CCACHE_HASH" + echo "ccache_hash=$CCACHE_HASH" >> $GITHUB_OUTPUT - name: Set targets id: find_targets @@ -64,7 +64,7 @@ jobs: echo "$JSON" echo -e "\n---- targets ----\n" - echo "::set-output name=target::$JSON" + echo "target=$JSON" >> $GITHUB_OUTPUT build: name: Build Kernel with external toolchain From c14030c6bfed692cc173e2f6893cf54298417ea7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 7 Aug 2022 18:46:11 +0200 Subject: [PATCH 61/78] CI: packages: Add github CI job to build all packages This will build OpenWrt for MIPS malta BE and x86 64 Bit with all packages and kernel modules activated. It is triggered when something changes in the build system or when a package definition is changed. This task probably needs 90 minutes to execute, but I hope that it will find build problems in pull requests early. This intentionally does not activate the feeds, because building them too would take too long. We only build x86/64 and malta/be to save resources. I would like to detect build problems when a package is changed. We often had build breaks when a package version was increased sometime even in other packages which used it as a dependency. This is based on the .github/workflows/packages.yml workflow. Signed-off-by: Hauke Mehrtens (cherry picked from commit b99d3778863d6ba67ee1ebda6fd42413062c6480) --- .github/workflows/packages.yml | 151 +++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 .github/workflows/packages.yml diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml new file mode 100644 index 0000000000..bf918fe562 --- /dev/null +++ b/.github/workflows/packages.yml @@ -0,0 +1,151 @@ +name: Build all core packages + +on: + pull_request: + paths: + - '.github/workflows/packages.yml' + - 'config/**' + - 'include/**' + - 'package/**' + - 'target/linux/generic/**' + - 'toolchain/**' + push: + paths: + - '.github/workflows/packages.yml' + - 'config/**' + - 'include/**' + - 'package/**' + - 'target/linux/generic/**' + - 'toolchain/**' + +permissions: + contents: read + +jobs: + setup_build: + name: Setup build + runs-on: ubuntu-latest + outputs: + owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} + + steps: + - name: Set lower case owner name + id: lower_owner + run: | + OWNER_LC=$(echo "${{ github.repository_owner }}" \ + | tr '[:upper:]' '[:lower:]') + echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT + + build: + name: Build all core packages + needs: setup_build + runs-on: ubuntu-latest + strategy: + fail-fast: False + matrix: + include: + - name: malta-be + target: malta + subtarget: be + - name: x86-64 + target: x86 + subtarget: 64 + + container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout master directory + uses: actions/checkout@v3 + with: + path: openwrt + + - name: Fix permission + run: | + chown -R buildbot:buildbot openwrt + + - name: Initialization environment + run: | + TARGET=$(echo ${{ matrix.target }}) + SUBTARGET=$(echo ${{ matrix.subtarget }}) + echo "TARGET=$TARGET" >> "$GITHUB_ENV" + echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" + + - name: Parse toolchain file + working-directory: openwrt + run: | + TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ + | grep ".*openwrt-toolchain.*tar.xz")" + TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') + TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) + + echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" + echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" + + - name: Cache external toolchain + id: cache-external-toolchain + uses: actions/cache@v3 + with: + path: openwrt/${{ env.TOOLCHAIN_FILE }} + key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} + + - name: Download external toolchain + if: ${{ steps.cache-external-toolchain.outputs.cache-hit != 'true' }} + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ + | tar --xz -xf - + + - name: Extract prebuilt tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: ./scripts/ext-tools.sh --tools /tools.tar + + - name: Create configuration + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_ALL=y >> .config + echo CONFIG_ALL_KMODS=y >> .config + echo CONFIG_ALL_NONSHARED=y >> .config + + ./scripts/ext-toolchain.sh \ + --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ + --overwrite-config \ + --config ${{ env.TARGET }}/${{ env.SUBTARGET }} + + - name: Show configuration + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: ./scripts/diffconfig.sh + + - name: Build tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Build toolchain + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Build Kernel + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Build everything + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v3 + with: + name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs + path: "openwrt/logs" From 1b34fc20ccad1adb493d8f343bd9b1916ff69d5c Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 2 Nov 2022 22:17:51 +0100 Subject: [PATCH 62/78] CI: packages.yml: Fix usage of pre-build tools Activate CONFIG_AUTOREMOVE to match the settings used to build the pre-build tools. This has to match the pre-build tools to not rebuild them. This prevents the tools being rebuild in packages.yml. Signed-off-by: Hauke Mehrtens (cherry picked from commit 6645a019f88e2e6930fe63d1a51046a8e72445a0) --- .github/workflows/packages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index bf918fe562..49d795c122 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -112,6 +112,8 @@ jobs: echo CONFIG_ALL=y >> .config echo CONFIG_ALL_KMODS=y >> .config echo CONFIG_ALL_NONSHARED=y >> .config + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config ./scripts/ext-toolchain.sh \ --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ From 6ca1d74ac1732fd9c0c20b6a58fb77f1f2e1d808 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 9 Feb 2022 17:26:58 +0100 Subject: [PATCH 63/78] meta: drop issue_template The contents do not apply anymore now that the switch to Github issue has been decided. Signed-off-by: Jo-Philipp Wich (cherry picked from commit 64125ed1d0067f0648f2669b29b59a77ece3bf10) --- .github/issue_template | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .github/issue_template diff --git a/.github/issue_template b/.github/issue_template deleted file mode 100644 index dc2b2da70c..0000000000 --- a/.github/issue_template +++ /dev/null @@ -1,13 +0,0 @@ -This repository is a mirror of our main repo at https://git.openwrt.org/openwrt/openwrt.git -It is for reference only and is not active for checkins or for reporting issues. - -All issues should be reported at: https://bugs.openwrt.org - -Please do not open any NEW issue here - we will be closing the Github issues -capability in the near future. - -We will continue to accept Pull Requests here as described in the repo description. - -Close this now and click here: https://bugs.openwrt.org - -Thankyou for your co-operation. From 43980bfbf08365b2c92a51d1d82b2489106a8e12 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 5 Nov 2022 14:38:35 +0100 Subject: [PATCH 64/78] CI: Simplify if conditions There is no need to put a ${{ }} around the if conditions. Signed-off-by: Hauke Mehrtens (cherry picked from commit ce343653c2618e1d335662b924c382c0192b7b46) --- .github/workflows/kernel.yml | 2 +- .github/workflows/packages.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 773e843bfd..a204be3395 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -156,7 +156,7 @@ jobs: ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}- - name: Download external toolchain - if: ${{ steps.cache-external-toolchain.outputs.cache-hit != 'true' }} + if: steps.cache-external-toolchain.outputs.cache-hit != 'true' shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 49d795c122..05f089e66e 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -93,7 +93,7 @@ jobs: key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} - name: Download external toolchain - if: ${{ steps.cache-external-toolchain.outputs.cache-hit != 'true' }} + if: steps.cache-external-toolchain.outputs.cache-hit != 'true' shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | From 02391a5e5afb17378d4d9b67adef89c4c18fc558 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 1 Nov 2022 19:10:01 +0100 Subject: [PATCH 65/78] CI: Extract the OpenWrt building to own sub workflow Extract the building of OpenWrt into an own workflow which is then triggered by the kernel.yml and packages.yml workflow with different inputs. This allows us to share much of the code of the workflow. Signed-off-by: Hauke Mehrtens (cherry picked from commit 7c406a5f0837b0bfc293b723932695176a8ef6fe) --- .github/workflows/build.yml | 213 +++++++++++++++++++ .github/workflows/check-kernel-patches.yml | 93 ++++++++ .github/workflows/kernel.yml | 234 ++------------------- .github/workflows/packages.yml | 134 +----------- 4 files changed, 332 insertions(+), 342 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/check-kernel-patches.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..4cc1116d58 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,213 @@ +name: Build sub target + +on: + workflow_call: + inputs: + target: + required: true + type: string + include_feeds: + type: boolean + build_full: + type: boolean + build_all_modules: + type: boolean + build_all_kmods: + type: boolean + +permissions: + contents: read + +jobs: + setup_build: + name: Setup build + runs-on: ubuntu-latest + outputs: + owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} + ccache_hash: ${{ steps.ccache_hash.outputs.ccache_hash }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set lower case owner name + id: lower_owner + run: | + OWNER_LC=$(echo "${{ github.repository_owner }}" \ + | tr '[:upper:]' '[:lower:]') + echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT + + - name: Generate ccache hash + id: ccache_hash + run: | + CCACHE_HASH=$(md5sum include/kernel-* | awk '{ print $1 }' \ + | md5sum | awk '{ print $1 }') + echo "ccache_hash=$CCACHE_HASH" >> $GITHUB_OUTPUT + + build: + name: Build with external toolchain + needs: setup_build + runs-on: ubuntu-latest + + container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout master directory + uses: actions/checkout@v3 + with: + path: openwrt + + - name: Checkout packages feed + if: inputs.include_feeds == true + uses: actions/checkout@v3 + with: + repository: openwrt/packages + path: openwrt/feeds/packages + + - name: Checkout luci feed + if: inputs.include_feeds == true + uses: actions/checkout@v3 + with: + repository: openwrt/luci + path: openwrt/feeds/luci + + - name: Checkout routing feed + if: inputs.include_feeds == true + uses: actions/checkout@v3 + with: + repository: openwrt/routing + path: openwrt/feeds/routing + + - name: Checkout telephony feed + if: inputs.include_feeds == true + uses: actions/checkout@v3 + with: + repository: openwrt/telephony + path: openwrt/feeds/telephony + + - name: Fix permission + run: | + chown -R buildbot:buildbot openwrt + + - name: Initialization environment + run: | + TARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 1) + SUBTARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 2) + echo "TARGET=$TARGET" >> "$GITHUB_ENV" + echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" + + - name: Update & Install feeds + if: inputs.include_feeds == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + ./scripts/feeds update -a + ./scripts/feeds install -a + + - name: Parse toolchain file + working-directory: openwrt + run: | + TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ + | grep ".*openwrt-toolchain.*tar.xz")" + TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') + TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) + + echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" + echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" + + - name: Cache external toolchain + id: cache-external-toolchain + uses: actions/cache@v3 + with: + path: openwrt/${{ env.TOOLCHAIN_FILE }} + key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} + + - name: Cache ccache + uses: actions/cache@v3 + with: + path: openwrt/.ccache + key: ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-${{ needs.setup_build.outputs.ccache_hash }} + restore-keys: | + ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}- + + - name: Download external toolchain + if: steps.cache-external-toolchain.outputs.cache-hit != 'true' + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ + | tar --xz -xf - + + - name: Extract prebuilt tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: ./scripts/ext-tools.sh --tools /tools.tar + + - name: Configure all kernel modules + if: inputs.build_all_kmods == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_ALL_KMODS=y >> .config + + - name: Configure all modules + if: inputs.build_all_modules == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_ALL=y >> .config + + - name: Configure external toolchain + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config + + ./scripts/ext-toolchain.sh \ + --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ + --overwrite-config \ + --config ${{ env.TARGET }}/${{ env.SUBTARGET }} + + - name: Show configuration + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: ./scripts/diffconfig.sh + + - name: Build tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Build toolchain + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Build Kernel + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Build Kernel Kmods + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Build everything + if: inputs.build_full == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v3 + with: + name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs + path: "openwrt/logs" diff --git a/.github/workflows/check-kernel-patches.yml b/.github/workflows/check-kernel-patches.yml new file mode 100644 index 0000000000..3608b5a3cc --- /dev/null +++ b/.github/workflows/check-kernel-patches.yml @@ -0,0 +1,93 @@ +name: Refresh kernel for target + +on: + workflow_call: + inputs: + target: + required: true + type: string + +permissions: + contents: read + +jobs: + setup_build: + name: Setup build + runs-on: ubuntu-latest + outputs: + owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} + + steps: + - name: Set lower case owner name + id: lower_owner + run: | + OWNER_LC=$(echo "${{ github.repository_owner }}" \ + | tr '[:upper:]' '[:lower:]') + echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT + + check-patch: + name: Check Kernel patches + needs: setup_build + runs-on: ubuntu-latest + + container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout master directory + uses: actions/checkout@v3 + with: + path: openwrt + + - name: Fix permission + run: | + chown -R buildbot:buildbot openwrt + + - name: Initialization environment + run: | + TARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 1) + SUBTARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 2) + echo "TARGET=$TARGET" >> "$GITHUB_ENV" + echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" + + - name: Extract prebuilt tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: ./scripts/ext-tools.sh --tools /tools.tar + + - name: Configure system + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_ALL_KMODS=y >> .config + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config + + echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config + echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config + + make defconfig + + - name: Build tools + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh + + - name: Refresh Kernel patches + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + make target/linux/refresh V=s + + . .github/workflows/scripts/ci_helpers.sh + + if git diff --name-only --exit-code; then + success "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} seems ok" + else + err "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} require refresh. (run 'make target/linux/refresh' and force push this pr)" + exit 1 + fi diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index a204be3395..06efe14d5c 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -23,27 +23,11 @@ jobs: runs-on: ubuntu-latest outputs: target: ${{ steps.find_targets.outputs.target }} - owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} - ccache_hash: ${{ steps.ccache_hash.outputs.ccache_hash }} steps: - name: Checkout uses: actions/checkout@v3 - - name: Set lower case owner name - id: lower_owner - run: | - OWNER_LC=$(echo "${{ github.repository_owner }}" \ - | tr '[:upper:]' '[:lower:]') - echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT - - - name: Generate ccache hash - id: ccache_hash - run: | - CCACHE_HASH=$(md5sum include/kernel-* | awk '{ print $1 }' \ - | md5sum | awk '{ print $1 }') - echo "ccache_hash=$CCACHE_HASH" >> $GITHUB_OUTPUT - - name: Set targets id: find_targets run: | @@ -69,218 +53,30 @@ jobs: build: name: Build Kernel with external toolchain needs: determine_targets - runs-on: ubuntu-latest + permissions: + contents: read + packages: read strategy: fail-fast: False matrix: target: ${{fromJson(needs.determine_targets.outputs.target)}} + uses: ./.github/workflows/build.yml + with: + target: ${{ matrix.target }} + build_all_kmods: true + include_feeds: true - container: ghcr.io/${{ needs.determine_targets.outputs.owner_lc }}/tools:latest - - permissions: - contents: read - packages: read - - steps: - - name: Checkout master directory - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Checkout packages feed - uses: actions/checkout@v3 - with: - repository: openwrt/packages - path: openwrt/feeds/packages - - - name: Checkout luci feed - uses: actions/checkout@v3 - with: - repository: openwrt/luci - path: openwrt/feeds/luci - - - name: Checkout routing feed - uses: actions/checkout@v3 - with: - repository: openwrt/routing - path: openwrt/feeds/routing - - - name: Checkout telephony feed - uses: actions/checkout@v3 - with: - repository: openwrt/telephony - path: openwrt/feeds/telephony - - - name: Fix permission - run: | - chown -R buildbot:buildbot openwrt - - - name: Initialization environment - run: | - TARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 1) - SUBTARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 2) - echo "TARGET=$TARGET" >> "$GITHUB_ENV" - echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" - - - name: Update & Install feeds - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Parse toolchain file - working-directory: openwrt - run: | - TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ - | grep ".*openwrt-toolchain.*tar.xz")" - TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') - TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) - - echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" - echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" - - - name: Cache external toolchain - id: cache-external-toolchain - uses: actions/cache@v3 - with: - path: openwrt/${{ env.TOOLCHAIN_FILE }} - key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} - - - name: Cache ccache - uses: actions/cache@v3 - with: - path: openwrt/.ccache - key: ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-${{ needs.determine_targets.outputs.ccache_hash }} - restore-keys: | - ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}- - - - name: Download external toolchain - if: steps.cache-external-toolchain.outputs.cache-hit != 'true' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ - | tar --xz -xf - - - - name: Extract prebuilt tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/ext-tools.sh --tools /tools.tar - - - name: Configure external toolchain - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL_KMODS=y >> .config - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - - ./scripts/ext-toolchain.sh \ - --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ - --overwrite-config \ - --config ${{ env.TARGET }}/${{ env.SUBTARGET }} - - - name: Show configuration - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/diffconfig.sh - - - name: Build tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build toolchain - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build Kernel - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build Kernel Kmods - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v3 - with: - name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs - path: "openwrt/logs" - - check-patch: + check-kernel-patches: name: Check Kernel patches needs: determine_targets - runs-on: ubuntu-latest + permissions: + contents: read + packages: read strategy: fail-fast: False matrix: target: ${{fromJson(needs.determine_targets.outputs.target)}} + uses: ./.github/workflows/check-kernel-patches.yml + with: + target: ${{ matrix.target }} - container: ghcr.io/${{ needs.determine_targets.outputs.owner_lc }}/tools:latest - - permissions: - contents: read - packages: read - - steps: - - name: Checkout master directory - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Fix permission - run: | - chown -R buildbot:buildbot openwrt - - - name: Initialization environment - run: | - TARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 1) - SUBTARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 2) - echo "TARGET=$TARGET" >> "$GITHUB_ENV" - echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" - - - name: Extract prebuilt tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/ext-tools.sh --tools /tools.tar - - - name: Setup Config - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL_KMODS=y >> .config - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - - echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config - echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config - - make defconfig - - - name: Build tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Refresh Kernel patches - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - make target/linux/refresh V=s - - . .github/workflows/scripts/ci_helpers.sh - - if git diff --name-only --exit-code; then - success "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} seems ok" - else - err "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} require refresh. (run 'make target/linux/refresh' and force push this pr)" - exit 1 - fi diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 05f089e66e..a374b37023 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -22,132 +22,20 @@ permissions: contents: read jobs: - setup_build: - name: Setup build - runs-on: ubuntu-latest - outputs: - owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} - - steps: - - name: Set lower case owner name - id: lower_owner - run: | - OWNER_LC=$(echo "${{ github.repository_owner }}" \ - | tr '[:upper:]' '[:lower:]') - echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT - build: - name: Build all core packages - needs: setup_build - runs-on: ubuntu-latest + permissions: + contents: read + packages: read strategy: fail-fast: False matrix: include: - - name: malta-be - target: malta - subtarget: be - - name: x86-64 - target: x86 - subtarget: 64 + - target: malta/be + - target: x86/64 + uses: ./.github/workflows/build.yml + with: + target: ${{ matrix.target }} + build_all_kmods: true + build_all_modules: true + build_full: true - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:latest - - permissions: - contents: read - packages: read - - steps: - - name: Checkout master directory - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Fix permission - run: | - chown -R buildbot:buildbot openwrt - - - name: Initialization environment - run: | - TARGET=$(echo ${{ matrix.target }}) - SUBTARGET=$(echo ${{ matrix.subtarget }}) - echo "TARGET=$TARGET" >> "$GITHUB_ENV" - echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" - - - name: Parse toolchain file - working-directory: openwrt - run: | - TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ - | grep ".*openwrt-toolchain.*tar.xz")" - TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') - TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) - - echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" - echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" - - - name: Cache external toolchain - id: cache-external-toolchain - uses: actions/cache@v3 - with: - path: openwrt/${{ env.TOOLCHAIN_FILE }} - key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} - - - name: Download external toolchain - if: steps.cache-external-toolchain.outputs.cache-hit != 'true' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ - | tar --xz -xf - - - - name: Extract prebuilt tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/ext-tools.sh --tools /tools.tar - - - name: Create configuration - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL=y >> .config - echo CONFIG_ALL_KMODS=y >> .config - echo CONFIG_ALL_NONSHARED=y >> .config - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - - ./scripts/ext-toolchain.sh \ - --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ - --overwrite-config \ - --config ${{ env.TARGET }}/${{ env.SUBTARGET }} - - - name: Show configuration - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/diffconfig.sh - - - name: Build tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build toolchain - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build Kernel - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build everything - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v3 - with: - name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs - path: "openwrt/logs" From b0e6bce6347936d208eb60ce17f972407c7fe440 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 5 Nov 2022 14:27:11 +0100 Subject: [PATCH 66/78] CI: Allow building with internal toolchain This adds an option to build with internal toolchain. This can be used to build targets which are currently not build by the OpenWrt build bots and which needs their own toolchain build for every build. Building the toolchain takes about 30 minutes compared to using the external toolchain which takes some seconds. Signed-off-by: Hauke Mehrtens (cherry picked from commit 08f5283392674fe874c7f441128319263ce0d171) --- .github/workflows/build.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4cc1116d58..b29698a774 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,8 @@ on: target: required: true type: string + build_toolchain: + type: boolean include_feeds: type: boolean build_full: @@ -109,6 +111,7 @@ jobs: ./scripts/feeds install -a - name: Parse toolchain file + if: inputs.build_toolchain == false working-directory: openwrt run: | TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ @@ -120,6 +123,7 @@ jobs: echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" - name: Cache external toolchain + if: inputs.build_toolchain == false id: cache-external-toolchain uses: actions/cache@v3 with: @@ -135,7 +139,7 @@ jobs: ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}- - name: Download external toolchain - if: steps.cache-external-toolchain.outputs.cache-hit != 'true' + if: inputs.build_toolchain == false && steps.cache-external-toolchain.outputs.cache-hit != 'true' shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | @@ -162,6 +166,7 @@ jobs: echo CONFIG_ALL=y >> .config - name: Configure external toolchain + if: inputs.build_toolchain == false shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | @@ -174,6 +179,20 @@ jobs: --overwrite-config \ --config ${{ env.TARGET }}/${{ env.SUBTARGET }} + - name: Configure internal toolchain + if: inputs.build_toolchain == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config + + echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config + echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config + + make defconfig + - name: Show configuration shell: su buildbot -c "sh -e {0}" working-directory: openwrt From 0943f4dc99f3e6498415f7700023c61ee3880eee Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 3 Dec 2022 03:04:40 +0100 Subject: [PATCH 67/78] CI: Build all boards and testing kernel This adds options to build all boards of a selected target and an additional option to build the testing kernel instead of the normal kernel. This can be used by other trigger work flows. Signed-off-by: Hauke Mehrtens (cherry picked from commit cf361b85097216538dfac5ad7b22050390b0bc67) --- .github/workflows/build.yml | 20 ++++++++++++++++++++ .github/workflows/check-kernel-patches.yml | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b29698a774..347eb5a90c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,8 @@ on: target: required: true type: string + testing: + type: boolean build_toolchain: type: boolean include_feeds: @@ -16,6 +18,8 @@ on: type: boolean build_all_kmods: type: boolean + build_all_boards: + type: boolean permissions: contents: read @@ -151,6 +155,13 @@ jobs: working-directory: openwrt run: ./scripts/ext-tools.sh --tools /tools.tar + - name: Configure testing kernel + if: inputs.testing == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_TESTING_KERNEL=y >> .config + - name: Configure all kernel modules if: inputs.build_all_kmods == true shell: su buildbot -c "sh -e {0}" @@ -165,6 +176,15 @@ jobs: run: | echo CONFIG_ALL=y >> .config + - name: Configure all boards + if: inputs.build_all_boards == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_TARGET_MULTI_PROFILE=y >> .config + echo CONFIG_TARGET_PER_DEVICE_ROOTFS=y >> .config + echo CONFIG_TARGET_ALL_PROFILES=y >> .config + - name: Configure external toolchain if: inputs.build_toolchain == false shell: su buildbot -c "sh -e {0}" diff --git a/.github/workflows/check-kernel-patches.yml b/.github/workflows/check-kernel-patches.yml index 3608b5a3cc..c04cb27b37 100644 --- a/.github/workflows/check-kernel-patches.yml +++ b/.github/workflows/check-kernel-patches.yml @@ -6,6 +6,8 @@ on: target: required: true type: string + testing: + type: boolean permissions: contents: read @@ -58,6 +60,13 @@ jobs: working-directory: openwrt run: ./scripts/ext-tools.sh --tools /tools.tar + - name: Configure testing kernel + if: inputs.testing == true + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_TESTING_KERNEL=y >> .config + - name: Configure system shell: su buildbot -c "sh -e {0}" working-directory: openwrt From 5bc5df10d813b26b0ce5a816cfcfc501320229c6 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 27 Nov 2022 19:45:38 +0100 Subject: [PATCH 68/78] CI: tools: support per branch tools container Add support to push per branch container tools. For anything not official stick to latest tag that correspond to test run from master. If we are testing something for one of the openwrt stable branch, parse the branch name or the tag and push dedicated tools containers. To use the stable container for local testing the branch needs to have the prefix openwrt-[0-9][0-9].[0-9][0-9] (example openwrt-21.02-fixup) Any branch that will match this pattern openwrt-[0-9][0-9].[0-9][0-9] will refresh the tools container with the matching tag. (example branch openwrt-22.03 -> tools:openwrt-22.03) (example branch openwrt-22.03-test -> tools:openwrt-22.03) Signed-off-by: Christian Marangi (cherry picked from commit 75550771ae76fbcab4160e10b73287f918727384) --- .github/workflows/tools.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index def01678c6..304b5f7d62 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -174,6 +174,31 @@ jobs: run: | echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV" + # Per branch tools container tag + # By default stick to latest + # For official test targetting openwrt stable branch + # Get the branch or parse the tag and push dedicated tools containers + # Any branch that will match this pattern openwrt-[0-9][0-9].[0-9][0-9] + # will refresh the tools container with the matching tag. + # (example branch openwrt-22.03 -> tools:openwrt-22.03) + # (example branch openwrt-22.03-test -> tools:openwrt-22.03) + - name: Determine tools container tag + run: | + CONTAINER_TAG=latest + + if [ ${{ github.ref_type }} == "branch" ]; then + if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then + CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\).*/\1/')" + fi + elif [ ${{ github.ref_type }} == "tag" ]; then + if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then + CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" + fi + fi + + echo "Tools container to push tools:$CONTAINER_TAG" + echo "CONTAINER_TAG=$CONTAINER_TAG" >> "$GITHUB_ENV" + - name: Checkout uses: actions/checkout@v3 with: @@ -197,5 +222,5 @@ jobs: with: context: openwrt push: true - tags: ghcr.io/${{ env.OWNER_LC }}/tools:latest + tags: ghcr.io/${{ env.OWNER_LC }}/tools:${{ env.CONTAINER_TAG }} file: openwrt/.github/workflows/Dockerfile.tools From 40536320ef2f30e3872ba2e1748efc3c8cb0e06d Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 27 Nov 2022 19:53:08 +0100 Subject: [PATCH 69/78] CI: build: add support for per branch tools container Add support in build shared workflow for per branch tools container. With pr the target branch is parsed and the right container is used. To use the stable container for local testing the branch needs to have the prefix openwrt-[0-9][0-9].[0-9][0-9]- (example openwrt-21.02-fixup) Signed-off-by: Christian Marangi (cherry picked from commit abe8a4824210966e0899724bf4561a89216a1e36) --- .github/workflows/build.yml | 29 +++++++++++++++++++++- .github/workflows/check-kernel-patches.yml | 29 +++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 347eb5a90c..510ff6a879 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,7 @@ jobs: outputs: owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} ccache_hash: ${{ steps.ccache_hash.outputs.ccache_hash }} + container_tag: ${{ steps.determine_tools_container.outputs.container_tag }} steps: - name: Checkout @@ -50,12 +51,38 @@ jobs: | md5sum | awk '{ print $1 }') echo "ccache_hash=$CCACHE_HASH" >> $GITHUB_OUTPUT + # Per branch tools container tag + # By default stick to latest + # For official test targetting openwrt stable branch + # Get the branch or parse the tag and push dedicated tools containers + # For local test to use the correct container for stable release testing + # you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]- + - name: Determine tools container tag + id: determine_tools_container + run: | + CONTAINER_TAG=latest + if [ -n "${{ github.base_ref }}" ]; then + if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then + CONTAINER_TAG="${{ github.base_ref }}" + fi + elif [ ${{ github.ref_type }} == "branch" ]; then + if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]-'; then + CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')" + fi + elif [ ${{ github.ref_type }} == "tag" ]; then + if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then + CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" + fi + fi + echo "Tools container to use tools:$CONTAINER_TAG" + echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT + build: name: Build with external toolchain needs: setup_build runs-on: ubuntu-latest - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:latest + container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }} permissions: contents: read diff --git a/.github/workflows/check-kernel-patches.yml b/.github/workflows/check-kernel-patches.yml index c04cb27b37..f01782d5da 100644 --- a/.github/workflows/check-kernel-patches.yml +++ b/.github/workflows/check-kernel-patches.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest outputs: owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} + container_tag: ${{ steps.determine_tools_container.outputs.container_tag }} steps: - name: Set lower case owner name @@ -27,12 +28,38 @@ jobs: | tr '[:upper:]' '[:lower:]') echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT + # Per branch tools container tag + # By default stick to latest + # For official test targetting openwrt stable branch + # Get the branch or parse the tag and push dedicated tools containers + # For local test to use the correct container for stable release testing + # you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]- + - name: Determine tools container tag + id: determine_tools_container + run: | + CONTAINER_TAG=latest + if [ -n "${{ github.base_ref }}" ]; then + if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then + CONTAINER_TAG="${{ github.base_ref }}" + fi + elif [ ${{ github.ref_type }} == "branch" ]; then + if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]-'; then + CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')" + fi + elif [ ${{ github.ref_type }} == "tag" ]; then + if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then + CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" + fi + fi + echo "Tools container to use tools:$CONTAINER_TAG" + echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT + check-patch: name: Check Kernel patches needs: setup_build runs-on: ubuntu-latest - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:latest + container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }} permissions: contents: read From 69c0c3c2f904279d1c687cd7a42d82987c99b3e7 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 28 Nov 2022 12:44:01 +0100 Subject: [PATCH 70/78] CI: build: add support for external toolchains from stable branch Add support to use external toolchains from stable branch if we are testing commit targeting stable openwrt branch in kernel and packages workflow. With pr the target branch is parsed and the right toolchain is used. To use the stable toolchain for local testing the branch needs to have the prefix openwrt-[0-9][0-9].[0-9][0-9]- (example openwrt-21.02-fixup) Signed-off-by: Christian Marangi (cherry picked from commit e24a1e6f6d7f08fb766eb11b8008f8fc5b72d072) --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 510ff6a879..909b849731 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -145,13 +145,38 @@ jobs: if: inputs.build_toolchain == false working-directory: openwrt run: | - TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ + TOOLCHAIN_PATH=snapshots + + if [ -n "${{ github.base_ref }}" ]; then + if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then + major_ver="$(echo ${{ github.base_ref }} | sed 's/openwrt-/v/')" + fi + elif [ "${{ github.ref_type }}" = "branch" ]; then + if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]-'; then + major_ver="$(echo ${{ github.ref_name }} | sed 's/openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')" + fi + elif [ "${{ github.ref_type }}" = "tag" ]; then + if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then + major_ver="$(sed 's/\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" + fi + fi + + if [ -n "$major_ver" ]; then + git fetch --tags + latest_tag="$(git tag --sort=-creatordate -l $major_ver* | head -n1)" + if [ -n "$latest_tag" ]; then + TOOLCHAIN_PATH=releases/$(echo $latest_tag | sed 's/^v//') + fi + fi + + TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/$TOOLCHAIN_PATH/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ | grep ".*openwrt-toolchain.*tar.xz")" TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" + echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV" - name: Cache external toolchain if: inputs.build_toolchain == false @@ -174,7 +199,7 @@ jobs: shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | - wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \ + wget -O - https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${{ env.TOOLCHAIN_FILE }}.tar.xz \ | tar --xz -xf - - name: Extract prebuilt tools From 006e52545d1421affba9c993c70996e0f9f6e596 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 28 Nov 2022 16:12:13 +0100 Subject: [PATCH 71/78] CI: build: add support to fallback to sdk for external toolchain Add support to use sdk as external toolchain if the packaged external toolchain tar is not found on openwrt servers for build shared workflow. Signed-off-by: Christian Marangi (cherry picked from commit b59ac2a7d0ff427419e86bd38dea3d8910dd7926) --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 909b849731..511d9596fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,6 +143,7 @@ jobs: - name: Parse toolchain file if: inputs.build_toolchain == false + id: parse-toolchain working-directory: openwrt run: | TOOLCHAIN_PATH=snapshots @@ -169,22 +170,32 @@ jobs: fi fi - TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/$TOOLCHAIN_PATH/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \ - | grep ".*openwrt-toolchain.*tar.xz")" - TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') - TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) + SUMS_FILE="https://downloads.cdn.openwrt.org/$TOOLCHAIN_PATH/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" + if curl $SUMS_FILE | grep -q ".*openwrt-toolchain.*tar.xz"; then + TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-toolchain.*tar.xz")" + TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') + TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) + + echo "toolchain-type=external_toolchain" >> $GITHUB_OUTPUT + elif curl $SUMS_FILE | grep -q ".*openwrt-sdk.*tar.xz"; then + TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-sdk.*tar.xz")" + TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-sdk.*\).tar.xz/\1/p') + TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) + + echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT + fi echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV" - - name: Cache external toolchain + - name: Cache external toolchain/sdk if: inputs.build_toolchain == false id: cache-external-toolchain uses: actions/cache@v3 with: path: openwrt/${{ env.TOOLCHAIN_FILE }} - key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} + key: ${{ env.TOOLCHAIN_FILE }}-${{ steps.parse-toolchain.outputs.toolchain-type }}-${{ env.TOOLCHAIN_SHA256 }} - name: Cache ccache uses: actions/cache@v3 @@ -194,7 +205,7 @@ jobs: restore-keys: | ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}- - - name: Download external toolchain + - name: Download external toolchain/sdk if: inputs.build_toolchain == false && steps.cache-external-toolchain.outputs.cache-hit != 'true' shell: su buildbot -c "sh -e {0}" working-directory: openwrt @@ -238,7 +249,7 @@ jobs: echo CONFIG_TARGET_ALL_PROFILES=y >> .config - name: Configure external toolchain - if: inputs.build_toolchain == false + if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_toolchain' shell: su buildbot -c "sh -e {0}" working-directory: openwrt run: | @@ -251,6 +262,20 @@ jobs: --overwrite-config \ --config ${{ env.TARGET }}/${{ env.SUBTARGET }} + - name: Configure external toolchain with sdk + if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk' + shell: su buildbot -c "sh -e {0}" + working-directory: openwrt + run: | + echo CONFIG_DEVEL=y >> .config + echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config + + ./scripts/ext-toolchain.sh \ + --toolchain ${{ env.TOOLCHAIN_FILE }}/staging_dir/toolchain-* \ + --overwrite-config \ + --config ${{ env.TARGET }}/${{ env.SUBTARGET }} + - name: Configure internal toolchain if: inputs.build_toolchain == true shell: su buildbot -c "sh -e {0}" From 12b1d2f700188e7f6fbb9761510c83e36079ddc6 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 7 Sep 2022 23:50:36 +0200 Subject: [PATCH 72/78] build: handle directory with whitespace in AUTOREMOVE clean Package with whitespace in their build directory are not correctly removed when CONFIG_AUTOREMOVE is enabled. This is caused by xargs that use whitespace as delimiters. To handle this use \0 as the delimiter and set find to use \0 as the delimiter. Signed-off-by: Christian Marangi (cherry picked from commit dccee21792b89031bcd801030de403f195d80278) --- include/host-build.mk | 4 ++-- include/package.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/host-build.mk b/include/host-build.mk index 36b3fed1f3..c3e0c26e6a 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -197,8 +197,8 @@ ifndef DUMP ifneq ($(CONFIG_AUTOREMOVE),) host-compile: - $(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \ - $(XARGS) rm -rf + $(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -print0 | \ + $(XARGS) -0 rm -rf endif endef endif diff --git a/include/package.mk b/include/package.mk index 389ba4243b..225fdfc771 100644 --- a/include/package.mk +++ b/include/package.mk @@ -258,8 +258,8 @@ define Build/CoreTargets ifneq ($(CONFIG_AUTOREMOVE),) compile: -touch -r $(PKG_BUILD_DIR)/.built $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null - $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \ - $(XARGS) rm -rf + $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' -print0 | \ + $(XARGS) -0 rm -rf endif endef From cbce6c6d9519ab86e11c9752910a4c72dd52cb58 Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Mon, 10 Jan 2022 17:02:30 +0100 Subject: [PATCH 73/78] kernel: split kernel version to dedicated files Move the kernel versions and hash to dedicated files. This makes kernel bump quicker and fix some annoying problem with rebasing when multiple kernel bump are proposed. Signed-off-by: Ansuel Smith [Rebased on top of current master] Signed-off-by: Rui Salvaterra (cherry picked from commit 0765466a42f46f7357e260866a4284ed567bb7ad) Signed-off-by: Josef Schlehofer [Rebased on top of current openwrt-21.02] --- include/kernel-5.4 | 2 ++ include/kernel-version.mk | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 include/kernel-5.4 diff --git a/include/kernel-5.4 b/include/kernel-5.4 new file mode 100644 index 0000000000..cd7de7b8fc --- /dev/null +++ b/include/kernel-5.4 @@ -0,0 +1,2 @@ +LINUX_VERSION-5.4 = .225 +LINUX_KERNEL_HASH-5.4.225 = 59f596f6714317955cf481590babcf015aff2bc1900bd8e8dc8f7af73bc560aa diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 7480663923..1edb01df27 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,12 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .225 +KERNEL_DETAILS_FILE=$(INCLUDE_DIR)/kernel-$(KERNEL_PATCHVER) +ifeq ($(wildcard $(KERNEL_DETAILS_FILE)),) + $(error Missing kernel version/hash file for $(KERNEL_PATCHVER). Please create $(KERNEL_DETAILS_FILE)) +endif -LINUX_KERNEL_HASH-5.4.225 = 59f596f6714317955cf481590babcf015aff2bc1900bd8e8dc8f7af73bc560aa +include $(KERNEL_DETAILS_FILE) remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) From ee05f20e9717669d979a8666d74b70fd3eb0e7a9 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 29 Nov 2022 19:53:23 +0100 Subject: [PATCH 74/78] CI: add support to tag pr targeting stable branch Add support to tag pr targeting stable branch matching the simple regex of openwrt-[0-9][0-9].[0-9][0-9]. The tag that will be added will match the pr target branch. Signed-off-by: Christian Marangi (cherry picked from commit b67d284e93ee052e3ea3abb5d3dae55723ce0353) --- .github/workflows/labeler.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index b67265ca80..62a895a68b 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -17,3 +17,17 @@ jobs: - uses: actions/labeler@v4 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' + + - name: Check Branch + id: check-branch + run: | + if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then + echo "apply-tag=yes" >> $GITHUB_OUTPUT + fi + + - uses: buildsville/add-remove-label@v2.0.0 + if: ${{ steps.check-branch.outputs.apply-tag }} + with: + token: ${{secrets.GITHUB_TOKEN}} + labels: ${{ github.base_ref }} + type: add From 26f35c40b624600b07292951c0ced58db500ce66 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 1 Dec 2022 01:46:03 +0100 Subject: [PATCH 75/78] CI: labeler: fix wrong label for pr targeting stable branch The label used for stable branch is in the form of release/[0-9][0-9].[0-9][0-9] Currently we apply the name of the target branch as the label, fix this and correctly use the current label. Signed-off-by: Christian Marangi (cherry picked from commit af8bc8e51b6daef65c497522b67a1dd9d0cdab84) --- .github/workflows/labeler.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 62a895a68b..5f82b88a50 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -22,12 +22,12 @@ jobs: id: check-branch run: | if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then - echo "apply-tag=yes" >> $GITHUB_OUTPUT + echo "release-tag=$(echo ${{ github.base_ref }} | sed 's/openwrt-/release\//')" >> $GITHUB_OUTPUT fi - uses: buildsville/add-remove-label@v2.0.0 - if: ${{ steps.check-branch.outputs.apply-tag }} + if: ${{ steps.check-branch.outputs.release-tag }} with: token: ${{secrets.GITHUB_TOKEN}} - labels: ${{ github.base_ref }} + labels: ${{ steps.check-branch.outputs.release-tag }} type: add From d48f38c30f7c3d8458d86fec238b5153f78df297 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 4 Dec 2022 20:28:28 +0100 Subject: [PATCH 76/78] CI: fix matching for openwrt release branch for container selection The current match logic doesn't handle test for push events related to stable release (example openwrt-22.03) but only fork with the related prefix (example openwrt-22.03-fixup) Fix wrong matching and while at it also add extra checks to other matching (check if the branch name actually start with the requested prefix) Fixes: abe8a4824210 ("CI: build: add support for per branch tools container") Signed-off-by: Christian Marangi (cherry picked from commit 65c3d19c4b28ccac0d08d916de0ffa4c0e7b3dc2) --- .github/workflows/build.yml | 10 ++++++---- .github/workflows/check-kernel-patches.yml | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 511d9596fa..f35a70d8f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,16 +62,18 @@ jobs: run: | CONTAINER_TAG=latest if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then + if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then CONTAINER_TAG="${{ github.base_ref }}" fi elif [ ${{ github.ref_type }} == "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]-'; then + if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then + CONTAINER_TAG=${{ github.ref_name }} + elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')" fi elif [ ${{ github.ref_type }} == "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then - CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" + if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then + CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" fi fi echo "Tools container to use tools:$CONTAINER_TAG" diff --git a/.github/workflows/check-kernel-patches.yml b/.github/workflows/check-kernel-patches.yml index f01782d5da..e5b619064f 100644 --- a/.github/workflows/check-kernel-patches.yml +++ b/.github/workflows/check-kernel-patches.yml @@ -39,16 +39,18 @@ jobs: run: | CONTAINER_TAG=latest if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then + if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then CONTAINER_TAG="${{ github.base_ref }}" fi elif [ ${{ github.ref_type }} == "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]-'; then + if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then + CONTAINER_TAG=${{ github.ref_name }} + elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')" fi elif [ ${{ github.ref_type }} == "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then - CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" + if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then + CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" fi fi echo "Tools container to use tools:$CONTAINER_TAG" From 8df40b136a172db2d65745695a60515395339413 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 4 Dec 2022 20:36:11 +0100 Subject: [PATCH 77/78] CI: build: fix matching for openwrt release branch for toolchain parsing The current match logic doesn't handle test for push events related to stable release (example openwrt-22.03) but only fork with the related prefix (example openwrt-22.03-fixup) Fix wrong matching and while at it also add extra checks to other matching (check if the branch name actually start with the requested prefix) Fixes: e24a1e6f6d7f ("CI: build: add support for external toolchains from stable branch") Signed-off-by: Christian Marangi (cherry picked from commit e3cf2b84e5f8708ca17d931ef60746516c8a2fe4) --- .github/workflows/build.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f35a70d8f9..115bf2c654 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -151,16 +151,18 @@ jobs: TOOLCHAIN_PATH=snapshots if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then - major_ver="$(echo ${{ github.base_ref }} | sed 's/openwrt-/v/')" + if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then + major_ver="$(echo ${{ github.base_ref }} | sed 's/^openwrt-/v/')" fi elif [ "${{ github.ref_type }}" = "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]-'; then - major_ver="$(echo ${{ github.ref_name }} | sed 's/openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')" + if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then + major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-/v/')" + elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then + major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')" fi elif [ "${{ github.ref_type }}" = "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then - major_ver="$(sed 's/\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" + if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then + major_ver="$(echo ${{ github.ref_name }} | sed 's/^\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" fi fi From be3b061d7bbf425c95ef9108a37c51747c0025e9 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 4 Dec 2022 20:58:11 +0100 Subject: [PATCH 78/78] CI: trigger check also on build and check-kernel-patches workflow change Since kernel and packages workflow now use a shared build workflow, they also need to react on changes on these shared workflow. Fix this and add these shared workflow to the event paths to check. Signed-off-by: Christian Marangi (cherry picked from commit 644175c29ca11e0a008c58c82986045f738f5c6f) --- .github/workflows/kernel.yml | 4 ++++ .github/workflows/packages.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 06efe14d5c..5a8c1123af 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -3,12 +3,16 @@ name: Build Kernel on: pull_request: paths: + - '.github/workflows/check-kernel-patches.yml' + - '.github/workflows/build.yml' - '.github/workflows/kernel.yml' - 'include/kernel*' - 'package/kernel/**' - 'target/linux/generic/**' push: paths: + - '.github/workflows/check-kernel-patches.yml' + - '.github/workflows/build.yml' - '.github/workflows/kernel.yml' - 'include/kernel*' - 'package/kernel/**' diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index a374b37023..94982ba65b 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -3,6 +3,7 @@ name: Build all core packages on: pull_request: paths: + - '.github/workflows/build.yml' - '.github/workflows/packages.yml' - 'config/**' - 'include/**' @@ -11,6 +12,7 @@ on: - 'toolchain/**' push: paths: + - '.github/workflows/build.yml' - '.github/workflows/packages.yml' - 'config/**' - 'include/**'