From 3c561cff0bb5bfa20ac0b498e98bb0a884bb9616 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Thu, 24 Feb 2022 20:52:16 +0000 Subject: [PATCH 01/66] kernel: generic: add missing 5.10 symbols Add the following kconfig symbols (disabled): CONFIG_DEFAULT_FQ CONFIG_DEFAULT_CODEL CONFIG_DEFAULT_SFQ Also resort the config with the kconfig.pl script. Fixes: f39872d966 ("kernel: generic: select the fq_codel qdisc by default") Tested-by: Christian Lamparter Signed-off-by: Rui Salvaterra --- target/linux/generic/config-5.10 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index 56eb052981..c6a34eea13 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -1329,8 +1329,10 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_WX is not set # CONFIG_DEBUG_ZBOOT is not set # CONFIG_DECNET is not set +# CONFIG_DEFAULT_CODEL is not set CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y +# CONFIG_DEFAULT_FQ is not set CONFIG_DEFAULT_FQ_CODEL=y CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 @@ -1343,6 +1345,7 @@ CONFIG_DEFAULT_NET_SCH="fq_codel" CONFIG_DEFAULT_SECURITY="" CONFIG_DEFAULT_SECURITY_DAC=y # CONFIG_DEFAULT_SECURITY_SELINUX is not set +# CONFIG_DEFAULT_SFQ is not set CONFIG_DEFAULT_TCP_CONG="cubic" CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set @@ -3594,6 +3597,7 @@ CONFIG_MTD_NAND_IDS=y # CONFIG_MTD_NAND_JZ4740 is not set # CONFIG_MTD_NAND_MPC5121_NFC is not set # CONFIG_MTD_NAND_MTK is not set +# CONFIG_MTD_NAND_MTK_BMT is not set # CONFIG_MTD_NAND_MXC is not set # CONFIG_MTD_NAND_MXIC is not set # CONFIG_MTD_NAND_NANDSIM is not set @@ -3678,7 +3682,6 @@ CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_UBI_GLUEBI is not set # CONFIG_MTD_UIMAGE_SPLIT is not set # CONFIG_MTD_VIRT_CONCAT is not set -# CONFIG_MTD_NAND_MTK_BMT is not set # CONFIG_MTK_MMC is not set # CONFIG_MTK_MMSYS is not set # CONFIG_MULTIPLEXER is not set @@ -4590,14 +4593,14 @@ CONFIG_PROC_SYSCTL=y # CONFIG_PSB6970_PHY is not set # CONFIG_PSI is not set # CONFIG_PSTORE is not set +# CONFIG_PSTORE_842_COMPRESS is not set # CONFIG_PSTORE_COMPRESS is not set # CONFIG_PSTORE_COMPRESS_DEFAULT="deflate" # CONFIG_PSTORE_CONSOLE is not set # CONFIG_PSTORE_DEFLATE_COMPRESS is not set # CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT is not set -# CONFIG_PSTORE_842_COMPRESS is not set -# CONFIG_PSTORE_LZ4_COMPRESS is not set # CONFIG_PSTORE_LZ4HC_COMPRESS is not set +# CONFIG_PSTORE_LZ4_COMPRESS is not set # CONFIG_PSTORE_LZO_COMPRESS is not set # CONFIG_PSTORE_PMSG is not set # CONFIG_PSTORE_RAM is not set From 0dbcefdd5229daacf6cd4c9996b8e6f31c90ffd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 25 Feb 2022 10:47:08 +0100 Subject: [PATCH 02/66] bcm4908: fix USB PHY support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes problem with USB PHY not handling some USB 3.0 devices. Signed-off-by: Rafał Miłecki --- ...y-phy-brcm-usb-fixup-BCM4908-support.patch | 147 ++++++++++++++++++ ...y-phy-brcm-usb-fixup-BCM4908-support.patch | 147 ++++++++++++++++++ 2 files changed, 294 insertions(+) create mode 100644 target/linux/bcm4908/patches-5.10/088-v5.18-phy-phy-brcm-usb-fixup-BCM4908-support.patch create mode 100644 target/linux/bcm4908/patches-5.4/088-v5.18-phy-phy-brcm-usb-fixup-BCM4908-support.patch diff --git a/target/linux/bcm4908/patches-5.10/088-v5.18-phy-phy-brcm-usb-fixup-BCM4908-support.patch b/target/linux/bcm4908/patches-5.10/088-v5.18-phy-phy-brcm-usb-fixup-BCM4908-support.patch new file mode 100644 index 0000000000..a9568bcbba --- /dev/null +++ b/target/linux/bcm4908/patches-5.10/088-v5.18-phy-phy-brcm-usb-fixup-BCM4908-support.patch @@ -0,0 +1,147 @@ +From 32942d33d63d27714ed16a4176e5a99547adb6e0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 18 Feb 2022 18:24:59 +0100 +Subject: [PATCH] phy: phy-brcm-usb: fixup BCM4908 support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Just like every other family BCM4908 should get its own enum value. That +is required to properly handle it in chipset conditional code. + +The real change is excluding BCM4908 from the PLL reprogramming code +(see brcmusb_usb3_pll_54mhz()). I'm not sure what's the BCM4908 +reference clock frequency but: +1. BCM4908 custom driver from Broadcom's SDK doesn't reprogram PLL +2. Doing that in Linux driver stopped PHY handling some USB 3.0 devices + +This change makes USB 3.0 PHY recognize e.g.: +1. 04e8:6860 - Samsung Electronics Co., Ltd Galaxy series, misc. (MTP mode) +2. 1058:259f - Western Digital My Passport 259F + +Broadcom's STB SoCs come with a set of SUN_TOP_CTRL_* registers that +allow reading chip family and product ids. Such a block & register is +missing on BCM4908 so this commit introduces "compatible" string +specific binding. + +Fixes: 4b402fa8e0b7 ("phy: phy-brcm-usb: support PHY on the BCM4908") +Signed-off-by: Rafał Miłecki +Reviewed-by: Florian Fainelli +Link: https://lore.kernel.org/r/20220218172459.10431-1-zajec5@gmail.com +Signed-off-by: Vinod Koul +--- + drivers/phy/broadcom/phy-brcm-usb-init.c | 36 ++++++++++++++++++++++++ + drivers/phy/broadcom/phy-brcm-usb-init.h | 1 + + drivers/phy/broadcom/phy-brcm-usb.c | 11 +++++++- + 3 files changed, 47 insertions(+), 1 deletion(-) + +--- a/drivers/phy/broadcom/phy-brcm-usb-init.c ++++ b/drivers/phy/broadcom/phy-brcm-usb-init.c +@@ -79,6 +79,7 @@ + + enum brcm_family_type { + BRCM_FAMILY_3390A0, ++ BRCM_FAMILY_4908, + BRCM_FAMILY_7250B0, + BRCM_FAMILY_7271A0, + BRCM_FAMILY_7364A0, +@@ -96,6 +97,7 @@ enum brcm_family_type { + + static const char *family_names[BRCM_FAMILY_COUNT] = { + USB_BRCM_FAMILY(3390A0), ++ USB_BRCM_FAMILY(4908), + USB_BRCM_FAMILY(7250B0), + USB_BRCM_FAMILY(7271A0), + USB_BRCM_FAMILY(7364A0), +@@ -203,6 +205,27 @@ usb_reg_bits_map_table[BRCM_FAMILY_COUNT + USB_CTRL_USB_PM_USB20_HC_RESETB_VAR_MASK, + ENDIAN_SETTINGS, /* USB_CTRL_SETUP ENDIAN bits */ + }, ++ /* 4908 */ ++ [BRCM_FAMILY_4908] = { ++ 0, /* USB_CTRL_SETUP_SCB1_EN_MASK */ ++ 0, /* USB_CTRL_SETUP_SCB2_EN_MASK */ ++ 0, /* USB_CTRL_SETUP_SS_EHCI64BIT_EN_MASK */ ++ 0, /* USB_CTRL_SETUP_STRAP_IPP_SEL_MASK */ ++ 0, /* USB_CTRL_SETUP_OC3_DISABLE_MASK */ ++ 0, /* USB_CTRL_PLL_CTL_PLL_IDDQ_PWRDN_MASK */ ++ 0, /* USB_CTRL_USB_PM_BDC_SOFT_RESETB_MASK */ ++ USB_CTRL_USB_PM_XHC_SOFT_RESETB_MASK, ++ USB_CTRL_USB_PM_USB_PWRDN_MASK, ++ 0, /* USB_CTRL_USB30_CTL1_XHC_SOFT_RESETB_MASK */ ++ 0, /* USB_CTRL_USB30_CTL1_USB3_IOC_MASK */ ++ 0, /* USB_CTRL_USB30_CTL1_USB3_IPP_MASK */ ++ 0, /* USB_CTRL_USB_DEVICE_CTL1_PORT_MODE_MASK */ ++ 0, /* USB_CTRL_USB_PM_SOFT_RESET_MASK */ ++ 0, /* USB_CTRL_SETUP_CC_DRD_MODE_ENABLE_MASK */ ++ 0, /* USB_CTRL_SETUP_STRAP_CC_DRD_MODE_ENABLE_SEL_MASK */ ++ 0, /* USB_CTRL_USB_PM_USB20_HC_RESETB_VAR_MASK */ ++ 0, /* USB_CTRL_SETUP ENDIAN bits */ ++ }, + /* 7250b0 */ + [BRCM_FAMILY_7250B0] = { + USB_CTRL_SETUP_SCB1_EN_MASK, +@@ -559,6 +582,7 @@ static void brcmusb_usb3_pll_54mhz(struc + */ + switch (params->selected_family) { + case BRCM_FAMILY_3390A0: ++ case BRCM_FAMILY_4908: + case BRCM_FAMILY_7250B0: + case BRCM_FAMILY_7366C0: + case BRCM_FAMILY_74371A0: +@@ -1004,6 +1028,18 @@ static const struct brcm_usb_init_ops bc + .set_dual_select = usb_set_dual_select, + }; + ++void brcm_usb_dvr_init_4908(struct brcm_usb_init_params *params) ++{ ++ int fam; ++ ++ fam = BRCM_FAMILY_4908; ++ params->selected_family = fam; ++ params->usb_reg_bits_map = ++ &usb_reg_bits_map_table[fam][0]; ++ params->family_name = family_names[fam]; ++ params->ops = &bcm7445_ops; ++} ++ + void brcm_usb_dvr_init_7445(struct brcm_usb_init_params *params) + { + int fam; +--- a/drivers/phy/broadcom/phy-brcm-usb-init.h ++++ b/drivers/phy/broadcom/phy-brcm-usb-init.h +@@ -64,6 +64,7 @@ struct brcm_usb_init_params { + bool suspend_with_clocks; + }; + ++void brcm_usb_dvr_init_4908(struct brcm_usb_init_params *params); + void brcm_usb_dvr_init_7445(struct brcm_usb_init_params *params); + void brcm_usb_dvr_init_7216(struct brcm_usb_init_params *params); + void brcm_usb_dvr_init_7211b0(struct brcm_usb_init_params *params); +--- a/drivers/phy/broadcom/phy-brcm-usb.c ++++ b/drivers/phy/broadcom/phy-brcm-usb.c +@@ -253,6 +253,15 @@ static const struct attribute_group brcm + .attrs = brcm_usb_phy_attrs, + }; + ++static const struct match_chip_info chip_info_4908 = { ++ .init_func = &brcm_usb_dvr_init_4908, ++ .required_regs = { ++ BRCM_REGS_CTRL, ++ BRCM_REGS_XHCI_EC, ++ -1, ++ }, ++}; ++ + static const struct match_chip_info chip_info_7216 = { + .init_func = &brcm_usb_dvr_init_7216, + .required_regs = { +@@ -288,7 +297,7 @@ static const struct match_chip_info chip + static const struct of_device_id brcm_usb_dt_ids[] = { + { + .compatible = "brcm,bcm4908-usb-phy", +- .data = &chip_info_7445, ++ .data = &chip_info_4908, + }, + { + .compatible = "brcm,bcm7216-usb-phy", diff --git a/target/linux/bcm4908/patches-5.4/088-v5.18-phy-phy-brcm-usb-fixup-BCM4908-support.patch b/target/linux/bcm4908/patches-5.4/088-v5.18-phy-phy-brcm-usb-fixup-BCM4908-support.patch new file mode 100644 index 0000000000..a9568bcbba --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/088-v5.18-phy-phy-brcm-usb-fixup-BCM4908-support.patch @@ -0,0 +1,147 @@ +From 32942d33d63d27714ed16a4176e5a99547adb6e0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 18 Feb 2022 18:24:59 +0100 +Subject: [PATCH] phy: phy-brcm-usb: fixup BCM4908 support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Just like every other family BCM4908 should get its own enum value. That +is required to properly handle it in chipset conditional code. + +The real change is excluding BCM4908 from the PLL reprogramming code +(see brcmusb_usb3_pll_54mhz()). I'm not sure what's the BCM4908 +reference clock frequency but: +1. BCM4908 custom driver from Broadcom's SDK doesn't reprogram PLL +2. Doing that in Linux driver stopped PHY handling some USB 3.0 devices + +This change makes USB 3.0 PHY recognize e.g.: +1. 04e8:6860 - Samsung Electronics Co., Ltd Galaxy series, misc. (MTP mode) +2. 1058:259f - Western Digital My Passport 259F + +Broadcom's STB SoCs come with a set of SUN_TOP_CTRL_* registers that +allow reading chip family and product ids. Such a block & register is +missing on BCM4908 so this commit introduces "compatible" string +specific binding. + +Fixes: 4b402fa8e0b7 ("phy: phy-brcm-usb: support PHY on the BCM4908") +Signed-off-by: Rafał Miłecki +Reviewed-by: Florian Fainelli +Link: https://lore.kernel.org/r/20220218172459.10431-1-zajec5@gmail.com +Signed-off-by: Vinod Koul +--- + drivers/phy/broadcom/phy-brcm-usb-init.c | 36 ++++++++++++++++++++++++ + drivers/phy/broadcom/phy-brcm-usb-init.h | 1 + + drivers/phy/broadcom/phy-brcm-usb.c | 11 +++++++- + 3 files changed, 47 insertions(+), 1 deletion(-) + +--- a/drivers/phy/broadcom/phy-brcm-usb-init.c ++++ b/drivers/phy/broadcom/phy-brcm-usb-init.c +@@ -79,6 +79,7 @@ + + enum brcm_family_type { + BRCM_FAMILY_3390A0, ++ BRCM_FAMILY_4908, + BRCM_FAMILY_7250B0, + BRCM_FAMILY_7271A0, + BRCM_FAMILY_7364A0, +@@ -96,6 +97,7 @@ enum brcm_family_type { + + static const char *family_names[BRCM_FAMILY_COUNT] = { + USB_BRCM_FAMILY(3390A0), ++ USB_BRCM_FAMILY(4908), + USB_BRCM_FAMILY(7250B0), + USB_BRCM_FAMILY(7271A0), + USB_BRCM_FAMILY(7364A0), +@@ -203,6 +205,27 @@ usb_reg_bits_map_table[BRCM_FAMILY_COUNT + USB_CTRL_USB_PM_USB20_HC_RESETB_VAR_MASK, + ENDIAN_SETTINGS, /* USB_CTRL_SETUP ENDIAN bits */ + }, ++ /* 4908 */ ++ [BRCM_FAMILY_4908] = { ++ 0, /* USB_CTRL_SETUP_SCB1_EN_MASK */ ++ 0, /* USB_CTRL_SETUP_SCB2_EN_MASK */ ++ 0, /* USB_CTRL_SETUP_SS_EHCI64BIT_EN_MASK */ ++ 0, /* USB_CTRL_SETUP_STRAP_IPP_SEL_MASK */ ++ 0, /* USB_CTRL_SETUP_OC3_DISABLE_MASK */ ++ 0, /* USB_CTRL_PLL_CTL_PLL_IDDQ_PWRDN_MASK */ ++ 0, /* USB_CTRL_USB_PM_BDC_SOFT_RESETB_MASK */ ++ USB_CTRL_USB_PM_XHC_SOFT_RESETB_MASK, ++ USB_CTRL_USB_PM_USB_PWRDN_MASK, ++ 0, /* USB_CTRL_USB30_CTL1_XHC_SOFT_RESETB_MASK */ ++ 0, /* USB_CTRL_USB30_CTL1_USB3_IOC_MASK */ ++ 0, /* USB_CTRL_USB30_CTL1_USB3_IPP_MASK */ ++ 0, /* USB_CTRL_USB_DEVICE_CTL1_PORT_MODE_MASK */ ++ 0, /* USB_CTRL_USB_PM_SOFT_RESET_MASK */ ++ 0, /* USB_CTRL_SETUP_CC_DRD_MODE_ENABLE_MASK */ ++ 0, /* USB_CTRL_SETUP_STRAP_CC_DRD_MODE_ENABLE_SEL_MASK */ ++ 0, /* USB_CTRL_USB_PM_USB20_HC_RESETB_VAR_MASK */ ++ 0, /* USB_CTRL_SETUP ENDIAN bits */ ++ }, + /* 7250b0 */ + [BRCM_FAMILY_7250B0] = { + USB_CTRL_SETUP_SCB1_EN_MASK, +@@ -559,6 +582,7 @@ static void brcmusb_usb3_pll_54mhz(struc + */ + switch (params->selected_family) { + case BRCM_FAMILY_3390A0: ++ case BRCM_FAMILY_4908: + case BRCM_FAMILY_7250B0: + case BRCM_FAMILY_7366C0: + case BRCM_FAMILY_74371A0: +@@ -1004,6 +1028,18 @@ static const struct brcm_usb_init_ops bc + .set_dual_select = usb_set_dual_select, + }; + ++void brcm_usb_dvr_init_4908(struct brcm_usb_init_params *params) ++{ ++ int fam; ++ ++ fam = BRCM_FAMILY_4908; ++ params->selected_family = fam; ++ params->usb_reg_bits_map = ++ &usb_reg_bits_map_table[fam][0]; ++ params->family_name = family_names[fam]; ++ params->ops = &bcm7445_ops; ++} ++ + void brcm_usb_dvr_init_7445(struct brcm_usb_init_params *params) + { + int fam; +--- a/drivers/phy/broadcom/phy-brcm-usb-init.h ++++ b/drivers/phy/broadcom/phy-brcm-usb-init.h +@@ -64,6 +64,7 @@ struct brcm_usb_init_params { + bool suspend_with_clocks; + }; + ++void brcm_usb_dvr_init_4908(struct brcm_usb_init_params *params); + void brcm_usb_dvr_init_7445(struct brcm_usb_init_params *params); + void brcm_usb_dvr_init_7216(struct brcm_usb_init_params *params); + void brcm_usb_dvr_init_7211b0(struct brcm_usb_init_params *params); +--- a/drivers/phy/broadcom/phy-brcm-usb.c ++++ b/drivers/phy/broadcom/phy-brcm-usb.c +@@ -253,6 +253,15 @@ static const struct attribute_group brcm + .attrs = brcm_usb_phy_attrs, + }; + ++static const struct match_chip_info chip_info_4908 = { ++ .init_func = &brcm_usb_dvr_init_4908, ++ .required_regs = { ++ BRCM_REGS_CTRL, ++ BRCM_REGS_XHCI_EC, ++ -1, ++ }, ++}; ++ + static const struct match_chip_info chip_info_7216 = { + .init_func = &brcm_usb_dvr_init_7216, + .required_regs = { +@@ -288,7 +297,7 @@ static const struct match_chip_info chip + static const struct of_device_id brcm_usb_dt_ids[] = { + { + .compatible = "brcm,bcm4908-usb-phy", +- .data = &chip_info_7445, ++ .data = &chip_info_4908, + }, + { + .compatible = "brcm,bcm7216-usb-phy", From fb830fd894f7ae5ad23f712ebf50808f8be2a1f7 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Fri, 25 Feb 2022 12:28:46 +0100 Subject: [PATCH 03/66] 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 --- .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 68a20d86313a58128cc8c17a58d5bd38c603c673 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Feb 2022 20:19:32 -0800 Subject: [PATCH 04/66] tools/quilt: update to 0.67 - Call pager with original LANG environment variable - Consistently complain early if no series file is found - Fix handling of symbolic links by several commands - Tighten the patch format parsing - Reuse the shell (performance) - Document the series file format further - Document that quilt loads /etc/quilt.quiltrc - configure: Make stat configurable - series: Minor optimizations - setup: Don't obey the settings of any englobing .pc - setup: Default to fast mode - quilt.el: Fix documentation of quilt-pc-directory - quilt.el: Load /etc/quilt.quiltrc if ~/.quiltrc doesn't exist - quilt.el: Fix quilt-editable when QUILT_PATCHES_PREFIX is set Refresh patches. Signed-off-by: Rosen Penev [add changelog] Signed-off-by: Paul Spooren --- tools/quilt/Makefile | 4 ++-- tools/quilt/patches/000-relocatable.patch | 4 ++-- tools/quilt/patches/001-fix_compile.patch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/quilt/Makefile b/tools/quilt/Makefile index 149b7996a3..c16f989b5d 100644 --- a/tools/quilt/Makefile +++ b/tools/quilt/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=quilt -PKG_VERSION:=0.66 +PKG_VERSION:=0.67 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SAVANNAH/quilt -PKG_HASH:=314b319a6feb13bf9d0f9ffa7ce6683b06919e734a41275087ea457cc9dc6e07 +PKG_HASH:=3be3be0987e72a6c364678bb827e3e1fcc10322b56bc5f02b576698f55013cc2 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/quilt/patches/000-relocatable.patch b/tools/quilt/patches/000-relocatable.patch index 666c4b4791..caf5eb89a6 100644 --- a/tools/quilt/patches/000-relocatable.patch +++ b/tools/quilt/patches/000-relocatable.patch @@ -92,7 +92,7 @@ SHELL:= @BASH@ # It does not work if dash is used as a shell, for example GREP := @GREP@ TAIL := @TAIL@ -@@ -32,7 +32,7 @@ AWK := @AWK@ +@@ -33,7 +33,7 @@ AWK := @AWK@ FIND := @FIND@ XARGS := @XARGS@ DIFF := @DIFF@ @@ -101,7 +101,7 @@ MKTEMP := @MKTEMP@ MSGMERGE := @MSGMERGE@ MSGFMT := @MSGFMT@ -@@ -49,8 +49,8 @@ USE_NLS := @USE_NLS@ +@@ -50,8 +50,8 @@ USE_NLS := @USE_NLS@ STAT_HARDLINK := @STAT_HARDLINK@ PATCH_WRAPPER := @PATCH_WRAPPER@ diff --git a/tools/quilt/patches/001-fix_compile.patch b/tools/quilt/patches/001-fix_compile.patch index 56e38728de..ef6f8ff608 100644 --- a/tools/quilt/patches/001-fix_compile.patch +++ b/tools/quilt/patches/001-fix_compile.patch @@ -1,6 +1,6 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -275,13 +275,10 @@ $(patsubst %.in,%,$(wildcard bin/*.in qu +@@ -276,13 +276,10 @@ $(patsubst %.in,%,$(wildcard bin/*.in qu @$(if $(filter $@,$(NON_EXEC_IN)),,chmod +x $@) configure : configure.ac aclocal.m4 From e126a1e4137f5c7fba00e762369eb30a16f8fbf4 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Fri, 25 Feb 2022 08:11:36 +0100 Subject: [PATCH 05/66] mac80211: add #if guards against 5.4 compile failures Both struct net_device_path_ctx and struct net_device_path are not available in 5.4. This causes an build error on the bcm63xx target. |mac80211/driver-ops.h: In function 'drv_net_fill_forward_path': |driver-ops.h:1502:57: error: passing argument 4 of |'local->ops->net_fill_forward_path' from incompatible pointer type | [-Werror=incompatible-pointer-types] | 1502 | ctx, path); | | ^~~ | | | | | struct net_device_path_ctx * Signed-off-by: Christian Lamparter --- ...dd-support-for-.ndo_fill_forward_path.patch | 18 ++++++++++++------ ...-introduce-set_radar_offchan-callback.patch | 2 +- ...-offchannel_chain-structs-to-backgrou.patch | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package/kernel/mac80211/patches/subsys/308-mac80211-add-support-for-.ndo_fill_forward_path.patch b/package/kernel/mac80211/patches/subsys/308-mac80211-add-support-for-.ndo_fill_forward_path.patch index 7764edfb27..2f3c1a2669 100644 --- a/package/kernel/mac80211/patches/subsys/308-mac80211-add-support-for-.ndo_fill_forward_path.patch +++ b/package/kernel/mac80211/patches/subsys/308-mac80211-add-support-for-.ndo_fill_forward_path.patch @@ -22,24 +22,27 @@ Signed-off-by: Johannes Berg */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, -@@ -4265,6 +4267,11 @@ struct ieee80211_ops { +@@ -4265,6 +4267,13 @@ struct ieee80211_ops { struct ieee80211_twt_setup *twt); void (*twt_teardown_request)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u8 flowid); ++#if LINUX_VERSION_IS_GEQ(5,10,0) + int (*net_fill_forward_path)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct net_device_path_ctx *ctx, + struct net_device_path *path); ++#endif }; /** --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h -@@ -1483,4 +1483,26 @@ static inline void drv_twt_teardown_requ +@@ -1483,4 +1483,28 @@ static inline void drv_twt_teardown_requ trace_drv_return_void(local); } - + ++#if LINUX_VERSION_IS_GEQ(5,10,0) +static inline int drv_net_fill_forward_path(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta, @@ -61,6 +64,7 @@ Signed-off-by: Johannes Berg + + return ret; +} ++#endif + #endif /* __MAC80211_DRIVER_OPS */ --- a/net/mac80211/ieee80211_i.h @@ -143,7 +147,7 @@ Signed-off-by: Johannes Berg static const struct net_device_ops ieee80211_dataif_8023_ops = { #if LINUX_VERSION_IS_LESS(4,10,0) .ndo_change_mtu = __change_mtu, -@@ -839,7 +899,9 @@ static const struct net_device_ops ieee8 +@@ -839,7 +901,9 @@ static const struct net_device_ops ieee8 #else .ndo_get_stats64 = bp_ieee80211_get_stats64, #endif @@ -156,16 +160,18 @@ Signed-off-by: Johannes Berg static bool ieee80211_iftype_supports_hdr_offload(enum nl80211_iftype iftype) --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h -@@ -2892,6 +2892,13 @@ TRACE_EVENT(drv_twt_teardown_request, +@@ -2892,6 +2892,15 @@ TRACE_EVENT(drv_twt_teardown_request, ) ); - + ++#if LINUX_VERSION_IS_GEQ(5,10,0) +DEFINE_EVENT(sta_event, drv_net_fill_forward_path, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta), + TP_ARGS(local, sdata, sta) +); ++#endif + #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ diff --git a/package/kernel/mac80211/patches/subsys/319-mac80211-introduce-set_radar_offchan-callback.patch b/package/kernel/mac80211/patches/subsys/319-mac80211-introduce-set_radar_offchan-callback.patch index 127b86e76d..eb80afbccb 100644 --- a/package/kernel/mac80211/patches/subsys/319-mac80211-introduce-set_radar_offchan-callback.patch +++ b/package/kernel/mac80211/patches/subsys/319-mac80211-introduce-set_radar_offchan-callback.patch @@ -35,9 +35,9 @@ Signed-off-by: Johannes Berg struct ieee80211_sta *sta, u8 flowid); + int (*set_radar_offchan)(struct ieee80211_hw *hw, + struct cfg80211_chan_def *chandef); + #if LINUX_VERSION_IS_GEQ(5,10,0) int (*net_fill_forward_path)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - struct ieee80211_sta *sta, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4344,6 +4344,18 @@ out: diff --git a/package/kernel/mac80211/patches/subsys/320-cfg80211-rename-offchannel_chain-structs-to-backgrou.patch b/package/kernel/mac80211/patches/subsys/320-cfg80211-rename-offchannel_chain-structs-to-backgrou.patch index ce4611b145..a73e81bec6 100644 --- a/package/kernel/mac80211/patches/subsys/320-cfg80211-rename-offchannel_chain-structs-to-backgrou.patch +++ b/package/kernel/mac80211/patches/subsys/320-cfg80211-rename-offchannel_chain-structs-to-backgrou.patch @@ -107,9 +107,9 @@ Signed-off-by: Johannes Berg - struct cfg80211_chan_def *chandef); + int (*set_radar_background)(struct ieee80211_hw *hw, + struct cfg80211_chan_def *chandef); + #if LINUX_VERSION_IS_GEQ(5,10,0) int (*net_fill_forward_path)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - struct ieee80211_sta *sta, --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -2608,10 +2608,10 @@ enum nl80211_commands { From 71d86a2db92d3426f594b21873b9a2cc952b33c2 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Fri, 25 Feb 2022 08:13:36 +0100 Subject: [PATCH 06/66] kernel: add disabled PSTORE+REED_SOLOMON symbols for 5.4 The last remaining 5.4 target currently chokes because the symbols haven't been disabled like for 5.10. Fixes: 97158fe10e60 ("kernel: package ramoops pstore-ram crash log storage") Reported-by: Hannu Nyman Signed-off-by: Christian Lamparter --- target/linux/generic/config-5.4 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 7fcb045b37..899d04c669 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -1507,6 +1507,7 @@ CONFIG_DUMMY_CONSOLE_ROWS=25 # CONFIG_EEPROM_MAX6875 is not set # CONFIG_EFI is not set CONFIG_EFI_PARTITION=y +# CONFIG_EFI_VARS_PSTORE is not set # CONFIG_EFS_FS is not set CONFIG_ELFCORE=y # CONFIG_ELF_CORE is not set @@ -4202,6 +4203,17 @@ CONFIG_PROC_SYSCTL=y # CONFIG_PSB6970_PHY is not set # CONFIG_PSI is not set # CONFIG_PSTORE is not set +# CONFIG_PSTORE_842_COMPRESS is not set +# CONFIG_PSTORE_COMPRESS is not set +# CONFIG_PSTORE_CONSOLE is not set +# CONFIG_PSTORE_DEFLATE_COMPRESS is not set +# CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT is not set +# CONFIG_PSTORE_LZ4HC_COMPRESS is not set +# CONFIG_PSTORE_LZ4_COMPRESS is not set +# CONFIG_PSTORE_LZO_COMPRESS is not set +# CONFIG_PSTORE_PMSG is not set +# CONFIG_PSTORE_RAM is not set +# CONFIG_PSTORE_ZSTD_COMPRESS is not set # CONFIG_PTP_1588_CLOCK is not set # CONFIG_PTP_1588_CLOCK_IXP46X is not set # CONFIG_PTP_1588_CLOCK_KVM is not set @@ -4299,6 +4311,9 @@ CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 # CONFIG_READ_ONLY_THP_FOR_FS is not set # CONFIG_REALTEK_PHY is not set # CONFIG_REDWOOD is not set +# CONFIG_REED_SOLOMON is not set +# CONFIG_REED_SOLOMON_DEC8 is not set +# CONFIG_REED_SOLOMON_ENC8 is not set # CONFIG_REED_SOLOMON_TEST is not set # CONFIG_REFCOUNT_FULL is not set # CONFIG_REGMAP is not set From 8144f9c665327cae94a4e4b27ed3789d3777f978 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Thu, 17 Feb 2022 21:15:54 +0100 Subject: [PATCH 07/66] mpc85xx: HiveAP-330: add tmp125 temperature sensor the Aerohive HiveAP-330 and HiveAP-350 come equipped with an TI TMP125 temperature chip. This patch wires up the necessary support for this sensor and exposes it through hwmon / thermal sensor framework. Upstream support is coming, but it has to go through hwmon-next first. Signed-off-by: Christian Lamparter --- ...ext-hwmon-lm70-Add-ti-tmp125-support.patch | 71 +++++++++++++++++++ .../arch/powerpc/boot/dts/hiveap-330.dts | 9 +++ target/linux/mpc85xx/image/p1020.mk | 2 +- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 target/linux/generic/backport-5.10/870-hwmon-next-hwmon-lm70-Add-ti-tmp125-support.patch diff --git a/target/linux/generic/backport-5.10/870-hwmon-next-hwmon-lm70-Add-ti-tmp125-support.patch b/target/linux/generic/backport-5.10/870-hwmon-next-hwmon-lm70-Add-ti-tmp125-support.patch new file mode 100644 index 0000000000..fabf177628 --- /dev/null +++ b/target/linux/generic/backport-5.10/870-hwmon-next-hwmon-lm70-Add-ti-tmp125-support.patch @@ -0,0 +1,71 @@ +From 31d8f414e1596ba54a4315418e4c0086fda9e428 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 18 Feb 2022 10:06:43 +0100 +Subject: hwmon: (lm70) Add ti,tmp125 support + +The TMP125 is a 2 degree Celsius accurate Digital +Temperature Sensor with a SPI interface. + +The temperature register is a 16-bit, read-only register. +The MSB (Bit 15) is a leading zero and never set. Bits 14 +to 5 are the 1+9 temperature data bits in a two's +complement format. Bits 4 to 0 are useless copies of +Bit 5 value and therefore ignored. + +Signed-off-by: Christian Lamparter +Link: https://lore.kernel.org/r/43b19cbd4e7f51e9509e561b02b5d8d0e7079fac.1645175187.git.chunkeey@gmail.com +Signed-off-by: Guenter Roeck +--- +--- a/drivers/hwmon/lm70.c ++++ b/drivers/hwmon/lm70.c +@@ -34,6 +34,7 @@ + #define LM70_CHIP_LM71 2 /* NS LM71 */ + #define LM70_CHIP_LM74 3 /* NS LM74 */ + #define LM70_CHIP_TMP122 4 /* TI TMP122/TMP124 */ ++#define LM70_CHIP_TMP125 5 /* TI TMP125 */ + + struct lm70 { + struct spi_device *spi; +@@ -87,6 +88,12 @@ static ssize_t temp1_input_show(struct d + * LM71: + * 14 bits of 2's complement data, discard LSB 2 bits, + * resolution 0.0312 degrees celsius. ++ * ++ * TMP125: ++ * MSB/D15 is a leading zero. D14 is the sign-bit. This is ++ * followed by 9 temperature bits (D13..D5) in 2's complement ++ * data format with a resolution of 0.25 degrees celsius per unit. ++ * LSB 5 bits (D4..D0) share the same value as D5 and get discarded. + */ + switch (p_lm70->chip) { + case LM70_CHIP_LM70: +@@ -102,6 +109,10 @@ static ssize_t temp1_input_show(struct d + case LM70_CHIP_LM71: + val = ((int)raw / 4) * 3125 / 100; + break; ++ ++ case LM70_CHIP_TMP125: ++ val = (sign_extend32(raw, 14) / 32) * 250; ++ break; + } + + status = sprintf(buf, "%d\n", val); /* millidegrees Celsius */ +@@ -136,6 +147,10 @@ static const struct of_device_id lm70_of + .data = (void *) LM70_CHIP_TMP122, + }, + { ++ .compatible = "ti,tmp125", ++ .data = (void *) LM70_CHIP_TMP125, ++ }, ++ { + .compatible = "ti,lm71", + .data = (void *) LM70_CHIP_LM71, + }, +@@ -184,6 +199,7 @@ static const struct spi_device_id lm70_i + { "lm70", LM70_CHIP_LM70 }, + { "tmp121", LM70_CHIP_TMP121 }, + { "tmp122", LM70_CHIP_TMP122 }, ++ { "tmp125", LM70_CHIP_TMP125 }, + { "lm71", LM70_CHIP_LM71 }, + { "lm74", LM70_CHIP_LM74 }, + { }, diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts index bb2f2d0827..ccf60eaeed 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts @@ -24,6 +24,7 @@ led-running = &led_power_green; led-upgrade = &led_fault_red; label-mac-device = &enet0; + spi0 = &spi0; }; memory { @@ -113,6 +114,14 @@ board_soc: soc: soc@ffe00000 { ranges = <0x0 0x0 0xffe00000 0x100000>; + spi0: spi@7000 { + temperature-sensor@1 { + compatible = "ti,tmp125"; + reg = <1>; + spi-max-frequency = <5000000>; + }; + }; + i2c@3100 { tpm@29 { compatible = "atmel,at97sc3204t"; diff --git a/target/linux/mpc85xx/image/p1020.mk b/target/linux/mpc85xx/image/p1020.mk index a50b489df1..64cad1ad9c 100644 --- a/target/linux/mpc85xx/image/p1020.mk +++ b/target/linux/mpc85xx/image/p1020.mk @@ -15,7 +15,7 @@ define Device/aerohive_hiveap-330 DEVICE_MODEL := HiveAP-330 DEVICE_ALT0_VENDOR := Aerohive DEVICE_ALT0_MODEL := HiveAP-350 - DEVICE_PACKAGES := kmod-tpm-i2c-atmel + DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-hwmon-lm70 BLOCKSIZE := 128k KERNEL := kernel-bin | uImage none KERNEL_INITRAMFS := kernel-bin | MultiImage none From 33a7cd1833b8d7106f8d9813132e6a22f1f7c8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Wed, 23 Feb 2022 18:35:23 +0100 Subject: [PATCH 08/66] bcm63xx: Fast 2704n: configure the WAN port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Sagem/Plusnet F@ST2704N has a red label in ethernet port 4. Its purpose is to be used as Fibre/WAN with the stock firmware. Configure the Eth4 as WAN. Fixes: fbbb977772 (brcm63xx: Tune the network configuration for several routers) Signed-off-by: Daniel González Cabanelas --- target/linux/bcm63xx/base-files/etc/board.d/02_network | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index c594a9265f..b48aa57d2e 100644 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -100,8 +100,7 @@ huawei,echolife-hg556a-c) ;; comtrend,ar-5315u|\ innacomm,w3400v6|\ -observa,vh4032n|\ -sagem,fast-2704n) +observa,vh4032n) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "8t@eth0" ;; @@ -141,6 +140,7 @@ netgear,dgnd3700-v1) ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "8t@eth0" ;; +sagem,fast-2704n|\ sercomm,ad1018|\ sercomm,ad1018-nor) ucidef_add_switch "switch0" \ From 4e28494144d2806e33fba6ebb452dd418046ed1a Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 22 Feb 2022 11:43:32 +0100 Subject: [PATCH 09/66] x86: geode: fix package nameing kmod-crypto-ebc does not exist This commit fixes the package naming that was added by commit: e1e4cbde5ceb228e60fff1fc752cb90d9a7df2ab Signed-off-by: Florian Eckert --- target/linux/x86/image/geode.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/x86/image/geode.mk b/target/linux/x86/image/geode.mk index ce5e93a2c5..91851b90ca 100644 --- a/target/linux/x86/image/geode.mk +++ b/target/linux/x86/image/geode.mk @@ -1,7 +1,7 @@ define Device/generic DEVICE_VENDOR := Generic DEVICE_MODEL := x86/Geode - DEVICE_PACKAGES += kmod-crypto-cbc kmod-crypto-ebc kmod-crypto-hw-geode \ + DEVICE_PACKAGES += kmod-crypto-cbc kmod-crypto-ecb kmod-crypto-hw-geode \ kmod-ledtrig-gpio GRUB2_VARIANT := legacy endef From fe1ecf1fcbc00642b60f00f95640c17787cc9c62 Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Sun, 20 Feb 2022 18:21:38 -0700 Subject: [PATCH 10/66] ath79: add Zyxel EMG2926-Q10A The Zyxel EMG2926-Q10A is 99% the Zyxel NBG6716, but the bootloader expects a different product name when flashing over TFTP. Also, the EMG2926-Q10A always has 128 MiB of NAND flash whereas the NBG6716 reportedly can have either 128 MiB or 256 MiB. Signed-off-by: Alex Henrie --- .../base-files/etc/hotplug.d/ieee80211/00-wifi-migration | 1 + target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts | 8 ++++++++ target/linux/ath79/image/nand.mk | 7 +++++++ target/linux/ath79/nand/base-files/etc/board.d/02_network | 1 + .../base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 1 + .../base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac | 1 + .../ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh | 1 + 7 files changed, 20 insertions(+) create mode 100644 target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts diff --git a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration index d2df0533fe..35e7c4452c 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration +++ b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration @@ -16,6 +16,7 @@ migrate_wifi_path() { case "$board" in tplink,archer-c7-v1|\ tplink,archer-c7-v2|\ + zyxel,emg2926-q10a|\ zyxel,nbg6716) path="pci0000:00/0000:00:00.0" WIFI_PATH_CHANGED=1 diff --git a/target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts b/target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts new file mode 100644 index 0000000000..c00109a5b4 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_zyxel_nbg6716.dts" + +/ { + compatible = "zyxel,emg2926-q10a", "zyxel,nbg6716", "qca,qca9558"; + model = "ZyXEL EMG2926-Q10A"; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 2d7892db94..9f209368e4 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -344,3 +344,10 @@ define Device/zyxel_nbg6716 UBINIZE_OPTS := -E 5 endef TARGET_DEVICES += zyxel_nbg6716 + +define Device/zyxel_emg2926_q10a + $(Device/zyxel_nbg6716) + DEVICE_MODEL := EMG2926-Q10A + RAS_BOARD := AAVK-EMG2926Q10A +endef +TARGET_DEVICES += zyxel_emg2926_q10a diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index e26a5e4ddf..2c6e676ae9 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -49,6 +49,7 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "5:lan:1" ;; + zyxel,emg2926-q10a|\ zyxel,nbg6716) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index d47e296853..e5c26d6bb5 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -21,6 +21,7 @@ case "$FIRMWARE" in netgear,r6100) caldata_extract "caldata" 0x5000 0x844 ;; + zyxel,emg2926-q10a|\ zyxel,nbg6716) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1) diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac index 730a5f9943..20974248c1 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac @@ -15,6 +15,7 @@ case $board in [ "$PHYNBR" -eq 0 ] && \ macaddr_add $(mtd_get_mac_binary art 0x0) 2 > /sys${DEVPATH}/macaddress ;; + zyxel,emg2926-q10a|\ zyxel,nbg6716) # Set mac address for 2.4g device [ "$PHYNBR" -eq 1 ] && \ diff --git a/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh index fdd8381f56..4e501496be 100644 --- a/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh @@ -3,6 +3,7 @@ preinit_set_mac_address() { case $(board_name) in + zyxel,emg2926-q10a|\ zyxel,nbg6716) ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) ip link set dev eth0 address $(macaddr_add $ethaddr 2) From 65c28d7a6750b5f73328736414902e58339b0784 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Mon, 21 Feb 2022 14:44:43 -0300 Subject: [PATCH 11/66] scripts/diffconfig.sh: ensure config/conf is built MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diffconfig.sh runs ./scripts/config/conf, but it does not get built with 'make {menu,x,n}config. Call 'make ./scripts/config/conf' to ensure it's been built before running it, aborting in case of failure. Signed-off-by: Eneas U de Queiroz Signed-off-by: Petr Štetiar [removed Fixes: due revert] --- scripts/diffconfig.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/diffconfig.sh b/scripts/diffconfig.sh index 5f9fec5600..7ffe9dd01a 100755 --- a/scripts/diffconfig.sh +++ b/scripts/diffconfig.sh @@ -1,4 +1,5 @@ #!/bin/sh +make ./scripts/config/conf >/dev/null || { make ./scripts/config/conf; exit 1; } grep \^CONFIG_TARGET_ .config | head -n3 > tmp/.diffconfig.head grep \^CONFIG_TARGET_DEVICE_ .config >> tmp/.diffconfig.head grep '^CONFIG_ALL=y' .config >> tmp/.diffconfig.head From 2b202185d2ba1eeb3e176128a738240753ba194a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= Date: Mon, 14 Feb 2022 10:00:38 +0300 Subject: [PATCH 12/66] ramips: mt7621-dts: fix switch@1f warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove reg property from ports node to fix this warning: Warning (unit_address_vs_reg): /ethernet@1e100000/mdio-bus/switch@1f/ports: node has a reg or ranges property, but no unit name Another warning surfaces afterwards. Remove #address-cells and #size-cells from switch@1f node to fix this warning: Warning (avoid_unnecessary_addr_size): /ethernet@1e100000/mdio-bus/switch@1f: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Signed-off-by: Arınç ÜNAL --- target/linux/ramips/dts/mt7621.dtsi | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index b784a9d60c..ec95223a62 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -481,8 +481,6 @@ switch0: switch@1f { compatible = "mediatek,mt7621"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x1f>; mediatek,mcm; resets = <&rstctrl 2>; @@ -494,7 +492,6 @@ ports { #address-cells = <1>; #size-cells = <0>; - reg = <0>; port@0 { status = "disabled"; From 704c8426fb9d8de7ac8f41dd61e44092d7527620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= Date: Mon, 14 Feb 2022 10:00:39 +0300 Subject: [PATCH 13/66] ramips: mt7621-dts: enable flow control on port@6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flow control needs to be enabled on both sides to work. It is already enabled on gmac0, enable it on port@6 too. Signed-off-by: Arınç ÜNAL Tested-by: Sungbo Eo --- target/linux/ramips/dts/mt7621.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index ec95223a62..bfb66740a2 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -532,6 +532,7 @@ fixed-link { speed = <1000>; full-duplex; + pause; }; }; }; From 7774b86019377fa4aae0f0612d8cb67201eb13bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= Date: Mon, 14 Feb 2022 10:00:40 +0300 Subject: [PATCH 14/66] ramips: mt7621-dts: add pinctrl properties for ethernet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the missing pinctrl properties on the ethernet node. GMAC1 will start working with this change. Link: https://lore.kernel.org/netdev/83a35aa3-6cb8-2bc4-2ff4-64278bbcd8c8@arinc9.com/ Overwrite pinctrl-0 property without rgmii2_pins on devicetrees which use the rgmii2 pins as GPIO (22 - 33). Give gpio function to rgmii2 pin group on mt7621_tplink_archer-x6-v3.dtsi which uses GPIO 28. Signed-off-by: Arınç ÜNAL --- target/linux/ramips/dts/mt7621.dtsi | 3 +++ target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts | 4 ++++ target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts | 4 ++++ target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts | 4 ++++ target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts | 4 ++++ target/linux/ramips/dts/mt7621_firefly_firewrt.dts | 4 ++++ target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts | 4 ++++ target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts | 4 ++++ target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts | 4 ++++ .../linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts | 4 ++++ .../linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts | 4 ++++ target/linux/ramips/dts/mt7621_mtc_wr1201.dts | 4 ++++ target/linux/ramips/dts/mt7621_netgear_ex6150.dts | 4 ++++ target/linux/ramips/dts/mt7621_sercomm_na502.dts | 4 ++++ target/linux/ramips/dts/mt7621_telco-electronics_x1.dts | 4 ++++ target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi | 6 +++++- target/linux/ramips/dts/mt7621_tplink_re350-v1.dts | 4 ++++ target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi | 4 ++++ target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi | 4 ++++ target/linux/ramips/dts/mt7621_wavlink_wl-wn531a6.dts | 4 ++++ target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi | 4 ++++ target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts | 4 ++++ target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts | 4 ++++ target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi | 4 ++++ target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts | 4 ++++ target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi | 4 ++++ target/linux/ramips/dts/mt7621_zyxel_nr7101.dts | 4 ++++ 27 files changed, 108 insertions(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index bfb66740a2..09124072bd 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -456,6 +456,9 @@ mediatek,ethsys = <&sysc>; + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>, <&rgmii2_pins>; + gmac0: mac@0 { compatible = "mediatek,eth-mac"; reg = <0>; diff --git a/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts index 8c6fdab04f..cc048d4487 100644 --- a/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts +++ b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts @@ -147,6 +147,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index f9211463f8..74d8fbe1d1 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -152,6 +152,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &switch0 { ports { port@0 { diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index 5d20b6e28a..0f3b0fd8f0 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -172,6 +172,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts index d30e4d1953..03b593e093 100644 --- a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts +++ b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts @@ -174,6 +174,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts index 9da515f017..46954b616f 100644 --- a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts +++ b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts @@ -104,6 +104,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts index db760381a4..6854d56266 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts @@ -99,6 +99,10 @@ status = "okay"; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts index a3ef3a0104..de113c2a5a 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts @@ -109,6 +109,10 @@ status = "okay"; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts index 73dfbef27f..43cf502b0b 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts @@ -112,6 +112,10 @@ status = "okay"; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_5>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts index c86eea0de5..ce627d6621 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts @@ -39,6 +39,10 @@ status = "okay"; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &switch0 { ports { port@0 { diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts index 20a834a3eb..eacbbda54d 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts @@ -66,6 +66,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &switch0 { ports { port@0 { diff --git a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts index b1b020b3a8..0f45743d6f 100644 --- a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts +++ b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts @@ -98,6 +98,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts index 360bcbb77d..1695e9c845 100644 --- a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts +++ b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts @@ -227,6 +227,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502.dts b/target/linux/ramips/dts/mt7621_sercomm_na502.dts index ee77e30362..9ec4cf7788 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502.dts @@ -95,6 +95,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts index ce700e0c2b..23e85f9902 100644 --- a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts +++ b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts @@ -120,6 +120,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi index 3cc738530c..6454273f49 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi @@ -115,7 +115,7 @@ &state_default { gpio { - groups = "i2c", "uart2", "uart3", "jtag", "wdt"; + groups = "i2c", "rgmii2", "uart2", "uart3", "jtag", "wdt"; function = "gpio"; }; }; @@ -153,6 +153,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_config_8>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts index 3df4bc5d64..866abf87c6 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts @@ -147,6 +147,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_config_10008>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi b/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi index 6cb6c0e460..f67c0e3c6d 100644 --- a/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi @@ -167,6 +167,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_config_10008>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi index e968c4e685..dcc84d7ccc 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi @@ -19,6 +19,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_22>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_wavlink_wl-wn531a6.dts b/target/linux/ramips/dts/mt7621_wavlink_wl-wn531a6.dts index 252ade4854..f8c6bffb40 100644 --- a/target/linux/ramips/dts/mt7621_wavlink_wl-wn531a6.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn531a6.dts @@ -137,6 +137,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi index 005cc619c6..cfd2344d21 100644 --- a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi +++ b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi @@ -108,6 +108,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts index af6181b6d0..ec81839d1d 100644 --- a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts +++ b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts @@ -118,6 +118,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts index 6e04f9a493..32f7e5056a 100644 --- a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts +++ b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts @@ -152,6 +152,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi index e377a13444..4830206ae1 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi @@ -148,6 +148,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts index e33fac8db1..a1d6af9466 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts @@ -106,6 +106,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi index 01269e1c1c..9af057378d 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi @@ -110,6 +110,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts index 2a0bc6f8fd..71eb4c9414 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts @@ -143,6 +143,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; From abd18bd033fba30ccb391d4d18baf9944bedb96b Mon Sep 17 00:00:00 2001 From: Vladislav Grigoryev Date: Wed, 1 Sep 2021 11:39:59 +0300 Subject: [PATCH 15/66] jsonfilter: update makefile url Specify URL as PKG_SOURCE_URL in the jsonfilter Makefile. Signed-off-by: Vladislav Grigoryev --- package/utils/jsonfilter/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/jsonfilter/Makefile b/package/utils/jsonfilter/Makefile index 6b7557b38c..56f96d52b5 100644 --- a/package/utils/jsonfilter/Makefile +++ b/package/utils/jsonfilter/Makefile @@ -21,7 +21,7 @@ define Package/jsonfilter CATEGORY:=Base system DEPENDS:=+libubox +libjson-c TITLE:=OpenWrt JSON filter utility - URL:=http://git.openwrt.org/?p=project/jsonpath.git + URL:=$(PKG_SOURCE_URL) endef define Package/jsonfilter/install From 104e912c27d40f336574c1dee7703b4f4a2a576f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 24 Feb 2022 21:46:50 +0100 Subject: [PATCH 16/66] usbmode: update to version 2022-02-24 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * usbmode: add config #0 and delay before actual config Signed-off-by: Petr Štetiar --- package/utils/usbmode/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile index e3b457efd6..1aa1980ce2 100644 --- a/package/utils/usbmode/Makefile +++ b/package/utils/usbmode/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=usbmode -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/usbmode.git -PKG_SOURCE_DATE:=2017-12-19 -PKG_SOURCE_VERSION:=f40f84c27534159066c94dadc0c08e0b255c3e26 -PKG_MIRROR_HASH:=840c7ee2843102b09d8943a20820025251cc259385e2b0bde6b7c8cce8190f83 +PKG_SOURCE_DATE:=2022-02-24 +PKG_SOURCE_VERSION:=3c8595a4e75510f58fa231b145d5506768dcafc9 +PKG_MIRROR_HASH:=5f0234945f61639080f039522172151452180dd4aec33bafc8a61b60131c3bed CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 628970a1959c0a0fbc0c3deb3d92945af63c2ddc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Feb 2022 20:41:07 -0800 Subject: [PATCH 17/66] tools/meson: update to 0.61.2 Seems to be minor bugfixes with Cygwin and Windows. Signed-off-by: Rosen Penev --- tools/meson/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/meson/Makefile b/tools/meson/Makefile index 0d69593d56..cd5af31cff 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.61.1 +PKG_VERSION:=0.61.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=feb2cefb325b437dbf36146df7c6b87688ddff0b0205caa31dc64055c6da410c +PKG_HASH:=0233a7f8d959079318f6052b0939c27f68a5de86ba601f25c9ee6869fb5f5889 PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 From 7ac8da00609f42b8aba74b7efc6b0d055b7cef3e Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Thu, 3 Feb 2022 20:50:57 +0100 Subject: [PATCH 18/66] ath79: support ZTE MF286A/R ZTE MF286A and MF286R are indoor LTE category 6/7 CPE router with simultaneous dual-band 802.11ac plus 802.11n Wi-Fi radios and quad-port gigabit Ethernet switch, FXS and external USB 2.0 port. Hardware highlights: - CPU: QCA9563 SoC at 775MHz, - RAM: 128MB DDR2, - NOR Flash: MX25L1606E 2MB SPI Flash, for U-boot only, - NAND Flash: W25N01GV 128MB SPI NAND-Flash, for all other data, - Wi-Fi 5GHz: QCA9886 2x2 MIMO 802.11ac Wave2 radio, - WI-Fi 2.4GHz: QCA9563 3x3 MIMO 802.11n radio, - Switch: QCA8337v2 4-port gigabit Ethernet, with single SGMII CPU port, - WWAN: [MF286A] MDM9230-based category 6 internal LTE modem [MF286R] PXA1826-based category 7 internal LTE modem in extended mini-PCIE form factor, with 3 internal antennas and 2 external antenna connections, single mini-SIM slot. - FXS: one external ATA port (handled entirely by modem part) with two physical connections in parallel, - USB: Single external USB 2.0 port, - Switches: power switch, WPS, Wi-Fi and reset buttons, - LEDs: Wi-Fi, Test (internal). Rest of LEDs (Phone, WWAN, Battery, Signal state) handled entirely by modem. 4 link status LEDs handled by the switch on the backside. - Battery: 3Ah 1-cell Li-Ion replaceable battery, with charging and monitoring handled by modem. - Label MAC device: eth0 The device shares many components with previous model, MF286, differing mostly by a Wave2 5GHz radio, flash layout and internal LED color. In case of MF286A, the modem is the same as in MF286. MF286R uses a different modem based on Marvell PXA1826 chip. Internal modem of MF286A is supported via uqmi, MF286R modem isn't fully supported, but it is expected to use comgt-ncm for connection, as it uses standard 3GPP AT commands for connection establishment. Console connection: connector X2 is the console port, with the following pinout, starting from pin 1, which is the topmost pin when the board is upright: - VCC (3.3V). Do not use unless you need to source power for the converer from it. - TX - RX - GND Default port configuration in U-boot as well as in stock firmware is 115200-8-N-1. Installation: Due to different flash layout from stock firmware, sysupgrade from within stock firmware is impossible, despite it's based on QSDK which itself is based on OpenWrt. STEP 0: Stock firmware update: As installing OpenWrt cuts you off from official firmware updates for the modem part, it is recommended to update the stock firmware to latest version before installation, to have built-in modem at the latest firmware version. STEP 1: gaining root shell: Method 1: This works if busybox has telnetd compiled in the binary. If this does not work, try method 2. Using well-known exploit to start telnetd on your router - works only if Busybox on stock firmware has telnetd included: - Open stock firmware web interface - Navigate to "URL filtering" section by going to "Advanced settings", then "Firewall" and finally "URL filter". - Add an entry ending with "&&telnetd&&", for example "http://hostname/&&telnetd&&". - telnetd will immediately listen on port 4719. - After connecting to telnetd use "admin/admin" as credentials. Method 2: This works if busybox does not have telnetd compiled in. Notably, this is the case in DNA.fi firmware. If this does not work, try method 3. - Set IP of your computer to 192.168.0.22. (or appropriate subnet if changed) - Have a TFTP server running at that address - Download MIPS build of busybox including telnetd, for example from: https://busybox.net/downloads/binaries/1.21.1/busybox-mips and put it in it's root directory. Rename it as "telnetd". - As previously, login to router's web UI and navigate to "URL filtering" - Using "Inspect" feature, extend "maxlength" property of the input field named "addURLFilter", so it looks like this: - Stay on the page - do not navigate anywhere - Enter "http://aa&zte_debug.sh 192.168.0.22 telnetd" as a filter. - Save the settings. This will download the telnetd binary over tftp and execute it. You should be able to log in at port 23, using "admin/admin" as credentials. Method 3: If the above doesn't work, use the serial console - it exposes root shell directly without need for login. Some stock firmwares, notably one from finnish DNA operator lack telnetd in their builds. STEP 2: Backing up original software: As the stock firmware may be customized by the carrier and is not officially available in the Internet, IT IS IMPERATIVE to back up the stock firmware, if you ever plan to returning to stock firmware. It is highly recommended to perform backup using both methods, to avoid hassle of reassembling firmware images in future, if a restore is needed. Method 1: after booting OpenWrt initramfs image via TFTP: PLEASE NOTE: YOU CANNOT DO THIS IF USING INTERMEDIATE FIRMWARE FOR INSTALLATION. - Dump stock firmware located on stock kernel and ubi partitions: ssh root@192.168.1.1: cat /dev/mtd4 > mtd4_kernel.bin ssh root@192.168.1.1: cat /dev/mtd9 > mtd9_ubi.bin And keep them in a safe place, should a restore be needed in future. Method 2: using stock firmware: - Connect an external USB drive formatted with FAT or ext4 to the USB port. - The drive will be auto-mounted to /var/usb_disk - Check the flash layout of the device: cat /proc/mtd It should show the following: mtd0: 000a0000 00010000 "u-boot" mtd1: 00020000 00010000 "u-boot-env" mtd2: 00140000 00010000 "reserved1" mtd3: 000a0000 00020000 "fota-flag" mtd4: 00080000 00020000 "art" mtd5: 00080000 00020000 "mac" mtd6: 000c0000 00020000 "reserved2" mtd7: 00400000 00020000 "cfg-param" mtd8: 00400000 00020000 "log" mtd9: 000a0000 00020000 "oops" mtd10: 00500000 00020000 "reserved3" mtd11: 00800000 00020000 "web" mtd12: 00300000 00020000 "kernel" mtd13: 01a00000 00020000 "rootfs" mtd14: 01900000 00020000 "data" mtd15: 03200000 00020000 "fota" mtd16: 01d00000 00020000 "firmware" Differences might indicate that this is NOT a MF286A device but one of other variants. - Copy over all MTD partitions, for example by executing the following: for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do cat /dev/mtd$i > \ /var/usb_disk/mtd$i; done "Firmware" partition can be skipped, it is a concatenation of "kernel" and "rootfs". - If the count of MTD partitions is different, this might indicate that this is not a MF286A device, but one of its other variants. - (optionally) rename the files according to MTD partition names from /proc/mtd - Unmount the filesystem: umount /var/usb_disk; sync and then remove the drive. - Store the files in safe place if you ever plan to return to stock firmware. This is especially important, because stock firmware for this device is not available officially, and is usually customized by the mobile providers. STEP 3: Booting initramfs image: Method 1: using serial console (RECOMMENDED): - Have TFTP server running, exposing the OpenWrt initramfs image, and set your computer's IP address as 192.168.0.22. This is the default expected by U-boot. You may wish to change that, and alter later commands accordingly. - Connect the serial console if you haven't done so already, - Interrupt boot sequence by pressing any key in U-boot when prompted - Use the following commands to boot OpenWrt initramfs through TFTP: setenv serverip 192.168.0.22 setenv ipaddr 192.168.0.1 tftpboot 0x81000000 openwrt-ath79-nand-zte_mf286a-initramfs-kernel.bin bootm 0x81000000 (Replace server IP and router IP as needed). There is no emergency TFTP boot sequence triggered by buttons, contrary to MF283+. - When OpenWrt initramfs finishes booting, proceed to actual installation. Method 2: using initramfs image as temporary boot kernel This exploits the fact, that kernel and rootfs MTD devices are consecutive on NAND flash, so from within stock image, an initramfs can be written to this area and booted by U-boot on next reboot, because it uses "nboot" command which isn't limited by kernel partition size. - Download the initramfs-kernel.bin image - After backing up the previous MTD contents, write the images to the "firmware" MTD device, which conveniently concatenates "kernel" and "rootfs" partitions that can fit the initramfs image: nandwrite -p /dev/ \ /var/usb_disk/openwrt-ath79-zte_mf286a-initramfs-kernel.bin - If write is OK, reboot the device, it will reboot to OpenWrt initramfs: reboot -f - After rebooting, SSH into the device and use sysupgrade to perform proper installation. Method 3: using built-in TFTP recovery (LAST RESORT): - With that method, ensure you have complete backup of system's NAND flash first. It involves deliberately erasing the kernel. - Download "-initramfs-kernel.bin" image for the device. - Prepare the recovery image by prepending 8MB of zeroes to the image, and name it root_uImage: dd if=/dev/zero of=padding.bin bs=8M count=1 cat padding.bin openwrt-ath79-nand-zte_mf286a-initramfs-kernel.bin > root_uImage - Set up a TFTP server at 192.0.0.1/8. Router will use random address from that range. - Put the previously generated "root_uImage" into TFTP server root directory. - Deliberately erase "kernel" partition" using stock firmware after taking backup. THIS IS POINT OF NO RETURN. - Restart the device. U-boot will attempt flashing the recovery initramfs image, which will let you perform actual installation using sysupgrade. This might take a considerable time, sometimes the router doesn't establish Ethernet link properly right after booting. Be patient. - After U-boot finishes flashing, the LEDs of switch ports will all light up. At this moment, perform power-on reset, and wait for OpenWrt initramfs to finish booting. Then proceed to actual installation. STEP 4: Actual installation: - Set your computer IP to 192.168.1.22/24 - scp the sysupgrade image to the device: scp openwrt-ath79-nand-zte_mf286a-squashfs-sysupgrade.bin \ root@192.168.1.1:/tmp/ - ssh into the device and execute sysupgrade: sysupgrade -n /tmp/openwrt-ath79-nand-zte_mf286a-squashfs-sysupgrade.bin - Wait for router to reboot to full OpenWrt. STEP 5: WAN connection establishment Since the router is equipped with LTE modem as its main WAN interface, it might be useful to connect to the Internet right away after installation. To do so, please put the following entries in /etc/config/network, replacing the specific configuration entries with one needed for your ISP: config interface 'wan' option proto 'qmi' option device '/dev/cdc-wdm0' option auth '' # As required, usually 'none' option pincode '' # If required by SIM option apn '' # As required by ISP option pdptype '' # Typically 'ipv4', or 'ipv4v6' or 'ipv6' For example, the following works for most polish ISPs config interface 'wan' option proto 'qmi' option device '/dev/cdc-wdm0' option auth 'none' option apn 'internet' option pdptype 'ipv4' The required minimum is: config interface 'wan' option proto 'qmi' option device '/dev/cdc-wdm0' In this case, the modem will use last configured APN from stock firmware - this should work out of the box, unless your SIM requires PIN which can't be switched off. If you have build with LuCI, installing luci-proto-qmi helps with this task. Restoring the stock firmware: Preparation: If you took your backup using stock firmware, you will need to reassemble the partitions into images to be restored onto the flash. The layout might differ from ISP to ISP, this example is based on generic stock firmware The only partitions you really care about are "web", "kernel", and "rootfs". These are required to restore the stock firmware through factory TFTP recovery. Because kernel partition was enlarged, compared to stock firmware, the kernel and rootfs MTDs don't align anymore, and you need to carve out required data if you only have backup from stock FW: - Prepare kernel image cat mtd12_kernel.bin mtd13_rootfs.bin > owrt_kernel.bin truncate -s 4M owrt_kernel_restore.bin - Cut off first 1MB from rootfs dd if=mtd13_rootfs.bin of=owrt_rootfs.bin bs=1M skip=1 - Prepare image to write to "ubi" meta-partition: cat mtd6_reserved2.bi mtd7_cfg-param.bin mtd8_log.bin mtd9_oops.bin \ mtd10_reserved3.bin mtd11_web.bin owrt_rootfs.bin > \ owrt_ubi_ubi_restore.bin You can skip the "fota" partition altogether, it is used only for stock firmware update purposes and can be overwritten safely anyway. The same is true for "data" partition which on my device was found to be unused at all. Restoring mtd5_cfg-param.bin will restore the stock firmware configuration you had before. Method 1: Using initramfs: This method is recmmended if you took your backup from within OpenWrt initramfs, as the reassembly is not needed. - Boot to initramfs as in step 3: - Completely detach ubi0 partition using ubidetach /dev/ubi0_0 - Look up the kernel and ubi partitions in /proc/mtd - Copy over the stock kernel image using scp to /tmp - Erase kernel and restore stock kernel: (scp mtd4_kernel.bin root@192.168.1.1:/tmp/) mtd write mtd4_kernel.bin rm mtd4_kernel.bin - Copy over the stock partition backups one-by-one using scp to /tmp, and restore them individually. Otherwise you might run out of space in tmpfs: (scp mtd3_ubiconcat0.bin root@192.168.1.1:/tmp/) mtd write mtd3_ubiconcat0.bin rm mtd3_ubiconcat0.bin (scp mtd5_ubiconcat1.bin root@192.168.1.1:/tmp/) mtd write mtd5_ubiconcat1.bin rm mtd5_ubiconcat1.bin - If the write was correct, force a device reboot with reboot -f Method 2: Using live OpenWrt system (NOT RECOMMENDED): - Prepare a USB flash drive contatining MTD backup files - Ensure you have kmod-usb-storage and filesystem driver installed for your drive - Mount your flash drive mkdir /tmp/usb mount /dev/sda1 /tmp/usb - Remount your UBI volume at /overlay to R/O mount -o remount,ro /overlay - Write back the kernel and ubi partitions from USB drive cd /tmp/usb mtd write mtd4_kernel.bin /dev/ mtd write mtd9_ubi.bin /dev/ - If everything went well, force a device reboot with reboot -f Last image may be truncated a bit due to lack of space in RAM, but this will happen over "fota" MTD partition which may be safely erased after reboot anyway. Method 3: using built-in TFTP recovery: This method is recommended if you took backups using stock firmware. - Assemble a recovery rootfs image from backup of stock partitions by concatenating "web", "kernel", "rootfs" images dumped from the device, as "root_uImage" - Use it in place of "root_uImage" recovery initramfs image as in the TFTP pre-installation method. Quirks and known issuesa - It was observed, that CH340-based USB-UART converters output garbage during U-boot phase of system boot. At least CP2102 is known to work properly. - Kernel partition size is increased to 4MB compared to stock 3MB, to accomodate future kernel updates - at this moment OpenWrt 5.10 kernel image is at 2.5MB which is dangerously close to the limit. This has no effect on booting the system - but keep that in mind when reassembling an image to restore stock firmware. - uqmi seems to be unable to change APN manually, so please use the one you used before in stock firmware first. If you need to change it, please use protocok '3g' to establish connection once, or use the following command to change APN (and optionally IP type) manually: echo -ne 'AT+CGDCONT=1,"IP","' > /dev/ttyUSB0 - The only usable LED as a "system LED" is the blue debug LED hidden inside the case. All other LEDs are controlled by modem, on which the router part has some influence only on Wi-Fi LED. - Wi-Fi LED currently doesn't work while under OpenWrt, despite having correct GPIO mapping. All other LEDs are controlled by modem, including this one in stock firmware. GPIO19, mapped there only acts as a gate, while the actual signal source seems to be 5GHz Wi-Fi radio, however it seems it is not the LED exposed by ath10k as ath10k-phy0. - GPIO5 used for modem reset is a suicide switch, causing a hardware reset of whole board, not only the modem. It is attached to gpio-restart driver, to restart the modem on reboot as well, to ensure QMI connectivity after reboot, which tends to fail otherwise. - Modem, as in MF283+, exposes root shell over ADB - while not needed for OpenWrt operation at all - have fun lurking around. The same modem module is used as in older MF286. Signed-off-by: Lech Perczak --- package/boot/uboot-envtools/files/ath79 | 4 +- target/linux/ath79/dts/qca9563_zte_mf286.dts | 288 +++++------------- target/linux/ath79/dts/qca9563_zte_mf286.dtsi | 158 ++++++++++ target/linux/ath79/dts/qca9563_zte_mf286a.dts | 9 + .../linux/ath79/dts/qca9563_zte_mf286ar.dtsi | 134 ++++++++ target/linux/ath79/dts/qca9563_zte_mf286r.dts | 9 + target/linux/ath79/image/nand.mk | 29 +- .../nand/base-files/etc/board.d/02_network | 4 +- 8 files changed, 421 insertions(+), 214 deletions(-) create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286.dtsi create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286a.dts create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286r.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 1f0e02a2f7..57be9ccb84 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -122,7 +122,9 @@ qihoo,c301) wallys,dr531) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000" ;; -zte,mf286) +zte,mf286|\ +zte,mf286a|\ +zte,mf286r) ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x20000" "0x10000" ;; esac diff --git a/target/linux/ath79/dts/qca9563_zte_mf286.dts b/target/linux/ath79/dts/qca9563_zte_mf286.dts index c4ebdebd10..2e528a6b97 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf286.dts +++ b/target/linux/ath79/dts/qca9563_zte_mf286.dts @@ -1,72 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT // Copyright (c) 2021 Cezary Jackiewicz // Copyright (c) 2021, 2022 Lech Perczak -#include "qca956x.dtsi" - -#include -#include -#include +#include "qca9563_zte_mf286.dtsi" / { model = "ZTE MF286"; compatible = "zte,mf286", "qca,qca9563"; - aliases { - led-boot = &led_debug; - led-failsafe = &led_debug; - led-running = &led_debug; - led-upgrade = &led_debug; - label-mac-device = ð0; - }; - - leds { - compatible = "gpio-leds"; - - /* Hidden green SMD LED below signal strength LEDs - * Visible through slits underside of the case, - * and slightly through the case below signal state LEDs */ - led_debug: led-0 { - color = ; - function = LED_FUNCTION_DEBUG; - label = "green:debug"; - gpios = <&gpio 7 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 2 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - wps { - label = "wps"; - linux,code = ; - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - wifi { - label = "wifi"; - linux,code = ; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; - - /* This GPIO is used to reset whole board _including_ the modem */ - gpio-restart { - compatible = "gpio-restart"; - gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; - active-delay = <3000>; - inactive-delay = <1000>; - }; - ubi-concat { compatible = "mtd-concat"; devices = <&ubiconcat0 &ubiconcat1>; @@ -84,173 +24,107 @@ }; }; -&gpio { - /* GPIO19 is used as a mask to enable WLAN LED - * in stock firmware, which is controlled directly - * by 5GHz Wi-Fi chip, which currently is inactive - * in OpenWrt */ - led-wlan { - gpio-hog; - gpios = <19 GPIO_ACTIVE_LOW>; - output-high; - line-name = "led:wlan"; - }; +&led_debug { + /* Hidden green SMD LED below signal strength LEDs + * Visible through slits underside of the case, + * and slightly through the case below signal state LEDs + */ + color = ; + label = "green:debug"; }; -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x000000 0x080000>; - read-only; - }; - - partition@80000 { - label = "u-boot-env"; - reg = <0x080000 0x020000>; - read-only; - }; +&boot_flash { + partitions { + partition@0 { + label = "u-boot"; + reg = <0x000000 0x080000>; + read-only; }; - }; - flash@1 { - compatible = "spi-nand"; - reg = <1>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "fota-flag"; - reg = <0x000000 0x140000>; - read-only; - }; - - caldata: partition@140000 { - label = "caldata"; - reg = <0x140000 0x140000>; - read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_caldata_5000: cal@5000 { - reg = <0x5000 0x844>; - }; - }; - - mac: partition@280000 { - label = "mac"; - reg = <0x280000 0x140000>; - read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; - }; - }; - - /* This encompasses stock cfg-param, oops, web partitions, - * which can be overwritten safely */ - ubiconcat0: partition@3c0000 { - label = "ubiconcat0"; - reg = <0x3c0000 0xf40000>; - }; - - /* Kernel MTD size is increased to 4MB from stock 3MB */ - partition@1300000 { - label = "kernel"; - reg = <0x1300000 0x400000>; - }; - - /* This encompasses stock rootfs, data, fota partitions, - * which can be overwritten safely */ - ubiconcat1: partition@1600000 { - label = "ubiconcat1"; - reg = <0x1700000 0x6900000>; - }; + partition@80000 { + label = "u-boot-env"; + reg = <0x080000 0x020000>; + read-only; }; }; }; -&mdio0 { - status = "okay"; +&system_flash { + partitions { + partition@0 { + label = "fota-flag"; + reg = <0x000000 0x140000>; + read-only; + }; - phy-mask = <0>; - phy0: ethernet-phy@0 { - reg = <0>; - phy-mode = "sgmii"; + partition@140000 { + label = "caldata"; + reg = <0x140000 0x140000>; + read-only; - qca,ar8327-initvals = < - 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x7c 0x0000007e /* PORT0_STATUS */ - >; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x844>; + }; + }; + + partition@280000 { + label = "mac"; + reg = <0x280000 0x140000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + + /* This encompasses stock cfg-param, oops, web partitions, + * which can be overwritten safely + */ + ubiconcat0: partition@3c0000 { + label = "ubiconcat0"; + reg = <0x3c0000 0xf40000>; + }; + + /* Kernel MTD size is increased to 4MB from stock 3MB */ + partition@1300000 { + label = "kernel"; + reg = <0x1300000 0x400000>; + }; + + /* This encompasses stock rootfs, data, fota partitions, + * which can be overwritten safely + */ + ubiconcat1: partition@1600000 { + label = "ubiconcat1"; + reg = <0x1700000 0x6900000>; + }; }; }; ð0 { - status = "okay"; - nvmem-cells = <&macaddr_mac_0>; nvmem-cell-names = "mac-address"; - phy-mode = "sgmii"; - phy-handle = <&phy0>; }; -&pcie { - status = "okay"; - - wifi@0,0 { - compatible = "qcom,ath10k"; - reg = <0x0 0 0 0 0>; - - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>; - nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; - }; +&wifi_ath10k { + nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>; + nvmem-cell-names = "mac-address", "calibration"; + mac-address-increment = <1>; }; &wmac { - status = "okay"; - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; nvmem-cell-names = "mac-address", "calibration"; }; - -&usb_phy0 { - status = "okay"; -}; - -&usb0 { - status = "okay"; -}; - -&usb_phy1 { - status = "okay"; -}; - -&usb1 { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286.dtsi b/target/linux/ath79/dts/qca9563_zte_mf286.dtsi new file mode 100644 index 0000000000..3013daa470 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286.dtsi @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca956x.dtsi" + +#include +#include +#include + +/ { + aliases { + led-boot = &led_debug; + led-failsafe = &led_debug; + led-running = &led_debug; + led-upgrade = &led_debug; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + /* Hidden SMD LED below signal strength LEDs. + * Visible through slits underside of the case, + * and slightly through the case below signal state LEDs + */ + led_debug: led-0 { + function = LED_FUNCTION_DEBUG; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wifi { + label = "wifi"; + linux,code = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + /* This GPIO is used to reset whole board _including_ the modem */ + gpio-restart { + compatible = "gpio-restart"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + active-delay = <3000>; + inactive-delay = <1000>; + }; +}; + +&gpio { + /* GPIO19 is used as a mask to enable WLAN LED + * in stock firmware, which is controlled directly + * by 5GHz Wi-Fi chip, which currently is inactive + * in OpenWrt + */ + led-wlan { + gpio-hog; + gpios = <19 GPIO_ACTIVE_LOW>; + output-high; + line-name = "led:wlan"; + }; +}; + +&spi { + status = "okay"; + + boot_flash: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; + + system_flash: flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&pcie { + status = "okay"; + + wifi_ath10k: wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0 0 0 0 0>; + }; +}; + +&wmac { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286a.dts b/target/linux/ath79/dts/qca9563_zte_mf286a.dts new file mode 100644 index 0000000000..205dde8030 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286a.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca9563_zte_mf286ar.dtsi" + +/ { + model = "ZTE MF286A"; + compatible = "zte,mf286a", "qca,qca9563"; +}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi b/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi new file mode 100644 index 0000000000..45ac3bc7ea --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca9563_zte_mf286.dtsi" + +/ { + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x7a60000>; + label = "ubi"; + }; + }; + }; +}; + +&led_debug { + /* Hidden blue SMD LED below signal strength LEDs + * Visible through slits underside of the case, + * and slightly through the case below signal state LEDs + */ + color = ; + label = "blue:debug"; +}; + +&boot_flash { + partitions { + partition@0 { + label = "u-boot"; + reg = <0x000000 0x0a0000>; + read-only; + }; + + partition@a0000 { + label = "u-boot-env"; + reg = <0x0a0000 0x020000>; + read-only; + }; + + partition@c0000 { + label = "reserved1"; + reg = <0x0c0000 0x140000>; + read-only; + }; + }; +}; + +&system_flash { + partitions { + partition@0 { + label = "fota-flag"; + reg = <0x00000 0xa0000>; + read-only; + }; + + partition@a0000 { + label = "art"; + reg = <0xa0000 0x80000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@120000 { + label = "mac"; + reg = <0x120000 0x80000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: mac-address@0 { + reg = <0x0 0x6>; + }; + }; + + /* This encompasses stock reserved2, cfg-param, log, oops, + * reserved3, web partitions, + * which can be overwritten safely + */ + ubiconcat0: partition@1a0000 { + label = "ubiconcat0"; + reg = <0x1a0000 0x1660000>; + }; + + /* Kernel MTD size is increased to 4MB from stock 3MB */ + partition@1800000 { + label = "kernel"; + reg = <0x1800000 0x400000>; + }; + + /* This encompasses stock rootfs, data, fota partitions, + * which can be overwritten safely + */ + ubiconcat1: partition@1c00000 { + label = "ubiconcat1"; + reg = <0x1c00000 0x6400000>; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_mac_0>; + nvmem-cell-names = "mac-address"; +}; + +&wifi_ath10k { + nvmem-cells = <&macaddr_mac_0>, <&precal_art_5000>; + nvmem-cell-names = "mac-address", "pre-calibration"; + mac-address-increment = <0x20000>; +}; + +&wmac { + nvmem-cells = <&macaddr_mac_0>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286r.dts b/target/linux/ath79/dts/qca9563_zte_mf286r.dts new file mode 100644 index 0000000000..6fa0f7a7f8 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286r.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca9563_zte_mf286ar.dtsi" + +/ { + model = "ZTE MF286R"; + compatible = "zte,mf286r", "qca,qca9563"; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 9f209368e4..0cf8f331d5 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -305,20 +305,39 @@ define Device/netgear_wndr4500-v3 endef TARGET_DEVICES += netgear_wndr4500-v3 -define Device/zte_mf286 +define Device/zte_mf286_common SOC := qca9563 DEVICE_VENDOR := ZTE - DEVICE_MODEL := MF286 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \ - ath10k-firmware-qca988x-ct kmod-usb-net-qmi-wwan kmod-usb-serial-option \ - uqmi + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct BLOCKSIZE := 128k PAGESIZE := 2048 KERNEL_SIZE := 4096k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef + +define Device/zte_mf286 + $(Device/zte_mf286_common) + DEVICE_MODEL := MF286 + DEVICE_PACKAGES += ath10k-firmware-qca988x-ct kmod-usb-net-qmi-wwan \ + kmod-usb-serial-option uqmi +endef TARGET_DEVICES += zte_mf286 +define Device/zte_mf286a + $(Device/zte_mf286_common) + DEVICE_MODEL := MF286A + DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-qmi-wwan \ + kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += zte_mf286a + +define Device/zte_mf286r + $(Device/zte_mf286_common) + DEVICE_MODEL := MF286R + DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-rndis kmod-usb-acm +endef +TARGET_DEVICES += zte_mf286r + define Device/zyxel_nbg6716 SOC := qca9558 DEVICE_VENDOR := ZyXEL diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 2c6e676ae9..417a881e5b 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -45,7 +45,9 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" ;; - zte,mf286) + zte,mf286|\ + zte,mf286a|\ + zte,mf286r) ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "5:lan:1" ;; From ec32c4ef01055228de9412fc8bf4a3e80929c88d Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Thu, 24 Feb 2022 18:31:48 +0200 Subject: [PATCH 19/66] ipq806x: Increase kernel size to 4 MB for EA8500/EA7500v1 Increase the kernel size from 3 MB to 4 MB for EA8500 and EA7500v1. * modify the common .dtsi * modify the kernel size in the image recipes Define compat-version 2.0 to force factory image usage for sysupgrade. Add explanation message. Reenable both devices. As for 4MiB (and not more): Hannu Nyman noted that: "We have lots of ipq806x devices with 4 MB kernel, so will need action at that point in future in any case. (Assuming that the bootloader did not have a 4 MB limit that has been tested...)" Signed-off-by: Hannu Nyman (squashed, added 4MiB notice of support in ipq806x) Signed-off-by: Christian Lamparter --- .../etc/uci-defaults/05_fix-compat-version | 11 +++++++++++ .../arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi | 10 +++++----- target/linux/ipq806x/image/generic.mk | 15 +++++++++++---- 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 target/linux/ipq806x/base-files/etc/uci-defaults/05_fix-compat-version diff --git a/target/linux/ipq806x/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/ipq806x/base-files/etc/uci-defaults/05_fix-compat-version new file mode 100644 index 0000000000..3b9dd4e028 --- /dev/null +++ b/target/linux/ipq806x/base-files/etc/uci-defaults/05_fix-compat-version @@ -0,0 +1,11 @@ +. /lib/functions.sh + +case "$(board_name)" in + linksys,ea7500-v1|\ + linksys,ea8500) + uci set system.@system[0].compat_version="2.0" + uci commit system + ;; +esac + +exit 0 diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi index 98c4b2d29d..955ad97e3a 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi @@ -133,12 +133,12 @@ partition@f80000 { label = "kernel1"; - reg = <0x0f80000 0x2800000>; /* 3 MB spill to rootfs */ + reg = <0x0f80000 0x2800000>; /* 4 MB, spill to rootfs */ }; - partition@1280000 { + partition@1380000 { label = "rootfs1"; - reg = <0x1280000 0x2500000>; + reg = <0x1380000 0x2400000>; }; partition@3780000 { @@ -146,9 +146,9 @@ reg = <0x3780000 0x2800000>; }; - partition@3a80000 { + partition@3b80000 { label = "rootfs2"; - reg = <0x3a80000 0x2500000>; + reg = <0x3b80000 0x2400000>; }; }; }; diff --git a/target/linux/ipq806x/image/generic.mk b/target/linux/ipq806x/image/generic.mk index 9e733d921a..11592ad97e 100644 --- a/target/linux/ipq806x/image/generic.mk +++ b/target/linux/ipq806x/image/generic.mk @@ -1,6 +1,13 @@ DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_VARS += TPLINK_BOARD_ID +define Device/kernel-size-migration + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := *** Kernel partition size has changed from earlier \ + versions. You need to sysupgrade with the OpenWrt factory image and \ + use the force flag when image check fails. Settings will be lost. *** +endef + define Build/buffalo-rootfs-cksum ( \ echo -ne "\x$$(od -A n -t u1 $@ | tr -s ' ' '\n' | \ @@ -128,13 +135,14 @@ TARGET_DEVICES += edgecore_ecw5410 define Device/linksys_ea7500-v1 $(call Device/LegacyImage) + $(Device/kernel-size-migration) DEVICE_VENDOR := Linksys DEVICE_MODEL := EA7500 DEVICE_VARIANT := v1 SOC := qcom-ipq8064 PAGESIZE := 2048 BLOCKSIZE := 128k - KERNEL_SIZE := 3072k + KERNEL_SIZE := 4096k KERNEL = kernel-bin | append-dtb | uImage none | \ append-uImage-fakehdr filesystem UBINIZE_OPTS := -E 5 @@ -142,18 +150,18 @@ define Device/linksys_ea7500-v1 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ append-ubi | pad-to $$$$(PAGESIZE) DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct - DEFAULT := n endef TARGET_DEVICES += linksys_ea7500-v1 define Device/linksys_ea8500 $(call Device/LegacyImage) + $(Device/kernel-size-migration) DEVICE_VENDOR := Linksys DEVICE_MODEL := EA8500 SOC := qcom-ipq8064 PAGESIZE := 2048 BLOCKSIZE := 128k - KERNEL_SIZE := 3072k + KERNEL_SIZE := 4096k KERNEL = kernel-bin | append-dtb | uImage none | \ append-uImage-fakehdr filesystem BOARD_NAME := ea8500 @@ -163,7 +171,6 @@ define Device/linksys_ea8500 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ append-ubi DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct - DEFAULT := n endef TARGET_DEVICES += linksys_ea8500 From fbf485e6c62732919440565d5662635628c79faf Mon Sep 17 00:00:00 2001 From: Lucian Cristian Date: Sun, 20 Feb 2022 21:23:04 +0200 Subject: [PATCH 20/66] mbedtls: update to 2.28.0 LTS branch "Mbed TLS 2.28 is a long-time support branch. It will be supported with bug-fixes and security fixes until end of 2024." "Currently, the only supported LTS branch is: mbedtls-2.28. For a short time we also have the previous LTS, which has recently ended its support period, mbedtls-2.16. This branch will move into the archive namespace around the time of the next release." this will also add support for uacme ualpn support. size changes 221586 libmbedtls12_2.28.0-1_mips_24kc.ipk 182742 libmbedtls12_2.16.12-1_mips_24kc.ipk Signed-off-by: Lucian Cristian (remark about 2.16's EOS, slightly reworded) Signed-off-by: Christian Lamparter --- package/libs/mbedtls/Makefile | 7 ++- package/libs/mbedtls/patches/200-config.patch | 45 ++++++++++--------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index d3f7d0cad2..9c6c81d9c1 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.16.12 +PKG_VERSION:=2.28.0 PKG_RELEASE:=$(AUTORELEASE) PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=294871ab1864a65d0b74325e9219d5bcd6e91c34a3c59270c357bb9ae4d5c393 +PKG_HASH:=6519579b836ed78cc549375c7c18b111df5717e86ca0eeff4cb64b2674f424cc PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=gpl-2.0.txt @@ -111,6 +111,9 @@ define Build/Configure END { exit(rc) }' $(PKG_BUILD_DIR)/include/mbedtls/config.h \ >$(PKG_BUILD_DIR)/include/mbedtls/config.h.new && \ mv $(PKG_BUILD_DIR)/include/mbedtls/config.h.new $(PKG_BUILD_DIR)/include/mbedtls/config.h + + sed -i '/fuzz/d' $(PKG_BUILD_DIR)/programs/CMakeLists.txt + sed -i '/test/d' $(PKG_BUILD_DIR)/programs/CMakeLists.txt endef define Build/InstallDev diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index 67f331674c..faf5bb5db9 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -1,6 +1,6 @@ --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h -@@ -692,14 +692,14 @@ +@@ -665,14 +665,14 @@ * * Enable Output Feedback mode (OFB) for symmetric ciphers. */ @@ -17,10 +17,10 @@ /** * \def MBEDTLS_CIPHER_NULL_CIPHER -@@ -816,19 +816,19 @@ - * +@@ -790,20 +790,20 @@ * Comment macros to disable the curve and functions for it */ + /* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */ -#define MBEDTLS_ECP_DP_SECP192R1_ENABLED -#define MBEDTLS_ECP_DP_SECP224R1_ENABLED +//#define MBEDTLS_ECP_DP_SECP192R1_ENABLED @@ -40,13 +40,14 @@ +//#define MBEDTLS_ECP_DP_BP256R1_ENABLED +//#define MBEDTLS_ECP_DP_BP384R1_ENABLED +//#define MBEDTLS_ECP_DP_BP512R1_ENABLED + /* Montgomery curves (supporting ECP) */ #define MBEDTLS_ECP_DP_CURVE25519_ENABLED -#define MBEDTLS_ECP_DP_CURVE448_ENABLED +//#define MBEDTLS_ECP_DP_CURVE448_ENABLED /** * \def MBEDTLS_ECP_NIST_OPTIM -@@ -952,7 +952,7 @@ +@@ -956,7 +956,7 @@ * See dhm.h for more details. * */ @@ -55,7 +56,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -@@ -972,7 +972,7 @@ +@@ -976,7 +976,7 @@ * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA */ @@ -64,7 +65,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -@@ -997,7 +997,7 @@ +@@ -1001,7 +1001,7 @@ * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA */ @@ -73,7 +74,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -@@ -1131,7 +1131,7 @@ +@@ -1135,7 +1135,7 @@ * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 */ @@ -82,7 +83,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -@@ -1155,7 +1155,7 @@ +@@ -1159,7 +1159,7 @@ * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 */ @@ -91,7 +92,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED -@@ -1259,7 +1259,7 @@ +@@ -1263,7 +1263,7 @@ * This option is only useful if both MBEDTLS_SHA256_C and * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. */ @@ -100,7 +101,7 @@ /** * \def MBEDTLS_ENTROPY_NV_SEED -@@ -1354,14 +1354,14 @@ +@@ -1478,14 +1478,14 @@ * Uncomment this macro to disable the use of CRT in RSA. * */ @@ -117,7 +118,7 @@ /** * \def MBEDTLS_SHA256_SMALLER -@@ -1515,7 +1515,7 @@ +@@ -1756,7 +1756,7 @@ * configuration of this extension). * */ @@ -126,7 +127,7 @@ /** * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -@@ -1720,7 +1720,7 @@ +@@ -2017,7 +2017,7 @@ * * Comment this macro to disable support for truncated HMAC in SSL */ @@ -135,7 +136,7 @@ /** * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT -@@ -1796,7 +1796,7 @@ +@@ -2185,7 +2185,7 @@ * * Comment this to disable run-time checking and save ROM space */ @@ -144,7 +145,7 @@ /** * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -@@ -2126,7 +2126,7 @@ +@@ -2534,7 +2534,7 @@ * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 */ @@ -153,7 +154,7 @@ /** * \def MBEDTLS_ARIA_C -@@ -2192,7 +2192,7 @@ +@@ -2600,7 +2600,7 @@ * This module enables the AES-CCM ciphersuites, if other requisites are * enabled as well. */ @@ -162,7 +163,7 @@ /** * \def MBEDTLS_CERTS_C -@@ -2204,7 +2204,7 @@ +@@ -2612,7 +2612,7 @@ * * This module is used for testing (ssl_client/server). */ @@ -171,7 +172,7 @@ /** * \def MBEDTLS_CHACHA20_C -@@ -2312,7 +2312,7 @@ +@@ -2725,7 +2725,7 @@ * \warning DES is considered a weak cipher and its use constitutes a * security risk. We recommend considering stronger ciphers instead. */ @@ -180,7 +181,7 @@ /** * \def MBEDTLS_DHM_C -@@ -2475,7 +2475,7 @@ +@@ -2890,7 +2890,7 @@ * This module adds support for the Hashed Message Authentication Code * (HMAC)-based key derivation function (HKDF). */ @@ -189,7 +190,7 @@ /** * \def MBEDTLS_HMAC_DRBG_C -@@ -2785,7 +2785,7 @@ +@@ -3203,7 +3203,7 @@ * * This module enables abstraction of common (libc) functions. */ @@ -198,7 +199,7 @@ /** * \def MBEDTLS_POLY1305_C -@@ -2806,7 +2806,7 @@ +@@ -3279,7 +3279,7 @@ * Caller: library/md.c * */ @@ -207,7 +208,7 @@ /** * \def MBEDTLS_RSA_C -@@ -3013,7 +3013,7 @@ +@@ -3486,7 +3486,7 @@ * * This module provides run-time version information. */ @@ -216,7 +217,7 @@ /** * \def MBEDTLS_X509_USE_C -@@ -3123,7 +3123,7 @@ +@@ -3596,7 +3596,7 @@ * Module: library/xtea.c * Caller: */ From d52bf5a424581996bb40dd6ae7c3e5db43542680 Mon Sep 17 00:00:00 2001 From: Claudiu Beznea Date: Fri, 25 Feb 2022 12:05:34 +0200 Subject: [PATCH 21/66] at91: remove pm debug features from sama5 kernel config Remove PM debug features from sama5 kernel config. It is not necessary to have it on production code. This also fixes the build for sama5 target after commit 97158fe10e60 ("kernel: package ramoops pstore-ram crash log storage) Fixes: 97158fe10e60 ("kernel: package ramoops pstore-ram crash log storage") Signed-off-by: Claudiu Beznea --- target/linux/at91/sama5/config-default | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default index 0d02dd1922..3a75675c41 100644 --- a/target/linux/at91/sama5/config-default +++ b/target/linux/at91/sama5/config-default @@ -327,12 +327,8 @@ CONFIG_PINCTRL_AT91=y CONFIG_PINCTRL_AT91PIO4=y # CONFIG_PINCTRL_SINGLE is not set CONFIG_PM=y -CONFIG_PM_ADVANCED_DEBUG=y CONFIG_PM_CLK=y -CONFIG_PM_DEBUG=y CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_DEBUG=y -# CONFIG_PM_TEST_SUSPEND is not set CONFIG_POWER_RESET=y CONFIG_POWER_RESET_AT91_POWEROFF=y CONFIG_POWER_RESET_AT91_RESET=y From 64d159cdadadb6c23b9a62fc96dba27a6ed95893 Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Sat, 5 Feb 2022 12:41:44 +0300 Subject: [PATCH 22/66] argp-standalone: add host-compile ability This patch adds host-compile ability to argp-standalone for build hosts without glibc and argp lib, e.g. MacOS. iucode-tool/host can not be built on MacOS due to lack of argp. Signed-off-by: Sergey V. Lobanov --- package/libs/argp-standalone/Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/package/libs/argp-standalone/Makefile b/package/libs/argp-standalone/Makefile index 8fad739d85..21b154f29d 100644 --- a/package/libs/argp-standalone/Makefile +++ b/package/libs/argp-standalone/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=argp-standalone PKG_VERSION:=1.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.lysator.liu.se/~nisse/misc/ @@ -20,6 +20,7 @@ PKG_LICENSE:=LGPL-2.1 PKG_LICENSE:=Makefile.am include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk define Package/argp-standalone SECTION:=libs @@ -45,4 +46,14 @@ define Build/InstallDev $(1)/usr/lib/ endef +define Host/Install + $(INSTALL_DIR) $(1)/include + $(CP) $(HOST_BUILD_DIR)/argp.h \ + $(1)/include/ + $(INSTALL_DIR) $(1)/lib + $(CP) $(HOST_BUILD_DIR)/libargp.a \ + $(1)/lib/ +endef + $(eval $(call BuildPackage,argp-standalone)) +$(eval $(call HostBuild)) From e6a4f30ed77f8ae6a08cb5cab1fd9509fde3227f Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Sat, 5 Feb 2022 16:26:55 +0300 Subject: [PATCH 23/66] iucode-tool: fix host-compile on macos and non-x86 linux iucode-tool/host is used by intel-microcode to manipulate with microcode.bin file. iucode-tool requires cpuid.h at compile time for autodection feature, but non-x86 build hosts does not have this header file (e.g. ubuntu 20.04 aarch64) or this header generates compile time error (#error macro) (e.g. macos arm64). This patch provides compat cpuid.h to build iucode-tool/host on non-x86 linux hosts and macos. CPU autodectection is not required for intel-microcode package build so compat cpuid.h is ok for OpenWrt purposes. glibc and argp lib are not present in macos so iucode-tool/host build fails. This patch adds argp-standalone/host as build dependency if host os is macos. Generated ucode (intel-microcode package) is exactly the same on Linux x86_64 (Ubuntu 20.04), Linux aarch64 (Ubuntu 20.04) and Darwin arm64 (MacOS 11.6) build hosts. Signed-off-by: Sergey V. Lobanov --- package/system/iucode-tool/Makefile | 15 ++++++++- ...atibility-header-to-build-on-non-x86.patch | 31 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 package/system/iucode-tool/patches/200_add-cpuid-compatibility-header-to-build-on-non-x86.patch diff --git a/package/system/iucode-tool/Makefile b/package/system/iucode-tool/Makefile index b8227ed4a1..d7c85b2d42 100644 --- a/package/system/iucode-tool/Makefile +++ b/package/system/iucode-tool/Makefile @@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iucode-tool PKG_VERSION:=2.3.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=iucode-tool_$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://gitlab.com/iucode-tool/releases/raw/latest PKG_HASH:=12b88efa4d0d95af08db05a50b3dcb217c0eb2bfc67b483779e33d498ddb2f95 PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone +HOST_BUILD_DEPENDS:=HOST_OS_MACOS:argp-standalone/host PKG_MAINTAINER:=Zoltan HERPAI PKG_LICENSE:=GPL-2.0 @@ -41,6 +42,18 @@ define Package/iucode-tool/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/iucode_tool $(1)/usr/bin/ endef +# List of build hosts with working cpuid.h +IUT_NATIVE_HOST_OS_ARCH := \ + linux/x86_64 linux/amd64 linux/i386 linux/i686 + +IUT_HOST_OS_ARCH := $(call tolower,$(HOST_OS))/$(HOST_ARCH) + +# Use cpuid.h compat header if build host does not have working cpuid.h +ifeq ($(filter $(IUT_HOST_OS_ARCH),$(IUT_NATIVE_HOST_OS_ARCH)),) +HOST_CFLAGS += \ + -I$(HOST_BUILD_DIR)/cpuid-compat +endif + define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/iucode_tool $(STAGING_DIR_HOST)/bin/iucode_tool endef diff --git a/package/system/iucode-tool/patches/200_add-cpuid-compatibility-header-to-build-on-non-x86.patch b/package/system/iucode-tool/patches/200_add-cpuid-compatibility-header-to-build-on-non-x86.patch new file mode 100644 index 0000000000..900f3596f8 --- /dev/null +++ b/package/system/iucode-tool/patches/200_add-cpuid-compatibility-header-to-build-on-non-x86.patch @@ -0,0 +1,31 @@ +From a21e75da32c0016f1575ea29775565934a67660d Mon Sep 17 00:00:00 2001 +From: "Sergey V. Lobanov" +Date: Sat, 5 Feb 2022 13:10:23 +0300 +Subject: [PATCH] Add cpuid compatibility header to build on non-x86 hosts + +Signed-off-by: Sergey V. Lobanov +--- + cpuid-compat/cpuid.h | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + create mode 100644 cpuid-compat/cpuid.h + +--- /dev/null ++++ b/cpuid-compat/cpuid.h +@@ -0,0 +1,17 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * cpuid compatibility header to build iucode-tool on non-x86 hosts ++ * ++ * Copyright (C) 2022 Sergey V. Lobanov ++ */ ++ ++#ifdef __APPLE__ ++# include ++#endif ++ ++static __inline int __get_cpuid (unsigned int leaf, ++ unsigned int *eax, unsigned int *ebx, ++ unsigned int *ecx, unsigned int *edx) ++{ ++ return 0; ++} From 1753f8c14bc09183492d62bccb8d8e42b5f24e19 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 26 Feb 2022 00:30:25 +0100 Subject: [PATCH 24/66] firmware: intel-microcode: update to 20220207 Debians' changelog by Henrique de Moraes Holschuh : * upstream changelog: new upstream datafile 20220207 * Mitigates (*only* when loaded from UEFI firmware through the FIT) CVE-2021-0146, INTEL-SA-00528: VT-d privilege escalation through debug port, on Pentium, Celeron and Atom processors with signatures 0x506c9, 0x506ca, 0x506f1, 0x706a1, 0x706a8 https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/57#issuecomment-1036363145 * Mitigates CVE-2021-0127, INTEL-SA-00532: an unexpected code breakpoint may cause a system hang, on many processors. * Mitigates CVE-2021-0145, INTEL-SA-00561: information disclosure due to improper sanitization of shared resources (fast-store forward predictor), on many processors. * Mitigates CVE-2021-33120, INTEL-SA-00589: out-of-bounds read on some Atom Processors may allow information disclosure or denial of service via network access. * Fixes critical errata (functional issues) on many processors * Adds a MSR switch to enable RAPL filtering (default off, once enabled it can only be disabled by poweroff or reboot). Useful to protect SGX and other threads from side-channel info leak. Improves the mitigation for CVE-2020-8694, CVE-2020-8695, INTEL-SA-00389 on many processors. * Disables TSX in more processor models. * Fixes issue with WBINDV on multi-socket (server) systems which could cause resets and unpredictable system behavior. * Adds a MSR switch to 10th and 11th-gen (Ice Lake, Tiger Lake, Rocket Lake) processors, to control a fix for (hopefully rare) unpredictable processor behavior when HyperThreading is enabled. This MSR switch is enabled by default on *server* processors. On other processors, it needs to be explicitly enabled by an updated UEFI/BIOS (with added configuration logic). An updated operating system kernel might also be able to enable it. When enabled, this fix can impact performance. * Updated Microcodes: sig 0x000306f2, pf_mask 0x6f, 2021-08-11, rev 0x0049, size 38912 sig 0x000306f4, pf_mask 0x80, 2021-05-24, rev 0x001a, size 23552 sig 0x000406e3, pf_mask 0xc0, 2021-04-28, rev 0x00ec, size 105472 sig 0x00050653, pf_mask 0x97, 2021-05-26, rev 0x100015c, size 34816 sig 0x00050654, pf_mask 0xb7, 2021-06-16, rev 0x2006c0a, size 43008 sig 0x00050656, pf_mask 0xbf, 2021-08-13, rev 0x400320a, size 35840 sig 0x00050657, pf_mask 0xbf, 2021-08-13, rev 0x500320a, size 36864 sig 0x0005065b, pf_mask 0xbf, 2021-06-04, rev 0x7002402, size 28672 sig 0x00050663, pf_mask 0x10, 2021-06-12, rev 0x700001c, size 28672 sig 0x00050664, pf_mask 0x10, 2021-06-12, rev 0xf00001a, size 27648 sig 0x00050665, pf_mask 0x10, 2021-09-18, rev 0xe000014, size 23552 sig 0x000506c9, pf_mask 0x03, 2021-05-10, rev 0x0046, size 17408 sig 0x000506ca, pf_mask 0x03, 2021-05-10, rev 0x0024, size 16384 sig 0x000506e3, pf_mask 0x36, 2021-04-29, rev 0x00ec, size 108544 sig 0x000506f1, pf_mask 0x01, 2021-05-10, rev 0x0036, size 11264 sig 0x000606a6, pf_mask 0x87, 2021-12-03, rev 0xd000331, size 291840 sig 0x000706a1, pf_mask 0x01, 2021-05-10, rev 0x0038, size 74752 sig 0x000706a8, pf_mask 0x01, 2021-05-10, rev 0x001c, size 75776 sig 0x000706e5, pf_mask 0x80, 2021-05-26, rev 0x00a8, size 110592 sig 0x000806a1, pf_mask 0x10, 2021-09-02, rev 0x002d, size 34816 sig 0x000806c1, pf_mask 0x80, 2021-08-06, rev 0x009a, size 109568 sig 0x000806c2, pf_mask 0xc2, 2021-07-16, rev 0x0022, size 96256 sig 0x000806d1, pf_mask 0xc2, 2021-07-16, rev 0x003c, size 101376 sig 0x000806e9, pf_mask 0x10, 2021-04-28, rev 0x00ec, size 104448 sig 0x000806e9, pf_mask 0xc0, 2021-04-28, rev 0x00ec, size 104448 sig 0x000806ea, pf_mask 0xc0, 2021-04-28, rev 0x00ec, size 103424 sig 0x000806eb, pf_mask 0xd0, 2021-04-28, rev 0x00ec, size 104448 sig 0x000806ec, pf_mask 0x94, 2021-04-28, rev 0x00ec, size 104448 sig 0x00090661, pf_mask 0x01, 2021-09-21, rev 0x0015, size 20480 sig 0x000906c0, pf_mask 0x01, 2021-08-09, rev 0x2400001f, size 20480 sig 0x000906e9, pf_mask 0x2a, 2021-04-29, rev 0x00ec, size 106496 sig 0x000906ea, pf_mask 0x22, 2021-04-28, rev 0x00ec, size 102400 sig 0x000906eb, pf_mask 0x02, 2021-04-28, rev 0x00ec, size 104448 sig 0x000906ec, pf_mask 0x22, 2021-04-28, rev 0x00ec, size 103424 sig 0x000906ed, pf_mask 0x22, 2021-04-28, rev 0x00ec, size 103424 sig 0x000a0652, pf_mask 0x20, 2021-04-28, rev 0x00ec, size 93184 sig 0x000a0653, pf_mask 0x22, 2021-04-28, rev 0x00ec, size 94208 sig 0x000a0655, pf_mask 0x22, 2021-04-28, rev 0x00ee, size 94208 sig 0x000a0660, pf_mask 0x80, 2021-04-28, rev 0x00ea, size 94208 sig 0x000a0661, pf_mask 0x80, 2021-04-29, rev 0x00ec, size 93184 sig 0x000a0671, pf_mask 0x02, 2021-08-29, rev 0x0050, size 102400 * Removed Microcodes: sig 0x00080664, pf_mask 0x01, 2021-02-17, rev 0xb00000f, size 130048 sig 0x00080665, pf_mask 0x01, 2021-02-17, rev 0xb00000f, size 130048 * update .gitignore and debian/.gitignore. Add some missing items from .gitignore and debian/.gitignore. * ucode-blacklist: do not late-load 0x406e3 and 0x506e3. When the BIOS microcode is older than revision 0x7f (and perhaps in some other cases as well), the latest microcode updates for 0x406e3 and 0x506e3 must be applied using the early update method. Otherwise, the system might hang. Also: there must not be any other intermediate microcode update attempts [other than the one done by the BIOS itself], either. It must go from the BIOS microcode update directly to the latest microcode update. * source: update symlinks to reflect id of the latest release, 20220207 Signed-off-by: Christian Lamparter --- package/firmware/intel-microcode/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/firmware/intel-microcode/Makefile b/package/firmware/intel-microcode/Makefile index 7f8d5adf7c..e6f730fcb2 100644 --- a/package/firmware/intel-microcode/Makefile +++ b/package/firmware/intel-microcode/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=intel-microcode -PKG_VERSION:=20210608 +PKG_VERSION:=20220207 PKG_RELEASE:=1 -PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).2.tar.xz +PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).1.tar.xz PKG_SOURCE_URL:=@DEBIAN/pool/non-free/i/intel-microcode/ -PKG_HASH:=fbf82688ffd0d87b352a35c57bd097ea014f0ad32c9c8f9629725c1b43d1c84d -PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).2 +PKG_HASH:=42f2ab3c14bda745ec64008cde5c0f416f32f40e838a9df04cf5ddf5fc87498b +PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).1 PKG_BUILD_DEPENDS:=iucode-tool/host From 73dfc9e7d9013d39ca8a3cc9fe833875b71bdbe6 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Sun, 20 Feb 2022 19:10:08 +0200 Subject: [PATCH 25/66] firmware-utils: bump to git HEAD 706e9cc tplink-safeloader: support for Archer A6 v3 JP 497726b firmware-utils: support checksum for AVM fritzbox wasp SOCs 2ca6462 iptime-crc32: add support for AX8004M 57d0e31 tplink-safeloader: TP-Link EAP615-Wall v1 support 8a8da19 tplink-safeloader: add TL-WPA8631P v3 support eea4ee7 tplink-safeloader: add TP-Link Archer A9 v6 support Signed-off-by: Stijn Tintel --- tools/firmware-utils/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 60e0c74b45..af43f1e643 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2022-01-29 -PKG_SOURCE_VERSION:=872c87c6805bea08677de71b744cce7deb24903e -PKG_MIRROR_HASH:=e9bb14bca59485345c9f109f6ee2aec709e4d29cd389e3b05447a91c06806cf8 +PKG_SOURCE_DATE:=2022-02-26 +PKG_SOURCE_VERSION:=eea4ee70d3da01a92bd1da4f18563fc43895f64e +PKG_MIRROR_HASH:=655cabd23caf7b51aa019eee8ae385ac9e18b11596dc79e80419d42d220dbd83 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From a1b8a4d7b3ff3fa671623e2bccafd43a3c141e07 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 27 Jan 2022 23:42:33 +0200 Subject: [PATCH 26/66] ramips: support TP-Link EAP615-Wall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for the TP-Link EAP615-Wall, an AX1800 Wall Plate WiFi 6 AP. The device is very similar to the TP-Link EAP235-Wall. Hardware: * SoC: MediaTek MT7621AT * RAM: 128MiB * Flash: 16MiB SPI-NOR * Ethernet: 4x GbE * Back: ETH0 (PoE-PD) * Bottom: ETH1, ETH2, ETH3 (PoE passthrough) * WiFi: MT7905DAN/MT7975DN 2.4/5 GHz 2T2R * LEDS: 1x white * Buttons: 1x LED, 1x reset Stock firmware uses a random MAC address for ethernet. OpenWrt uses the MAC address that is on the device label for ethernet and the wireless interfaces. MAC address must not be incremented, as this will cause MAC address conflicts in case you have two devices with consecutive MAC addresses. Instead, different locally administered addresses will be generated automatically, based on the MAC on the label. Installation via stock firmware: * Enable SSH in the TP-Link web interface * SSH to the device * Run `cliclientd stopcs` * Upload the OpenWrt factory image via the TP-Link web interface Installation via bootloader: * Solder TTL header. Pinout: 1: TX, 2: RX, 3: GND, 4: VCC, with pin 1 closest to ETH1. Baud rate 115200 * Interrupt boot process by holding a key during boot * Boot the OpenWrt initramfs: # tftpboot 0x84000000 openwrt-ramips-mt7621-tplink_eap615-wall-v1-initramfs-kernel.bin # bootm * Copy openwrt-ramips-mt7621-tplink_eap615-wall-v1-squashfs-sysupgrade.bin to /tmp and use sysupgrade to install it Thanks to Sander Vanheule for his work on the EAP235-Wall, which made adding support for the EAP615-Wall very easy. Signed-off-by: Stijn Tintel Reviewed-by: Sander Vanheule Acked-by: Arınç ÜNAL --- .../dts/mt7621_tplink_eap615-wall-v1.dts | 194 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 13 ++ .../mt7621/base-files/etc/board.d/02_network | 3 +- 3 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts diff --git a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts new file mode 100644 index 0000000000..a0c3912d8e --- /dev/null +++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts @@ -0,0 +1,194 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "tplink,eap615-wall-v1", "mediatek,mt7621-soc"; + model = "TP-Link EAP615-Wall v1"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status: status { + label = "white:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + led { + label = "led"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + poe_passthrough { + gpio-export,name = "poe-passthrough"; + gpio-export,output = <0>; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ðernet { + reg = <0x1e100000 0xe000>; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "partition-table"; + reg = <0x80000 0x10000>; + read-only; + }; + + info: partition@90000 { + label = "product-info"; + reg = <0x90000 0x10000>; + read-only; + }; + + partition@a0000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0xa0000 0xcf0000>; + }; + + partition@d90000 { + label = "user-config"; + reg = <0xd90000 0x60000>; + read-only; + }; + + partition@f30000 { + label = "mutil-log"; + reg = <0xf30000 0x80000>; + read-only; + }; + + partition@fb0000 { + label = "oops"; + reg = <0xfb0000 0x40000>; + read-only; + }; + + radio: partition@ff0000 { + label = "radio"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "uart2", "uart3"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + }; +}; + +&pcie2 { + status = "disabled"; +}; + +&gmac0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + compatible = "mediatek,mt7530"; + ports { + port@0 { + status = "okay"; + label = "lan0"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + }; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 340c8eab3c..1b75f0d7a6 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1499,6 +1499,19 @@ define Device/tplink_eap235-wall-v1 endef TARGET_DEVICES += tplink_eap235-wall-v1 +define Device/tplink_eap615-wall-v1 + $(Device/dsa-migration) + $(Device/tplink-safeloader) + DEVICE_MODEL := EAP615-Wall + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7915e + TPLINK_BOARD_ID := EAP615-WALL-V1 + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | pad-to 64k + KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd + IMAGE_SIZE := 13248k +endef +TARGET_DEVICES += tplink_eap615-wall-v1 + define Device/tplink_re350-v1 $(Device/dsa-migration) $(Device/tplink-safeloader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 374a260882..9af169fbef 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -63,7 +63,8 @@ ramips_setup_interfaces() mikrotik,routerboard-760igs) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp" ;; - tplink,eap235-wall-v1) + tplink,eap235-wall-v1|\ + tplink,eap615-wall-v1) ucidef_set_interface_lan "lan0 lan1 lan2 lan3" ;; ubnt,edgerouter-x) From c3ccc4529d883346d52d543887274290c619cb8c Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 23 Feb 2022 10:28:21 +0100 Subject: [PATCH 27/66] bcm63xx: fix booting with Kernel 5.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a workaround to make the target overall bootable. With this more people should be able to test the Kernel 5.10 and report further issues. Suggested-by: Daniel González Cabanelas Signed-off-by: Paul Spooren --- ...acronix_nand_block_protection_support.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 target/linux/bcm63xx/patches-5.10/100-macronix_nand_block_protection_support.patch diff --git a/target/linux/bcm63xx/patches-5.10/100-macronix_nand_block_protection_support.patch b/target/linux/bcm63xx/patches-5.10/100-macronix_nand_block_protection_support.patch new file mode 100644 index 0000000000..cee69dd8c6 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.10/100-macronix_nand_block_protection_support.patch @@ -0,0 +1,18 @@ +bcm63xx: fix booting with Kernel 5.10 + +This is a workaround to make the target overall bootable. With this more +people should be able to test the Kernel 5.10 and report further issues. + +Suggested-by: Daniel González Cabanelas +Signed-off-by: Paul Spooren +--- a/drivers/mtd/nand/raw/nand_macronix.c ++++ b/drivers/mtd/nand/raw/nand_macronix.c +@@ -323,7 +323,7 @@ static int macronix_nand_init(struct nan + + macronix_nand_fix_broken_get_timings(chip); + macronix_nand_onfi_init(chip); +- macronix_nand_block_protection_support(chip); ++ //macronix_nand_block_protection_support(chip); + macronix_nand_deep_power_down_support(chip); + + return 0; From 493b60d044c1d32ec7dbc4b02f7f5d6ada397a29 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 29 Sep 2021 19:16:07 -1000 Subject: [PATCH 28/66] bcm63xx: switch to Kernel 5.10 Bump the last missing target to Kernel 5.10. While this requires a work around to boot it will allow more people to test the new Kernel before the upcomming release. Signed-off-by: Paul Spooren --- target/linux/bcm63xx/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/bcm63xx/Makefile b/target/linux/bcm63xx/Makefile index 23e43f601a..289b55b762 100644 --- a/target/linux/bcm63xx/Makefile +++ b/target/linux/bcm63xx/Makefile @@ -10,8 +10,8 @@ BOARD:=bcm63xx BOARDNAME:=Broadcom BCM63xx SUBTARGETS:=generic smp FEATURES:=squashfs usb atm pci pcmcia usbgadget -KERNEL_PATCHVER:=5.4 -KERNEL_TESTING_PATCHVER:=5.10 + +KERNEL_PATCHVER:=5.10 define Target/Description Build firmware images for Broadcom based xDSL/routers From f645bacd06643ba6141f9be34c22681449a42392 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Tue, 22 Feb 2022 15:50:22 +0100 Subject: [PATCH 29/66] ath79: reduce 'nvmem-cells' definitions on ALFA Network QCA9531 boards All the QCA9531 based boards from ALFA Network are based on the same design and share a common DTSI: 'qca9531_alfa-network_r36a.dtsi'. Instead of defining 'nvmem-cells' for the MAC address in every device's DTS, move definition to the common DTSI file. Signed-off-by: Piotr Dymacz --- target/linux/ath79/dts/qca9531_alfa-network_n2q.dts | 10 ---------- .../linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts | 10 ---------- target/linux/ath79/dts/qca9531_alfa-network_r36a.dts | 10 ---------- target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi | 8 ++++++++ 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts index 671adb8ccf..8759198f53 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts @@ -120,13 +120,3 @@ &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts index 5a934ce957..e9e19f9d32 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts @@ -86,13 +86,3 @@ #trigger-source-cells = <0>; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts index 01e14bb0b1..6af8d3b8b5 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts @@ -81,13 +81,3 @@ debounce-interval = <60>; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi index 4c9346db1e..7e89605480 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi @@ -86,6 +86,14 @@ label = "art"; reg = <0x070000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; partition@80000 { From 53ac6ee552baca52f3f18fc95b793c03e1bf9581 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Tue, 22 Feb 2022 16:29:27 +0100 Subject: [PATCH 30/66] ath79: utilize ath9k 'nvmem-cells' on ALFA Network boards Drop custom 'mtd-cal-data' and switch to 'nvmem-cells' based solution for fetching radio calibration data and its MAC address. Signed-off-by: Piotr Dymacz --- .../ath79/dts/ar9331_alfa-network_ap121f.dtsi | 31 +++++++++------ .../ath79/dts/ar9344_alfa-network_n5q.dts | 39 +++++++++++-------- .../ath79/dts/qca9531_alfa-network_r36a.dtsi | 9 ++++- 3 files changed, 49 insertions(+), 30 deletions(-) diff --git a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi index e12205c310..2be7cdb05d 100644 --- a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi @@ -96,10 +96,26 @@ reg = <0x030000 0x010000>; }; - art: partition@40000 { + partition@40000 { label = "art"; reg = <0x040000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; partition@50000 { @@ -122,15 +138,6 @@ &wmac { status = "okay"; - mtd-cal-data = <&art 0x1000>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>; + nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts index c54270a78d..ca762c3bca 100644 --- a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts +++ b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts @@ -131,10 +131,30 @@ reg = <0x060000 0x010000>; }; - art: partition@70000 { + partition@70000 { label = "art"; reg = <0x070000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; partition@80000 { @@ -149,19 +169,6 @@ &wmac { status = "okay"; - mtd-cal-data = <&art 0x1000>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>; + nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi index 7e89605480..9704e69211 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi @@ -82,7 +82,7 @@ reg = <0x060000 0x010000>; }; - art: partition@70000 { + partition@70000 { label = "art"; reg = <0x070000 0x010000>; read-only; @@ -91,6 +91,10 @@ #address-cells = <1>; #size-cells = <1>; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + macaddr_art_1002: macaddr@1002 { reg = <0x1002 0x6>; }; @@ -124,5 +128,6 @@ &wmac { status = "okay"; - mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>; + nvmem-cell-names = "calibration", "mac-address"; }; From 131671bc54dff89c33c10241b8fca8fa34a9b2bf Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Thu, 17 Feb 2022 23:22:25 +0100 Subject: [PATCH 31/66] ath79: add support for ALFA Network Tube-2HQ ALFA Network Tube-2HQ is a successor of the Tube-2H/P series (EOL) which was based on the Atheros AR9331. The new version uses Qualcomm QCA9531. Specifications: - Qualcomm/Atheros QCA9531 v2 - 650/400/200 MHz (CPU/DDR/AHB) - 64 or 128 MB of RAM (DDR2) - 16+ MB of flash (SPI NOR) - 1x 10/100 Mbps Ethernet with passive PoE input (24 V) (802.3at/af PoE support with optional module) - 1T1R 2.4 GHz Wi-Fi with external PA (SE2623L, up to 27 dBm) and LNA - 1x Type-N (male) antenna connector - 6x LED (5x driven by GPIO) - 1x button (reset) - external h/w watchdog (EM6324QYSP5B, enabled by default) - UART (4-pin, 2.00 mm pitch) header on PCB Flash instruction: You can use sysupgrade image directly in vendor firmware which is based on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot: 1. Configure PC with static IP 192.168.1.2/24. 2. Connect PC with one of RJ45 ports, press the reset button, power up device, wait for first blink of all LEDs (indicates network setup), then keep button for 3 following blinks and release it. 3. Open 192.168.1.1 address in your browser and upload sysupgrade image. Signed-off-by: Piotr Dymacz --- .../dts/qca9531_alfa-network_tube-2hq.dts | 65 +++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 8 +++ .../generic/base-files/etc/board.d/02_network | 2 + target/linux/ath79/image/generic.mk | 10 +++ 4 files changed, 85 insertions(+) create mode 100644 target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts diff --git a/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts b/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts new file mode 100644 index 0000000000..f81fe287df --- /dev/null +++ b/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9531_alfa-network_r36a.dtsi" + +/ { + model = "ALFA Network Tube-2HQ"; + compatible = "alfa-network,tube-2hq", "qca,qca9531"; + + aliases { + led-boot = &led_signal4; + led-failsafe = &led_signal4; + led-upgrade = &led_signal4; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio4 &enable_gpio16>; + + lan { + label = "blue:lan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_signal4: signal4 { + label = "green:signal4"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + signal1 { + label = "red:signal1"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + signal2 { + label = "orange:signal2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + signal3 { + label = "green:signal3"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + + mac-address-increment = <(-1)>; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; + +&usb0 { + status = "disabled"; +}; + +&usb_phy { + status = "disabled"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 18904f8528..354df1da6f 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -48,6 +48,14 @@ alfa-network,r36a) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x10" ;; +alfa-network,tube-2hq) + ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "signal1" "SIGNAL1" "red:signal1" "wlan0" "1" "100" + ucidef_set_led_rssi "signal2" "SIGNAL2" "orange:signal2" "wlan0" "25" "100" + ucidef_set_led_rssi "signal3" "SIGNAL3" "green:signal3" "wlan0" "50" "100" + ucidef_set_led_rssi "signal4" "SIGNAL4" "green:signal4" "wlan0" "75" "100" + ;; asus,rp-ac66) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_rssimon "wlan1" "200000" "1" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 447d1cdea2..bb5c63a33e 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -13,6 +13,7 @@ ath79_setup_interfaces() allnet,all-wap02860ac|\ alfa-network,ap121f|\ alfa-network,pi-wifi4|\ + alfa-network,tube-2hq|\ arduino,yun|\ aruba,ap-105|\ asus,rp-ac66|\ @@ -529,6 +530,7 @@ ath79_setup_macs() alfa-network,n5q|\ alfa-network,pi-wifi4|\ alfa-network,r36a|\ + alfa-network,tube-2hq|\ engenius,eap300-v2|\ engenius,ens202ext-v1) label_mac=$(mtd_get_mac_binary art 0x1002) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index b01eff7d0b..27a9860d28 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -298,6 +298,16 @@ define Device/alfa-network_r36a endef TARGET_DEVICES += alfa-network_r36a +define Device/alfa-network_tube-2hq + SOC := qca9531 + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := Tube-2HQ + DEVICE_PACKAGES := rssileds -swconfig + IMAGE_SIZE := 15872k + SUPPORTED_DEVICES += tube-2hq +endef +TARGET_DEVICES += alfa-network_tube-2hq + define Device/allnet_all-wap02860ac $(Device/senao_loader_okli) SOC := qca9558 From 2d5b596b493bfaeab024d6ecee37d97420c2ac07 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Thu, 17 Feb 2022 23:24:04 +0100 Subject: [PATCH 32/66] uboot-envtools: ath79: add support for ALFA Network Tube-2HQ Signed-off-by: Piotr Dymacz --- package/boot/uboot-envtools/files/ath79 | 1 + 1 file changed, 1 insertion(+) diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 57be9ccb84..bc02f4517c 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -18,6 +18,7 @@ alfa-network,n2q|\ alfa-network,n5q|\ alfa-network,pi-wifi4|\ alfa-network,r36a|\ +alfa-network,tube-2hq|\ allnet,all-wap02860ac|\ arduino,yun|\ buffalo,bhr-4grv2|\ From 9c335accfe57f3049850b8fdb684c9e7e5feea82 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Fri, 25 Feb 2022 23:01:10 +0100 Subject: [PATCH 33/66] ath79: add support for TP-Link Archer A9 v6 TP-Link Archer A9 v6 (FCCID: TE7A9V6) is an AC1900 Wave-2 gigabit home router based on a combination of Qualcomm QCN5502 (most likely a 4x4:4 version of the QCA9563 WiSOC), QCA9984 and QCA8337N. The vendor's firmware content reveals that the same device might be available on the US market under name 'Archer C90 v6'. Due to lack of access to such hardware, support introduced in this commit was tested only on the EU version (sold under 'Archer A9 v6' name). Based on the information on the PL version of the vendor website, this device has been already phased out and is no longer available. Specifications: - Qualcomm QCN5502 (775 MHz) - 128 MB of RAM (DDR2) - 16 MB of flash (SPI NOR) - 5x Gbps Ethernet (Qualcomm QCA8337N over SGMII) - Wi-Fi: - 802.11b/g/n on 2.4 GHz: Qualcomm QCN5502* in 4x4:4 mode - 802.11a/n/ac on 5 GHz: Qualcomm QCA9984 in 3x3:3 mode - 3x non-detachable, dual-band external antennas (~3.5 dBi for 5 GHz, ~2.2 dBi for 2.4 GHz, IPEX/U.FL connectors) - 1x internal PCB antenna for 2.4 GHz (~1.8 dBi) - 1x USB 2.0 Type-A - 11x LED (4x connected to QCA8337N, 7x connected to QCN5502) - 2x button (reset, WPS) - UART (4-pin, 2.54 mm pitch) header on PCB (not populated) - 1x mechanical power switch - 1x DC jack (12 V) *) unsupported due to missing support for QCN550x in ath9k UART system serial console notice: The RX signal of the main SOC's UART on this device is shared with the WPS button's GPIO. The first-stage U-Boot by default disables the RX, resulting in a non-functional UART input. If you press and keep 'ENTER' on the serial console during early boot-up, the first-stage U-Boot will enable RX input. Vendor firmware allows password-less access to the system over serial. Flash instruction (vendor GUI): 1. It is recommended to first upgrade vendor firmware to the latest version (1.1.1 Build 20210315 rel.40637 at the time of writing). 2. Use the 'factory' image directly in the vendor's GUI. Flash instruction (TFTP based recovery in second-stage U-Boot): 1. Rename 'factory' image to 'ArcherA9v6_tp_recovery.bin' 2. Setup a TFTP server on your PC with IP 192.168.0.66/24. 3. Press and hold the reset button for ~5 sec while turning on power. 4. The device will download image, flash it and reboot. Flash instruction (web based recovery in first-stage U-Boot): 1. Use 'CTRL+C' during power-up to enable CLI in first-stage U-Boot. 2. Connect a PC with IP set to 192.168.0.1 to one of the LAN ports. 3. Issue 'httpd' command and visit http://192.168.0.1 in browser. 4. Use the 'factory' image. If you would like to restore vendor's firmware, follow one of the recovery methods described above. Signed-off-by: Piotr Dymacz --- .../ath79/dts/qcn5502_tplink_archer-a9-v6.dts | 248 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 3 + .../generic/base-files/etc/board.d/02_network | 2 + target/linux/ath79/image/generic-tp-link.mk | 12 + 4 files changed, 265 insertions(+) create mode 100644 target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts diff --git a/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts b/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts new file mode 100644 index 0000000000..c095bbd2ed --- /dev/null +++ b/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts @@ -0,0 +1,248 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + model = "TP-Link Archer A9 v6"; + compatible = "tplink,archer-a9-v6", "qca,qcn5500", "qca,qca9560"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb { + label = "green:usb"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + trigger-sources = <&hub_port0>; + linux,default-trigger = "usbport"; + }; + + wan { + label = "green:wan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "orange:wan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "green:wps"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x80080080 /* PORT0 PAD MODE CTRL */ + 0x08 0x00000000 /* PORT5 PAD MODE CTRL */ + 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */ + 0x10 0x00000080 /* POWER_ON_STRAP */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x00000200 /* PORT6_STATUS */ + >; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,0046"; + reg = <0 0 0 0 0>; + + nvmem-cells = <&macaddr_info_8>, <&precal_art_5000>; + nvmem-cell-names = "mac-address", "pre-calibration"; + + mac-address-increment = <(-1)>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + m25p,fast-read; + + mtdparts: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + label = "partition-table"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "art"; + reg = <0x050000 0x010000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@60000 { + label = "info"; + reg = <0x060000 0x020000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; + + partition@80000 { + label = "user-config"; + reg = <0x080000 0x040000>; + read-only; + }; + + partition@c0000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0c0000 0xf00000>; + }; + + partition@fc0000 { + label = "log"; + reg = <0xfc0000 0x020000>; + read-only; + }; + + partition@fe0000 { + label = "certificate"; + reg = <0xfe0000 0x010000>; + read-only; + }; + + partition@ff0000 { + label = "default-config"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&wmac { + /* TODO: missing support in ath9k */ + status = "disabled"; + + nvmem-cells = <&cal_art_1000>, <&macaddr_info_8>; + nvmem-cell-names = "calibration", "mac-address"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 354df1da6f..2ce489b0d1 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -325,6 +325,9 @@ tplink,archer-c7-v5) ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x10" ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x20" ;; +tplink,archer-a9-v6) + ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x02" + ;; tplink,archer-c2-v3|\ tplink,tl-wr1043nd-v4|\ tplink,tl-wr1043n-v5) diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index bb5c63a33e..86ce8f5bd7 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -337,6 +337,7 @@ ath79_setup_interfaces() ;; mercury,mw4530r-v1|\ tplink,archer-a7-v5|\ + tplink,archer-a9-v6|\ tplink,archer-c6-v2|\ tplink,archer-c6-v2-us|\ tplink,archer-c7-v4|\ @@ -691,6 +692,7 @@ ath79_setup_macs() label_mac=$lan_mac ;; tplink,archer-a7-v5|\ + tplink,archer-a9-v6|\ tplink,archer-c7-v4|\ tplink,archer-c7-v5|\ tplink,tl-wr1043nd-v4|\ diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index c47fcd0039..d6f7e7655d 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -12,6 +12,18 @@ define Device/tplink_archer-a7-v5 endef TARGET_DEVICES += tplink_archer-a7-v5 +define Device/tplink_archer-a9-v6 + $(Device/tplink-safeloader-uimage) + SOC := qcn5502 + IMAGE_SIZE := 15360k + DEVICE_MODEL := Archer A9 + DEVICE_VARIANT := v6 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \ + ath10k-firmware-qca9984-ct + TPLINK_BOARD_ID := ARCHER-A9-V6 +endef +TARGET_DEVICES += tplink_archer-a9-v6 + define Device/tplink_archer-c2-v3 $(Device/tplink-safeloader-uimage) SOC := qca9563 From 4f443c885dede3331b969e6265a41a0ff1e3059a Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 24 Feb 2022 05:44:49 +0000 Subject: [PATCH 34/66] netfilter: separate packages for kmod-ipt-socket and kmod-ipt-tproxy Signed-off-by: Yousong Zhou --- include/netfilter.mk | 13 ++++---- package/kernel/linux/modules/netfilter.mk | 39 ++++++++++++++++++++++- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/include/netfilter.mk b/include/netfilter.mk index 4602a1d412..751fabef19 100644 --- a/include/netfilter.mk +++ b/include/netfilter.mk @@ -239,14 +239,15 @@ $(eval $(call nf_add,IPT_NFQUEUE,CONFIG_NETFILTER_XT_TARGET_NFQUEUE, $(P_XT)xt_N $(eval $(call nf_add,IPT_DEBUG,CONFIG_NETFILTER_XT_TARGET_TRACE, $(P_XT)xt_TRACE)) -# tproxy +# socket +$(eval $(call nf_add,NF_SOCKET,CONFIG_NF_SOCKET_IPV4, $(P_V4)nf_socket_ipv4)) +$(eval $(call nf_add,NF_SOCKET,CONFIG_NF_SOCKET_IPV6, $(P_V6)nf_socket_ipv6)) +$(eval $(call nf_add,IPT_SOCKET,CONFIG_NETFILTER_XT_MATCH_SOCKET, $(P_XT)xt_socket)) -$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_MATCH_SOCKET, $(P_XT)xt_socket)) -$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV4, $(P_V4)nf_socket_ipv4)) -$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV6, $(P_V6)nf_socket_ipv6)) +# tproxy +$(eval $(call nf_add,NF_TPROXY,CONFIG_NF_TPROXY_IPV4, $(P_V4)nf_tproxy_ipv4)) +$(eval $(call nf_add,NF_TPROXY,CONFIG_NF_TPROXY_IPV6, $(P_V6)nf_tproxy_ipv6)) $(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_TARGET_TPROXY, $(P_XT)xt_TPROXY)) -$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV4, $(P_V4)nf_tproxy_ipv4)) -$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV6, $(P_V6)nf_tproxy_ipv6)) # led $(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED)) diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 75a06fb651..85780306f3 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -162,6 +162,28 @@ endef $(eval $(call KernelPackage,nf-flow)) +define KernelPackage/nf-socket + SUBMENU:=$(NF_MENU) + TITLE:=Netfilter socket lookup support + KCONFIG:= $(KCOFNIG_NF_SOCKET) + FILES:=$(foreach mod,$(NF_SOCKET-m),$(LINUX_DIR)/net/$(mod).ko) + AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_SOCKET-m))) +endef + +$(eval $(call KernelPackage,nf-socket)) + + +define KernelPackage/nf-tproxy + SUBMENU:=$(NF_MENU) + TITLE:=Netfilter tproxy support + KCONFIG:= $(KCOFNIG_NF_TPROXY) + FILES:=$(foreach mod,$(NF_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko) + AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_TPROXY-m))) +endef + +$(eval $(call KernelPackage,nf-tproxy)) + + define AddDepends/ipt SUBMENU:=$(NF_MENU) DEPENDS+= +kmod-ipt-core $(1) @@ -645,9 +667,24 @@ endef $(eval $(call KernelPackage,ipt-led)) +define KernelPackage/ipt-socket + TITLE:=Iptables socket matching support + DEPENDS+=+kmod-nf-socket +kmod-nf-conntrack + KCONFIG:=$(KCONFIG_IPT_SOCKET) + FILES:=$(foreach mod,$(IPT_SOCKET-m),$(LINUX_DIR)/net/$(mod).ko) + AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_SOCKET-m))) + $(call AddDepends/ipt) +endef + +define KernelPackage/ipt-socket/description + Kernel modules for socket matching +endef + +$(eval $(call KernelPackage,ipt-socket)) + define KernelPackage/ipt-tproxy TITLE:=Transparent proxying support - DEPENDS+=+kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +IPV6:kmod-ip6tables + DEPENDS+=+kmod-nf-tproxy +kmod-nf-conntrack KCONFIG:=$(KCONFIG_IPT_TPROXY) FILES:=$(foreach mod,$(IPT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko) AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_TPROXY-m))) From 0225df1ec8570d144a0a8d7862036c532cc44dbd Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 24 Feb 2022 05:47:11 +0000 Subject: [PATCH 35/66] netfilter: add kmod-nft-socket Signed-off-by: Yousong Zhou --- include/netfilter.mk | 2 ++ package/kernel/linux/modules/netfilter.mk | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/netfilter.mk b/include/netfilter.mk index 751fabef19..83455cc378 100644 --- a/include/netfilter.mk +++ b/include/netfilter.mk @@ -351,6 +351,8 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_IPV6, $(P_V6)nft_fib $(eval $(if $(NF_KMOD),$(call nf_add,NFT_QUEUE,CONFIG_NFT_QUEUE, $(P_XT)nft_queue),)) +$(eval $(if $(NF_KMOD),$(call nf_add,NFT_SOCKET,CONFIG_NFT_SOCKET, $(P_XT)nft_socket),)) + $(eval $(if $(NF_KMOD),$(call nf_add,NFT_COMPAT,CONFIG_NFT_COMPAT, $(P_XT)nft_compat),)) # userland only diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 85780306f3..7200af769f 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -1217,6 +1217,17 @@ endef $(eval $(call KernelPackage,nft-queue)) +define KernelPackage/nft-socket + SUBMENU:=$(NF_MENU) + TITLE:=Netfilter nf_tables socket support + DEPENDS:=+kmod-nft-core +kmod-nf-socket + FILES:=$(foreach mod,$(NFT_SOCKET-m),$(LINUX_DIR)/net/$(mod).ko) + AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_SOCKET-m))) + KCONFIG:=$(KCONFIG_NFT_SOCKET) +endef + +$(eval $(call KernelPackage,nft-socket)) + define KernelPackage/nft-compat SUBMENU:=$(NF_MENU) TITLE:=Netfilter nf_tables compat support From 43276b60c6dd5adeec89401c6ddd514e2cd22896 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 24 Feb 2022 05:47:21 +0000 Subject: [PATCH 36/66] netfilter: add kmod-nft-tproxy Signed-off-by: Yousong Zhou --- include/netfilter.mk | 2 ++ package/kernel/linux/modules/netfilter.mk | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/netfilter.mk b/include/netfilter.mk index 83455cc378..2ef8f83e4c 100644 --- a/include/netfilter.mk +++ b/include/netfilter.mk @@ -353,6 +353,8 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_QUEUE,CONFIG_NFT_QUEUE, $(P_XT)nft_queu $(eval $(if $(NF_KMOD),$(call nf_add,NFT_SOCKET,CONFIG_NFT_SOCKET, $(P_XT)nft_socket),)) +$(eval $(if $(NF_KMOD),$(call nf_add,NFT_TPROXY,CONFIG_NFT_TPROXY, $(P_XT)nft_tproxy),)) + $(eval $(if $(NF_KMOD),$(call nf_add,NFT_COMPAT,CONFIG_NFT_COMPAT, $(P_XT)nft_compat),)) # userland only diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 7200af769f..1707bf2d9f 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -1228,6 +1228,17 @@ endef $(eval $(call KernelPackage,nft-socket)) +define KernelPackage/nft-tproxy + SUBMENU:=$(NF_MENU) + TITLE:=Netfilter nf_tables tproxy support + DEPENDS:=+kmod-nft-core +kmod-nf-tproxy +kmod-nf-conntrack + FILES:=$(foreach mod,$(NFT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko) + AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_TPROXY-m))) + KCONFIG:=$(KCONFIG_NFT_TPROXY) +endef + +$(eval $(call KernelPackage,nft-tproxy)) + define KernelPackage/nft-compat SUBMENU:=$(NF_MENU) TITLE:=Netfilter nf_tables compat support From 0dc3566a3b5a54c57cccdf09d36ff54d85ecac21 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 28 Feb 2022 13:12:00 +0200 Subject: [PATCH 37/66] firmware-utils: bump to git HEAD 002cfaf firmware-utils: fix compilation with macOS Signed-off-by: Stijn Tintel --- tools/firmware-utils/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index af43f1e643..fb51eb15e2 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2022-02-26 -PKG_SOURCE_VERSION:=eea4ee70d3da01a92bd1da4f18563fc43895f64e -PKG_MIRROR_HASH:=655cabd23caf7b51aa019eee8ae385ac9e18b11596dc79e80419d42d220dbd83 +PKG_SOURCE_DATE:=2022-02-28 +PKG_SOURCE_VERSION:=002cfaf0204ef48fdced6f43c99d59394860e2cb +PKG_MIRROR_HASH:=aa2ab50ab24474cd8b8342d8c6d88309a13117e2f1a34b7bfc61b15e0510bce6 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From 9116096c0f1abe3cdb07ad9c9340dd4ca65ce797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 25 Feb 2022 11:15:45 +0100 Subject: [PATCH 38/66] check-toolchain-clean.sh: fix shellcheck warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following complaints and suggestions: In scripts/check-toolchain-clean.sh line 2: eval `grep CONFIG_GCC_VERSION .config` ^-- SC2046 (warning): Quote this to prevent word splitting. ^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`. Signed-off-by: Petr Štetiar --- scripts/check-toolchain-clean.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-toolchain-clean.sh b/scripts/check-toolchain-clean.sh index af24e740b7..34b82dec5d 100755 --- a/scripts/check-toolchain-clean.sh +++ b/scripts/check-toolchain-clean.sh @@ -1,5 +1,5 @@ #!/bin/sh -eval `grep CONFIG_GCC_VERSION .config` +eval "$(grep CONFIG_GCC_VERSION .config)" CONFIG_TOOLCHAIN_BUILD_VER="$CONFIG_GCC_VERSION-$(cat toolchain/build_version)" touch .toolchain_build_ver [ "$CONFIG_TOOLCHAIN_BUILD_VER" = "$(cat .toolchain_build_ver)" ] && exit 0 From 57f7a86c681b70c688f51e26d31e45baf64ac5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 24 Feb 2022 17:37:45 +0100 Subject: [PATCH 39/66] check-toolchain-clean.sh: workaround stray rebuilds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems, that there are currently some unhandled corner cases in which `.toolchain_build_ver` results in empty file and thus forcing rebuilds, even if the toolchain was build correctly just a few moments ago. Until proper fix is found, workaround that by checking for this corner case and simply populate `.toolchain_build_ver` file. While at it, improve the UX and display version mismatch, so it's more clear what has forced the rebuild: "Toolchain build version changed (11.2.0-1 != ), running make targetclean" References: https://gitlab.com/ynezz/openwrt/-/jobs/2133332533/raw Signed-off-by: Petr Štetiar --- scripts/check-toolchain-clean.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/check-toolchain-clean.sh b/scripts/check-toolchain-clean.sh index 34b82dec5d..455cfb0449 100755 --- a/scripts/check-toolchain-clean.sh +++ b/scripts/check-toolchain-clean.sh @@ -2,8 +2,13 @@ eval "$(grep CONFIG_GCC_VERSION .config)" CONFIG_TOOLCHAIN_BUILD_VER="$CONFIG_GCC_VERSION-$(cat toolchain/build_version)" touch .toolchain_build_ver -[ "$CONFIG_TOOLCHAIN_BUILD_VER" = "$(cat .toolchain_build_ver)" ] && exit 0 -echo "Toolchain build version changed, running make targetclean" +CURRENT_TOOLCHAIN_BUILD_VER="$(cat .toolchain_build_ver)" +[ -z "$CURRENT_TOOLCHAIN_BUILD_VER" ] && { + echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver + exit 0 +} +[ "$CONFIG_TOOLCHAIN_BUILD_VER" = "$CURRENT_TOOLCHAIN_BUILD_VER" ] && exit 0 +echo "Toolchain build version changed ($CONFIG_TOOLCHAIN_BUILD_VER != $CURRENT_TOOLCHAIN_BUILD_VER), running make targetclean" make targetclean echo "$CONFIG_TOOLCHAIN_BUILD_VER" > .toolchain_build_ver exit 0 From 1a97c03d864ee5ab917aff2988c62fce223c041e Mon Sep 17 00:00:00 2001 From: "Arvid E. Picciani" Date: Mon, 28 Feb 2022 12:01:14 +0100 Subject: [PATCH 40/66] rampis: feed zbt-we1026 external watchdog Without feeding the gpio watchdog, the board will reset after 90 seconds Signed-off-by: Arvid E. Picciani --- .../linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi | 8 ++++++++ target/linux/ramips/mt7620/config-5.10 | 1 + 2 files changed, 9 insertions(+) diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi index 4991897ca4..f86ac1a88a 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi @@ -26,6 +26,14 @@ gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; }; }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <20000>; + always-running; + }; }; &pcie { diff --git a/target/linux/ramips/mt7620/config-5.10 b/target/linux/ramips/mt7620/config-5.10 index 04a7614604..cae1d20bff 100644 --- a/target/linux/ramips/mt7620/config-5.10 +++ b/target/linux/ramips/mt7620/config-5.10 @@ -67,6 +67,7 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y # CONFIG_GPIO_MT7621 is not set CONFIG_GPIO_RALINK=y +CONFIG_GPIO_WATCHDOG=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y From fc317a190c930c9c338bd07c2e323b6b9eaa1f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 28 Feb 2022 14:59:16 +0100 Subject: [PATCH 41/66] ipq806x: base-files: asrock: fix bootcount include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following warning message during image building process: Finalizing root filesystem... root-ipq806x/lib/upgrade/asrock.sh: line 1: /lib/functions.sh: No such file or directory Enabling boot root-ipq806x/lib/upgrade/asrock.sh: line 1: /lib/functions.sh: No such file or directory Enabling bootcount Fixes #9350 Fixes: 98b86296e67d ("ipq806x: add support for ASRock G10") Signed-off-by: Petr Štetiar --- target/linux/ipq806x/base-files/lib/upgrade/asrock.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh index 9645b64671..b98eab33b2 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh @@ -1,4 +1,4 @@ -. /lib/functions.sh +. "$IPKG_INSTROOT/lib/functions.sh" asrock_bootconfig_mangle() { local mtdnum="$(find_mtd_index 0:bootconfig)" From 58212a6194e4a9620c67053e616c5cb67a0ced50 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 28 Feb 2022 16:11:48 +0200 Subject: [PATCH 42/66] ubus: bump to git HEAD 66baa44 libubus: introduce new status messages b3cd5ab cli: use UBUS_STATUS_PARSE_ERROR 584f56a cli: improve error logging for call command Signed-off-by: Stijn Tintel --- package/system/ubus/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index f24dd6169c..7477615c5d 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2021-08-09 -PKG_SOURCE_VERSION:=a72457b61df045d3c499a6211362b751710590d7 -PKG_MIRROR_HASH:=ac617577bcb2ff3dbc3039ad67200afcce910840223a2de15977d3224e6557fd +PKG_SOURCE_DATE:=2022-02-28 +PKG_SOURCE_VERSION:=584f56a2331471459604ad054b3a7bcc366e0f07 +PKG_MIRROR_HASH:=9bb7025fa5513530e6f407e0514014a8116babe9287d4217d0b8f9315b1f2181 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 From fb2801b82c06878ae2ad20b8f95546c34ed3cdf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 28 Feb 2022 21:28:38 +0100 Subject: [PATCH 43/66] mt7620: fix missing kernel config symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following missing kernel config symbol after adding GPIO watchdog: Software watchdog (SOFT_WATCHDOG) [M/n/y/?] m Watchdog device controlled through GPIO-line (GPIO_WATCHDOG) [Y/n/m/?] y Register the watchdog as early as possible (GPIO_WATCHDOG_ARCH_INITCALL) [N/y/?] (NEW) Fixes: 1a97c03d864e ("rampis: feed zbt-we1026 external watchdog") Signed-off-by: Petr Štetiar --- target/linux/ramips/mt7620/config-5.10 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/mt7620/config-5.10 b/target/linux/ramips/mt7620/config-5.10 index cae1d20bff..aa384b5907 100644 --- a/target/linux/ramips/mt7620/config-5.10 +++ b/target/linux/ramips/mt7620/config-5.10 @@ -68,6 +68,7 @@ CONFIG_GPIOLIB=y # CONFIG_GPIO_MT7621 is not set CONFIG_GPIO_RALINK=y CONFIG_GPIO_WATCHDOG=y +# CONFIG_GPIO_WATCHDOG_ARCH_INITCALL is not set CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y From 50d327196681f9514739355573e49db0ad151d6a Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Sat, 26 Feb 2022 19:22:59 -0500 Subject: [PATCH 44/66] iptables: fix libnftnl/IPTABLES_NFTABLES dependency libxtables doesn't depend on libnftnl, iptables-nft does, so move the dependency to not pull libnftnl with firewall3/iptables-legacy Also libxtables-nft depends on IPTABLES_NFTABLES Signed-off-by: Etienne Champetier --- package/network/utils/iptables/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index e936a57380..12021c21f1 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -112,7 +112,7 @@ endef define Package/iptables-nft $(call Package/iptables/Default) TITLE:=IP firewall administration tool nft - DEPENDS:=@IPTABLES_NFTABLES +libxtables-nft +libip4tc +IPV6:libip6tc +kmod-ipt-core +kmod-nft-compat + DEPENDS:=@IPTABLES_NFTABLES +libnftnl +libxtables-nft +libip4tc +IPV6:libip6tc +kmod-ipt-core +kmod-nft-compat ALTERNATIVES:=\ 300:/usr/sbin/iptables:/usr/sbin/xtables-nft-multi \ 300:/usr/sbin/iptables-restore:/usr/sbin/xtables-nft-multi \ @@ -527,9 +527,7 @@ define Package/libxtables CATEGORY:=Libraries TITLE:=IPv4/IPv6 firewall - shared xtables library ABI_VERSION:=12 - DEPENDS:= \ - +IPTABLES_CONNLABEL:libnetfilter-conntrack \ - +IPTABLES_NFTABLES:libnftnl + DEPENDS:=+IPTABLES_CONNLABEL:libnetfilter-conntrack endef define Package/libxtables-nft @@ -538,7 +536,7 @@ define Package/libxtables-nft CATEGORY:=Libraries TITLE:=IPv4/IPv6 firewall - shared xtables nft library ABI_VERSION:=12 - DEPENDS:=+libxtables + DEPENDS:=@IPTABLES_NFTABLES +libxtables endef TARGET_CPPFLAGS := \ From d35a573004ff21e5a7bbdb896967454c63b7a363 Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Mon, 21 Feb 2022 16:20:34 -0500 Subject: [PATCH 45/66] iptables: make mod depend on libxtables 'iptables-mod-' can be used directly by firewall3, by iptables and by iptables-nft. They are not linked to iptables but to libxtables, so fix the dependencies to allow to remove iptables(-legacy) Signed-off-by: Etienne Champetier --- package/network/utils/iptables/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 12021c21f1..c5310838a3 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -41,7 +41,7 @@ endef define Package/iptables/Module $(call Package/iptables/Default) - DEPENDS:=+iptables $(1) + DEPENDS:=+libxtables $(1) endef define Package/iptables @@ -457,7 +457,6 @@ $(call Package/iptables/Default) DEPENDS:=@IPV6 +kmod-ip6tables +iptables CATEGORY:=Network TITLE:=IPv6 firewall administration tool - MENU:=1 ALTERNATIVES:=\ 200:/usr/sbin/ip6tables:/usr/sbin/xtables-legacy-multi \ 200:/usr/sbin/ip6tables-restore:/usr/sbin/xtables-legacy-multi \ @@ -485,7 +484,7 @@ endef define Package/ip6tables-extra $(call Package/iptables/Default) - DEPENDS:=ip6tables +kmod-ip6tables-extra + DEPENDS:=+libxtables +kmod-ip6tables-extra TITLE:=IPv6 header matching modules endef @@ -495,7 +494,7 @@ endef define Package/ip6tables-mod-nat $(call Package/iptables/Default) - DEPENDS:=ip6tables +kmod-ipt-nat6 + DEPENDS:=+libxtables +kmod-ipt-nat6 TITLE:=IPv6 NAT extensions endef From 316c406e62a535d17d654ab8c4f5e84a0485058f Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Mon, 21 Feb 2022 16:20:36 -0500 Subject: [PATCH 46/66] iptables: move IPTABLES_{CONNLABEL,NFTABLES} to libxtables Those 2 configs are not specific to iptables(-legacy) Signed-off-by: Etienne Champetier --- package/network/utils/iptables/Makefile | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index c5310838a3..78d29089a3 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -47,7 +47,6 @@ endef define Package/iptables $(call Package/iptables/Default) TITLE:=IP firewall administration tool - MENU:=1 DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libxtables ALTERNATIVES:=\ 200:/usr/sbin/iptables:/usr/sbin/xtables-legacy-multi \ @@ -55,20 +54,6 @@ $(call Package/iptables/Default) 200:/usr/sbin/iptables-save:/usr/sbin/xtables-legacy-multi endef -define Package/iptables/config - config IPTABLES_CONNLABEL - bool "Enable Connlabel support" - default n - help - This enable connlabel support in iptables. - - config IPTABLES_NFTABLES - bool "Enable Nftables support" - default y - help - This enable nftables support in iptables. -endef - define Package/iptables/description IP firewall administration tool. @@ -525,10 +510,25 @@ define Package/libxtables SECTION:=libs CATEGORY:=Libraries TITLE:=IPv4/IPv6 firewall - shared xtables library + MENU:=1 ABI_VERSION:=12 DEPENDS:=+IPTABLES_CONNLABEL:libnetfilter-conntrack endef +define Package/libxtables/config + config IPTABLES_CONNLABEL + bool "Enable Connlabel support" + default n + help + This enable connlabel support in iptables. + + config IPTABLES_NFTABLES + bool "Enable Nftables support" + default y + help + This enable nftables support in iptables. +endef + define Package/libxtables-nft $(call Package/iptables/Default) SECTION:=libs From 795e7155cbe3e78669f6821bf7aecb7c4e1e1afb Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Mon, 21 Feb 2022 16:20:42 -0500 Subject: [PATCH 47/66] iptables: rename to ip(6)tables-legacy, add PROVIDES Using PROVIDES allows to have other packages continue to depend on iptables and users to pick between legacy and nft version. Signed-off-by: Etienne Champetier --- package/network/utils/iptables/Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 78d29089a3..2199866b37 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -44,17 +44,18 @@ $(call Package/iptables/Default) DEPENDS:=+libxtables $(1) endef -define Package/iptables +define Package/iptables-legacy $(call Package/iptables/Default) TITLE:=IP firewall administration tool DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libxtables + PROVIDES:=iptables ALTERNATIVES:=\ 200:/usr/sbin/iptables:/usr/sbin/xtables-legacy-multi \ 200:/usr/sbin/iptables-restore:/usr/sbin/xtables-legacy-multi \ 200:/usr/sbin/iptables-save:/usr/sbin/xtables-legacy-multi endef -define Package/iptables/description +define Package/iptables-legacy/description IP firewall administration tool. Matches: @@ -98,6 +99,7 @@ define Package/iptables-nft $(call Package/iptables/Default) TITLE:=IP firewall administration tool nft DEPENDS:=@IPTABLES_NFTABLES +libnftnl +libxtables-nft +libip4tc +IPV6:libip6tc +kmod-ipt-core +kmod-nft-compat + PROVIDES:=iptables ALTERNATIVES:=\ 300:/usr/sbin/iptables:/usr/sbin/xtables-nft-multi \ 300:/usr/sbin/iptables-restore:/usr/sbin/xtables-nft-multi \ @@ -437,11 +439,12 @@ define Package/iptables-mod-checksum/description iptables extension for the CHECKSUM calculation target endef -define Package/ip6tables +define Package/ip6tables-legacy $(call Package/iptables/Default) - DEPENDS:=@IPV6 +kmod-ip6tables +iptables + DEPENDS:=@IPV6 +kmod-ip6tables +iptables-legacy CATEGORY:=Network TITLE:=IPv6 firewall administration tool + PROVIDES:=ip6tables ALTERNATIVES:=\ 200:/usr/sbin/ip6tables:/usr/sbin/xtables-legacy-multi \ 200:/usr/sbin/ip6tables-restore:/usr/sbin/xtables-legacy-multi \ @@ -452,6 +455,7 @@ define Package/ip6tables-nft $(call Package/iptables/Default) DEPENDS:=@IPV6 +kmod-ip6tables +iptables-nft TITLE:=IP firewall administration tool nft + PROVIDES:=ip6tables ALTERNATIVES:=\ 300:/usr/sbin/ip6tables:/usr/sbin/xtables-nft-multi \ 300:/usr/sbin/ip6tables-restore:/usr/sbin/xtables-nft-multi \ @@ -608,7 +612,7 @@ define Build/InstallDev $(CP) $(PKG_BUILD_DIR)/extensions/libiptext*.so $(1)/usr/lib/ endef -define Package/iptables/install +define Package/iptables-legacy/install $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_INSTALL_DIR)/usr/sbin/xtables-legacy-multi $(1)/usr/sbin/ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables-legacy{,-restore,-save} $(1)/usr/sbin/ @@ -622,7 +626,7 @@ define Package/iptables-nft/install $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables{,-restore}-translate $(1)/usr/sbin/ endef -define Package/ip6tables/install +define Package/ip6tables-legacy/install $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables-legacy{,-restore,-save} $(1)/usr/sbin/ endef @@ -674,7 +678,7 @@ $(eval $(call BuildPackage,libxtables)) $(eval $(call BuildPackage,libxtables-nft)) $(eval $(call BuildPackage,libip4tc)) $(eval $(call BuildPackage,libip6tc)) -$(eval $(call BuildPackage,iptables)) +$(eval $(call BuildPackage,iptables-legacy)) $(eval $(call BuildPackage,iptables-nft)) $(eval $(call BuildPlugin,iptables-mod-conntrack-extra,$(IPT_CONNTRACK_EXTRA-m))) $(eval $(call BuildPlugin,iptables-mod-conntrack-label,$(IPT_CONNTRACK_LABEL-m))) @@ -698,7 +702,7 @@ $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m))) $(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m))) $(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m))) $(eval $(call BuildPlugin,iptables-mod-checksum,$(IPT_CHECKSUM-m))) -$(eval $(call BuildPackage,ip6tables)) +$(eval $(call BuildPackage,ip6tables-legacy)) $(eval $(call BuildPackage,ip6tables-nft)) $(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m))) $(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m))) From 39d50a2008b7f29a46b7a9511525613816cc15e1 Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Sat, 26 Feb 2022 20:14:29 -0500 Subject: [PATCH 48/66] iptables: move libiptext* to their own packages iptables-nft doesn't depend on libip{4,6}tc, so move libiptext* libs in their own packages to clean up dependencies Rename libxtables-nft to libiptext-nft Signed-off-by: Etienne Champetier --- package/network/config/firewall/Makefile | 2 +- package/network/utils/iptables/Makefile | 68 ++++++++++++++++-------- 2 files changed, 48 insertions(+), 22 deletions(-) diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index f0123aa7fb..e05d9dd426 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -28,7 +28,7 @@ define Package/firewall SECTION:=net CATEGORY:=Base system TITLE:=OpenWrt C Firewall - DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +kmod-ipt-nat + DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libiptext +IPV6:libiptext6 +libxtables +kmod-ipt-core +kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +kmod-ipt-nat PROVIDES:=uci-firewall CONFLICTS:=firewall4 endef diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 2199866b37..5b2f4e1f8a 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -47,7 +47,7 @@ endef define Package/iptables-legacy $(call Package/iptables/Default) TITLE:=IP firewall administration tool - DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libxtables + DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libiptext +IPV6:libiptext6 +libxtables PROVIDES:=iptables ALTERNATIVES:=\ 200:/usr/sbin/iptables:/usr/sbin/xtables-legacy-multi \ @@ -98,7 +98,7 @@ endef define Package/iptables-nft $(call Package/iptables/Default) TITLE:=IP firewall administration tool nft - DEPENDS:=@IPTABLES_NFTABLES +libnftnl +libxtables-nft +libip4tc +IPV6:libip6tc +kmod-ipt-core +kmod-nft-compat + DEPENDS:=@IPTABLES_NFTABLES +libnftnl +libiptext +IPV6:libiptext6 +libiptext-nft +kmod-ipt-core +kmod-nft-compat PROVIDES:=iptables ALTERNATIVES:=\ 300:/usr/sbin/iptables:/usr/sbin/xtables-nft-multi \ @@ -497,7 +497,6 @@ $(call Package/iptables/Default) CATEGORY:=Libraries TITLE:=IPv4 firewall - shared libiptc library ABI_VERSION:=2 - DEPENDS:=+libxtables endef define Package/libip6tc @@ -506,7 +505,33 @@ $(call Package/iptables/Default) CATEGORY:=Libraries TITLE:=IPv6 firewall - shared libiptc library ABI_VERSION:=2 - DEPENDS:=+libxtables +endef + +define Package/libiptext + $(call Package/iptables/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=IPv4 firewall - shared libiptext library + ABI_VERSION:=0 + DEPENDS:=+libxtables +endef + +define Package/libiptext6 + $(call Package/iptables/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=IPv6 firewall - shared libiptext library + ABI_VERSION:=0 + DEPENDS:=+libxtables +endef + +define Package/libiptext-nft + $(call Package/iptables/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=IPv4/IPv6 firewall - shared libiptext nft library + ABI_VERSION:=0 + DEPENDS:=@IPTABLES_NFTABLES +libxtables endef define Package/libxtables @@ -533,15 +558,6 @@ define Package/libxtables/config This enable nftables support in iptables. endef -define Package/libxtables-nft - $(call Package/iptables/Default) - SECTION:=libs - CATEGORY:=Libraries - TITLE:=IPv4/IPv6 firewall - shared xtables nft library - ABI_VERSION:=12 - DEPENDS:=@IPTABLES_NFTABLES +libxtables -endef - TARGET_CPPFLAGS := \ -I$(PKG_BUILD_DIR)/include \ -I$(LINUX_DIR)/user_headers/include \ @@ -640,24 +656,32 @@ endef define Package/libip4tc/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libip4tc.so.* $(1)/usr/lib/ - $(CP) $(PKG_BUILD_DIR)/extensions/libiptext4.so $(1)/usr/lib/ endef define Package/libip6tc/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libip6tc.so.* $(1)/usr/lib/ +endef + +define Package/libiptext/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/extensions/libiptext.so $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/extensions/libiptext4.so $(1)/usr/lib/ +endef + +define Package/libiptext6/install + $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_BUILD_DIR)/extensions/libiptext6.so $(1)/usr/lib/ endef +define Package/libiptext-nft/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/extensions/libiptext_*.so $(1)/usr/lib/ +endef + define Package/libxtables/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxtables.so.* $(1)/usr/lib/ - $(CP) $(PKG_BUILD_DIR)/extensions/libiptext.so $(1)/usr/lib/ -endef - -define Package/libxtables-nft/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/extensions/libiptext_*.so $(1)/usr/lib/ endef define BuildPlugin @@ -675,9 +699,11 @@ define BuildPlugin endef $(eval $(call BuildPackage,libxtables)) -$(eval $(call BuildPackage,libxtables-nft)) $(eval $(call BuildPackage,libip4tc)) $(eval $(call BuildPackage,libip6tc)) +$(eval $(call BuildPackage,libiptext)) +$(eval $(call BuildPackage,libiptext6)) +$(eval $(call BuildPackage,libiptext-nft)) $(eval $(call BuildPackage,iptables-legacy)) $(eval $(call BuildPackage,iptables-nft)) $(eval $(call BuildPlugin,iptables-mod-conntrack-extra,$(IPT_CONNTRACK_EXTRA-m))) From d95b74f7c9f8ce58e583991f598a9b39bb43ee2f Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Sat, 26 Feb 2022 22:48:47 -0500 Subject: [PATCH 49/66] iptables: bump PKG_RELEASE Following dependencies rework, bump PKG_RELEASE Signed-off-by: Etienne Champetier --- package/network/utils/iptables/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 5b2f4e1f8a..69bbb0237d 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=iptables PKG_VERSION:=1.8.7 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 From 4a956a06f23f56162f90eec79a3cbc6caa732681 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sun, 27 Feb 2022 14:54:33 -0500 Subject: [PATCH 50/66] kernel: move CONFIG_ASN1 to generic config Rather than populating this symbol in the individual configs, move it to the generic config. Signed-off-by: John Audia --- target/linux/generic/config-5.10 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index c6a34eea13..bf96908178 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -414,6 +414,7 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_AS3935 is not set # CONFIG_AS73211 is not set # CONFIG_ASM9260_TIMER is not set +# CONFIG_ASN1 is not set # CONFIG_ASUS_LAPTOP is not set # CONFIG_ASUS_WIRELESS is not set # CONFIG_ASYMMETRIC_KEY_TYPE is not set From a68dd8057ce27cb8fe20443fbacfc9b066248133 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 26 Feb 2022 12:05:19 -0500 Subject: [PATCH 51/66] bcm27xx: bcm2711: update defconfig Ran `make kernel_menuconfig CONFIG_TARGET=bcm2711` having used the snapshot config for bcm2711[1]. Manually added back two symbols that the make target removed, namely: * # CONFIG_SND_SOC_AD193X_I2C is not set * # CONFIG_SND_SOC_AD193X_SPI is not set Without adding these back, the build fails due to unsatisfied deps[2]. Build system: x86_64 Build-tested: bcm2711/multidevices 1. https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/config.buildinfo 2. https://github.com/openwrt/openwrt/commit/a478202d74b66c3da17d57442649eb4f131fc7b2#commitcomment-67096592 Signed-off-by: John Audia --- target/linux/bcm27xx/bcm2711/config-5.10 | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/bcm27xx/bcm2711/config-5.10 b/target/linux/bcm27xx/bcm2711/config-5.10 index ed095231ae..03d84378b3 100644 --- a/target/linux/bcm27xx/bcm2711/config-5.10 +++ b/target/linux/bcm27xx/bcm2711/config-5.10 @@ -37,8 +37,6 @@ CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y CONFIG_ARM64_VHE=y CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y -CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y -CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y CONFIG_ARM_AMBA=y CONFIG_ARM_ARCH_TIMER=y CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y From d4c20ff948fc9c64b03af648f911f222fcb593a2 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 26 Feb 2022 13:09:24 -0500 Subject: [PATCH 52/66] bcm27xx: bcm2710: update defconfig Ran `make kernel_menuconfig CONFIG_TARGET=bcm2710` having used the snapshot config for bcm2710[1]. Manually added back two symbols that the make target removed, namely: * # CONFIG_SND_SOC_AD193X_I2C is not set * # CONFIG_SND_SOC_AD193X_SPI is not set 1. https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710/config.buildinfo Signed-off-by: John Audia --- target/linux/bcm27xx/bcm2710/config-5.10 | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/bcm27xx/bcm2710/config-5.10 b/target/linux/bcm27xx/bcm2710/config-5.10 index 39c00762ba..6e26891070 100644 --- a/target/linux/bcm27xx/bcm2710/config-5.10 +++ b/target/linux/bcm27xx/bcm2710/config-5.10 @@ -37,8 +37,6 @@ CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y CONFIG_ARM64_VHE=y CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y -CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y -CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y CONFIG_ARM_AMBA=y CONFIG_ARM_ARCH_TIMER=y CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y From aee3594ffcb72ae3e18c3719012d52519ee2d160 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 28 Feb 2022 10:14:25 +0100 Subject: [PATCH 53/66] verbose.mk: print ERROR messages in non-verbose Using `make -j9` only prints a subset of messages to follow the build process progressing. However this silently skips over errors which might be of interested. Using `make V=s` easily floods the terminal making it hard to find error messages between the lines. A compromise is the usage of `$(call ERROR_MESSAGE,...)` which prints a message in red. This function is silenced in the non-verbose mode, even if only used at a single place in `package/Makefile` where it notifies about a OPKG corner case. This commit moves the `ERROR_MESSAGE` definition outside of the `OPENWRT_VERBOSE` condition and print error messages in every mode. With this in place further error messages are possible. Signed-off-by: Paul Spooren --- include/verbose.mk | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/verbose.mk b/include/verbose.mk index 3ecf842d11..4487a207e8 100644 --- a/include/verbose.mk +++ b/include/verbose.mk @@ -29,15 +29,15 @@ ifeq ($(IS_TTY),1) endif endif +define ERROR_MESSAGE + printf "$(_R)%s$(_N)\n" "$(1)" >&8 +endef + ifeq ($(findstring s,$(OPENWRT_VERBOSE)),) define MESSAGE printf "$(_Y)%s$(_N)\n" "$(1)" >&8 endef - define ERROR_MESSAGE - printf "$(_R)%s$(_N)\n" "$(1)" >&8 - endef - ifeq ($(QUIET),1) ifneq ($(CURDIR),$(TOPDIR)) _DIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR}) @@ -60,5 +60,4 @@ else define MESSAGE printf "%s\n" "$(1)" endef - ERROR_MESSAGE=$(MESSAGE) endif From a9478490d86e16f130f12fe5394ee484dcf13822 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 28 Feb 2022 10:20:53 +0100 Subject: [PATCH 54/66] image-commands.mk: Use ERROR_MESSAGE for imagesize fails If a image is bigger than the device can handle, an error message is printed. This is usually silenced and silently ignored, making it harder to debug. While it's possible to run the build in verbose mode (via `make V=s`) and grep for *is too big*, it's more intuitive to print the error message directly. For that use the newly unlocked `$(call ERROR_MESSAGE,...)` definition which now also print in non-verbose mode. Fixes: FS#50 (aka #7604) Signed-off-by: Paul Spooren --- include/image-commands.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 485d870f05..939f5ef2db 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -191,7 +191,7 @@ define Build/check-size @imagesize="$$(stat -c%s $@)"; \ limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \ [ $$limitsize -ge $$imagesize ] || { \ - echo "WARNING: Image file $@ is too big: $$imagesize > $$limitsize" >&2; \ + $(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \ rm -f $@; \ } endef From d6aa9d9e071d9f23ed26f5142991bc66aefe20f5 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Mon, 21 Feb 2022 18:55:15 +0100 Subject: [PATCH 55/66] u-boot.mk: add LOCALVERSION (explicitly specify OpenWrt build) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For debugging purposes, we need to know if users are using modified U-boot versions or not. Currently, the U-boot version is somehow stripped. This is a little bit problematic when there are backported/wip/to-upstream patches. To make it more confusing, there was (before this commit) two U-boot versioning. U-boot compiled by OpenWrt build bots are missing ``Build:`` This is also the case when the U-boot is compiled locally. Example: ``` U-Boot SPL 2022.01 (Jan 27 2022 - 00:24:34 +0000) U-Boot 2022.01 (Jan 27 2022 - 00:24:34 +0000) ``` On the other hand, if you run full build, you can at least see, where it was compiled. Notice added ``Build:``. Example: ``` U-Boot 2022.01 (Jan 27 2022 - 00:24:34 +0000), Build: jenkins-turris-os-packages-burstlab-omnia-216 ``` In both cases, it is not clear to U-boot developers if it is an unmodified build. This is also caused that there is a missing ``.git`` file from U-boot folder, and so there is no history. It leads to that it can not contain suffix ``-dirty`` (uncommitted modifications) or even something else like number of commits, etc. [1] When U-boot is compiled as it should be, the version should look like this: ``U-Boot 2022.04-rc1-01173-g278195ea1f (Feb 11 2022 - 14:46:50 +0100)`` The date is not changed daily when there are new OpenWrt builds. This commit adds OpenWrt specific version, which could be verified by using strings. ``` $ strings bin/targets/mvebu/cortexa9/u-boot-omnia/u-boot-spl.kwb | grep -E "OpenWrt*" U-Boot SPL 2022.01-OpenWrt-r18942+54-cbfce92367 (Feb 21 2022 - 13:17:34 +0000) arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 11.2.0 r18942+54-cbfce92367) 11.2.0 2022.01-OpenWrt-r18942+54-cbfce92367 U-Boot 2022.01-OpenWrt-r18942+54-cbfce92367 (Feb 21 2022 - 13:17:34 +0000) ``` [1] https://u-boot.readthedocs.io/en/latest/develop/version.html Reported-by: Pali Rohár Suggested-by: Karel Kočí Signed-off-by: Josef Schlehofer --- include/u-boot.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/include/u-boot.mk b/include/u-boot.mk index 509b3d76dc..8945e8e2b8 100644 --- a/include/u-boot.mk +++ b/include/u-boot.mk @@ -45,6 +45,7 @@ UBOOT_MAKE_FLAGS = \ HOSTCC="$(HOSTCC)" \ HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \ HOSTLDFLAGS="$(HOST_LDFLAGS)" \ + LOCALVERSION="-OpenWrt-$(REVISION)" \ STAGING_PREFIX="$(STAGING_DIR_HOST)" \ PKG_CONFIG_PATH="$(STAGING_DIR_HOST)/lib/pkgconfig" \ PKG_CONFIG_LIBDIR="$(STAGING_DIR_HOST)/lib/pkgconfig" \ From 038d5bdab117e4c618442dfc96858263dd1ee72e Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 17 Feb 2022 18:14:37 +0100 Subject: [PATCH 56/66] layerscape: use semantic versions for LSDK PKG_VERSION should not contain the package name but the version only. Signed-off-by: Paul Spooren --- package/boot/tfa-layerscape/Makefile | 2 +- package/boot/uboot-layerscape/Makefile | 2 +- package/firmware/layerscape/fman-ucode/Makefile | 2 +- package/firmware/layerscape/ls-ddr-phy/Makefile | 2 +- package/firmware/layerscape/ls-dpl/Makefile | 2 +- package/firmware/layerscape/ls-mc/Makefile | 2 +- package/firmware/layerscape/ls-rcw/Makefile | 2 +- package/firmware/layerscape/ppfe-firmware/Makefile | 2 +- package/network/utils/layerscape/restool/Makefile | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package/boot/tfa-layerscape/Makefile b/package/boot/tfa-layerscape/Makefile index 84ababf5e0..5337d7df83 100644 --- a/package/boot/tfa-layerscape/Makefile +++ b/package/boot/tfa-layerscape/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tfa-layerscape -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index 6681f21e2b..bd30a15ade 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-layerscape -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git diff --git a/package/firmware/layerscape/fman-ucode/Makefile b/package/firmware/layerscape/fman-ucode/Makefile index f2dda04e81..3f89080e6f 100644 --- a/package/firmware/layerscape/fman-ucode/Makefile +++ b/package/firmware/layerscape/fman-ucode/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fman-ucode -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git diff --git a/package/firmware/layerscape/ls-ddr-phy/Makefile b/package/firmware/layerscape/ls-ddr-phy/Makefile index 3ae0344e78..30609dc9c7 100644 --- a/package/firmware/layerscape/ls-ddr-phy/Makefile +++ b/package/firmware/layerscape/ls-ddr-phy/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-ddr-phy -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git diff --git a/package/firmware/layerscape/ls-dpl/Makefile b/package/firmware/layerscape/ls-dpl/Makefile index 8c6a88aab2..03ac7e8ff1 100644 --- a/package/firmware/layerscape/ls-dpl/Makefile +++ b/package/firmware/layerscape/ls-dpl/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-dpl -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git diff --git a/package/firmware/layerscape/ls-mc/Makefile b/package/firmware/layerscape/ls-mc/Makefile index 9dbc81809d..c0fd029766 100644 --- a/package/firmware/layerscape/ls-mc/Makefile +++ b/package/firmware/layerscape/ls-mc/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-mc -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git diff --git a/package/firmware/layerscape/ls-rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile index b9a6059d0d..b8a051097f 100644 --- a/package/firmware/layerscape/ls-rcw/Makefile +++ b/package/firmware/layerscape/ls-rcw/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-rcw -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git diff --git a/package/firmware/layerscape/ppfe-firmware/Makefile b/package/firmware/layerscape/ppfe-firmware/Makefile index 4e6b69596c..9fcc25fde9 100644 --- a/package/firmware/layerscape/ppfe-firmware/Makefile +++ b/package/firmware/layerscape/ppfe-firmware/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ppfe -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git diff --git a/package/network/utils/layerscape/restool/Makefile b/package/network/utils/layerscape/restool/Makefile index bb2eac48cd..f108799836 100644 --- a/package/network/utils/layerscape/restool/Makefile +++ b/package/network/utils/layerscape/restool/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=restool -PKG_VERSION:=LSDK-21.08 +PKG_VERSION:=21.08 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git From c8b7065f61b75cab17b3b39c5091aa8de14f0aa8 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Feb 2022 20:27:34 -0800 Subject: [PATCH 57/66] tools/mklibs: update to 0.1.45 Refresh 2to3 patch. Upstream partially did this against some older python version. This is still needed. Refreshed other patches to be python3 safe. Remove uClibc patches as only musl is present now. Refresh others. Signed-off-by: Rosen Penev --- tools/mklibs/Makefile | 4 +- .../patches/002-disable_symbol_checks.patch | 4 +- tools/mklibs/patches/003-no_copy.patch | 6 +- tools/mklibs/patches/005-duplicate_syms.patch | 2 +- tools/mklibs/patches/006-uclibc_init.patch | 14 -- tools/mklibs/patches/007-gc_sections.patch | 2 +- .../patches/008-uclibc_libgcc_link.patch | 2 +- .../009-uclibc_libpthread_symbols.patch | 63 ----- .../mklibs/patches/011-remove_multiarch.patch | 2 +- tools/mklibs/patches/100-apply-2to3.patch | 225 ++---------------- 10 files changed, 37 insertions(+), 287 deletions(-) delete mode 100644 tools/mklibs/patches/006-uclibc_init.patch delete mode 100644 tools/mklibs/patches/009-uclibc_libpthread_symbols.patch diff --git a/tools/mklibs/Makefile b/tools/mklibs/Makefile index 7c9ffffbad..efa912bf6d 100644 --- a/tools/mklibs/Makefile +++ b/tools/mklibs/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mklibs -PKG_VERSION:=0.1.44 +PKG_VERSION:=0.1.45 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@DEBIAN/pool/main/m/mklibs/ -PKG_HASH:=3af0b6bd35e5b6fc58d8b68827fbae2ff6b7e20dd2b238ccb9b49d84722066c2 +PKG_HASH:=dd92a904b3942566f713fe536cd77dd1a5cfc62243c0e0bc6bb5d866e37422f3 HOST_FIXUP:=autoreconf diff --git a/tools/mklibs/patches/002-disable_symbol_checks.patch b/tools/mklibs/patches/002-disable_symbol_checks.patch index e18dfa8e55..96ca7a5f83 100644 --- a/tools/mklibs/patches/002-disable_symbol_checks.patch +++ b/tools/mklibs/patches/002-disable_symbol_checks.patch @@ -5,7 +5,7 @@ for name in unresolved: if not needed_symbols[name].weak: - raise Exception("Unresolvable symbol %s" % name) -+ print "WARNING: Unresolvable symbol %s" % name ++ print("WARNING: Unresolvable symbol %s" % name) break previous_pass_unresolved = unresolved @@ -14,7 +14,7 @@ if not name in symbol_provider: if not needed_symbols[name].weak: - raise Exception("No library provides non-weak %s" % name) -+ print "WARNING: Unresolvable symbol %s" % name ++ print("WARNING: Unresolvable symbol %s" % name) else: lib = symbol_provider[name] library_symbols_used[lib].add(library_symbols[lib][name]) diff --git a/tools/mklibs/patches/003-no_copy.patch b/tools/mklibs/patches/003-no_copy.patch index 75beccf82e..bc1ae8d73d 100644 --- a/tools/mklibs/patches/003-no_copy.patch +++ b/tools/mklibs/patches/003-no_copy.patch @@ -32,11 +32,11 @@ - dest_path + "/" + so_file_name + "-so", - dest_path + "/" + so_file_name + "-so-stripped") ## DEBUG - debug(DEBUG_VERBOSE, so_file, "\t", `os.stat(so_file)[ST_SIZE]`) + debug(DEBUG_VERBOSE, so_file, "\t", str(os.stat(so_file)[ST_SIZE])) debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so", "\t", - `os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE]`) + str(os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE])) - debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so-stripped", -- "\t", `os.stat(dest_path + "/" + so_file_name + "-so-stripped")[ST_SIZE]`) +- "\t", str(os.stat(dest_path + "/" + so_file_name + "-so-stripped")[ST_SIZE])) # Finalising libs and cleaning up -for lib in regexpfilter(os.listdir(dest_path), "(.*)-so-stripped$"): diff --git a/tools/mklibs/patches/005-duplicate_syms.patch b/tools/mklibs/patches/005-duplicate_syms.patch index b0fdab7b10..2627203fab 100644 --- a/tools/mklibs/patches/005-duplicate_syms.patch +++ b/tools/mklibs/patches/005-duplicate_syms.patch @@ -23,7 +23,7 @@ for name in needed_symbols: - if not name in symbol_provider: - if not needed_symbols[name].weak: -- print "WARNING: Unresolvable symbol %s" % name +- print("WARNING: Unresolvable symbol %s" % name) - else: - lib = symbol_provider[name] - library_symbols_used[lib].add(library_symbols[lib][name]) diff --git a/tools/mklibs/patches/006-uclibc_init.patch b/tools/mklibs/patches/006-uclibc_init.patch deleted file mode 100644 index da83340fe4..0000000000 --- a/tools/mklibs/patches/006-uclibc_init.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/src/mklibs -+++ b/src/mklibs -@@ -604,6 +604,11 @@ while 1: - extra_post_obj.append(sysroot + libc_extras_dir + "/sofini.o") - symbols.add(ProvidedSymbol('__dso_handle', None, None, True)) - -+ if soname in ("libc.so.0"): -+ symbols.add(ProvidedSymbol('__uClibc_init', None, None, True)) -+ symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True)) -+ extra_flags.append("-Wl,-init,__uClibc_init") -+ - map_file = find_pic_map(library) - if map_file: - extra_flags.append("-Wl,--version-script=" + map_file) diff --git a/tools/mklibs/patches/007-gc_sections.patch b/tools/mklibs/patches/007-gc_sections.patch index 2fdf4034da..3d098ae426 100644 --- a/tools/mklibs/patches/007-gc_sections.patch +++ b/tools/mklibs/patches/007-gc_sections.patch @@ -1,6 +1,6 @@ --- a/src/mklibs +++ b/src/mklibs -@@ -616,7 +616,7 @@ while 1: +@@ -611,7 +611,7 @@ while 1: # compile in only used symbols cmd = [] cmd.extend(gcc_options) diff --git a/tools/mklibs/patches/008-uclibc_libgcc_link.patch b/tools/mklibs/patches/008-uclibc_libgcc_link.patch index 34cd9d3ab3..a221278d2a 100644 --- a/tools/mklibs/patches/008-uclibc_libgcc_link.patch +++ b/tools/mklibs/patches/008-uclibc_libgcc_link.patch @@ -22,7 +22,7 @@ symbols.update(library_symbols_used[library]) -@@ -623,9 +621,10 @@ while 1: +@@ -618,9 +616,10 @@ while 1: cmd.append(pic_file) cmd.extend(extra_post_obj) cmd.extend(extra_flags) diff --git a/tools/mklibs/patches/009-uclibc_libpthread_symbols.patch b/tools/mklibs/patches/009-uclibc_libpthread_symbols.patch deleted file mode 100644 index 0d4d3e95aa..0000000000 --- a/tools/mklibs/patches/009-uclibc_libpthread_symbols.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/src/mklibs -+++ b/src/mklibs -@@ -173,9 +173,10 @@ def undefined_symbols(obj): - return result - - class ProvidedSymbol(Symbol): -- def __init__(self, name, version, library, default_version): -+ def __init__(self, name, version, library, default_version, weak): - super(ProvidedSymbol, self).__init__(name, version, library) - self.default_version = default_version -+ self.weak = weak - - def base_names(self): - ret = [] -@@ -216,11 +217,15 @@ def provided_symbols(obj): - if version_string.lower() not in ('base', 'none'): - version = version_string - -+ weak = False -+ if weak_string.lower() == 'true': -+ weak = True -+ - default_version = False - if default_version_string.lower() == 'true': - default_version = True - -- result.append(ProvidedSymbol(name, version, library, default_version)) -+ result.append(ProvidedSymbol(name, version, library, default_version, weak)) - - return result - -@@ -509,6 +514,9 @@ while 1: - debug(DEBUG_SPAM, "present_symbols adding %s" % symbol) - names = symbol.base_names() - for name in names: -+ if name in present_symbols: -+ if symbol.library != present_symbols[name].library: -+ needed_symbols[name] = UndefinedSymbol(name, True, symbol.version, symbol.library) - present_symbols[name] = symbol - - # are we finished? -@@ -600,12 +608,16 @@ while 1: - # may segfault in ptmalloc_init due to undefined weak reference - extra_pre_obj.append(sysroot + libc_extras_dir + "/soinit.o") - extra_post_obj.append(sysroot + libc_extras_dir + "/sofini.o") -- symbols.add(ProvidedSymbol('__dso_handle', None, None, True)) -+ symbols.add(ProvidedSymbol('__dso_handle', None, None, True, True)) - -- if soname in ("libc.so.0"): -- symbols.add(ProvidedSymbol('__uClibc_init', None, None, True)) -- symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True)) -- extra_flags.append("-Wl,-init,__uClibc_init") -+ if soname == "libc.so.0": -+ symbols.add(ProvidedSymbol('__uClibc_init', None, None, True, True)) -+ symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True, True)) -+ extra_pre_obj.append("-Wl,-init,__uClibc_init") -+ -+ if soname == "libpthread.so.0": -+ symbols.add(ProvidedSymbol('__pthread_initialize_minimal_internal', None, None, True, True)) -+ extra_flags.append("-Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal") - - map_file = find_pic_map(library) - if map_file: diff --git a/tools/mklibs/patches/011-remove_multiarch.patch b/tools/mklibs/patches/011-remove_multiarch.patch index 23e45cc12c..8c0bfdf1a0 100644 --- a/tools/mklibs/patches/011-remove_multiarch.patch +++ b/tools/mklibs/patches/011-remove_multiarch.patch @@ -1,6 +1,6 @@ --- a/src/mklibs +++ b/src/mklibs -@@ -274,6 +274,7 @@ def extract_soname(so_file): +@@ -269,6 +269,7 @@ def extract_soname(so_file): return "" def multiarch(paths): diff --git a/tools/mklibs/patches/100-apply-2to3.patch b/tools/mklibs/patches/100-apply-2to3.patch index 9f2ae6c438..dcacbab205 100644 --- a/tools/mklibs/patches/100-apply-2to3.patch +++ b/tools/mklibs/patches/100-apply-2to3.patch @@ -1,10 +1,10 @@ --- a/src/mklibs +++ b/src/mklibs -@@ -57,18 +57,18 @@ debuglevel = DEBUG_NORMAL +@@ -57,17 +57,17 @@ debuglevel = DEBUG_NORMAL def debug(level, *msg): if debuglevel >= level: -- print string.join(msg) +- print(string.join(msg)) + print(' '.join(msg)) # return a list of lines of output of the command @@ -15,82 +15,22 @@ output = pipe.read().strip() status = pipe.close() if status is not None and os.WEXITSTATUS(status) != 0: -- print "Command failed with status", os.WEXITSTATUS(status), ":", \ -- command, string.join(args) -- print "With output:", output -+ print("Command failed with status", os.WEXITSTATUS(status), ":", \ + print("Command failed with status", os.WEXITSTATUS(status), ":", \ +- command, string.join(args)) + command, ' '.join(args)) -+ print("With output:", output) + print("With output:", output) sys.exit(1) return [i for i in output.split('\n') if i] - -@@ -204,7 +204,7 @@ class ProvidedSymbol(Symbol): - # Return a set of symbols provided by a library - def provided_symbols(obj): - if not os.access(obj, os.F_OK): -- raise Exception("Cannot find lib" + obj) -+ raise Exception("Cannot find lib " + obj) - library = extract_soname(obj) - - output = command("mklibs-readelf", "--print-symbols-provided", obj) -@@ -297,27 +297,27 @@ def usage(was_err): - outfd = sys.stderr - else: - outfd = sys.stdout -- print >> outfd, "Usage: mklibs [OPTION]... -d DEST FILE ..." -- print >> outfd, "Make a set of minimal libraries for FILE(s) in DEST." -- print >> outfd, "" -- print >> outfd, " -d, --dest-dir DIRECTORY create libraries in DIRECTORY" -- print >> outfd, " -D, --no-default-lib omit default libpath (", ':'.join(default_lib_path), ")" -- print >> outfd, " -L DIRECTORY[:DIRECTORY]... add DIRECTORY(s) to the library search path" -- print >> outfd, " -l LIBRARY add LIBRARY always" -- print >> outfd, " --ldlib LDLIB use LDLIB for the dynamic linker" -- print >> outfd, " --libc-extras-dir DIRECTORY look for libc extra files in DIRECTORY" -- print >> outfd, " --target TARGET prepend TARGET- to the gcc and binutils calls" -- print >> outfd, " --root ROOT search in ROOT for library rpaths" -- print >> outfd, " --sysroot ROOT prepend ROOT to all paths for libraries" -- print >> outfd, " --gcc-options OPTIONS pass OPTIONS to gcc" -- print >> outfd, " --libdir DIR use DIR (e.g. lib64) in place of lib in default paths" -- print >> outfd, " -v, --verbose explain what is being done" -- print >> outfd, " -h, --help display this help and exit" -+ print("Usage: mklibs [OPTION]... -d DEST FILE ...", file=outfd) -+ print("Make a set of minimal libraries for FILE(s) in DEST.", file=outfd) -+ print("", file=outfd) -+ print(" -d, --dest-dir DIRECTORY create libraries in DIRECTORY", file=outfd) +@@ -296,7 +296,7 @@ def usage(was_err): + print("Make a set of minimal libraries for FILE(s, file=outfd) in DEST.", file=outfd) + print("" , file=outfd) + print(" -d, --dest-dir DIRECTORY create libraries in DIRECTORY", file=outfd) +- print(" -D, --no-default-lib omit default libpath (", ':'.join(default_lib_path, file=outfd), ", file=outfd)", file=outfd) + print(" -D, --no-default-lib omit default libpath (", ':'.join(default_lib_path), ")", file=outfd) -+ print(" -L DIRECTORY[:DIRECTORY]... add DIRECTORY(s) to the library search path", file=outfd) -+ print(" -l LIBRARY add LIBRARY always", file=outfd) -+ print(" --ldlib LDLIB use LDLIB for the dynamic linker", file=outfd) -+ print(" --libc-extras-dir DIRECTORY look for libc extra files in DIRECTORY", file=outfd) -+ print(" --target TARGET prepend TARGET- to the gcc and binutils calls", file=outfd) -+ print(" --root ROOT search in ROOT for library rpaths", file=outfd) -+ print(" --sysroot ROOT prepend ROOT to all paths for libraries", file=outfd) -+ print(" --gcc-options OPTIONS pass OPTIONS to gcc", file=outfd) -+ print(" --libdir DIR use DIR (e.g. lib64) in place of lib in default paths", file=outfd) -+ print(" -v, --verbose explain what is being done", file=outfd) -+ print(" -h, --help display this help and exit", file=outfd) - sys.exit(was_err) - - def version(vers): -- print "mklibs: version ",vers -- print "" -+ print("mklibs: version ",vers) -+ print("") - - #################### main #################### - ## Usage: ./mklibs.py [OPTION]... -d DEST FILE ... -@@ -368,8 +368,8 @@ script_pattern = re.compile("^#!\s*/") - - try: - optlist, proglist = getopt.getopt(sys.argv[1:], opts, longopts) --except getopt.GetoptError, msg: -- print >> sys.stderr, msg -+except getopt.GetoptError as msg: -+ print(msg, file=sys.stderr) - usage(1) - - for opt, arg in optlist: -@@ -377,7 +377,7 @@ for opt, arg in optlist: + print(" -L DIRECTORY[:DIRECTORY]... add DIRECTORY(s, file=outfd) to the library search path", file=outfd) + print(" -l LIBRARY add LIBRARY always", file=outfd) + print(" --ldlib LDLIB use LDLIB for the dynamic linker", file=outfd) +@@ -372,7 +372,7 @@ for opt, arg in optlist: if debuglevel < DEBUG_SPAM: debuglevel = debuglevel + 1 elif opt == "-L": @@ -99,7 +39,7 @@ elif opt in ("-d", "--dest-dir"): dest_path = arg elif opt in ("-D", "--no-default-lib"): -@@ -396,17 +396,17 @@ for opt, arg in optlist: +@@ -391,7 +391,7 @@ for opt, arg in optlist: elif opt in ("-l",): force_libs.append(arg) elif opt == "--gcc-options": @@ -108,19 +48,7 @@ elif opt == "--libdir": libdir = arg elif opt in ("--help", "-h"): -- usage(0) -+ usage(0) - sys.exit(0) - elif opt in ("--version", "-V"): - version(vers) - sys.exit(0) - else: -- print "WARNING: unknown option: " + opt + "\targ: " + arg -+ print("WARNING: unknown option: " + opt + "\targ: " + arg) - - if include_default_lib_path == "yes": - lib_path.extend([a.replace("/lib/", "/" + libdir + "/") for a in default_lib_path]) -@@ -424,22 +424,22 @@ if ldlib == "LDLIB": +@@ -419,17 +419,17 @@ if ldlib == "LDLIB": objects = {} # map from inode to filename for prog in proglist: inode = os.stat(prog)[ST_INO] @@ -141,45 +69,20 @@ output = command("mklibs-readelf", "--print-interp", obj) if output: ldlib = output.pop() -- if ldlib: -- break -+ if ldlib: -+ break - - if not ldlib: - sys.exit("E: Dynamic linker not found, aborting.") -@@ -454,10 +454,10 @@ for obj in sorted(objects.values()): - for rpath_elem in rpath_val: - if not rpath_elem in lib_rpath: - if debuglevel >= DEBUG_VERBOSE: -- print "Adding rpath " + rpath_elem + " for " + obj -+ print("Adding rpath " + rpath_elem + " for " + obj) - lib_rpath.append(rpath_elem) - else: -- print "warning: " + obj + " may need rpath, but --root not specified" -+ print("warning: " + obj + " may need rpath, but --root not specified") - - lib_path.extend(lib_rpath) - -@@ -465,12 +465,12 @@ passnr = 1 - available_libs = [] - previous_pass_unresolved = set() +@@ -462,9 +462,9 @@ previous_pass_unresolved = set() while 1: -- debug(DEBUG_NORMAL, "I: library reduction pass", `passnr`) -+ debug(DEBUG_NORMAL, "I: library reduction pass", repr(passnr)) + debug(DEBUG_NORMAL, "I: library reduction pass", str(passnr)) if debuglevel >= DEBUG_VERBOSE: -- print "Objects:", +- print("Objects:",) - for obj in sorted([x[string.rfind(x, '/') + 1:] for x in objects.values()]): -- print obj, -- print +- print(obj,) + print("Objects:", end=' ') + for obj in sorted([x[x.rfind('/') + 1:] for x in list(objects.values())]): + print(obj, end=' ') -+ print() + print() passnr = passnr + 1 - # Gather all already reduced libraries and treat them as objects as well -@@ -479,7 +479,7 @@ while 1: +@@ -474,7 +474,7 @@ while 1: obj = dest_path + "/" + lib small_libs.append(obj) inode = os.stat(obj)[ST_INO] @@ -188,7 +91,7 @@ debug(DEBUG_SPAM, obj, "is hardlink to", objects[inode]) else: objects[inode] = obj -@@ -509,7 +509,7 @@ while 1: +@@ -504,7 +504,7 @@ while 1: present_symbols = {} checked_libs = small_libs checked_libs.extend(available_libs) @@ -197,70 +100,8 @@ for lib in checked_libs: for symbol in provided_symbols(lib): debug(DEBUG_SPAM, "present_symbols adding %s" % symbol) -@@ -529,8 +529,8 @@ while 1: - unresolved.add(name) - num_unresolved = num_unresolved + 1 - -- debug (DEBUG_NORMAL, `len(needed_symbols)`, "symbols,", -- `num_unresolved`, "unresolved") -+ debug (DEBUG_NORMAL, repr(len(needed_symbols)), "symbols,", -+ repr(num_unresolved), "unresolved") - - if num_unresolved == 0: - break -@@ -539,7 +539,7 @@ while 1: - # No progress in last pass. Verify all remaining symbols are weak. - for name in unresolved: - if not needed_symbols[name].weak: -- print "WARNING: Unresolvable symbol %s" % name -+ print("WARNING: Unresolvable symbol %s" % name) - break - - previous_pass_unresolved = unresolved -@@ -641,9 +641,9 @@ while 1: - command(target + "gcc", *cmd) - - ## DEBUG -- debug(DEBUG_VERBOSE, so_file, "\t", `os.stat(so_file)[ST_SIZE]`) -+ debug(DEBUG_VERBOSE, so_file, "\t", repr(os.stat(so_file)[ST_SIZE])) - debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so", "\t", -- `os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE]`) -+ repr(os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE])) - - # Finalising libs and cleaning up - for lib in regexpfilter(os.listdir(dest_path), "(.*)-so$"): -@@ -680,4 +680,4 @@ if not os.access(dest_path + "/" + ld_fu - command(target + "objcopy", "--strip-unneeded -R .note -R .comment", - ld_file, dest_path + "/" + ld_full_path) - --os.chmod(dest_path + "/" + ld_full_path, 0755) -+os.chmod(dest_path + "/" + ld_full_path, 0o755) --- a/src/mklibs-copy +++ b/src/mklibs-copy -@@ -51,9 +51,9 @@ def command(command, *args): - output = pipe.read().strip() - status = pipe.close() - if status is not None and os.WEXITSTATUS(status) != 0: -- print "Command failed with status", os.WEXITSTATUS(status), ":", \ -- command, ' '.join(args) -- print "With output:", output -+ print("Command failed with status", os.WEXITSTATUS(status), ":", \ -+ command, ' '.join(args)) -+ print("With output:", output) - sys.exit(1) - return output.split('\n') - -@@ -134,8 +134,8 @@ def multiarch(paths): - return paths - - def version(vers): -- print "mklibs: version ",vers -- print "" -+ print("mklibs: version ",vers) -+ print("") - - # Clean the environment - vers="0.12" @@ -159,7 +159,7 @@ if include_default_lib_path: objects = {} # map from inode to filename for prog in proglist: @@ -270,23 +111,15 @@ logger.debug("%s is a hardlink to %s", prog, objects[inode]) elif so_pattern.match(prog): logger.debug("%s is a library", prog) -@@ -169,12 +169,12 @@ for prog in proglist: +@@ -169,7 +169,7 @@ for prog in proglist: logger.debug("%s is no ELF", prog) if not ldlib: - for obj in objects.values(): + for obj in list(objects.values()): output = command("mklibs-readelf", "-i", obj) -- for x in output: -+ for x in output: - ldlib = x -- if ldlib: -- break -+ if ldlib: -+ break - - if not ldlib: - sys.exit("E: Dynamic linker not found, aborting.") + for x in output: + ldlib = x @@ -182,7 +182,7 @@ if not ldlib: logger.info('Using %s as dynamic linker', ldlib) @@ -319,9 +152,3 @@ libraries.update(library_depends(obj)) if libraries == previous_pass_libraries: -@@ -272,4 +272,4 @@ if not os.access(dest_path + "/" + ld_fu - command(target + "objcopy", "--strip-unneeded -R .note -R .comment", - ld_file, dest_path + "/" + ld_full_path) - --os.chmod(dest_path + "/" + ld_full_path, 0755) -+os.chmod(dest_path + "/" + ld_full_path, 0o755) From 63e530a5194809ed60590baa822c1e1ec2e1219e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Feb 2022 20:21:35 -0800 Subject: [PATCH 58/66] tools/mtools: update to 4.0.37 No changelog is available. Signed-off-by: Rosen Penev --- tools/mtools/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mtools/Makefile b/tools/mtools/Makefile index 5e3c950ba3..c10e887b36 100644 --- a/tools/mtools/Makefile +++ b/tools/mtools/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtools -PKG_VERSION:=4.0.35 +PKG_VERSION:=4.0.37 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=34769e173751d2f0d891a08c76c80427e929b8ee43438019b8666cc3d7a44749 +PKG_HASH:=799b197e23e47b61259628810b27790efb7a1fe36037ef1da8a27b0ae4fa8342 HOST_BUILD_PARALLEL:=1 From 03f55708cb849ff729be3ece34d949cc87de9bf9 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Feb 2022 20:53:13 -0800 Subject: [PATCH 59/66] tools/cmake: update to 3.22.2 Mostly random Python 3.10 fixes. Signed-off-by: Rosen Penev --- tools/cmake/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index 8f0631eb74..d1d5b58a47 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.22.1 +PKG_VERSION:=3.22.2 PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \ https://cmake.org/files/v3.19/ -PKG_HASH:=0e998229549d7b3f368703d20e248e7ee1f853910d42704aa87918c213ea82c0 +PKG_HASH:=3c1c478b9650b107d452c5bd545c72e2fad4e37c09b89a1984b9a2f46df6aced HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 From 2d5f03205ab81fcbee6ef2d2853db98a85f0ecd3 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Feb 2022 20:51:40 -0800 Subject: [PATCH 60/66] tools/ccache: add cmake dependency This will be needed for the next commit as ccache's cmake dependency is satisfied by zstd currenly. Signed-off-by: Rosen Penev --- tools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index 681344a014..a13c2e82b5 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -87,7 +87,7 @@ endif ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),) $(foreach tool, $(filter-out xz zstd pkgconf patch ninja meson libressl cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) tools-y += ccache -$(curdir)/ccache/compile := $(curdir)/zstd/compile +$(curdir)/ccache/compile := $(curdir)/cmake/compile $(curdir)/zstd/compile endif # in case there is no patch tool on the host we need to make patch tool a From 94dd68ff736c75d628a98a1f050d7f0454fc4af1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 30 Jan 2022 19:03:41 -0800 Subject: [PATCH 61/66] tools/zstd: update to 1.5.2 Switched to building with meson as it's faster and does not need a dependency on cmake, which takes a long time to build. Signed-off-by: Rosen Penev --- tools/Makefile | 2 +- tools/zstd/Makefile | 30 ++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index a13c2e82b5..4c2aa1a1e9 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -74,7 +74,7 @@ $(curdir)/sdcc/compile := $(curdir)/bison/compile $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile $(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/zlib/compile := $(curdir)/cmake/compile -$(curdir)/zstd/compile := $(curdir)/cmake/compile +$(curdir)/zstd/compile := $(curdir)/meson/compile ifneq ($(HOST_OS),Linux) $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile index b93a5d2b52..93f6745976 100644 --- a/tools/zstd/Makefile +++ b/tools/zstd/Makefile @@ -1,25 +1,35 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zstd -PKG_VERSION:=1.5.0 +PKG_VERSION:=1.5.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/facebook/zstd/releases/download/v$(PKG_VERSION) -PKG_HASH:=5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94 +PKG_HASH:=7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE PKG_CPE_ID:=cpe:/a:facebook:zstandard -CMAKE_SOURCE_SUBDIR:=build/cmake - include $(INCLUDE_DIR)/host-build.mk -include $(INCLUDE_DIR)/cmake.mk +include $(INCLUDE_DIR)/meson.mk -CMAKE_HOST_OPTIONS += \ - -DBUILD_TESTING=OFF \ - -DCMAKE_C_COMPILER_LAUNCHER="" \ - -DCMAKE_C_COMPILER=$(HOSTCC_NOCACHE) \ - -DZSTD_LEGACY_SUPPORT=OFF +MESON_HOST_BUILD_DIR:=$(HOST_BUILD_DIR)/build/meson/openwrt-build + +HOSTCC:= $(HOSTCC_NOCACHE) +HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOST)/lib + +MESON_HOST_ARGS += \ + -Dlegacy_level=7 \ + -Ddebug_level=0 \ + -Dbacktrace=false \ + -Dstatic_runtime=false \ + -Dbin_programs=true \ + -Dbin_tests=false \ + -Dbin_contrib=false \ + -Dmulti_thread=enabled \ + -Dzlib=disabled \ + -Dlzma=disabled \ + -Dlz4=disabled $(eval $(call HostBuild)) From c8fdca4f6f5a24c8cefefaf65e6302526442218b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 21 Feb 2022 15:47:13 -0800 Subject: [PATCH 62/66] tools/findutils: update to 4.9.0 Add compilation fix for Ubuntu 20.04. Provided by upstream maintainer: https://github.com/openwrt/packages/issues/17912#issuecomment-1046726426 Signed-off-by: Rosen Penev --- tools/findutils/Makefile | 4 ++-- tools/findutils/patches/010-endpwent.patch | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tools/findutils/patches/010-endpwent.patch diff --git a/tools/findutils/Makefile b/tools/findutils/Makefile index 37cd897355..d0d780689b 100644 --- a/tools/findutils/Makefile +++ b/tools/findutils/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=findutils PKG_CPE_ID:=cpe:/a:gnu:findutils -PKG_VERSION:=4.8.0 +PKG_VERSION:=4.9.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=57127b7e97d91282c6ace556378d5455a9509898297e46e10443016ea1387164 +PKG_HASH:=a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe HOST_BUILD_PARALLEL:=1 diff --git a/tools/findutils/patches/010-endpwent.patch b/tools/findutils/patches/010-endpwent.patch new file mode 100644 index 0000000000..dc346f3f76 --- /dev/null +++ b/tools/findutils/patches/010-endpwent.patch @@ -0,0 +1,20 @@ +--- a/find/parser.c ++++ b/find/parser.c +@@ -67,12 +67,12 @@ + #include "findutils-version.h" + #include "system.h" + +- +-#ifndef HAVE_ENDGRENT +-# define endgrent () ++#if ! HAVE_ENDGRENT ++# define endgrent() ((void) 0) + #endif +-#ifndef HAVE_ENDPWENT +-# define endpwent () ++ ++#if ! HAVE_ENDPWENT ++# define endpwent() ((void) 0) + #endif + + static bool parse_accesscheck (const struct parser_table*, char *argv[], int *arg_ptr); From 4e13229dd19e90975af9a51b4bc888477fbfad5e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 17 Jun 2021 22:50:51 -0700 Subject: [PATCH 63/66] tools/expat: update to 2.4.6 Switched to CMake for faster compilation and greater parallel friendliness. Added CMake options from the packages feed. This release fixes various CVEs. Signed-off-by: Rosen Penev --- tools/Makefile | 1 + tools/expat/Makefile | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 4c2aa1a1e9..f3f9a3bf73 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -46,6 +46,7 @@ $(curdir)/bison/compile := $(curdir)/flex/compile $(curdir)/cbootimage/compile += $(curdir)/automake/compile $(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile $(curdir)/dosfstools/compile := $(curdir)/autoconf/compile $(curdir)/automake/compile +$(curdir)/expat/compile := $(curdir)/cmake/compile $(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile $(curdir)/fakeroot/compile := $(curdir)/libtool/compile $(curdir)/findutils/compile := $(curdir)/bison/compile diff --git a/tools/expat/Makefile b/tools/expat/Makefile index cfc70b2a49..0bc54a3d48 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -9,21 +9,25 @@ include $(TOPDIR)/rules.mk PKG_NAME:=expat PKG_CPE_ID:=cpe:/a:libexpat:expat -PKG_VERSION:=2.2.10 +PKG_VERSION:=2.4.6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_HASH:=b2c160f1b60e92da69de8e12333096aeb0c3bf692d41c60794de278af72135a5 +PKG_HASH:=ce317706b07cae150f90cddd4253f5b4fba929607488af5ac47bf2bc08e31f09 PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION)) -HOST_BUILD_PARALLEL:=1 - include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/cmake.mk -HOST_CONFIGURE_ARGS += \ - --without-docbook - -define Host/Install - $(MAKE) -C $(HOST_BUILD_DIR) install -endef +CMAKE_HOST_OPTIONS += \ + -DDOCBOOK_TO_MAN=OFF \ + -DEXPAT_BUILD_TOOLS=OFF \ + -DEXPAT_BUILD_EXAMPLES=OFF \ + -DEXPAT_BUILD_TESTS=OFF \ + -DEXPAT_BUILD_DOCS=OFF \ + -DEXPAT_WITH_LIBBSD=OFF \ + -DEXPAT_ENABLE_INSTALL=ON \ + -DEXPAT_DTD=OFF \ + -DEXPAT_NS=OFF \ + -DEXPAT_DEV_URANDOM=OFF $(eval $(call HostBuild)) From 40f91f6a2f633d2fbca13aa7ad6e5be1e79f5aa6 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Feb 2022 20:50:36 -0800 Subject: [PATCH 64/66] tools/fakeroot: update to 1.27 Remove macOS stuff. Upstream has fixed it in the same way. Add SOL_TCP define. Taken from elsewhere in the code. Refreshed patches. Signed-off-by: Rosen Penev --- tools/fakeroot/Makefile | 4 +- .../patches/100-macos_compile_fix.patch | 11 -- .../patches/400-alpine-libc.musl-fix.patch | 4 +- .../patches/500-macos_arm64_compile_fix.patch | 119 ------------------ tools/fakeroot/patches/600-macOS.patch | 13 ++ 5 files changed, 17 insertions(+), 134 deletions(-) delete mode 100644 tools/fakeroot/patches/100-macos_compile_fix.patch delete mode 100644 tools/fakeroot/patches/500-macos_arm64_compile_fix.patch create mode 100644 tools/fakeroot/patches/600-macOS.patch diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index f4333fbfb3..adae332099 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fakeroot -PKG_VERSION:=1.26 +PKG_VERSION:=1.27 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot -PKG_HASH:=480a578ffdc5592e73df4c086950d321b4adc78dbdaec56c82e4fe1fb68de8e9 +PKG_HASH:=3c45eb2d1802a2762069e2e9d21bdd6fb533592bc0cda74c9aff066ab01caddc PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf diff --git a/tools/fakeroot/patches/100-macos_compile_fix.patch b/tools/fakeroot/patches/100-macos_compile_fix.patch deleted file mode 100644 index 64c0b472c6..0000000000 --- a/tools/fakeroot/patches/100-macos_compile_fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libfakeroot_inode64.c -+++ b/libfakeroot_inode64.c -@@ -36,6 +36,8 @@ - #include - #endif /* HAVE_FTS_H */ - -+void load_library_symbols(void); -+ - #include "wrapped.h" - #include "wraptmpf.h" - #include "wrapdef.h" diff --git a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch index c37282af5d..730732db2e 100644 --- a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch +++ b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch @@ -6,7 +6,7 @@ Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: sy --- a/libfakeroot.c +++ b/libfakeroot.c -@@ -81,12 +81,14 @@ +@@ -86,12 +86,14 @@ #define SEND_STAT64(a,b,c) send_stat64(a,b,c) #define SEND_GET_STAT(a,b) send_get_stat(a,b) #define SEND_GET_STAT64(a,b) send_get_stat64(a,b) @@ -21,7 +21,7 @@ Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: sy #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) #endif -@@ -131,8 +133,9 @@ +@@ -136,8 +138,9 @@ /* 10.10 uses id_t in getpriority/setpriority calls, so pretend id_t is used everywhere, just happens to be int on some OSes */ diff --git a/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch b/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch deleted file mode 100644 index 271dceef91..0000000000 --- a/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch +++ /dev/null @@ -1,119 +0,0 @@ ---- a/communicate.c -+++ b/communicate.c -@@ -24,7 +24,12 @@ - In this file, we want 'struct stat' to have a 32-bit 'ino_t'. - We use 'struct stat64' when we need a 64-bit 'ino_t'. - */ --#define _DARWIN_NO_64_BIT_INODE -+# include -+# if __DARWIN_ONLY_64_BIT_INO_T -+# define _DARWIN_USE_64_BIT_INODE -+# else -+# define _DARWIN_NO_64_BIT_INODE -+# endif - #endif - - #include "communicate.h" ---- a/communicate.h -+++ b/communicate.h -@@ -91,6 +91,10 @@ - # include - #endif - -+#if __DARWIN_ONLY_64_BIT_INO_T -+struct stat64 __DARWIN_STRUCT_STAT64; -+#endif -+ - #ifndef FAKEROOT_FAKENET - # define FAKEROOTKEY_ENV "FAKEROOTKEY" - #endif /* ! FAKEROOT_FAKENET */ ---- a/faked.c -+++ b/faked.c -@@ -84,7 +84,12 @@ - In this file, we want 'struct stat' to have a 32-bit 'ino_t'. - We use 'struct stat64' when we need a 64-bit 'ino_t'. - */ --#define _DARWIN_NO_64_BIT_INODE -+# include -+# if __DARWIN_ONLY_64_BIT_INO_T -+# define _DARWIN_USE_64_BIT_INODE -+# else -+# define _DARWIN_NO_64_BIT_INODE -+# endif - #endif - - #include "config.h" ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -38,7 +38,12 @@ - In this file, we want 'struct stat' to have a 32-bit 'ino_t'. - We use 'struct stat64' when we need a 64-bit 'ino_t'. - */ --#define _DARWIN_NO_64_BIT_INODE -+# include -+# if __DARWIN_ONLY_64_BIT_INO_T -+# define _DARWIN_USE_64_BIT_INODE -+# else -+# define _DARWIN_NO_64_BIT_INODE -+# endif - - /* The helper _unix2003 version of this file calls a few functions in this file - that are marked with static_nonapple so that needs to become private instead ---- a/libfakeroot_unix2003.c -+++ b/libfakeroot_unix2003.c -@@ -18,7 +18,11 @@ - In this file, we want 'struct stat' to have a 32-bit 'ino_t'. - We use 'struct stat64' when we need a 64-bit 'ino_t'. - */ --#define _DARWIN_NO_64_BIT_INODE -+# if __DARWIN_ONLY_64_BIT_INO_T -+# define _DARWIN_USE_64_BIT_INODE -+# else -+# define _DARWIN_NO_64_BIT_INODE -+# endif - - /* - This file is for 32-bit symbols which have the "$UNIX2003" version, i.e. ---- a/libfakeroot_inode64.c -+++ b/libfakeroot_inode64.c -@@ -25,7 +25,7 @@ - #include "config.h" - #include "communicate.h" - --#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 -+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T - - #include - #include ---- a/wrapfunc.inp -+++ b/wrapfunc.inp -@@ -48,9 +48,11 @@ getattrlist$UNIX2003;int;(const char *pa - #endif - #endif - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 -+#if !__DARWIN_ONLY_64_BIT_INO_T - lstat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf) - stat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf) - fstat$INODE64;int;(int fd, struct stat *buf);(fd, buf) -+#endif - posix_spawn;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp) - posix_spawnp;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp) - #endif -@@ -232,7 +234,7 @@ facl;int;(int fd, int cmd, int cnt, void - #ifdef HAVE_FTS_READ - fts_read;FTSENT *;(FTS *ftsp);(ftsp) - #ifdef __APPLE__ --#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 -+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T - fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp) - #endif - #endif /* ifdef __APPLE__ */ -@@ -240,7 +242,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f - #ifdef HAVE_FTS_CHILDREN - fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options) - #ifdef __APPLE__ --#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 -+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T - fts_children$INODE64;FTSENT *;(FTS *ftsp, int options);(ftsp, options) - #endif - #endif /* ifdef __APPLE__ */ diff --git a/tools/fakeroot/patches/600-macOS.patch b/tools/fakeroot/patches/600-macOS.patch new file mode 100644 index 0000000000..59e668eb9a --- /dev/null +++ b/tools/fakeroot/patches/600-macOS.patch @@ -0,0 +1,13 @@ +--- a/communicate.c ++++ b/communicate.c +@@ -441,6 +441,10 @@ void semaphore_down(){ + + #else /* FAKEROOT_FAKENET */ + ++#ifndef SOL_TCP ++# define SOL_TCP 6 /* this should probably be done with getprotoent */ ++#endif ++ + static struct sockaddr *get_addr(void) + { + static struct sockaddr_in addr = { 0, 0, { 0 } }; From 4a19cf3bc7caa8e1010dc5d2f6fc4411349ae6e4 Mon Sep 17 00:00:00 2001 From: Huangbin Zhan Date: Wed, 23 Feb 2022 22:51:09 +0800 Subject: [PATCH 65/66] tools/mkimage: update to 2022.01 - enable dot config - enable openwrt verbose - add bison as dependency to avoid failure ``` bison -oscripts/kconfig/zconf.tab.c -t -l scripts/kconfig/zconf.y bison: /builder/shared-workdir/build/staging_dir/host/share/bison/m4sugar/m4sugar.m4: cannot open: No such file or directory ``` Signed-off-by: Huangbin Zhan --- tools/Makefile | 2 +- tools/mkimage/Makefile | 20 +++------------ ...5-tools-disable-TOOLS_FIT_FULL_CHECK.patch | 25 +++++++++++++++++++ 3 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 tools/mkimage/patches/095-tools-disable-TOOLS_FIT_FULL_CHECK.patch diff --git a/tools/Makefile b/tools/Makefile index f3f9a3bf73..ec382b4122 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -62,7 +62,7 @@ $(curdir)/llvm-bpf/compile := $(curdir)/cmake/compile $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile $(curdir)/meson/compile := $(curdir)/ninja/compile $(curdir)/missing-macros/compile := $(curdir)/autoconf/compile -$(curdir)/mkimage/compile += $(curdir)/libressl/compile +$(curdir)/mkimage/compile += $(curdir)/bison/compile $(curdir)/libressl/compile $(curdir)/mklibs/compile := $(curdir)/libtool/compile $(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile $(curdir)/mpfr/compile := $(curdir)/gmp/compile diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile index 5ed4107e1d..fd5dad0cd8 100644 --- a/tools/mkimage/Makefile +++ b/tools/mkimage/Makefile @@ -7,38 +7,26 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mkimage -PKG_VERSION:=2021.10 +PKG_VERSION:=2022.01 PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ https://mirror.cyberbits.eu/u-boot \ https://ftp.denx.de/pub/u-boot \ ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4 +PKG_HASH:=81b4543227db228c03f8a1bf5ddbc813b0bb8f6555ce46064ef721a6fc680413 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION) include $(INCLUDE_DIR)/host-build.mk -define Host/Prepare - $(Host/Prepare/Default) - mkdir -p $(HOST_BUILD_DIR)/include/config - touch $(HOST_BUILD_DIR)/include/config/auto.conf - mkdir -p $(HOST_BUILD_DIR)/include/generated/ - touch $(HOST_BUILD_DIR)/include/generated/autoconf.h -endef - define Host/Compile $(MAKE) -C $(HOST_BUILD_DIR) \ HOSTCFLAGS="$(HOST_CFLAGS)" \ HOSTLDFLAGS="$(HOST_LDFLAGS)" \ PKG_CONFIG_EXTRAARGS="--static" \ - no-dot-config-targets=tools-only \ - CONFIG_MKIMAGE_DTC_PATH=dtc \ - CONFIG_FIT=y \ - CONFIG_FIT_SIGNATURE=y \ - CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000 \ - CONFIG_TOOLS_LIBCRYPTO=y \ + V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1) \ + tools-only_config \ tools-only endef diff --git a/tools/mkimage/patches/095-tools-disable-TOOLS_FIT_FULL_CHECK.patch b/tools/mkimage/patches/095-tools-disable-TOOLS_FIT_FULL_CHECK.patch new file mode 100644 index 0000000000..f2e3b9b053 --- /dev/null +++ b/tools/mkimage/patches/095-tools-disable-TOOLS_FIT_FULL_CHECK.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Huangbin Zhan +Date: Fri, 18 Feb 2022 14:19:23 +0800 +Subject: [PATCH] tools: disable TOOLS_FIT_FULL_CHECK + + U-Boot disallows unit addresses by default. Disable TOOLS_FIT_FULL_CHECK + to allow at symbol in node names. + +https://github.com/openwrt/openwrt/commits/master/scripts/mkits.sh +https://github.com/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917 +--- + tools/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/Kconfig ++++ b/tools/Kconfig +@@ -31,7 +31,7 @@ config TOOLS_FIT + Enable FIT support in the tools builds. + + config TOOLS_FIT_FULL_CHECK +- def_bool y ++ bool "Do a full check of the FIT" + help + Do a full check of the FIT before using it in the tools builds + From 495c4f4e197166a6fa997d4620ca6c241e3abd45 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Wed, 23 Feb 2022 21:32:41 +0100 Subject: [PATCH 66/66] tools/libressl: update to version 3.4.2 Release notes: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.2-relnotes.txt ``` It includes the following security fix * In some situations the X.509 verifier would discard an error on an unverified certificate chain, resulting in an authentication bypass. Thanks to Ilya Shipitsin and Timo Steinlein for reporting. ``` Signed-off-by: Josef Schlehofer --- tools/libressl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index be053ac788..da7cd6201b 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libressl -PKG_VERSION:=3.4.1 -PKG_HASH:=107ceae6ca800e81cb563584c16afa36d6c7138fade94a2b3e9da65456f7c61c +PKG_VERSION:=3.4.2 +PKG_HASH:=cb82ca7d547336917352fbd23db2fc483c6c44d35157b32780214ec74197b3ce PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:openbsd:libressl