From 09bbf5581713695cbf6bcb5791e9be02ff8c27fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 23 Feb 2021 10:52:06 +0100 Subject: [PATCH 01/45] bmips: bcm6358: fix EHCI/OHCI kernel panics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARCH_HAS_SYNC_DMA_FOR_CPU_ALL is causing kernel panics when EHCI or OHCI are enabled. Signed-off-by: Álvaro Fernández Rojas --- .../bmips/dts/bcm6358-huawei-hg556a-b.dts | 8 +++ ...isable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch | 62 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 target/linux/bmips/patches-5.10/208-mips-bmips-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch diff --git a/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts b/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts index 5b8709c722..f62c79fccb 100644 --- a/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts +++ b/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts @@ -126,6 +126,14 @@ }; }; +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + &pflash { status = "okay"; diff --git a/target/linux/bmips/patches-5.10/208-mips-bmips-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch b/target/linux/bmips/patches-5.10/208-mips-bmips-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch new file mode 100644 index 0000000000..09b494197b --- /dev/null +++ b/target/linux/bmips/patches-5.10/208-mips-bmips-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch @@ -0,0 +1,62 @@ +From 84c06b4a1dfa3e021fdbcafaff8cebfdec462402 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Tue, 23 Feb 2021 10:39:48 +0100 +Subject: [PATCH] mips: bmips: disable ARCH_HAS_SYNC_DMA_FOR_CPU_ALL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Enabling this option causes kernel panics on BCM6358 with EHCI/OHCI: +[ 3.881739] usb 1-1: new high-speed USB device number 2 using ehci-platform +[ 3.895011] Reserved instruction in kernel code[#1]: +[ 3.900113] CPU: 0 PID: 1 Comm: init Not tainted 5.10.16 #0 +[ 3.905829] $ 0 : 00000000 10008700 00000000 77d94060 +[ 3.911238] $ 4 : 7fd1f088 00000000 81431cac 81431ca0 +[ 3.916641] $ 8 : 00000000 ffffefff 8075cd34 00000000 +[ 3.922043] $12 : 806f8d40 f3e812b7 00000000 000d9aaa +[ 3.927446] $16 : 7fd1f068 7fd1f080 7ff559b8 81428470 +[ 3.932848] $20 : 00000000 00000000 55590000 77d70000 +[ 3.938251] $24 : 00000018 00000010 +[ 3.943655] $28 : 81430000 81431e60 81431f28 800157fc +[ 3.949058] Hi : 00000000 +[ 3.952013] Lo : 00000000 +[ 3.955019] epc : 80015808 setup_sigcontext+0x54/0x24c +[ 3.960464] ra : 800157fc setup_sigcontext+0x48/0x24c +[ 3.965913] Status: 10008703 KERNEL EXL IE +[ 3.970216] Cause : 00800028 (ExcCode 0a) +[ 3.974340] PrId : 0002a010 (Broadcom BMIPS4350) +[ 3.979170] Modules linked in: ohci_platform ohci_hcd fsl_mph_dr_of ehci_platform ehci_fsl ehci_hcd gpio_button_hotplug usbcore nls_base usb_common +[ 3.992907] Process init (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=77e22ec8) +[ 4.000776] Stack : 81431ef4 7fd1f080 81431f28 81428470 7fd1f068 81431edc 7ff559b8 81428470 +[ 4.009467] 81431f28 7fd1f080 55590000 77d70000 77d5498c 80015c70 806f0000 8063ae74 +[ 4.018149] 08100002 81431f28 0000000a 08100002 81431f28 0000000a 77d6b418 00000003 +[ 4.026831] ffffffff 80016414 80080734 81431ecc 81431ecc 00000001 00000000 04000000 +[ 4.035512] 77d54874 00000000 00000000 00000000 00000000 00000012 00000002 00000000 +[ 4.044196] ... +[ 4.046706] Call Trace: +[ 4.049238] [<80015808>] setup_sigcontext+0x54/0x24c +[ 4.054356] [<80015c70>] setup_frame+0xdc/0x124 +[ 4.059015] [<80016414>] do_notify_resume+0x1dc/0x288 +[ 4.064207] [<80011b50>] work_notifysig+0x10/0x18 +[ 4.069036] +[ 4.070538] Code: 8fc300b4 00001025 26240008 ac830004 3c048063 0c0228aa 24846a00 26240010 +[ 4.080686] +[ 4.082517] ---[ end trace 22a8edb41f5f983b ]--- +[ 4.087374] Kernel panic - not syncing: Fatal exception +[ 4.092753] Rebooting in 1 seconds.. + +Signed-off-by: Álvaro Fernández Rojas +--- + arch/mips/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -250,7 +250,6 @@ config ATH79 + config BMIPS_GENERIC + bool "Broadcom Generic BMIPS kernel" + select ARCH_HAS_RESET_CONTROLLER +- select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL + select ARCH_HAS_PHYS_TO_DMA + select BOOT_RAW + select NO_EXCEPT_FILL From 50cb3a750f96c4a0f97602b7242068e9bb239fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Tue, 19 May 2020 15:56:29 +0200 Subject: [PATCH 02/45] bcm63xx: pinctrl: fix BCM6348 groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current driver has some troubles: - Some groupings are wrong. - The pinctrl group0 owns pins never used (at least in Openwrt) for any pinmux. The driver hijacks all the pins on the group avoiding any other use, spite they're free. I.e. for buttons, causing this kernel error: [ 4.735928] gpio-keys-polled keys: unable to claim gpio 479, err=-22 [ 4.742642] gpio-keys-polled: probe of keys failed with error -22 - Minor errors about groupings on the documentation - Missing "diag" grouping in dtsi - Wrong groupings in dtsi Fix it by setting the correct groups. And relax the pin capturing, letting the gpios belonging to any group to be used for other purposes like buttons. This was the behavior with stock firmwares and old OpenWrt versions which never caused any trouble. Signed-off-by: Daniel González Cabanelas --- target/linux/bcm63xx/dts/bcm6348.dtsi | 9 ++++-- ...d-BCM6348-pincontroller-binding-docu.patch | 6 ++-- ...-add-a-pincontrol-driver-for-BCM6348.patch | 29 +++---------------- ...d-BCM6348-pincontroller-binding-docu.patch | 6 ++-- ...-add-a-pincontrol-driver-for-BCM6348.patch | 29 +++---------------- 5 files changed, 21 insertions(+), 58 deletions(-) diff --git a/target/linux/bcm63xx/dts/bcm6348.dtsi b/target/linux/bcm63xx/dts/bcm6348.dtsi index 1e04486909..38bb71e53c 100644 --- a/target/linux/bcm63xx/dts/bcm6348.dtsi +++ b/target/linux/bcm63xx/dts/bcm6348.dtsi @@ -94,7 +94,7 @@ }; pinctrl_mii_snoop: mii_snoop { - function = "ext_ephy"; + function = "mii_snoop"; groups = "group1", "group4"; }; @@ -125,7 +125,12 @@ pinctrl_utopia: utopia { function = "utopia"; - groups = "group0", "group1", "group3"; + groups = "group1", "group3", "group4"; + }; + + pinctrl_diag: diag { + function = "diag"; + groups = "group0", "group1", "group2", "group3", "group4"; }; }; diff --git a/target/linux/bcm63xx/patches-5.10/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch b/target/linux/bcm63xx/patches-5.10/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch index 6bac90373c..800f0540cc 100644 --- a/target/linux/bcm63xx/patches-5.10/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch +++ b/target/linux/bcm63xx/patches-5.10/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch @@ -41,9 +41,9 @@ Signed-off-by: Jonas Gorski + +name pins functions +----------------------------------------------------------- -+group0 32-36 ext_mii, utopia, diag ++group0 32-36 ext_mii, diag +group1 22-31 ext_ephy, mii_snoop, mii_pccard, + spi_master_uart, utopia, diag +group2 16-21 pci, diag -+group3 8-15 ext_mii, utopia -+group4 0-7 ext_ephy, mii_snoop, legacy_led, diag ++group3 8-15 ext_mii, utopia, diag ++group4 0-7 ext_ephy, mii_snoop, legacy_led, utopia, diag diff --git a/target/linux/bcm63xx/patches-5.10/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch b/target/linux/bcm63xx/patches-5.10/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch index b48723c1b3..3b613fdca5 100644 --- a/target/linux/bcm63xx/patches-5.10/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch +++ b/target/linux/bcm63xx/patches-5.10/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch @@ -37,7 +37,7 @@ Signed-off-by: Jonas Gorski +obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o --- /dev/null +++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c -@@ -0,0 +1,391 @@ +@@ -0,0 +1,370 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -225,15 +225,16 @@ Signed-off-by: Jonas Gorski +}; + +static const char * const utopia_groups[] = { -+ "group0", + "group1", + "group3", ++ "group4", +}; + +static const char * const diag_groups[] = { + "group0", + "group1", + "group2", ++ "group3", + "group4", +}; + @@ -335,27 +336,6 @@ Signed-off-by: Jonas Gorski + return 0; +} + -+static int bcm6348_gpio_request_enable(struct pinctrl_dev *pctldev, -+ struct pinctrl_gpio_range *range, -+ unsigned offset) -+{ -+ struct bcm6348_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); -+ struct pin_desc *desc; -+ u32 mask; -+ -+ /* don't reconfigure if already muxed */ -+ desc = pin_desc_get(pctldev, offset); -+ if (desc->mux_usecount) -+ return 0; -+ -+ mask = GROUP_MASK(offset); -+ -+ /* disable all functions using this pin */ -+ bcm6348_rmw_mux(pctl, mask, 0); -+ -+ return 0; -+} -+ +static struct pinctrl_ops bcm6348_pctl_ops = { + .get_groups_count = bcm6348_pinctrl_get_group_count, + .get_group_name = bcm6348_pinctrl_get_group_name, @@ -371,8 +351,7 @@ Signed-off-by: Jonas Gorski + .get_function_name = bcm6348_pinctrl_get_func_name, + .get_function_groups = bcm6348_pinctrl_get_groups, + .set_mux = bcm6348_pinctrl_set_mux, -+ .gpio_request_enable = bcm6348_gpio_request_enable, -+ .strict = true, ++ .strict = false, +}; + +static int bcm6348_pinctrl_probe(struct platform_device *pdev) diff --git a/target/linux/bcm63xx/patches-5.4/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch b/target/linux/bcm63xx/patches-5.4/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch index 6bac90373c..800f0540cc 100644 --- a/target/linux/bcm63xx/patches-5.4/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch +++ b/target/linux/bcm63xx/patches-5.4/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch @@ -41,9 +41,9 @@ Signed-off-by: Jonas Gorski + +name pins functions +----------------------------------------------------------- -+group0 32-36 ext_mii, utopia, diag ++group0 32-36 ext_mii, diag +group1 22-31 ext_ephy, mii_snoop, mii_pccard, + spi_master_uart, utopia, diag +group2 16-21 pci, diag -+group3 8-15 ext_mii, utopia -+group4 0-7 ext_ephy, mii_snoop, legacy_led, diag ++group3 8-15 ext_mii, utopia, diag ++group4 0-7 ext_ephy, mii_snoop, legacy_led, utopia, diag diff --git a/target/linux/bcm63xx/patches-5.4/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch b/target/linux/bcm63xx/patches-5.4/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch index b48723c1b3..3b613fdca5 100644 --- a/target/linux/bcm63xx/patches-5.4/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch +++ b/target/linux/bcm63xx/patches-5.4/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch @@ -37,7 +37,7 @@ Signed-off-by: Jonas Gorski +obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o --- /dev/null +++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c -@@ -0,0 +1,391 @@ +@@ -0,0 +1,370 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -225,15 +225,16 @@ Signed-off-by: Jonas Gorski +}; + +static const char * const utopia_groups[] = { -+ "group0", + "group1", + "group3", ++ "group4", +}; + +static const char * const diag_groups[] = { + "group0", + "group1", + "group2", ++ "group3", + "group4", +}; + @@ -335,27 +336,6 @@ Signed-off-by: Jonas Gorski + return 0; +} + -+static int bcm6348_gpio_request_enable(struct pinctrl_dev *pctldev, -+ struct pinctrl_gpio_range *range, -+ unsigned offset) -+{ -+ struct bcm6348_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); -+ struct pin_desc *desc; -+ u32 mask; -+ -+ /* don't reconfigure if already muxed */ -+ desc = pin_desc_get(pctldev, offset); -+ if (desc->mux_usecount) -+ return 0; -+ -+ mask = GROUP_MASK(offset); -+ -+ /* disable all functions using this pin */ -+ bcm6348_rmw_mux(pctl, mask, 0); -+ -+ return 0; -+} -+ +static struct pinctrl_ops bcm6348_pctl_ops = { + .get_groups_count = bcm6348_pinctrl_get_group_count, + .get_group_name = bcm6348_pinctrl_get_group_name, @@ -371,8 +351,7 @@ Signed-off-by: Jonas Gorski + .get_function_name = bcm6348_pinctrl_get_func_name, + .get_function_groups = bcm6348_pinctrl_get_groups, + .set_mux = bcm6348_pinctrl_set_mux, -+ .gpio_request_enable = bcm6348_gpio_request_enable, -+ .strict = true, ++ .strict = false, +}; + +static int bcm6348_pinctrl_probe(struct platform_device *pdev) From f0d5eb149efbdf28c859725927906eac3a4087f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 23 Feb 2021 12:34:27 +0100 Subject: [PATCH 03/45] bmips: remove unneeded downstream serial patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disabling CONFIG_SERIAL_8250 makes the upstream serial driver work OOB. Signed-off-by: Álvaro Fernández Rojas --- target/linux/bmips/config-5.10 | 2 +- .../201-serial-bcm63xx-init-uart-earlier.patch | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 target/linux/bmips/patches-5.10/201-serial-bcm63xx-init-uart-earlier.patch diff --git a/target/linux/bmips/config-5.10 b/target/linux/bmips/config-5.10 index e8386fa690..86c71aaeef 100644 --- a/target/linux/bmips/config-5.10 +++ b/target/linux/bmips/config-5.10 @@ -213,9 +213,9 @@ CONFIG_RESET_BCM6345=y CONFIG_RESET_CONTROLLER=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y +# CONFIG_SERIAL_8250 is not set CONFIG_SERIAL_BCM63XX=y CONFIG_SERIAL_BCM63XX_CONSOLE=y -CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SGL_ALLOC=y CONFIG_SMP=y CONFIG_SMP_UP=y diff --git a/target/linux/bmips/patches-5.10/201-serial-bcm63xx-init-uart-earlier.patch b/target/linux/bmips/patches-5.10/201-serial-bcm63xx-init-uart-earlier.patch deleted file mode 100644 index 468f89d0b5..0000000000 --- a/target/linux/bmips/patches-5.10/201-serial-bcm63xx-init-uart-earlier.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/tty/serial/bcm63xx_uart.c -+++ b/drivers/tty/serial/bcm63xx_uart.c -@@ -916,7 +916,7 @@ static void __exit bcm_uart_exit(void) - uart_unregister_driver(&bcm_uart_driver); - } - --module_init(bcm_uart_init); -+subsys_initcall(bcm_uart_init); - module_exit(bcm_uart_exit); - - MODULE_AUTHOR("Maxime Bizon "); From fc2a4e56821dae5a4a5c79b4d6c8a881efa4b66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 23 Feb 2021 12:57:28 +0100 Subject: [PATCH 04/45] bmips: bcm6358: add watchdog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Watchdog node was missing in commit 029093a302. Fixes: 029093a302c9 ("bmips: add new target") Signed-off-by: Álvaro Fernández Rojas --- target/linux/bmips/dts/bcm6358.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/linux/bmips/dts/bcm6358.dtsi b/target/linux/bmips/dts/bcm6358.dtsi index 650459d339..83cfb0ad90 100644 --- a/target/linux/bmips/dts/bcm6358.dtsi +++ b/target/linux/bmips/dts/bcm6358.dtsi @@ -149,6 +149,15 @@ #reset-cells = <1>; }; + wdt: watchdog@fffe005c { + compatible = "brcm,bcm7038-wdt"; + reg = <0xfffe005c 0xc>; + + clocks = <&periph_osc>; + + timeout-sec = <30>; + }; + pinctrl: pin-controller@fffe0080 { compatible = "brcm,bcm6358-pinctrl"; reg = <0xfffe0080 0x8>, From 068c82039f5192a79e2139db42fdc734702da5a3 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 10 Feb 2021 02:47:53 +0000 Subject: [PATCH 05/45] arm-trusted-firmware-mediatek: bring back package * use binary provided by MediaTek to work-around 'bromimage' issue * refactor Makefile * add mt7622 1c variants (using binaries provided by MTK) Signed-off-by: Daniel Golle --- .../arm-trusted-firmware-mediatek/Makefile | 145 ++++++++++++------ 1 file changed, 98 insertions(+), 47 deletions(-) diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index eebe500224..ad85c6ad2b 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -1,6 +1,6 @@ # # Copyright (C) 2017 Hauke Mehrtens -# Copyright (C) 2020 Daniel Golle +# Copyright (C) 2021 Daniel Golle # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -19,9 +19,22 @@ PKG_MIRROR_HASH:=b211b2f9143d4debc7ad8dc959cb606888af20af790855dd66c87e451b6a1bc PKG_MAINTAINER:=Daniel Golle +PKG_LICENSE+=proprietary +PKG_LICENSE_FILES:=LICENCE.mediatek + +BLOBS_TARBALL:=tfa-mtk-files-for-2020-11-09.tgz +BROMIMAGE_EXEC:=bromimage-x64 + include $(INCLUDE_DIR)/trusted-firmware-a.mk include $(INCLUDE_DIR)/package.mk +define Download/tfa-files + URL:=https://codeload.github.com/openwrt/arm-trusted-firmware-mediatek-files/tar.gz/for-2020-11-09? + URL_FILE:=$(BLOBS_TARBALL) + FILE:=$(BLOBS_TARBALL) + HASH:=689b097e4531d3eeca0c477675ab3dc3cace6ba4ed8a339116a9ede6537839d7 +endef + define Download/mt7622-header-emmc URL:=https://raw.githubusercontent.com/frank-w/BPI-R64-ATF/a36efa5f7435b8079479d13b562fedc0aa0d42f0 URL_FILE:=header_emmc.bin @@ -36,74 +49,112 @@ define Download/mt7622-header-sdmmc HASH:=242908c04e25289d25ba9fab61a1930425af173051c43d275d1ac9877d6accb1 endef -define Package/arm-trusted-firmware-mt7622/Default - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:=ARM Trusted Firmware for MT7622 - DEPENDS:=@TARGET_mediatek_mt7622 @BROKEN -# wait until bromimage gets replace by static build -# libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by tools/mediatek/bromimage/bromimage) +define Trusted-Firmware-A/Default + BUILD_TARGET:=mediatek + BUILD_SUBTARGET:=mt7622 + PLAT:=mt7622 + TFA_IMAGE:=bl2.img bl31.bin + BOOT_DEVICE:= + DDR_BLOB:= endef -define Package/arm-trusted-firmware-mt7622-nor - $(call Package/arm-trusted-firmware-mt7622/Default) - VARIANT:=nor +define Trusted-Firmware-A/mt7622-nor-1ddr + NAME:=MediaTek MT7622 (SPI-NOR, 1x DDR3) + BOOT_DEVICE:=nor + DDR_BLOB:=1 endef -define Package/arm-trusted-firmware-mt7622-snand - $(call Package/arm-trusted-firmware-mt7622/Default) - VARIANT:=snand +define Trusted-Firmware-A/mt7622-nor-2ddr + NAME:=MediaTek MT7622 (SPI-NOR, 2x DDR3) + BOOT_DEVICE:=nor + DDR_BLOB:=2 endef -define Package/arm-trusted-firmware-mt7622-emmc - $(call Package/arm-trusted-firmware-mt7622/Default) - VARIANT:=emmc +define Trusted-Firmware-A/mt7622-snand-1ddr + NAME:=MediaTek MT7622 (SPI-NAND, 1x DDR3) + BOOT_DEVICE:=snand + DDR_BLOB:=1 endef -define Package/arm-trusted-firmware-mt7622-sdmmc - $(call Package/arm-trusted-firmware-mt7622/Default) - VARIANT:=sdmmc +define Trusted-Firmware-A/mt7622-snand-2ddr + NAME:=MediaTek MT7622 (SPI-SNAND, 2x DDR3) + BOOT_DEVICE:=snand + DDR_BLOB:=2 endef -MAKE_VARS = \ - CROSS_COMPILE="$(TARGET_CROSS)" +define Trusted-Firmware-A/mt7622-emmc-1ddr + NAME:=MediaTek MT7622 (eMMC, 1x DDR3) + BOOT_DEVICE:=emmc + DDR_BLOB:=1 +endef -MAKE_FLAGS += \ - PLAT=mt7622 \ - BOOT_DEVICE=$(BUILD_VARIANT) \ - all +define Trusted-Firmware-A/mt7622-emmc-2ddr + NAME:=MediaTek MT7622 (eMMC, 2x DDR3) + BOOT_DEVICE:=emmc + DDR_BLOB:=2 +endef + +define Trusted-Firmware-A/mt7622-sdmmc-1ddr + NAME:=MediaTek MT7622 (SDcard, 1x DDR3) + BOOT_DEVICE:=sdmmc + DDR_BLOB:=1 +endef + +define Trusted-Firmware-A/mt7622-sdmmc-2ddr + NAME:=MediaTek MT7622 (SDcard, 2x DDR3) + BOOT_DEVICE:=sdmmc + DDR_BLOB:=2 +endef + +TFA_TARGETS:= \ + mt7622-nor-1ddr \ + mt7622-nor-2ddr \ + mt7622-snand-1ddr \ + mt7622-snand-2ddr \ + mt7622-emmc-1ddr \ + mt7622-emmc-2ddr \ + mt7622-sdmmc-1ddr \ + mt7622-sdmmc-2ddr + +TFA_MAKE_FLAGS += BOOT_DEVICE=$(BOOT_DEVICE) all define Build/Prepare $(call Build/Prepare/Default) -ifeq ($(BUILD_VARIANT),emmc) +ifeq ($(BOOT_DEVICE),emmc) $(eval $(call Download,mt7622-header-emmc)) endif -ifeq ($(BUILD_VARIANT),sdmmc) +ifeq ($(BOOT_DEVICE),sdmmc) $(eval $(call Download,mt7622-header-sdmmc)) endif + $(eval $(call Download,tfa-files)) +# replace 'bromimage' tool by static version + $(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \ + -O "*/$(BROMIMAGE_EXEC)" > $(PKG_BUILD_DIR)/tools/mediatek/bromimage/bromimage + $(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \ + -C $(PKG_BUILD_DIR) \ + --strip-components=1 */LICENCE.mediatek endef -define Build/InstallDev +define Build/Configure + $(call Build/Configure/Default) +# replace DRAM calib blobs if needed (variant '2' is shipped upstream) +ifeq ($(DDR_BLOB),1) + $(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \ + -C $(PKG_BUILD_DIR)/plat/mediatek/mt7622/drivers/dram/release \ + --strip-components=1 */*.o +endif +endef + +define Package/trusted-firmware-a/install $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.bin $(STAGING_DIR_IMAGE)/mt7622-bl2-$(BUILD_VARIANT).bin - $(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.img $(STAGING_DIR_IMAGE)/mt7622-bl2-$(BUILD_VARIANT).img -# bl31.bin turns out to be identical for all build variants - $(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl31.bin $(STAGING_DIR_IMAGE)/mt7622-bl31.bin -ifeq ($(BUILD_VARIANT),emmc) - $(CP) $(DL_DIR)/mt7622-header_emmc.bin $(STAGING_DIR_IMAGE) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.img $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.img + $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/mt7622/release/bl31.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl31.bin +ifeq ($(BOOT_DEVICE),emmc) + $(INSTALL_DATA) $(DL_DIR)/mt7622-header_emmc.bin $(STAGING_DIR_IMAGE)/ endif -ifeq ($(BUILD_VARIANT),sdmmc) - $(CP) $(DL_DIR)/mt7622-header_sdmmc.bin $(STAGING_DIR_IMAGE) +ifeq ($(BOOT_DEVICE),sdmmc) + $(INSTALL_DATA) $(DL_DIR)/mt7622-header_sdmmc.bin $(STAGING_DIR_IMAGE)/ endif endef -define Package/arm-trusted-firmware-mt7622-nor/install -endef -Package/arm-trusted-firmware-mt7622-snand/install = $(Package/arm-trusted-firmware-mt7622-nor/install) -Package/arm-trusted-firmware-mt7622-emmc/install = $(Package/arm-trusted-firmware-mt7622-nor/install) -Package/arm-trusted-firmware-mt7622-sdmmc/install = $(Package/arm-trusted-firmware-mt7622-nor/install) - -$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-nor)) -$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-snand)) -$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-emmc)) -$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-sdmmc)) +$(eval $(call BuildPackage/Trusted-Firmware-A)) From 5f1bd952785e3257199879248e0b82216757b0b6 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 23 Feb 2021 13:16:23 +0000 Subject: [PATCH 06/45] procd: update to git HEAD 2be57ed cosmetics: provide compatible system info on Aarch64 37eed13 system: expose if system was booted from initramfs Signed-off-by: Daniel Golle --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index fff9faa1bf..30d5adf427 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_SOURCE_DATE:=2021-02-08 -PKG_SOURCE_VERSION:=08938fe1cbc06eeaafa39448057368391d165272 -PKG_MIRROR_HASH:=efc3deac56057e929789d44742858b2a16d976f6bfa0a2036e413d10afcaeee4 +PKG_SOURCE_DATE:=2021-02-23 +PKG_SOURCE_VERSION:=37eed131e9967a35f47bacb3437a9d3c8a57b3f4 +PKG_MIRROR_HASH:=2b0131ff9055ccf987cbeb5f36c2c2585dc780999df6be312fbbbcd61ce676d4 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From de3066bef705bd400a05e92305e634939d46f5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 23 Feb 2021 15:14:41 +0100 Subject: [PATCH 07/45] bmips: rename upstream patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These patches were applied in linux v5.11, not v5.12. Signed-off-by: Álvaro Fernández Rojas --- ...> 001-v5.11-mips-bmips-select-ARCH_HAS_RESET_CONTROLLER.patch} | 0 ...11-dt-bindings-reset-add-BCM6345-reset-controller-bindi.patch} | 0 ... => 003-v5.11-reset-add-BCM6345-reset-controller-driver.patch} | 0 ....11-mips-bmips-dts-add-BCM6328-reset-controller-support.patch} | 0 ....11-mips-bmips-dts-add-BCM6358-reset-controller-support.patch} | 0 ....11-mips-bmips-dts-add-BCM6362-reset-controller-support.patch} | 0 ....11-mips-bmips-dts-add-BCM6368-reset-controller-support.patch} | 0 ...11-mips-bmips-dts-add-BCM63268-reset-controller-support.patch} | 0 ....11-mips-bmips-add-BCM6318-reset-controller-definitions.patch} | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/bmips/patches-5.10/{001-v5.12-mips-bmips-select-ARCH_HAS_RESET_CONTROLLER.patch => 001-v5.11-mips-bmips-select-ARCH_HAS_RESET_CONTROLLER.patch} (100%) rename target/linux/bmips/patches-5.10/{002-v5.12-dt-bindings-reset-add-BCM6345-reset-controller-bindi.patch => 002-v5.11-dt-bindings-reset-add-BCM6345-reset-controller-bindi.patch} (100%) rename target/linux/bmips/patches-5.10/{003-v5.12-reset-add-BCM6345-reset-controller-driver.patch => 003-v5.11-reset-add-BCM6345-reset-controller-driver.patch} (100%) rename target/linux/bmips/patches-5.10/{004-v5.12-mips-bmips-dts-add-BCM6328-reset-controller-support.patch => 004-v5.11-mips-bmips-dts-add-BCM6328-reset-controller-support.patch} (100%) rename target/linux/bmips/patches-5.10/{005-v5.12-mips-bmips-dts-add-BCM6358-reset-controller-support.patch => 005-v5.11-mips-bmips-dts-add-BCM6358-reset-controller-support.patch} (100%) rename target/linux/bmips/patches-5.10/{006-v5.12-mips-bmips-dts-add-BCM6362-reset-controller-support.patch => 006-v5.11-mips-bmips-dts-add-BCM6362-reset-controller-support.patch} (100%) rename target/linux/bmips/patches-5.10/{007-v5.12-mips-bmips-dts-add-BCM6368-reset-controller-support.patch => 007-v5.11-mips-bmips-dts-add-BCM6368-reset-controller-support.patch} (100%) rename target/linux/bmips/patches-5.10/{008-v5.12-mips-bmips-dts-add-BCM63268-reset-controller-support.patch => 008-v5.11-mips-bmips-dts-add-BCM63268-reset-controller-support.patch} (100%) rename target/linux/bmips/patches-5.10/{009-v5.12-mips-bmips-add-BCM6318-reset-controller-definitions.patch => 009-v5.11-mips-bmips-add-BCM6318-reset-controller-definitions.patch} (100%) diff --git a/target/linux/bmips/patches-5.10/001-v5.12-mips-bmips-select-ARCH_HAS_RESET_CONTROLLER.patch b/target/linux/bmips/patches-5.10/001-v5.11-mips-bmips-select-ARCH_HAS_RESET_CONTROLLER.patch similarity index 100% rename from target/linux/bmips/patches-5.10/001-v5.12-mips-bmips-select-ARCH_HAS_RESET_CONTROLLER.patch rename to target/linux/bmips/patches-5.10/001-v5.11-mips-bmips-select-ARCH_HAS_RESET_CONTROLLER.patch diff --git a/target/linux/bmips/patches-5.10/002-v5.12-dt-bindings-reset-add-BCM6345-reset-controller-bindi.patch b/target/linux/bmips/patches-5.10/002-v5.11-dt-bindings-reset-add-BCM6345-reset-controller-bindi.patch similarity index 100% rename from target/linux/bmips/patches-5.10/002-v5.12-dt-bindings-reset-add-BCM6345-reset-controller-bindi.patch rename to target/linux/bmips/patches-5.10/002-v5.11-dt-bindings-reset-add-BCM6345-reset-controller-bindi.patch diff --git a/target/linux/bmips/patches-5.10/003-v5.12-reset-add-BCM6345-reset-controller-driver.patch b/target/linux/bmips/patches-5.10/003-v5.11-reset-add-BCM6345-reset-controller-driver.patch similarity index 100% rename from target/linux/bmips/patches-5.10/003-v5.12-reset-add-BCM6345-reset-controller-driver.patch rename to target/linux/bmips/patches-5.10/003-v5.11-reset-add-BCM6345-reset-controller-driver.patch diff --git a/target/linux/bmips/patches-5.10/004-v5.12-mips-bmips-dts-add-BCM6328-reset-controller-support.patch b/target/linux/bmips/patches-5.10/004-v5.11-mips-bmips-dts-add-BCM6328-reset-controller-support.patch similarity index 100% rename from target/linux/bmips/patches-5.10/004-v5.12-mips-bmips-dts-add-BCM6328-reset-controller-support.patch rename to target/linux/bmips/patches-5.10/004-v5.11-mips-bmips-dts-add-BCM6328-reset-controller-support.patch diff --git a/target/linux/bmips/patches-5.10/005-v5.12-mips-bmips-dts-add-BCM6358-reset-controller-support.patch b/target/linux/bmips/patches-5.10/005-v5.11-mips-bmips-dts-add-BCM6358-reset-controller-support.patch similarity index 100% rename from target/linux/bmips/patches-5.10/005-v5.12-mips-bmips-dts-add-BCM6358-reset-controller-support.patch rename to target/linux/bmips/patches-5.10/005-v5.11-mips-bmips-dts-add-BCM6358-reset-controller-support.patch diff --git a/target/linux/bmips/patches-5.10/006-v5.12-mips-bmips-dts-add-BCM6362-reset-controller-support.patch b/target/linux/bmips/patches-5.10/006-v5.11-mips-bmips-dts-add-BCM6362-reset-controller-support.patch similarity index 100% rename from target/linux/bmips/patches-5.10/006-v5.12-mips-bmips-dts-add-BCM6362-reset-controller-support.patch rename to target/linux/bmips/patches-5.10/006-v5.11-mips-bmips-dts-add-BCM6362-reset-controller-support.patch diff --git a/target/linux/bmips/patches-5.10/007-v5.12-mips-bmips-dts-add-BCM6368-reset-controller-support.patch b/target/linux/bmips/patches-5.10/007-v5.11-mips-bmips-dts-add-BCM6368-reset-controller-support.patch similarity index 100% rename from target/linux/bmips/patches-5.10/007-v5.12-mips-bmips-dts-add-BCM6368-reset-controller-support.patch rename to target/linux/bmips/patches-5.10/007-v5.11-mips-bmips-dts-add-BCM6368-reset-controller-support.patch diff --git a/target/linux/bmips/patches-5.10/008-v5.12-mips-bmips-dts-add-BCM63268-reset-controller-support.patch b/target/linux/bmips/patches-5.10/008-v5.11-mips-bmips-dts-add-BCM63268-reset-controller-support.patch similarity index 100% rename from target/linux/bmips/patches-5.10/008-v5.12-mips-bmips-dts-add-BCM63268-reset-controller-support.patch rename to target/linux/bmips/patches-5.10/008-v5.11-mips-bmips-dts-add-BCM63268-reset-controller-support.patch diff --git a/target/linux/bmips/patches-5.10/009-v5.12-mips-bmips-add-BCM6318-reset-controller-definitions.patch b/target/linux/bmips/patches-5.10/009-v5.11-mips-bmips-add-BCM6318-reset-controller-definitions.patch similarity index 100% rename from target/linux/bmips/patches-5.10/009-v5.12-mips-bmips-add-BCM6318-reset-controller-definitions.patch rename to target/linux/bmips/patches-5.10/009-v5.11-mips-bmips-add-BCM6318-reset-controller-definitions.patch From c015d18cd7095ab0876484d2087c3e8add8674eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 23 Feb 2021 15:22:27 +0100 Subject: [PATCH 08/45] bmips: switch to accepted upstream patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch has been accepted and is going to be in linux v5.12. Signed-off-by: Álvaro Fernández Rojas --- ...v5.12-mips-bmips-init-clocks-earlier.patch | 25 +++++++++++++++++++ .../200-mips-bmips-init-clocks-earlier.patch | 8 ------ 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 target/linux/bmips/patches-5.10/040-v5.12-mips-bmips-init-clocks-earlier.patch delete mode 100644 target/linux/bmips/patches-5.10/200-mips-bmips-init-clocks-earlier.patch diff --git a/target/linux/bmips/patches-5.10/040-v5.12-mips-bmips-init-clocks-earlier.patch b/target/linux/bmips/patches-5.10/040-v5.12-mips-bmips-init-clocks-earlier.patch new file mode 100644 index 0000000000..7b9d92609f --- /dev/null +++ b/target/linux/bmips/patches-5.10/040-v5.12-mips-bmips-init-clocks-earlier.patch @@ -0,0 +1,25 @@ +From faf3c25e51a7e91b69ea26da72c74a8786af7968 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Mon, 22 Feb 2021 21:33:50 +0100 +Subject: [PATCH] mips: bmips: init clocks earlier +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +device_initcall() is too late for bcm63xx. +We need to call of_clk_init() earlier in order to properly boot. + +Signed-off-by: Álvaro Fernández Rojas +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/bmips/setup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/bmips/setup.c ++++ b/arch/mips/bmips/setup.c +@@ -201,4 +201,4 @@ static int __init plat_dev_init(void) + return 0; + } + +-device_initcall(plat_dev_init); ++arch_initcall(plat_dev_init); diff --git a/target/linux/bmips/patches-5.10/200-mips-bmips-init-clocks-earlier.patch b/target/linux/bmips/patches-5.10/200-mips-bmips-init-clocks-earlier.patch deleted file mode 100644 index ba58bff8d5..0000000000 --- a/target/linux/bmips/patches-5.10/200-mips-bmips-init-clocks-earlier.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- a/arch/mips/bmips/setup.c -+++ b/arch/mips/bmips/setup.c -@@ -201,4 +201,4 @@ static int __init plat_dev_init(void) - return 0; - } - --device_initcall(plat_dev_init); -+arch_initcall(plat_dev_init); From 4dd5845f4981c1dbecaf76ed695e28d6137cc7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 23 Feb 2021 15:25:13 +0100 Subject: [PATCH 09/45] bmips: fix SMP CPU mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SMP isn't supported on BCM6358 since it has a shared TLB. Some boards boot with CPU #1 instead of CPU #0, and this is currently not supported do to a smp-bmips bug. Signed-off-by: Álvaro Fernández Rojas --- .../200-mips-smp-bmips-fix-CPU-mappings.patch | 58 +++++++++++++++++++ .../202-irqchip-bcm6345-l1-intc-fix-smp.patch | 11 ---- 2 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 target/linux/bmips/patches-5.10/200-mips-smp-bmips-fix-CPU-mappings.patch delete mode 100644 target/linux/bmips/patches-5.10/202-irqchip-bcm6345-l1-intc-fix-smp.patch diff --git a/target/linux/bmips/patches-5.10/200-mips-smp-bmips-fix-CPU-mappings.patch b/target/linux/bmips/patches-5.10/200-mips-smp-bmips-fix-CPU-mappings.patch new file mode 100644 index 0000000000..16232f8b04 --- /dev/null +++ b/target/linux/bmips/patches-5.10/200-mips-smp-bmips-fix-CPU-mappings.patch @@ -0,0 +1,58 @@ +From 56e3adab09cbadb30045893c10ec2ff0d629bc6f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Tue, 23 Feb 2021 13:41:12 +0100 +Subject: [PATCH] mips: smp-bmips: fix CPU mappings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When booting bmips with SMP enabled on a BCM6358 running on CPU #1 instead of +CPU #0, the current CPU mapping code produces the following: +- smp_processor_id(): 0 +- cpu_logical_map(): 1 +- cpu_number_map(): 1 + +This is because SMP isn't supported on BCM6358 since it has a shared TLB, so +it is disabled and max_cpus is decreased from 2 to 1. + +Signed-off-by: Álvaro Fernández Rojas +--- + arch/mips/kernel/smp-bmips.c | 27 +++++++++++++++++---------- + 1 file changed, 17 insertions(+), 10 deletions(-) + +--- a/arch/mips/kernel/smp-bmips.c ++++ b/arch/mips/kernel/smp-bmips.c +@@ -134,17 +134,24 @@ static void __init bmips_smp_setup(void) + if (!board_ebase_setup) + board_ebase_setup = &bmips_ebase_setup; + +- __cpu_number_map[boot_cpu] = 0; +- __cpu_logical_map[0] = boot_cpu; ++ if (max_cpus > 1) { ++ __cpu_number_map[boot_cpu] = 0; ++ __cpu_logical_map[0] = boot_cpu; + +- for (i = 0; i < max_cpus; i++) { +- if (i != boot_cpu) { +- __cpu_number_map[i] = cpu; +- __cpu_logical_map[cpu] = i; +- cpu++; ++ for (i = 0; i < max_cpus; i++) { ++ if (i != boot_cpu) { ++ __cpu_number_map[i] = cpu; ++ __cpu_logical_map[cpu] = i; ++ cpu++; ++ } ++ set_cpu_possible(i, 1); ++ set_cpu_present(i, 1); + } +- set_cpu_possible(i, 1); +- set_cpu_present(i, 1); ++ } else { ++ __cpu_number_map[0] = boot_cpu; ++ __cpu_logical_map[0] = 0; ++ set_cpu_possible(0, 1); ++ set_cpu_possible(0, 1); + } + } + diff --git a/target/linux/bmips/patches-5.10/202-irqchip-bcm6345-l1-intc-fix-smp.patch b/target/linux/bmips/patches-5.10/202-irqchip-bcm6345-l1-intc-fix-smp.patch deleted file mode 100644 index f9001e685e..0000000000 --- a/target/linux/bmips/patches-5.10/202-irqchip-bcm6345-l1-intc-fix-smp.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/irqchip/irq-bcm6345-l1.c -+++ b/drivers/irqchip/irq-bcm6345-l1.c -@@ -121,7 +121,7 @@ static void bcm6345_l1_irq_handle(struct - unsigned int idx; - - #ifdef CONFIG_SMP -- cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; -+ cpu = intc->cpus[smp_processor_id()]; - #else - cpu = intc->cpus[0]; - #endif From dc6ac62046e7cd398c32c15c6de8321c2ae9e386 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 22 Feb 2021 17:37:07 +0000 Subject: [PATCH 10/45] kernel: 5.10: add further generic kconfig symbols This will make the specific kconfig smaller. Reviewed-by: Tomasz Maciej Nowak Tested-by: Tomasz Maciej Nowak Signed-off-by: Rui Salvaterra [improved commit title] Signed-off-by: Adrian Schmutzler --- target/linux/generic/config-5.10 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index 395e1098b5..36ab9dc66b 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -232,6 +232,7 @@ CONFIG_ARCH_MMAP_RND_BITS_MIN=8 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_MMP is not set +# CONFIG_ARCH_MSTARV7 is not set # CONFIG_ARCH_MULTIPLATFORM is not set # CONFIG_ARCH_MULTI_V6 is not set # CONFIG_ARCH_MULTI_V7 is not set @@ -1040,6 +1041,7 @@ CONFIG_CRYPTO_ALGAPI2=y # CONFIG_CRYPTO_CTR is not set # CONFIG_CRYPTO_CTS is not set # CONFIG_CRYPTO_CURVE25519 is not set +# CONFIG_CRYPTO_CURVE25519_NEON is not set # CONFIG_CRYPTO_DEFLATE is not set # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set @@ -1264,7 +1266,9 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set # CONFIG_DEBUG_TIMEKEEPING is not set # CONFIG_DEBUG_UART_8250_PALMCHIP is not set +# CONFIG_DEBUG_UART_8250_WORD is not set # CONFIG_DEBUG_UART_BCM63XX is not set +# CONFIG_DEBUG_UART_FLOW_CONTROL is not set # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_VIRTUAL is not set # CONFIG_DEBUG_VM is not set @@ -2906,6 +2910,7 @@ CONFIG_LEDS_TRIGGER_NETDEV=y # CONFIG_LEDS_TRIGGER_PATTERN is not set CONFIG_LEDS_TRIGGER_TIMER=y # CONFIG_LEDS_TRIGGER_TRANSIENT is not set +# CONFIG_LEDS_TURRIS_OMNIA is not set # CONFIG_LEDS_USER is not set # CONFIG_LED_TRIGGER_PHY is not set # CONFIG_LEGACY_PTYS is not set @@ -4742,6 +4747,7 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_RTC7301 is not set # CONFIG_RTC_DRV_RV3028 is not set # CONFIG_RTC_DRV_RV3029C2 is not set +# CONFIG_RTC_DRV_RV3032 is not set # CONFIG_RTC_DRV_RV8803 is not set # CONFIG_RTC_DRV_RX4581 is not set # CONFIG_RTC_DRV_RX6110 is not set @@ -4987,6 +4993,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_CORSAIR_CPRO is not set # CONFIG_SENSORS_DELL_SMM is not set # CONFIG_SENSORS_DME1737 is not set +# CONFIG_SENSORS_DRIVETEMP is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_DS620 is not set # CONFIG_SENSORS_EMC1403 is not set From 4d9ae8ca071565713934c5ae51f7ebb842f8df9e Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 22 Feb 2021 17:37:08 +0000 Subject: [PATCH 11/45] mvebu: refresh the 5.4 kernel configs Remove the implicit/inherited symbols. While not strictly necessary, this will make reviewing the diff between 5.4 and 5.10 easier. Reviewed-by: Tomasz Maciej Nowak Tested-by: Tomasz Maciej Nowak Signed-off-by: Rui Salvaterra --- target/linux/mvebu/config-5.4 | 74 +------------- target/linux/mvebu/cortexa53/config-5.4 | 122 +----------------------- target/linux/mvebu/cortexa72/config-5.4 | 111 ++++----------------- 3 files changed, 24 insertions(+), 283 deletions(-) diff --git a/target/linux/mvebu/config-5.4 b/target/linux/mvebu/config-5.4 index 2858408064..beeecd138e 100644 --- a/target/linux/mvebu/config-5.4 +++ b/target/linux/mvebu/config-5.4 @@ -2,22 +2,6 @@ CONFIG_AHCI_MVEBU=y CONFIG_ALIGNMENT_TRAP=y CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_ARCH_HAS_BINFMT_FLAT=y -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_KCOV=y -CONFIG_ARCH_HAS_KEEPINITRD=y -CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y -CONFIG_ARCH_HAS_PHYS_TO_DMA=y -CONFIG_ARCH_HAS_SETUP_DMA_OPS=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y @@ -28,16 +12,7 @@ CONFIG_ARCH_MVEBU=y CONFIG_ARCH_NR_GPIO=0 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y -CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_LIBATA_LEDS=y CONFIG_ARM=y CONFIG_ARMADA_370_CLK=y CONFIG_ARMADA_370_XP_IRQ=y @@ -70,8 +45,8 @@ CONFIG_ARM_UNWIND=y CONFIG_ARM_VIRT_EXT=y CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y CONFIG_ATA=y -CONFIG_ATA_LEDS=y CONFIG_ATAGS=y +CONFIG_ATA_LEDS=y CONFIG_AUTO_ZRELADDR=y CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y CONFIG_BLK_DEV_LOOP=y @@ -81,7 +56,6 @@ CONFIG_BLK_SCSI_REQUEST=y CONFIG_BOUNCE=y # CONFIG_CACHE_FEROCEON_L2 is not set CONFIG_CACHE_L2X0=y -CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y CONFIG_CLKSRC_MMIO=y @@ -207,6 +181,7 @@ CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y @@ -215,55 +190,14 @@ CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_GPIO_MVEBU=y CONFIG_GPIO_PCA953X=y CONFIG_GPIO_PCA953X_IRQ=y +CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARM_SCU=y -CONFIG_HAVE_ARM_SMCCC=y -CONFIG_HAVE_ARM_TWD=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_COPY_THREAD_TLS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_IDE=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_PCI=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_RSEQ=y CONFIG_HAVE_SMP=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_UID16=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HIGHMEM=y # CONFIG_HIGHPTE is not set CONFIG_HOTPLUG_CPU=y @@ -279,7 +213,6 @@ CONFIG_I2C_BOARDINFO=y CONFIG_I2C_CHARDEV=y CONFIG_I2C_MV64XXX=y # CONFIG_I2C_PXA is not set -# CONFIG_I2C_PXA_SLAVE is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y @@ -378,6 +311,7 @@ CONFIG_OUTER_CACHE=y CONFIG_OUTER_CACHE_SYNC=y CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y CONFIG_PCI=y CONFIG_PCI_BRIDGE_EMUL=y CONFIG_PCI_DOMAINS=y diff --git a/target/linux/mvebu/cortexa53/config-5.4 b/target/linux/mvebu/cortexa53/config-5.4 index cc44f997da..79d53932d0 100644 --- a/target/linux/mvebu/cortexa53/config-5.4 +++ b/target/linux/mvebu/cortexa53/config-5.4 @@ -1,47 +1,5 @@ CONFIG_64BIT=y -# CONFIG_ARCH_AGILEX is not set -# CONFIG_ARCH_BITMAIN is not set CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y -CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y -CONFIG_ARCH_HAS_FAST_MULTIPLIER=y -CONFIG_ARCH_HAS_GIGANTIC_PAGE=y -CONFIG_ARCH_HAS_PTE_DEVMAP=y -CONFIG_ARCH_HAS_PTE_SPECIAL=y -CONFIG_ARCH_HAS_SET_DIRECT_MAP=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y -CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y -CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y -CONFIG_ARCH_INLINE_READ_LOCK=y -CONFIG_ARCH_INLINE_READ_LOCK_BH=y -CONFIG_ARCH_INLINE_READ_LOCK_IRQ=y -CONFIG_ARCH_INLINE_READ_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_READ_UNLOCK=y -CONFIG_ARCH_INLINE_READ_UNLOCK_BH=y -CONFIG_ARCH_INLINE_READ_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_READ_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_INLINE_SPIN_LOCK=y -CONFIG_ARCH_INLINE_SPIN_LOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_LOCK_IRQ=y -CONFIG_ARCH_INLINE_SPIN_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_SPIN_TRYLOCK=y -CONFIG_ARCH_INLINE_SPIN_TRYLOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_INLINE_WRITE_LOCK=y -CONFIG_ARCH_INLINE_WRITE_LOCK_BH=y -CONFIG_ARCH_INLINE_WRITE_LOCK_IRQ=y -CONFIG_ARCH_INLINE_WRITE_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_BH=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE=y CONFIG_ARCH_MMAP_RND_BITS=18 CONFIG_ARCH_MMAP_RND_BITS_MAX=24 CONFIG_ARCH_MMAP_RND_BITS_MIN=18 @@ -50,42 +8,20 @@ CONFIG_ARCH_PROC_KCORE_TEXT=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y -CONFIG_ARCH_SUPPORTS_INT128=y -CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y -CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y -CONFIG_ARCH_USE_MEMREMAP_PROT=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -CONFIG_ARCH_WANT_FRAME_POINTERS=y -CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARM64=y -# CONFIG_ARM64_16K_PAGES is not set CONFIG_ARM64_4K_PAGES=y -# CONFIG_ARM64_64K_PAGES is not set CONFIG_ARM64_CONT_SHIFT=4 -# CONFIG_ARM64_CRYPTO is not set # CONFIG_ARM64_ERRATUM_1165522 is not set # CONFIG_ARM64_ERRATUM_1286807 is not set -# CONFIG_ARM64_HW_AFDBM is not set -# CONFIG_ARM64_MODULE_PLTS is not set CONFIG_ARM64_PAGE_SHIFT=12 -# CONFIG_ARM64_PAN is not set CONFIG_ARM64_PA_BITS=48 CONFIG_ARM64_PA_BITS_48=y -# CONFIG_ARM64_PMEM is not set -# CONFIG_ARM64_PSEUDO_NMI is not set -# CONFIG_ARM64_PTDUMP_DEBUGFS is not set CONFIG_ARM64_PTR_AUTH=y -# CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set CONFIG_ARM64_SSBD=y CONFIG_ARM64_SVE=y CONFIG_ARM64_TAGGED_ADDR_ABI=y -# CONFIG_ARM64_UAO is not set CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y -# CONFIG_ARM64_VA_BITS_48 is not set -# CONFIG_ARM64_VHE is not set CONFIG_ARMADA_37XX_CLK=y CONFIG_ARMADA_AP806_SYSCON=y CONFIG_ARMADA_AP_CP_HELPER=y @@ -101,18 +37,13 @@ CONFIG_ARM_GIC_V3_ITS_PCI=y # CONFIG_ARM_PL172_MPMC is not set # CONFIG_ARM_PSCI_CPUIDLE is not set CONFIG_ARM_PSCI_FW=y -# CONFIG_ARM_SP805_WATCHDOG is not set CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y # CONFIG_CAVIUM_TX2_ERRATUM_219 is not set -CONFIG_CC_HAS_KASAN_GENERIC=y +CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y # CONFIG_DEBUG_ALIGN_RODATA is not set CONFIG_DMA_DIRECT_REMAP=y CONFIG_DRM_RCAR_WRITEBACK=y -CONFIG_EFI_EARLYCON=y # CONFIG_FLATMEM_MANUAL is not set -CONFIG_FONT_8x16=y -CONFIG_FONT_AUTOSELECT=y -CONFIG_FONT_SUPPORT=y CONFIG_FRAME_POINTER=y # CONFIG_FUJITSU_ERRATUM_010001 is not set CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y @@ -120,52 +51,8 @@ CONFIG_GENERIC_CPU_VULNERABILITIES=y CONFIG_GENERIC_CSUM=y CONFIG_GENERIC_GETTIMEOFDAY=y CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y -CONFIG_HAVE_ARCH_HUGE_VMAP=y -CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y -CONFIG_HAVE_ARCH_KASAN=y -CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y -CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y -CONFIG_HAVE_ARCH_STACKLEAK=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARCH_VMAP_STACK=y -CONFIG_HAVE_ASM_MODVERSIONS=y -CONFIG_HAVE_CMPXCHG_DOUBLE=y -CONFIG_HAVE_CMPXCHG_LOCAL=y -CONFIG_HAVE_DEBUG_BUGVERBOSE=y -CONFIG_HAVE_FAST_GUP=y -CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y -CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y -CONFIG_HAVE_GENERIC_VDSO=y -CONFIG_HAVE_MEMORY_PRESENT=y -CONFIG_HAVE_PATA_PLATFORM=y -CONFIG_HAVE_RCU_TABLE_FREE=y CONFIG_HOLES_IN_ZONE=y -# CONFIG_HUGETLBFS is not set CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_INLINE_READ_LOCK=y -CONFIG_INLINE_READ_LOCK_BH=y -CONFIG_INLINE_READ_LOCK_IRQ=y -CONFIG_INLINE_READ_LOCK_IRQSAVE=y -CONFIG_INLINE_READ_UNLOCK_BH=y -CONFIG_INLINE_READ_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_SPIN_LOCK=y -CONFIG_INLINE_SPIN_LOCK_BH=y -CONFIG_INLINE_SPIN_LOCK_IRQ=y -CONFIG_INLINE_SPIN_LOCK_IRQSAVE=y -CONFIG_INLINE_SPIN_TRYLOCK=y -CONFIG_INLINE_SPIN_TRYLOCK_BH=y -CONFIG_INLINE_SPIN_UNLOCK_BH=y -CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_WRITE_LOCK=y -CONFIG_INLINE_WRITE_LOCK_BH=y -CONFIG_INLINE_WRITE_LOCK_IRQ=y -CONFIG_INLINE_WRITE_LOCK_IRQSAVE=y -CONFIG_INLINE_WRITE_UNLOCK_BH=y -CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE=y -CONFIG_KASAN_STACK=1 -# CONFIG_MEMORY_HOTPLUG is not set CONFIG_MFD_SYSCON=y CONFIG_MMC_SDHCI_XENON=y CONFIG_MODULES_USE_ELF_RELA=y @@ -175,7 +62,6 @@ CONFIG_MVEBU_ODMI=y CONFIG_MVEBU_PIC=y CONFIG_MVEBU_SEI=y CONFIG_NEED_SG_DMA_LENGTH=y -# CONFIG_NUMA is not set # CONFIG_OCTEONTX2_AF is not set CONFIG_PARTITION_PERCPU=y # CONFIG_PCIE_AL is not set @@ -187,16 +73,13 @@ CONFIG_PHY_MVEBU_A3700_UTMI=y CONFIG_PINCTRL_ARMADA_37XX=y CONFIG_PINCTRL_ARMADA_AP806=y CONFIG_PINCTRL_ARMADA_CP110=y -CONFIG_PLUGIN_HOSTCC="g++" CONFIG_POWER_RESET=y +# CONFIG_POWER_RESET_LINKSTATION is not set CONFIG_POWER_SUPPLY=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y -# CONFIG_RANDOMIZE_BASE is not set CONFIG_REGULATOR_GPIO=y CONFIG_RODATA_FULL_DEFAULT_ENABLED=y -CONFIG_SERIAL_8250_FSL=y -# CONFIG_SERIAL_AMBA_PL011 is not set CONFIG_SPARSEMEM=y CONFIG_SPARSEMEM_EXTREME=y CONFIG_SPARSEMEM_MANUAL=y @@ -207,7 +90,6 @@ CONFIG_SWIOTLB=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_SYS_SUPPORTS_HUGETLBFS=y CONFIG_THREAD_INFO_IN_TASK=y -CONFIG_UBSAN_ALIGNMENT=y CONFIG_UNMAP_KERNEL_AT_EL0=y CONFIG_VMAP_STACK=y CONFIG_ZONE_DMA32=y diff --git a/target/linux/mvebu/cortexa72/config-5.4 b/target/linux/mvebu/cortexa72/config-5.4 index 5727ae5918..db50baf1a9 100644 --- a/target/linux/mvebu/cortexa72/config-5.4 +++ b/target/linux/mvebu/cortexa72/config-5.4 @@ -1,37 +1,5 @@ CONFIG_64BIT=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -CONFIG_ARCH_HAS_FAST_MULTIPLIER=y -CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y -CONFIG_ARCH_HAS_PTE_SPECIAL=y -CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y -CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y -CONFIG_ARCH_INLINE_READ_LOCK=y -CONFIG_ARCH_INLINE_READ_LOCK_BH=y -CONFIG_ARCH_INLINE_READ_LOCK_IRQ=y -CONFIG_ARCH_INLINE_READ_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_READ_UNLOCK=y -CONFIG_ARCH_INLINE_READ_UNLOCK_BH=y -CONFIG_ARCH_INLINE_READ_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_READ_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_INLINE_SPIN_LOCK=y -CONFIG_ARCH_INLINE_SPIN_LOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_LOCK_IRQ=y -CONFIG_ARCH_INLINE_SPIN_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_SPIN_TRYLOCK=y -CONFIG_ARCH_INLINE_SPIN_TRYLOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_INLINE_WRITE_LOCK=y -CONFIG_ARCH_INLINE_WRITE_LOCK_BH=y -CONFIG_ARCH_INLINE_WRITE_LOCK_IRQ=y -CONFIG_ARCH_INLINE_WRITE_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_BH=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE=y CONFIG_ARCH_MMAP_RND_BITS=18 CONFIG_ARCH_MMAP_RND_BITS_MAX=24 CONFIG_ARCH_MMAP_RND_BITS_MIN=18 @@ -40,39 +8,23 @@ CONFIG_ARCH_PROC_KCORE_TEXT=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y -CONFIG_ARCH_SUPPORTS_INT128=y -CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y -CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_FRAME_POINTERS=y -CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARM64=y -# CONFIG_ARM64_16K_PAGES is not set CONFIG_ARM64_4K_PAGES=y -# CONFIG_ARM64_64K_PAGES is not set CONFIG_ARM64_CONT_SHIFT=4 -# CONFIG_ARM64_CRYPTO is not set -# CONFIG_ARM64_HW_AFDBM is not set -# CONFIG_ARM64_LSE_ATOMICS is not set +# CONFIG_ARM64_ERRATUM_1165522 is not set +# CONFIG_ARM64_ERRATUM_1286807 is not set CONFIG_ARM64_PAGE_SHIFT=12 -# CONFIG_ARM64_PAN is not set CONFIG_ARM64_PA_BITS=48 CONFIG_ARM64_PA_BITS_48=y -# CONFIG_ARM64_PMEM is not set -# CONFIG_ARM64_PTDUMP_DEBUGFS is not set -# CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set +# CONFIG_ARM64_PTR_AUTH is not set CONFIG_ARM64_SSBD=y CONFIG_ARM64_SVE=y -# CONFIG_ARM64_UAO is not set +# CONFIG_ARM64_TAGGED_ADDR_ABI is not set CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y -# CONFIG_ARM64_VA_BITS_48 is not set -# CONFIG_ARM64_VHE is not set CONFIG_ARMADA_37XX_CLK=y CONFIG_ARMADA_AP806_SYSCON=y +CONFIG_ARMADA_AP_CP_HELPER=y CONFIG_ARMADA_CP110_SYSCON=y CONFIG_ARM_AMBA=y CONFIG_ARM_ARCH_TIMER=y @@ -82,54 +34,25 @@ CONFIG_ARM_GIC_V3=y CONFIG_ARM_GIC_V3_ITS=y CONFIG_ARM_GIC_V3_ITS_PCI=y # CONFIG_ARM_PL172_MPMC is not set +# CONFIG_ARM_PSCI_CPUIDLE is not set CONFIG_ARM_PSCI_FW=y -# CONFIG_ARM_SP805_WATCHDOG is not set CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y +# CONFIG_CAVIUM_TX2_ERRATUM_219 is not set +CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y # CONFIG_DEBUG_ALIGN_RODATA is not set -CONFIG_DMA_DIRECT_OPS=y +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DRM_RCAR_WRITEBACK=y # CONFIG_FLATMEM_MANUAL is not set CONFIG_FRAME_POINTER=y +# CONFIG_FUJITSU_ERRATUM_010001 is not set CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_GETTIMEOFDAY=y CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y -CONFIG_HAVE_ARCH_HUGE_VMAP=y -CONFIG_HAVE_ARCH_KASAN=y -CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARCH_VMAP_STACK=y -CONFIG_HAVE_CMPXCHG_DOUBLE=y -CONFIG_HAVE_CMPXCHG_LOCAL=y -CONFIG_HAVE_DEBUG_BUGVERBOSE=y -CONFIG_HAVE_GENERIC_GUP=y -CONFIG_HAVE_MEMORY_PRESENT=y -CONFIG_HAVE_PATA_PLATFORM=y -CONFIG_HAVE_RCU_TABLE_FREE=y CONFIG_HOLES_IN_ZONE=y -# CONFIG_HUGETLBFS is not set CONFIG_HW_RANDOM_OMAP=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_INLINE_READ_LOCK=y -CONFIG_INLINE_READ_LOCK_BH=y -CONFIG_INLINE_READ_LOCK_IRQ=y -CONFIG_INLINE_READ_LOCK_IRQSAVE=y -CONFIG_INLINE_READ_UNLOCK_BH=y -CONFIG_INLINE_READ_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_SPIN_LOCK=y -CONFIG_INLINE_SPIN_LOCK_BH=y -CONFIG_INLINE_SPIN_LOCK_IRQ=y -CONFIG_INLINE_SPIN_LOCK_IRQSAVE=y -CONFIG_INLINE_SPIN_TRYLOCK=y -CONFIG_INLINE_SPIN_TRYLOCK_BH=y -CONFIG_INLINE_SPIN_UNLOCK_BH=y -CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_WRITE_LOCK=y -CONFIG_INLINE_WRITE_LOCK_BH=y -CONFIG_INLINE_WRITE_LOCK_IRQ=y -CONFIG_INLINE_WRITE_LOCK_IRQSAVE=y -CONFIG_INLINE_WRITE_UNLOCK_BH=y -CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE=y CONFIG_MARVELL_10G_PHY=y CONFIG_MFD_SYSCON=y CONFIG_MMC_SDHCI_XENON=y @@ -138,13 +61,15 @@ CONFIG_MVEBU_GICP=y CONFIG_MVEBU_ICU=y CONFIG_MVEBU_ODMI=y CONFIG_MVEBU_PIC=y +CONFIG_MVEBU_SEI=y CONFIG_MVPP2=y CONFIG_MV_XOR_V2=y CONFIG_NEED_SG_DMA_LENGTH=y -# CONFIG_NUMA is not set +# CONFIG_OCTEONTX2_AF is not set CONFIG_PARTITION_PERCPU=y CONFIG_PCIEAER=y CONFIG_PCIEPORTBUS=y +# CONFIG_PCIE_AL is not set CONFIG_PCIE_ARMADA_8K=y CONFIG_PCIE_DW=y CONFIG_PCIE_DW_HOST=y @@ -156,13 +81,13 @@ CONFIG_PINCTRL_ARMADA_37XX=y CONFIG_PINCTRL_ARMADA_AP806=y CONFIG_PINCTRL_ARMADA_CP110=y CONFIG_POWER_RESET=y +# CONFIG_POWER_RESET_LINKSTATION is not set CONFIG_POWER_SUPPLY=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y -# CONFIG_RANDOMIZE_BASE is not set CONFIG_RAS=y CONFIG_REGULATOR_GPIO=y -# CONFIG_SERIAL_AMBA_PL011 is not set +# CONFIG_RODATA_FULL_DEFAULT_ENABLED is not set CONFIG_SPARSEMEM=y CONFIG_SPARSEMEM_EXTREME=y CONFIG_SPARSEMEM_MANUAL=y From 202515b9015e1795ac2653c5c1d7100c4e2cac4d Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 22 Feb 2021 17:37:09 +0000 Subject: [PATCH 12/45] mvebu: copy 5.4 patches/kconfigs to 5.10 Just a simple copy, no refresh yet. Reviewed-by: Tomasz Maciej Nowak Tested-by: Tomasz Maciej Nowak Signed-off-by: Rui Salvaterra [do not duplicate files] Signed-off-by: Adrian Schmutzler --- target/linux/mvebu/config-5.10 | 430 ++++++++++ target/linux/mvebu/cortexa53/config-5.10 | 95 +++ target/linux/mvebu/cortexa72/config-5.10 | 102 +++ ...t-for-endpoint-to-be-ready-before-tr.patch | 50 ++ ...-t-rely-on-jiffies-while-holding-spi.patch | 54 ++ ...ntroduce-mvneta_update_stats-routine.patch | 95 +++ ...duce-page-pool-API-for-sw-buffer-man.patch | 181 ++++ ...on-build_skb-in-mvneta_rx_swbm-poll-.patch | 303 +++++++ ...006-net-mvneta-add-basic-XDP-support.patch | 311 +++++++ ...avoid_error_message_for_optional_IRQ.patch | 31 + ...header-prefetch-in-mvneta_swbm_rx_fr.patch | 43 + ...mvneta-make-tx-buffer-array-agnostic.patch | 210 +++++ .../009-net-mvneta-add-XDP_TX-support.patch | 175 ++++ ...fix-build-skb-for-bm-capable-devices.patch | 41 + ...-arm64-dts-uDPU-remove-i2c-fast-mode.patch | 31 + ...ts-uDPU-SFP-cages-support-3W-modules.patch | 34 + ...on-page_pool_recycle_direct-in-mvnet.patch | 39 + ...sallow-XDP-program-on-hardware-buffe.patch | 53 ++ ...DP-support-if-sw-bm-is-used-as-fallb.patch | 67 ++ ...in-link-immediately-after-enabling-t.patch | 60 ++ ...7-PCI-aardvark-Improve-link-training.patch | 208 +++++ ...18-PCI-aardvark-Issue-PERST-via-GPIO.patch | 123 +++ .../019-PCI-aardvark-Add-PHY-support.patch | 152 ++++ ...l-armada-37xx-Set-pcie_reset_pin-to-.patch | 93 +++ ...l-armada-37xx-Move-PCIe-comphy-handl.patch | 57 ++ ...l-armada-37xx-Move-PCIe-max-link-spe.patch | 44 + ...-arm64-dts-add-uDPU-i2c-bus-recovery.patch | 53 ++ ...-t-touch-PCIe-registers-if-no-card-c.patch | 50 ++ ...add-driver-for-LinkStation-power-off.patch | 207 +++++ ...-initialization-with-old-Marvell-s-A.patch | 44 + ...l-espressobin-Add-ethernet-switch-al.patch | 88 ++ ...s-mcbin-singleshot-add-heartbeat-LED.patch | 65 ++ ...Mangle-bootloader-s-kernel-arguments.patch | 208 +++++ ...-mvebu-armada-38x-enable-libata-leds.patch | 10 + .../patches-5.10/302-add_powertables.patch | 770 ++++++++++++++++++ ...3-linksys_hardcode_nand_ecc_settings.patch | 17 + .../patches-5.10/304-revert_i2c_delay.patch | 15 + .../305-armada-385-rd-mtd-partitions.patch | 19 + .../306-ARM-mvebu-385-ap-Add-partitions.patch | 35 + ...-armada-xp-linksys-mamba-broken-idle.patch | 10 + .../308-armada-xp-linksys-mamba-wan.patch | 11 + .../patches-5.10/309-linksys-status-led.patch | 50 ++ .../310-linksys-use-eth0-as-cpu-port.patch | 25 + .../311-adjust-compatible-for-linksys.patch | 68 ++ ...da388-clearfog-emmc-on-clearfog-base.patch | 87 ++ .../312-helios4-dts-status-led-alias.patch | 28 + ...ts-marvell-armada37xx-Add-eth0-alias.patch | 20 + ...l-armada-3720-espressobin-add-ports-.patch | 26 + ...witch-PHY-operation-mode-to-2500base.patch | 34 + .../patches-5.10/400-find_active_root.patch | 60 ++ .../700-mvneta-tx-queue-workaround.patch | 34 + ...dicate-failure-to-enter-deeper-sleep.patch | 40 + ...-pci-mvebu-time-out-reset-on-link-up.patch | 60 ++ 53 files changed, 5216 insertions(+) create mode 100644 target/linux/mvebu/config-5.10 create mode 100644 target/linux/mvebu/cortexa53/config-5.10 create mode 100644 target/linux/mvebu/cortexa72/config-5.10 create mode 100644 target/linux/mvebu/patches-5.10/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch create mode 100644 target/linux/mvebu/patches-5.10/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch create mode 100644 target/linux/mvebu/patches-5.10/003-net-mvneta-introduce-mvneta_update_stats-routine.patch create mode 100644 target/linux/mvebu/patches-5.10/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch create mode 100644 target/linux/mvebu/patches-5.10/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch create mode 100644 target/linux/mvebu/patches-5.10/006-net-mvneta-add-basic-XDP-support.patch create mode 100644 target/linux/mvebu/patches-5.10/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch create mode 100644 target/linux/mvebu/patches-5.10/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch create mode 100644 target/linux/mvebu/patches-5.10/008-net-mvneta-make-tx-buffer-array-agnostic.patch create mode 100644 target/linux/mvebu/patches-5.10/009-net-mvneta-add-XDP_TX-support.patch create mode 100644 target/linux/mvebu/patches-5.10/010-net-mvneta-fix-build-skb-for-bm-capable-devices.patch create mode 100644 target/linux/mvebu/patches-5.10/011-arm64-dts-uDPU-remove-i2c-fast-mode.patch create mode 100644 target/linux/mvebu/patches-5.10/012-arm64-dts-uDPU-SFP-cages-support-3W-modules.patch create mode 100644 target/linux/mvebu/patches-5.10/013-net-mvneta-rely-on-page_pool_recycle_direct-in-mvnet.patch create mode 100644 target/linux/mvebu/patches-5.10/014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch create mode 100644 target/linux/mvebu/patches-5.10/015-net-mvneta-fix-XDP-support-if-sw-bm-is-used-as-fallb.patch create mode 100644 target/linux/mvebu/patches-5.10/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch create mode 100644 target/linux/mvebu/patches-5.10/017-PCI-aardvark-Improve-link-training.patch create mode 100644 target/linux/mvebu/patches-5.10/018-PCI-aardvark-Issue-PERST-via-GPIO.patch create mode 100644 target/linux/mvebu/patches-5.10/019-PCI-aardvark-Add-PHY-support.patch create mode 100644 target/linux/mvebu/patches-5.10/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch create mode 100644 target/linux/mvebu/patches-5.10/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch create mode 100644 target/linux/mvebu/patches-5.10/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch create mode 100644 target/linux/mvebu/patches-5.10/023-arm64-dts-add-uDPU-i2c-bus-recovery.patch create mode 100644 target/linux/mvebu/patches-5.10/024-PCI-aardvark-Don-t-touch-PCIe-registers-if-no-card-c.patch create mode 100644 target/linux/mvebu/patches-5.10/025-power-reset-add-driver-for-LinkStation-power-off.patch create mode 100644 target/linux/mvebu/patches-5.10/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch create mode 100644 target/linux/mvebu/patches-5.10/027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch create mode 100644 target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch create mode 100644 target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch create mode 100644 target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch create mode 100644 target/linux/mvebu/patches-5.10/302-add_powertables.patch create mode 100644 target/linux/mvebu/patches-5.10/303-linksys_hardcode_nand_ecc_settings.patch create mode 100644 target/linux/mvebu/patches-5.10/304-revert_i2c_delay.patch create mode 100644 target/linux/mvebu/patches-5.10/305-armada-385-rd-mtd-partitions.patch create mode 100644 target/linux/mvebu/patches-5.10/306-ARM-mvebu-385-ap-Add-partitions.patch create mode 100644 target/linux/mvebu/patches-5.10/307-armada-xp-linksys-mamba-broken-idle.patch create mode 100644 target/linux/mvebu/patches-5.10/308-armada-xp-linksys-mamba-wan.patch create mode 100644 target/linux/mvebu/patches-5.10/309-linksys-status-led.patch create mode 100644 target/linux/mvebu/patches-5.10/310-linksys-use-eth0-as-cpu-port.patch create mode 100644 target/linux/mvebu/patches-5.10/311-adjust-compatible-for-linksys.patch create mode 100644 target/linux/mvebu/patches-5.10/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch create mode 100644 target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch create mode 100644 target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch create mode 100644 target/linux/mvebu/patches-5.10/315-arm64-dts-marvell-armada-3720-espressobin-add-ports-.patch create mode 100644 target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch create mode 100644 target/linux/mvebu/patches-5.10/400-find_active_root.patch create mode 100644 target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch create mode 100644 target/linux/mvebu/patches-5.10/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch create mode 100644 target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch diff --git a/target/linux/mvebu/config-5.10 b/target/linux/mvebu/config-5.10 new file mode 100644 index 0000000000..beeecd138e --- /dev/null +++ b/target/linux/mvebu/config-5.10 @@ -0,0 +1,430 @@ +CONFIG_AHCI_MVEBU=y +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_MVEBU=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM=y +CONFIG_ARMADA_370_CLK=y +CONFIG_ARMADA_370_XP_IRQ=y +CONFIG_ARMADA_370_XP_TIMER=y +# CONFIG_ARMADA_37XX_WATCHDOG is not set +CONFIG_ARMADA_38X_CLK=y +CONFIG_ARMADA_THERMAL=y +CONFIG_ARMADA_XP_CLK=y +CONFIG_ARM_APPENDED_DTB=y +# CONFIG_ARM_ARMADA_37XX_CPUFREQ is not set +# CONFIG_ARM_ARMADA_8K_CPUFREQ is not set +CONFIG_ARM_ATAG_DTB_COMPAT=y +# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_ERRATA_720789=y +CONFIG_ARM_ERRATA_764369=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GLOBAL_TIMER=y +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +CONFIG_ARM_MVEBU_V7_CPUIDLE=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_UNWIND=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y +CONFIG_ATA=y +CONFIG_ATAGS=y +CONFIG_ATA_LEDS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BOUNCE=y +# CONFIG_CACHE_FEROCEON_L2 is not set +CONFIG_CACHE_L2X0=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_PJ4B=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SPECTRE=y +CONFIG_CPU_THERMAL=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRC16=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_AES_ARM=y +CONFIG_CRYPTO_AES_ARM_BS=y +CONFIG_CRYPTO_AUTHENC=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_CRYPTD=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_MARVELL_CESA=y +CONFIG_CRYPTO_ESSIV=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_SHA1=y +CONFIG_CRYPTO_SHA1_ARM=y +CONFIG_CRYPTO_SHA1_ARM_NEON=y +CONFIG_CRYPTO_SHA256_ARM=y +CONFIG_CRYPTO_SHA512_ARM=y +CONFIG_CRYPTO_SIMD=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_MVEBU_UART0=y +# CONFIG_DEBUG_MVEBU_UART0_ALTERNATE is not set +# CONFIG_DEBUG_MVEBU_UART1_ALTERNATE is not set +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0xd0012000 +CONFIG_DEBUG_UART_VIRT=0xfec12000 +CONFIG_DEBUG_UNCOMPRESS=y +CONFIG_DEBUG_USER=y +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_ENGINE_RAID=y +CONFIG_DMA_OF=y +CONFIG_DMA_REMAP=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXT4_FS=y +CONFIG_EXTCON=y +CONFIG_F2FS_FS=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ARCH_TOPOLOGY=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GLOB=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_GENERIC_PLATFORM=y +CONFIG_GPIO_MVEBU=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y +CONFIG_GRO_CELLS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_SMP=y +CONFIG_HIGHMEM=y +# CONFIG_HIGHPTE is not set +CONFIG_HOTPLUG_CPU=y +CONFIG_HWBM=y +CONFIG_HWMON=y +CONFIG_HW_RANDOM=y +CONFIG_HZ=100 +CONFIG_HZ_100=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MV64XXX=y +# CONFIG_I2C_PXA is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_IWMMXT is not set +CONFIG_JBD2=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_PCA963X=y +CONFIG_LEDS_TLC591XX=y +CONFIG_LEDS_TRIGGER_DISK=y +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MACH_ARMADA_370=y +# CONFIG_MACH_ARMADA_375 is not set +CONFIG_MACH_ARMADA_38X=y +# CONFIG_MACH_ARMADA_39X is not set +CONFIG_MACH_ARMADA_XP=y +# CONFIG_MACH_DOVE is not set +CONFIG_MACH_MVEBU_ANY=y +CONFIG_MACH_MVEBU_V7=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MANGLE_BOOTARGS=y +CONFIG_MARVELL_PHY=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_I2C=y +CONFIG_MEMFD_CREATE=y +CONFIG_MEMORY=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_MVSDIO=y +CONFIG_MMC_SDHCI=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_PXAV3=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_ECC_SW_HAMMING=y +CONFIG_MTD_NAND_MARVELL=y +CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_MVEBU_CLK_COMMON=y +CONFIG_MVEBU_CLK_COREDIV=y +CONFIG_MVEBU_CLK_CPU=y +CONFIG_MVEBU_DEVBUS=y +CONFIG_MVEBU_MBUS=y +CONFIG_MVMDIO=y +CONFIG_MVNETA=y +CONFIG_MVNETA_BM=y +CONFIG_MVNETA_BM_ENABLE=y +# CONFIG_MVPP2 is not set +CONFIG_MV_XOR=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEON=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_MV88E6XXX=y +CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y +# CONFIG_NET_DSA_MV88E6XXX_PTP is not set +CONFIG_NET_DSA_TAG_DSA=y +CONFIG_NET_DSA_TAG_EDSA=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_SWITCHDEV=y +CONFIG_NLS=y +CONFIG_NOP_USB_XCEIV=y +CONFIG_NR_CPUS=4 +CONFIG_NVMEM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_ORION_WATCHDOG=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PCI=y +CONFIG_PCI_BRIDGE_EMUL=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCI_MVEBU=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLINK=y +# CONFIG_PHY_MVEBU_A3700_COMPHY is not set +# CONFIG_PHY_MVEBU_A3700_UTMI is not set +CONFIG_PHY_MVEBU_A38X_COMPHY=y +# CONFIG_PHY_MVEBU_CP110_COMPHY is not set +CONFIG_PINCTRL=y +CONFIG_PINCTRL_ARMADA_370=y +CONFIG_PINCTRL_ARMADA_38X=y +CONFIG_PINCTRL_ARMADA_XP=y +CONFIG_PINCTRL_MVEBU=y +# CONFIG_PINCTRL_SINGLE is not set +CONFIG_PJ4B_ERRATA_4742=y +CONFIG_PL310_ERRATA_753970=y +CONFIG_PLAT_ORION=y +CONFIG_PM_OPP=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=11 +CONFIG_PWM=y +CONFIG_PWM_SYSFS=y +CONFIG_RATIONAL=y +CONFIG_RCU_NEED_SEGCBLIST=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_REFCOUNT_FULL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_ARMADA38X=y +CONFIG_RTC_DRV_MV=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_SATA_MV=y +CONFIG_SATA_PMP=y +CONFIG_SCSI=y +# CONFIG_SENSORS_DRIVETEMP is not set +CONFIG_SENSORS_PWM_FAN=y +CONFIG_SENSORS_TMP421=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_8250_DWLIB=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_MVEBU_CONSOLE=y +CONFIG_SERIAL_MVEBU_UART=y +CONFIG_SFP=y +CONFIG_SGL_ALLOC=y +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SOC_BUS=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +# CONFIG_SPI_ARMADA_3700 is not set +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SPI_ORION=y +CONFIG_SRAM=y +CONFIG_SRAM_EXEC=y +CONFIG_SRCU=y +CONFIG_SWPHY=y +CONFIG_SWP_EMULATE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_OF=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNWINDER_ARM=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_ORION=y +CONFIG_USB_EHCI_HCD_PLATFORM=y +CONFIG_USB_LEDS_TRIGGER_USBPORT=y +CONFIG_USB_PHY=y +CONFIG_USB_STORAGE=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_MVEBU=y +CONFIG_USB_XHCI_PLATFORM=y +CONFIG_USE_OF=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_WATCHDOG_CORE=y +CONFIG_XPS=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/mvebu/cortexa53/config-5.10 b/target/linux/mvebu/cortexa53/config-5.10 new file mode 100644 index 0000000000..79d53932d0 --- /dev/null +++ b/target/linux/mvebu/cortexa53/config-5.10 @@ -0,0 +1,95 @@ +CONFIG_64BIT=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_MMAP_RND_BITS=18 +CONFIG_ARCH_MMAP_RND_BITS_MAX=24 +CONFIG_ARCH_MMAP_RND_BITS_MIN=18 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_PROC_KCORE_TEXT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARM64=y +CONFIG_ARM64_4K_PAGES=y +CONFIG_ARM64_CONT_SHIFT=4 +# CONFIG_ARM64_ERRATUM_1165522 is not set +# CONFIG_ARM64_ERRATUM_1286807 is not set +CONFIG_ARM64_PAGE_SHIFT=12 +CONFIG_ARM64_PA_BITS=48 +CONFIG_ARM64_PA_BITS_48=y +CONFIG_ARM64_PTR_AUTH=y +CONFIG_ARM64_SSBD=y +CONFIG_ARM64_SVE=y +CONFIG_ARM64_TAGGED_ADDR_ABI=y +CONFIG_ARM64_VA_BITS=39 +CONFIG_ARM64_VA_BITS_39=y +CONFIG_ARMADA_37XX_CLK=y +CONFIG_ARMADA_AP806_SYSCON=y +CONFIG_ARMADA_AP_CP_HELPER=y +CONFIG_ARMADA_CP110_SYSCON=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_ARMADA_37XX_CPUFREQ=y +CONFIG_ARM_GIC_V2M=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_GIC_V3_ITS=y +CONFIG_ARM_GIC_V3_ITS_PCI=y +# CONFIG_ARM_PL172_MPMC is not set +# CONFIG_ARM_PSCI_CPUIDLE is not set +CONFIG_ARM_PSCI_FW=y +CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y +# CONFIG_CAVIUM_TX2_ERRATUM_219 is not set +CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y +# CONFIG_DEBUG_ALIGN_RODATA is not set +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DRM_RCAR_WRITEBACK=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_FRAME_POINTER=y +# CONFIG_FUJITSU_ERRATUM_010001 is not set +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_HOLES_IN_ZONE=y +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +CONFIG_MFD_SYSCON=y +CONFIG_MMC_SDHCI_XENON=y +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_MVEBU_GICP=y +CONFIG_MVEBU_ICU=y +CONFIG_MVEBU_ODMI=y +CONFIG_MVEBU_PIC=y +CONFIG_MVEBU_SEI=y +CONFIG_NEED_SG_DMA_LENGTH=y +# CONFIG_OCTEONTX2_AF is not set +CONFIG_PARTITION_PERCPU=y +# CONFIG_PCIE_AL is not set +CONFIG_PCI_AARDVARK=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_PHY_MVEBU_A3700_COMPHY=y +CONFIG_PHY_MVEBU_A3700_UTMI=y +CONFIG_PINCTRL_ARMADA_37XX=y +CONFIG_PINCTRL_ARMADA_AP806=y +CONFIG_PINCTRL_ARMADA_CP110=y +CONFIG_POWER_RESET=y +# CONFIG_POWER_RESET_LINKSTATION is not set +CONFIG_POWER_SUPPLY=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_REGULATOR_GPIO=y +CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPI_ARMADA_3700=y +CONFIG_SWIOTLB=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_UNMAP_KERNEL_AT_EL0=y +CONFIG_VMAP_STACK=y +CONFIG_ZONE_DMA32=y diff --git a/target/linux/mvebu/cortexa72/config-5.10 b/target/linux/mvebu/cortexa72/config-5.10 new file mode 100644 index 0000000000..db50baf1a9 --- /dev/null +++ b/target/linux/mvebu/cortexa72/config-5.10 @@ -0,0 +1,102 @@ +CONFIG_64BIT=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_MMAP_RND_BITS=18 +CONFIG_ARCH_MMAP_RND_BITS_MAX=24 +CONFIG_ARCH_MMAP_RND_BITS_MIN=18 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_PROC_KCORE_TEXT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARM64=y +CONFIG_ARM64_4K_PAGES=y +CONFIG_ARM64_CONT_SHIFT=4 +# CONFIG_ARM64_ERRATUM_1165522 is not set +# CONFIG_ARM64_ERRATUM_1286807 is not set +CONFIG_ARM64_PAGE_SHIFT=12 +CONFIG_ARM64_PA_BITS=48 +CONFIG_ARM64_PA_BITS_48=y +# CONFIG_ARM64_PTR_AUTH is not set +CONFIG_ARM64_SSBD=y +CONFIG_ARM64_SVE=y +# CONFIG_ARM64_TAGGED_ADDR_ABI is not set +CONFIG_ARM64_VA_BITS=39 +CONFIG_ARM64_VA_BITS_39=y +CONFIG_ARMADA_37XX_CLK=y +CONFIG_ARMADA_AP806_SYSCON=y +CONFIG_ARMADA_AP_CP_HELPER=y +CONFIG_ARMADA_CP110_SYSCON=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_GIC_V2M=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_GIC_V3_ITS=y +CONFIG_ARM_GIC_V3_ITS_PCI=y +# CONFIG_ARM_PL172_MPMC is not set +# CONFIG_ARM_PSCI_CPUIDLE is not set +CONFIG_ARM_PSCI_FW=y +CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y +# CONFIG_CAVIUM_TX2_ERRATUM_219 is not set +CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y +# CONFIG_DEBUG_ALIGN_RODATA is not set +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DRM_RCAR_WRITEBACK=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_FRAME_POINTER=y +# CONFIG_FUJITSU_ERRATUM_010001 is not set +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_HOLES_IN_ZONE=y +CONFIG_HW_RANDOM_OMAP=y +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +CONFIG_MARVELL_10G_PHY=y +CONFIG_MFD_SYSCON=y +CONFIG_MMC_SDHCI_XENON=y +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_MVEBU_GICP=y +CONFIG_MVEBU_ICU=y +CONFIG_MVEBU_ODMI=y +CONFIG_MVEBU_PIC=y +CONFIG_MVEBU_SEI=y +CONFIG_MVPP2=y +CONFIG_MV_XOR_V2=y +CONFIG_NEED_SG_DMA_LENGTH=y +# CONFIG_OCTEONTX2_AF is not set +CONFIG_PARTITION_PERCPU=y +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +# CONFIG_PCIE_AL is not set +CONFIG_PCIE_ARMADA_8K=y +CONFIG_PCIE_DW=y +CONFIG_PCIE_DW_HOST=y +# CONFIG_PCI_AARDVARK is not set +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_PHY_MVEBU_CP110_COMPHY=y +CONFIG_PINCTRL_ARMADA_37XX=y +CONFIG_PINCTRL_ARMADA_AP806=y +CONFIG_PINCTRL_ARMADA_CP110=y +CONFIG_POWER_RESET=y +# CONFIG_POWER_RESET_LINKSTATION is not set +CONFIG_POWER_SUPPLY=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_RAS=y +CONFIG_REGULATOR_GPIO=y +# CONFIG_RODATA_FULL_DEFAULT_ENABLED is not set +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SWIOTLB=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_UNMAP_KERNEL_AT_EL0=y +CONFIG_VMAP_STACK=y +CONFIG_ZONE_DMA32=y diff --git a/target/linux/mvebu/patches-5.10/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch b/target/linux/mvebu/patches-5.10/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch new file mode 100644 index 0000000000..95abbce002 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch @@ -0,0 +1,50 @@ +From f4c7d053d7f77cd5c1a1ba7c7ce085ddba13d1d7 Mon Sep 17 00:00:00 2001 +From: Remi Pommarel +Date: Wed, 22 May 2019 23:33:50 +0200 +Subject: [PATCH] PCI: aardvark: Wait for endpoint to be ready before training + link + +When configuring pcie reset pin from gpio (e.g. initially set by +u-boot) to pcie function this pin goes low for a brief moment +asserting the PERST# signal. Thus connected device enters fundamental +reset process and link configuration can only begin after a minimal +100ms delay (see [1]). + +Because the pin configuration comes from the "default" pinctrl it is +implicitly configured before the probe callback is called: + +driver_probe_device() + really_probe() + ... + pinctrl_bind_pins() /* Here pin goes from gpio to PCIE reset + function and PERST# is asserted */ + ... + drv->probe() + +[1] "PCI Express Base Specification", REV. 4.0 + PCI Express, February 19 2014, 6.6.1 Conventional Reset + +Signed-off-by: Remi Pommarel +Signed-off-by: Lorenzo Pieralisi +Acked-by: Thomas Petazzoni +--- + drivers/pci/controller/pci-aardvark.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -337,6 +337,14 @@ static void advk_pcie_setup_hw(struct ad + reg |= PIO_CTRL_ADDR_WIN_DISABLE; + advk_writel(pcie, reg, PIO_CTRL); + ++ /* ++ * PERST# signal could have been asserted by pinctrl subsystem before ++ * probe() callback has been called, making the endpoint going into ++ * fundamental reset. As required by PCI Express spec a delay for at ++ * least 100ms after such a reset before link training is needed. ++ */ ++ msleep(PCI_PM_D3COLD_WAIT); ++ + /* Start link training */ + reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); + reg |= PCIE_CORE_LINK_TRAINING; diff --git a/target/linux/mvebu/patches-5.10/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch b/target/linux/mvebu/patches-5.10/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch new file mode 100644 index 0000000000..db4afd22a2 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch @@ -0,0 +1,54 @@ +From 7fbcb5da811be7d47468417c7795405058abb3da Mon Sep 17 00:00:00 2001 +From: Remi Pommarel +Date: Fri, 27 Sep 2019 10:55:02 +0200 +Subject: [PATCH] PCI: aardvark: Don't rely on jiffies while holding spinlock + +advk_pcie_wait_pio() can be called while holding a spinlock (from +pci_bus_read_config_dword()), then depends on jiffies in order to +timeout while polling on PIO state registers. In the case the PIO +transaction failed, the timeout will never happen and will also cause +the cpu to stall. + +This decrements a variable and wait instead of using jiffies. + +Signed-off-by: Remi Pommarel +Signed-off-by: Lorenzo Pieralisi +Reviewed-by: Andrew Murray +Acked-by: Thomas Petazzoni +--- + drivers/pci/controller/pci-aardvark.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -175,7 +175,8 @@ + (PCIE_CONF_BUS(bus) | PCIE_CONF_DEV(PCI_SLOT(devfn)) | \ + PCIE_CONF_FUNC(PCI_FUNC(devfn)) | PCIE_CONF_REG(where)) + +-#define PIO_TIMEOUT_MS 1 ++#define PIO_RETRY_CNT 500 ++#define PIO_RETRY_DELAY 2 /* 2 us*/ + + #define LINK_WAIT_MAX_RETRIES 10 + #define LINK_WAIT_USLEEP_MIN 90000 +@@ -400,17 +401,16 @@ static void advk_pcie_check_pio_status(s + static int advk_pcie_wait_pio(struct advk_pcie *pcie) + { + struct device *dev = &pcie->pdev->dev; +- unsigned long timeout; ++ int i; + +- timeout = jiffies + msecs_to_jiffies(PIO_TIMEOUT_MS); +- +- while (time_before(jiffies, timeout)) { ++ for (i = 0; i < PIO_RETRY_CNT; i++) { + u32 start, isr; + + start = advk_readl(pcie, PIO_START); + isr = advk_readl(pcie, PIO_ISR); + if (!start && isr) + return 0; ++ udelay(PIO_RETRY_DELAY); + } + + dev_err(dev, "config read/write timed out\n"); diff --git a/target/linux/mvebu/patches-5.10/003-net-mvneta-introduce-mvneta_update_stats-routine.patch b/target/linux/mvebu/patches-5.10/003-net-mvneta-introduce-mvneta_update_stats-routine.patch new file mode 100644 index 0000000000..f6ce6163cf --- /dev/null +++ b/target/linux/mvebu/patches-5.10/003-net-mvneta-introduce-mvneta_update_stats-routine.patch @@ -0,0 +1,95 @@ +From ff519e2acd463bff6c5bb4e8d7ed350c9bae885b Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 19 Oct 2019 10:13:21 +0200 +Subject: [PATCH 1/7] net: mvneta: introduce mvneta_update_stats routine + +Introduce mvneta_update_stats routine to collect {rx/tx} statistics +(packets and bytes). This is a preliminary patch to add XDP support to +mvneta driver + +Signed-off-by: Lorenzo Bianconi +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 43 ++++++++++++++------------- + 1 file changed, 22 insertions(+), 21 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -1913,6 +1913,23 @@ static void mvneta_rxq_drop_pkts(struct + } + } + ++static void ++mvneta_update_stats(struct mvneta_port *pp, u32 pkts, ++ u32 len, bool tx) ++{ ++ struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); ++ ++ u64_stats_update_begin(&stats->syncp); ++ if (tx) { ++ stats->tx_packets += pkts; ++ stats->tx_bytes += len; ++ } else { ++ stats->rx_packets += pkts; ++ stats->rx_bytes += len; ++ } ++ u64_stats_update_end(&stats->syncp); ++} ++ + static inline + int mvneta_rx_refill_queue(struct mvneta_port *pp, struct mvneta_rx_queue *rxq) + { +@@ -2093,14 +2110,8 @@ static int mvneta_rx_swbm(struct napi_st + rxq->left_size = 0; + } + +- if (rcvd_pkts) { +- struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); +- +- u64_stats_update_begin(&stats->syncp); +- stats->rx_packets += rcvd_pkts; +- stats->rx_bytes += rcvd_bytes; +- u64_stats_update_end(&stats->syncp); +- } ++ if (rcvd_pkts) ++ mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false); + + /* return some buffers to hardware queue, one at a time is too slow */ + refill = mvneta_rx_refill_queue(pp, rxq); +@@ -2223,14 +2234,8 @@ err_drop_frame: + napi_gro_receive(napi, skb); + } + +- if (rcvd_pkts) { +- struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); +- +- u64_stats_update_begin(&stats->syncp); +- stats->rx_packets += rcvd_pkts; +- stats->rx_bytes += rcvd_bytes; +- u64_stats_update_end(&stats->syncp); +- } ++ if (rcvd_pkts) ++ mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false); + + /* Update rxq management counters */ + mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_done); +@@ -2476,7 +2481,6 @@ static netdev_tx_t mvneta_tx(struct sk_b + + out: + if (frags > 0) { +- struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); + struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id); + + netdev_tx_sent_queue(nq, len); +@@ -2491,10 +2495,7 @@ out: + else + txq->pending += frags; + +- u64_stats_update_begin(&stats->syncp); +- stats->tx_packets++; +- stats->tx_bytes += len; +- u64_stats_update_end(&stats->syncp); ++ mvneta_update_stats(pp, 1, len, true); + } else { + dev->stats.tx_dropped++; + dev_kfree_skb_any(skb); diff --git a/target/linux/mvebu/patches-5.10/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch b/target/linux/mvebu/patches-5.10/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch new file mode 100644 index 0000000000..fbcae20f74 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch @@ -0,0 +1,181 @@ +From 568a3fa24a95476d40afe3f8616bafb543bc4182 Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 19 Oct 2019 10:13:22 +0200 +Subject: [PATCH 2/7] net: mvneta: introduce page pool API for sw buffer + manager + +Use the page_pool api for allocations and DMA handling instead of +__dev_alloc_page()/dma_map_page() and free_page()/dma_unmap_page(). +Pages are unmapped using page_pool_release_page before packets +go into the network stack. + +The page_pool API offers buffer recycling capabilities for XDP but +allocates one page per packet, unless the driver splits and manages +the allocated page. +This is a preliminary patch to add XDP support to mvneta driver + +Signed-off-by: Ilias Apalodimas +Signed-off-by: Jesper Dangaard Brouer +Signed-off-by: Lorenzo Bianconi +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/Kconfig | 1 + + drivers/net/ethernet/marvell/mvneta.c | 83 +++++++++++++++++++++------ + 2 files changed, 65 insertions(+), 19 deletions(-) + +--- a/drivers/net/ethernet/marvell/Kconfig ++++ b/drivers/net/ethernet/marvell/Kconfig +@@ -61,6 +61,7 @@ config MVNETA + depends on ARCH_MVEBU || COMPILE_TEST + select MVMDIO + select PHYLINK ++ select PAGE_POOL + ---help--- + This driver supports the network interface units in the + Marvell ARMADA XP, ARMADA 370, ARMADA 38x and +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + + /* Registers */ + #define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2)) +@@ -607,6 +608,10 @@ struct mvneta_rx_queue { + u32 pkts_coal; + u32 time_coal; + ++ /* page_pool */ ++ struct page_pool *page_pool; ++ struct xdp_rxq_info xdp_rxq; ++ + /* Virtual address of the RX buffer */ + void **buf_virt_addr; + +@@ -1825,23 +1830,21 @@ static int mvneta_rx_refill(struct mvnet + struct mvneta_rx_queue *rxq, + gfp_t gfp_mask) + { ++ enum dma_data_direction dma_dir; + dma_addr_t phys_addr; + struct page *page; + +- page = __dev_alloc_page(gfp_mask); ++ page = page_pool_alloc_pages(rxq->page_pool, ++ gfp_mask | __GFP_NOWARN); + if (!page) + return -ENOMEM; + +- /* map page for use */ +- phys_addr = dma_map_page(pp->dev->dev.parent, page, 0, PAGE_SIZE, +- DMA_FROM_DEVICE); +- if (unlikely(dma_mapping_error(pp->dev->dev.parent, phys_addr))) { +- __free_page(page); +- return -ENOMEM; +- } +- +- phys_addr += pp->rx_offset_correction; ++ phys_addr = page_pool_get_dma_addr(page) + pp->rx_offset_correction; ++ dma_dir = page_pool_get_dma_dir(rxq->page_pool); ++ dma_sync_single_for_device(pp->dev->dev.parent, phys_addr, ++ PAGE_SIZE, dma_dir); + mvneta_rx_desc_fill(rx_desc, phys_addr, page, rxq); ++ + return 0; + } + +@@ -1907,10 +1910,12 @@ static void mvneta_rxq_drop_pkts(struct + if (!data || !(rx_desc->buf_phys_addr)) + continue; + +- dma_unmap_page(pp->dev->dev.parent, rx_desc->buf_phys_addr, +- PAGE_SIZE, DMA_FROM_DEVICE); +- __free_page(data); ++ page_pool_put_page(rxq->page_pool, data, false); + } ++ if (xdp_rxq_info_is_reg(&rxq->xdp_rxq)) ++ xdp_rxq_info_unreg(&rxq->xdp_rxq); ++ page_pool_destroy(rxq->page_pool); ++ rxq->page_pool = NULL; + } + + static void +@@ -2047,8 +2052,7 @@ static int mvneta_rx_swbm(struct napi_st + skb_add_rx_frag(rxq->skb, frag_num, page, + frag_offset, frag_size, + PAGE_SIZE); +- dma_unmap_page(dev->dev.parent, phys_addr, +- PAGE_SIZE, DMA_FROM_DEVICE); ++ page_pool_release_page(rxq->page_pool, page); + rxq->left_size -= frag_size; + } + } else { +@@ -2078,9 +2082,7 @@ static int mvneta_rx_swbm(struct napi_st + frag_offset, frag_size, + PAGE_SIZE); + +- dma_unmap_page(dev->dev.parent, phys_addr, +- PAGE_SIZE, DMA_FROM_DEVICE); +- ++ page_pool_release_page(rxq->page_pool, page); + rxq->left_size -= frag_size; + } + } /* Middle or Last descriptor */ +@@ -2847,11 +2849,54 @@ static int mvneta_poll(struct napi_struc + return rx_done; + } + ++static int mvneta_create_page_pool(struct mvneta_port *pp, ++ struct mvneta_rx_queue *rxq, int size) ++{ ++ struct page_pool_params pp_params = { ++ .order = 0, ++ .flags = PP_FLAG_DMA_MAP, ++ .pool_size = size, ++ .nid = cpu_to_node(0), ++ .dev = pp->dev->dev.parent, ++ .dma_dir = DMA_FROM_DEVICE, ++ }; ++ int err; ++ ++ rxq->page_pool = page_pool_create(&pp_params); ++ if (IS_ERR(rxq->page_pool)) { ++ err = PTR_ERR(rxq->page_pool); ++ rxq->page_pool = NULL; ++ return err; ++ } ++ ++ err = xdp_rxq_info_reg(&rxq->xdp_rxq, pp->dev, rxq->id); ++ if (err < 0) ++ goto err_free_pp; ++ ++ err = xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq, MEM_TYPE_PAGE_POOL, ++ rxq->page_pool); ++ if (err) ++ goto err_unregister_rxq; ++ ++ return 0; ++ ++err_unregister_rxq: ++ xdp_rxq_info_unreg(&rxq->xdp_rxq); ++err_free_pp: ++ page_pool_destroy(rxq->page_pool); ++ rxq->page_pool = NULL; ++ return err; ++} ++ + /* Handle rxq fill: allocates rxq skbs; called when initializing a port */ + static int mvneta_rxq_fill(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, + int num) + { +- int i; ++ int i, err; ++ ++ err = mvneta_create_page_pool(pp, rxq, num); ++ if (err < 0) ++ return err; + + for (i = 0; i < num; i++) { + memset(rxq->descs + i, 0, sizeof(struct mvneta_rx_desc)); diff --git a/target/linux/mvebu/patches-5.10/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch b/target/linux/mvebu/patches-5.10/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch new file mode 100644 index 0000000000..9038ca8ca8 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch @@ -0,0 +1,303 @@ +From 8dc9a0888f4c8e27b25e48ff1b4bc2b3a845cc2d Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 19 Oct 2019 10:13:23 +0200 +Subject: [PATCH 3/7] net: mvneta: rely on build_skb in mvneta_rx_swbm poll + routine + +Refactor mvneta_rx_swbm code introducing mvneta_swbm_rx_frame and +mvneta_swbm_add_rx_fragment routines. Rely on build_skb in oreder to +allocate skb since the previous patch introduced buffer recycling using +the page_pool API. +This patch fixes even an issue in the original driver where dma buffers +are accessed before dma sync. +mvneta driver can run on not cache coherent devices so it is +necessary to sync DMA buffers before sending them to the device +in order to avoid memory corruptions. Running perf analysis we can +see a performance cost associated with this DMA-sync (anyway it is +already there in the original driver code). In follow up patches we +will add more logic to reduce DMA-sync as much as possible. + +Signed-off-by: Ilias Apalodimas +Signed-off-by: Jesper Dangaard Brouer +Signed-off-by: Lorenzo Bianconi +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 185 +++++++++++++------------- + 1 file changed, 95 insertions(+), 90 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -325,6 +325,11 @@ + ETH_HLEN + ETH_FCS_LEN, \ + cache_line_size()) + ++#define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \ ++ NET_SKB_PAD)) ++#define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD) ++#define MVNETA_MAX_RX_BUF_SIZE (PAGE_SIZE - MVNETA_SKB_PAD) ++ + #define IS_TSO_HEADER(txq, addr) \ + ((addr >= txq->tso_hdrs_phys) && \ + (addr < txq->tso_hdrs_phys + txq->size * TSO_HEADER_SIZE)) +@@ -650,7 +655,6 @@ static int txq_number = 8; + static int rxq_def; + + static int rx_copybreak __read_mostly = 256; +-static int rx_header_size __read_mostly = 128; + + /* HW BM need that each port be identify by a unique ID */ + static int global_port_id; +@@ -1842,7 +1846,7 @@ static int mvneta_rx_refill(struct mvnet + phys_addr = page_pool_get_dma_addr(page) + pp->rx_offset_correction; + dma_dir = page_pool_get_dma_dir(rxq->page_pool); + dma_sync_single_for_device(pp->dev->dev.parent, phys_addr, +- PAGE_SIZE, dma_dir); ++ MVNETA_MAX_RX_BUF_SIZE, dma_dir); + mvneta_rx_desc_fill(rx_desc, phys_addr, page, rxq); + + return 0; +@@ -1960,30 +1964,102 @@ int mvneta_rx_refill_queue(struct mvneta + return i; + } + ++static int ++mvneta_swbm_rx_frame(struct mvneta_port *pp, ++ struct mvneta_rx_desc *rx_desc, ++ struct mvneta_rx_queue *rxq, ++ struct page *page) ++{ ++ unsigned char *data = page_address(page); ++ int data_len = -MVNETA_MH_SIZE, len; ++ struct net_device *dev = pp->dev; ++ enum dma_data_direction dma_dir; ++ ++ if (MVNETA_SKB_SIZE(rx_desc->data_size) > PAGE_SIZE) { ++ len = MVNETA_MAX_RX_BUF_SIZE; ++ data_len += len; ++ } else { ++ len = rx_desc->data_size; ++ data_len += len - ETH_FCS_LEN; ++ } ++ ++ dma_dir = page_pool_get_dma_dir(rxq->page_pool); ++ dma_sync_single_for_cpu(dev->dev.parent, ++ rx_desc->buf_phys_addr, ++ len, dma_dir); ++ ++ rxq->skb = build_skb(data, PAGE_SIZE); ++ if (unlikely(!rxq->skb)) { ++ netdev_err(dev, ++ "Can't allocate skb on queue %d\n", ++ rxq->id); ++ dev->stats.rx_dropped++; ++ rxq->skb_alloc_err++; ++ return -ENOMEM; ++ } ++ page_pool_release_page(rxq->page_pool, page); ++ ++ skb_reserve(rxq->skb, MVNETA_MH_SIZE + NET_SKB_PAD); ++ skb_put(rxq->skb, data_len); ++ mvneta_rx_csum(pp, rx_desc->status, rxq->skb); ++ ++ rxq->left_size = rx_desc->data_size - len; ++ rx_desc->buf_phys_addr = 0; ++ ++ return 0; ++} ++ ++static void ++mvneta_swbm_add_rx_fragment(struct mvneta_port *pp, ++ struct mvneta_rx_desc *rx_desc, ++ struct mvneta_rx_queue *rxq, ++ struct page *page) ++{ ++ struct net_device *dev = pp->dev; ++ enum dma_data_direction dma_dir; ++ int data_len, len; ++ ++ if (rxq->left_size > MVNETA_MAX_RX_BUF_SIZE) { ++ len = MVNETA_MAX_RX_BUF_SIZE; ++ data_len = len; ++ } else { ++ len = rxq->left_size; ++ data_len = len - ETH_FCS_LEN; ++ } ++ dma_dir = page_pool_get_dma_dir(rxq->page_pool); ++ dma_sync_single_for_cpu(dev->dev.parent, ++ rx_desc->buf_phys_addr, ++ len, dma_dir); ++ if (data_len > 0) { ++ /* refill descriptor with new buffer later */ ++ skb_add_rx_frag(rxq->skb, ++ skb_shinfo(rxq->skb)->nr_frags, ++ page, NET_SKB_PAD, data_len, ++ PAGE_SIZE); ++ } ++ page_pool_release_page(rxq->page_pool, page); ++ rx_desc->buf_phys_addr = 0; ++ rxq->left_size -= len; ++} ++ + /* Main rx processing when using software buffer management */ + static int mvneta_rx_swbm(struct napi_struct *napi, + struct mvneta_port *pp, int budget, + struct mvneta_rx_queue *rxq) + { ++ int rcvd_pkts = 0, rcvd_bytes = 0, rx_proc = 0; + struct net_device *dev = pp->dev; +- int rx_todo, rx_proc; +- int refill = 0; +- u32 rcvd_pkts = 0; +- u32 rcvd_bytes = 0; ++ int rx_todo, refill; + + /* Get number of received packets */ + rx_todo = mvneta_rxq_busy_desc_num_get(pp, rxq); +- rx_proc = 0; + + /* Fairness NAPI loop */ +- while ((rcvd_pkts < budget) && (rx_proc < rx_todo)) { ++ while (rx_proc < budget && rx_proc < rx_todo) { + struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); ++ u32 rx_status, index; + unsigned char *data; + struct page *page; +- dma_addr_t phys_addr; +- u32 rx_status, index; +- int rx_bytes, skb_size, copy_size; +- int frag_num, frag_size, frag_offset; + + index = rx_desc - rxq->descs; + page = (struct page *)rxq->buf_virt_addr[index]; +@@ -1991,100 +2067,30 @@ static int mvneta_rx_swbm(struct napi_st + /* Prefetch header */ + prefetch(data); + +- phys_addr = rx_desc->buf_phys_addr; + rx_status = rx_desc->status; + rx_proc++; + rxq->refill_num++; + + if (rx_status & MVNETA_RXD_FIRST_DESC) { ++ int err; ++ + /* Check errors only for FIRST descriptor */ + if (rx_status & MVNETA_RXD_ERR_SUMMARY) { + mvneta_rx_error(pp, rx_desc); + /* leave the descriptor untouched */ + continue; + } +- rx_bytes = rx_desc->data_size - +- (ETH_FCS_LEN + MVNETA_MH_SIZE); +- +- /* Allocate small skb for each new packet */ +- skb_size = max(rx_copybreak, rx_header_size); +- rxq->skb = netdev_alloc_skb_ip_align(dev, skb_size); +- if (unlikely(!rxq->skb)) { +- struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); +- +- netdev_err(dev, +- "Can't allocate skb on queue %d\n", +- rxq->id); +- +- rxq->skb_alloc_err++; + +- u64_stats_update_begin(&stats->syncp); +- stats->rx_dropped++; +- u64_stats_update_end(&stats->syncp); ++ err = mvneta_swbm_rx_frame(pp, rx_desc, rxq, page); ++ if (err) + continue; +- } +- copy_size = min(skb_size, rx_bytes); +- +- /* Copy data from buffer to SKB, skip Marvell header */ +- memcpy(rxq->skb->data, data + MVNETA_MH_SIZE, +- copy_size); +- skb_put(rxq->skb, copy_size); +- rxq->left_size = rx_bytes - copy_size; +- +- mvneta_rx_csum(pp, rx_status, rxq->skb); +- if (rxq->left_size == 0) { +- int size = copy_size + MVNETA_MH_SIZE; +- +- dma_sync_single_range_for_cpu(dev->dev.parent, +- phys_addr, 0, +- size, +- DMA_FROM_DEVICE); +- +- /* leave the descriptor and buffer untouched */ +- } else { +- /* refill descriptor with new buffer later */ +- rx_desc->buf_phys_addr = 0; +- +- frag_num = 0; +- frag_offset = copy_size + MVNETA_MH_SIZE; +- frag_size = min(rxq->left_size, +- (int)(PAGE_SIZE - frag_offset)); +- skb_add_rx_frag(rxq->skb, frag_num, page, +- frag_offset, frag_size, +- PAGE_SIZE); +- page_pool_release_page(rxq->page_pool, page); +- rxq->left_size -= frag_size; +- } + } else { +- /* Middle or Last descriptor */ + if (unlikely(!rxq->skb)) { + pr_debug("no skb for rx_status 0x%x\n", + rx_status); + continue; + } +- if (!rxq->left_size) { +- /* last descriptor has only FCS */ +- /* and can be discarded */ +- dma_sync_single_range_for_cpu(dev->dev.parent, +- phys_addr, 0, +- ETH_FCS_LEN, +- DMA_FROM_DEVICE); +- /* leave the descriptor and buffer untouched */ +- } else { +- /* refill descriptor with new buffer later */ +- rx_desc->buf_phys_addr = 0; +- +- frag_num = skb_shinfo(rxq->skb)->nr_frags; +- frag_offset = 0; +- frag_size = min(rxq->left_size, +- (int)(PAGE_SIZE - frag_offset)); +- skb_add_rx_frag(rxq->skb, frag_num, page, +- frag_offset, frag_size, +- PAGE_SIZE); +- +- page_pool_release_page(rxq->page_pool, page); +- rxq->left_size -= frag_size; +- } ++ mvneta_swbm_add_rx_fragment(pp, rx_desc, rxq, page); + } /* Middle or Last descriptor */ + + if (!(rx_status & MVNETA_RXD_LAST_DESC)) +@@ -2109,7 +2115,6 @@ static int mvneta_rx_swbm(struct napi_st + + /* clean uncomplete skb pointer in queue */ + rxq->skb = NULL; +- rxq->left_size = 0; + } + + if (rcvd_pkts) +@@ -2970,7 +2975,7 @@ static void mvneta_rxq_hw_init(struct mv + /* Set Offset */ + mvneta_rxq_offset_set(pp, rxq, 0); + mvneta_rxq_buf_size_set(pp, rxq, PAGE_SIZE < SZ_64K ? +- PAGE_SIZE : ++ MVNETA_MAX_RX_BUF_SIZE : + MVNETA_RX_BUF_SIZE(pp->pkt_size)); + mvneta_rxq_bm_disable(pp, rxq); + mvneta_rxq_fill(pp, rxq, rxq->size); +@@ -4708,7 +4713,7 @@ static int mvneta_probe(struct platform_ + SET_NETDEV_DEV(dev, &pdev->dev); + + pp->id = global_port_id++; +- pp->rx_offset_correction = 0; /* not relevant for SW BM */ ++ pp->rx_offset_correction = NET_SKB_PAD; + + /* Obtain access to BM resources if enabled and already initialized */ + bm_node = of_parse_phandle(dn, "buffer-manager", 0); diff --git a/target/linux/mvebu/patches-5.10/006-net-mvneta-add-basic-XDP-support.patch b/target/linux/mvebu/patches-5.10/006-net-mvneta-add-basic-XDP-support.patch new file mode 100644 index 0000000000..163632df51 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/006-net-mvneta-add-basic-XDP-support.patch @@ -0,0 +1,311 @@ +From 0db51da7a8e99f0803ec3a8e25c1a66234a219cb Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 19 Oct 2019 10:13:24 +0200 +Subject: [PATCH 4/7] net: mvneta: add basic XDP support + +Add basic XDP support to mvneta driver for devices that rely on software +buffer management. Currently supported verdicts are: +- XDP_DROP +- XDP_PASS +- XDP_REDIRECT +- XDP_ABORTED + +- iptables drop: +$iptables -t raw -I PREROUTING -p udp --dport 9 -j DROP +$nstat -n && sleep 1 && nstat +IpInReceives 151169 0.0 +IpExtInOctets 6953544 0.0 +IpExtInNoECTPkts 151165 0.0 + +- XDP_DROP via xdp1 +$./samples/bpf/xdp1 3 +proto 0: 421419 pkt/s +proto 0: 421444 pkt/s +proto 0: 421393 pkt/s +proto 0: 421440 pkt/s +proto 0: 421184 pkt/s + +Tested-by: Matteo Croce +Signed-off-by: Lorenzo Bianconi +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 148 ++++++++++++++++++++++++-- + 1 file changed, 139 insertions(+), 9 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + /* Registers */ + #define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2)) +@@ -325,8 +326,10 @@ + ETH_HLEN + ETH_FCS_LEN, \ + cache_line_size()) + ++#define MVNETA_SKB_HEADROOM (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) + \ ++ NET_IP_ALIGN) + #define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \ +- NET_SKB_PAD)) ++ MVNETA_SKB_HEADROOM)) + #define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD) + #define MVNETA_MAX_RX_BUF_SIZE (PAGE_SIZE - MVNETA_SKB_PAD) + +@@ -354,6 +357,11 @@ struct mvneta_statistic { + #define T_REG_64 64 + #define T_SW 1 + ++#define MVNETA_XDP_PASS BIT(0) ++#define MVNETA_XDP_DROPPED BIT(1) ++#define MVNETA_XDP_TX BIT(2) ++#define MVNETA_XDP_REDIR BIT(3) ++ + static const struct mvneta_statistic mvneta_statistics[] = { + { 0x3000, T_REG_64, "good_octets_received", }, + { 0x3010, T_REG_32, "good_frames_received", }, +@@ -435,6 +443,8 @@ struct mvneta_port { + u32 cause_rx_tx; + struct napi_struct napi; + ++ struct bpf_prog *xdp_prog; ++ + /* Core clock */ + struct clk *clk; + /* AXI clock */ +@@ -1965,10 +1975,50 @@ int mvneta_rx_refill_queue(struct mvneta + } + + static int ++mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, ++ struct bpf_prog *prog, struct xdp_buff *xdp) ++{ ++ u32 ret, act = bpf_prog_run_xdp(prog, xdp); ++ ++ switch (act) { ++ case XDP_PASS: ++ ret = MVNETA_XDP_PASS; ++ break; ++ case XDP_REDIRECT: { ++ int err; ++ ++ err = xdp_do_redirect(pp->dev, xdp, prog); ++ if (err) { ++ ret = MVNETA_XDP_DROPPED; ++ xdp_return_buff(xdp); ++ } else { ++ ret = MVNETA_XDP_REDIR; ++ } ++ break; ++ } ++ default: ++ bpf_warn_invalid_xdp_action(act); ++ /* fall through */ ++ case XDP_ABORTED: ++ trace_xdp_exception(pp->dev, prog, act); ++ /* fall through */ ++ case XDP_DROP: ++ page_pool_recycle_direct(rxq->page_pool, ++ virt_to_head_page(xdp->data)); ++ ret = MVNETA_XDP_DROPPED; ++ break; ++ } ++ ++ return ret; ++} ++ ++static int + mvneta_swbm_rx_frame(struct mvneta_port *pp, + struct mvneta_rx_desc *rx_desc, + struct mvneta_rx_queue *rxq, +- struct page *page) ++ struct xdp_buff *xdp, ++ struct bpf_prog *xdp_prog, ++ struct page *page, u32 *xdp_ret) + { + unsigned char *data = page_address(page); + int data_len = -MVNETA_MH_SIZE, len; +@@ -1988,7 +2038,26 @@ mvneta_swbm_rx_frame(struct mvneta_port + rx_desc->buf_phys_addr, + len, dma_dir); + +- rxq->skb = build_skb(data, PAGE_SIZE); ++ xdp->data_hard_start = data; ++ xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE; ++ xdp->data_end = xdp->data + data_len; ++ xdp_set_data_meta_invalid(xdp); ++ ++ if (xdp_prog) { ++ u32 ret; ++ ++ ret = mvneta_run_xdp(pp, rxq, xdp_prog, xdp); ++ if (ret != MVNETA_XDP_PASS) { ++ mvneta_update_stats(pp, 1, ++ xdp->data_end - xdp->data, ++ false); ++ rx_desc->buf_phys_addr = 0; ++ *xdp_ret |= ret; ++ return ret; ++ } ++ } ++ ++ rxq->skb = build_skb(xdp->data_hard_start, PAGE_SIZE); + if (unlikely(!rxq->skb)) { + netdev_err(dev, + "Can't allocate skb on queue %d\n", +@@ -1999,8 +2068,9 @@ mvneta_swbm_rx_frame(struct mvneta_port + } + page_pool_release_page(rxq->page_pool, page); + +- skb_reserve(rxq->skb, MVNETA_MH_SIZE + NET_SKB_PAD); +- skb_put(rxq->skb, data_len); ++ skb_reserve(rxq->skb, ++ xdp->data - xdp->data_hard_start); ++ skb_put(rxq->skb, xdp->data_end - xdp->data); + mvneta_rx_csum(pp, rx_desc->status, rxq->skb); + + rxq->left_size = rx_desc->data_size - len; +@@ -2034,7 +2104,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet + /* refill descriptor with new buffer later */ + skb_add_rx_frag(rxq->skb, + skb_shinfo(rxq->skb)->nr_frags, +- page, NET_SKB_PAD, data_len, ++ page, MVNETA_SKB_HEADROOM, data_len, + PAGE_SIZE); + } + page_pool_release_page(rxq->page_pool, page); +@@ -2049,11 +2119,18 @@ static int mvneta_rx_swbm(struct napi_st + { + int rcvd_pkts = 0, rcvd_bytes = 0, rx_proc = 0; + struct net_device *dev = pp->dev; ++ struct bpf_prog *xdp_prog; ++ struct xdp_buff xdp_buf; + int rx_todo, refill; ++ u32 xdp_ret = 0; + + /* Get number of received packets */ + rx_todo = mvneta_rxq_busy_desc_num_get(pp, rxq); + ++ rcu_read_lock(); ++ xdp_prog = READ_ONCE(pp->xdp_prog); ++ xdp_buf.rxq = &rxq->xdp_rxq; ++ + /* Fairness NAPI loop */ + while (rx_proc < budget && rx_proc < rx_todo) { + struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); +@@ -2081,7 +2158,8 @@ static int mvneta_rx_swbm(struct napi_st + continue; + } + +- err = mvneta_swbm_rx_frame(pp, rx_desc, rxq, page); ++ err = mvneta_swbm_rx_frame(pp, rx_desc, rxq, &xdp_buf, ++ xdp_prog, page, &xdp_ret); + if (err) + continue; + } else { +@@ -2116,6 +2194,10 @@ static int mvneta_rx_swbm(struct napi_st + /* clean uncomplete skb pointer in queue */ + rxq->skb = NULL; + } ++ rcu_read_unlock(); ++ ++ if (xdp_ret & MVNETA_XDP_REDIR) ++ xdp_do_flush_map(); + + if (rcvd_pkts) + mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false); +@@ -2857,13 +2939,14 @@ static int mvneta_poll(struct napi_struc + static int mvneta_create_page_pool(struct mvneta_port *pp, + struct mvneta_rx_queue *rxq, int size) + { ++ struct bpf_prog *xdp_prog = READ_ONCE(pp->xdp_prog); + struct page_pool_params pp_params = { + .order = 0, + .flags = PP_FLAG_DMA_MAP, + .pool_size = size, + .nid = cpu_to_node(0), + .dev = pp->dev->dev.parent, +- .dma_dir = DMA_FROM_DEVICE, ++ .dma_dir = xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE, + }; + int err; + +@@ -3364,6 +3447,11 @@ static int mvneta_change_mtu(struct net_ + mtu = ALIGN(MVNETA_RX_PKT_SIZE(mtu), 8); + } + ++ if (pp->xdp_prog && mtu > MVNETA_MAX_RX_BUF_SIZE) { ++ netdev_info(dev, "Illegal MTU value %d for XDP mode\n", mtu); ++ return -EINVAL; ++ } ++ + dev->mtu = mtu; + + if (!netif_running(dev)) { +@@ -4029,6 +4117,47 @@ static int mvneta_ioctl(struct net_devic + return phylink_mii_ioctl(pp->phylink, ifr, cmd); + } + ++static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog, ++ struct netlink_ext_ack *extack) ++{ ++ bool need_update, running = netif_running(dev); ++ struct mvneta_port *pp = netdev_priv(dev); ++ struct bpf_prog *old_prog; ++ ++ if (prog && dev->mtu > MVNETA_MAX_RX_BUF_SIZE) { ++ NL_SET_ERR_MSG_MOD(extack, "Jumbo frames not supported on XDP"); ++ return -EOPNOTSUPP; ++ } ++ ++ need_update = !!pp->xdp_prog != !!prog; ++ if (running && need_update) ++ mvneta_stop(dev); ++ ++ old_prog = xchg(&pp->xdp_prog, prog); ++ if (old_prog) ++ bpf_prog_put(old_prog); ++ ++ if (running && need_update) ++ return mvneta_open(dev); ++ ++ return 0; ++} ++ ++static int mvneta_xdp(struct net_device *dev, struct netdev_bpf *xdp) ++{ ++ struct mvneta_port *pp = netdev_priv(dev); ++ ++ switch (xdp->command) { ++ case XDP_SETUP_PROG: ++ return mvneta_xdp_setup(dev, xdp->prog, xdp->extack); ++ case XDP_QUERY_PROG: ++ xdp->prog_id = pp->xdp_prog ? pp->xdp_prog->aux->id : 0; ++ return 0; ++ default: ++ return -EINVAL; ++ } ++} ++ + /* Ethtool methods */ + + /* Set link ksettings (phy address, speed) for ethtools */ +@@ -4425,6 +4554,7 @@ static const struct net_device_ops mvnet + .ndo_fix_features = mvneta_fix_features, + .ndo_get_stats64 = mvneta_get_stats64, + .ndo_do_ioctl = mvneta_ioctl, ++ .ndo_bpf = mvneta_xdp, + }; + + static const struct ethtool_ops mvneta_eth_tool_ops = { +@@ -4713,7 +4843,7 @@ static int mvneta_probe(struct platform_ + SET_NETDEV_DEV(dev, &pdev->dev); + + pp->id = global_port_id++; +- pp->rx_offset_correction = NET_SKB_PAD; ++ pp->rx_offset_correction = MVNETA_SKB_HEADROOM; + + /* Obtain access to BM resources if enabled and already initialized */ + bm_node = of_parse_phandle(dn, "buffer-manager", 0); diff --git a/target/linux/mvebu/patches-5.10/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch b/target/linux/mvebu/patches-5.10/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch new file mode 100644 index 0000000000..00d2b30d58 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch @@ -0,0 +1,31 @@ +From 525b0858ff2fdb78defec2d4d6d63baaa423d5fd Mon Sep 17 00:00:00 2001 +From: Chris Packham +Date: Fri, 13 Mar 2020 16:42:44 +1300 +Subject: [PATCH] gpio: mvebu: avoid error message for optional IRQ + +platform_get_irq() will generate an error message if the requested irq +is not present + + mvebu-gpio f1010140.gpio: IRQ index 3 not found + +use platform_get_irq_optional() to avoid the error message being +generated. + +Signed-off-by: Chris Packham +Acked-by: Uwe Kleine-König +Signed-off-by: Bartosz Golaszewski +--- + drivers/gpio/gpio-mvebu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpio/gpio-mvebu.c ++++ b/drivers/gpio/gpio-mvebu.c +@@ -1248,7 +1248,7 @@ static int mvebu_gpio_probe(struct platf + * pins. + */ + for (i = 0; i < 4; i++) { +- int irq = platform_get_irq(pdev, i); ++ int irq = platform_get_irq_optional(pdev, i); + + if (irq < 0) + continue; diff --git a/target/linux/mvebu/patches-5.10/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch b/target/linux/mvebu/patches-5.10/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch new file mode 100644 index 0000000000..e075796e41 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch @@ -0,0 +1,43 @@ +From fa383f6b77a2ed788266fa8fbfb659aa284d2f58 Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 19 Oct 2019 10:13:25 +0200 +Subject: [PATCH 5/7] net: mvneta: move header prefetch in mvneta_swbm_rx_frame + +Move data buffer prefetch in mvneta_swbm_rx_frame after +dma_sync_single_range_for_cpu + +Signed-off-by: Ilias Apalodimas +Signed-off-by: Jesper Dangaard Brouer +Signed-off-by: Lorenzo Bianconi +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -2038,6 +2038,9 @@ mvneta_swbm_rx_frame(struct mvneta_port + rx_desc->buf_phys_addr, + len, dma_dir); + ++ /* Prefetch header */ ++ prefetch(data); ++ + xdp->data_hard_start = data; + xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE; + xdp->data_end = xdp->data + data_len; +@@ -2135,14 +2138,10 @@ static int mvneta_rx_swbm(struct napi_st + while (rx_proc < budget && rx_proc < rx_todo) { + struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); + u32 rx_status, index; +- unsigned char *data; + struct page *page; + + index = rx_desc - rxq->descs; + page = (struct page *)rxq->buf_virt_addr[index]; +- data = page_address(page); +- /* Prefetch header */ +- prefetch(data); + + rx_status = rx_desc->status; + rx_proc++; diff --git a/target/linux/mvebu/patches-5.10/008-net-mvneta-make-tx-buffer-array-agnostic.patch b/target/linux/mvebu/patches-5.10/008-net-mvneta-make-tx-buffer-array-agnostic.patch new file mode 100644 index 0000000000..e79aa816b8 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/008-net-mvneta-make-tx-buffer-array-agnostic.patch @@ -0,0 +1,210 @@ +From 9e58c8b410650b5a6eb5b8fad8474bd8425a4023 Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 19 Oct 2019 10:13:26 +0200 +Subject: [PATCH 6/7] net: mvneta: make tx buffer array agnostic + +Allow tx buffer array to contain both skb and xdp buffers in order to +enable xdp frame recycling adding XDP_TX verdict support + +Signed-off-by: Lorenzo Bianconi +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 66 +++++++++++++++++---------- + 1 file changed, 43 insertions(+), 23 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -565,6 +565,20 @@ struct mvneta_rx_desc { + }; + #endif + ++enum mvneta_tx_buf_type { ++ MVNETA_TYPE_SKB, ++ MVNETA_TYPE_XDP_TX, ++ MVNETA_TYPE_XDP_NDO, ++}; ++ ++struct mvneta_tx_buf { ++ enum mvneta_tx_buf_type type; ++ union { ++ struct xdp_frame *xdpf; ++ struct sk_buff *skb; ++ }; ++}; ++ + struct mvneta_tx_queue { + /* Number of this TX queue, in the range 0-7 */ + u8 id; +@@ -580,8 +594,8 @@ struct mvneta_tx_queue { + int tx_stop_threshold; + int tx_wake_threshold; + +- /* Array of transmitted skb */ +- struct sk_buff **tx_skb; ++ /* Array of transmitted buffers */ ++ struct mvneta_tx_buf *buf; + + /* Index of last TX DMA descriptor that was inserted */ + int txq_put_index; +@@ -1793,14 +1807,9 @@ static void mvneta_txq_bufs_free(struct + int i; + + for (i = 0; i < num; i++) { ++ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_get_index]; + struct mvneta_tx_desc *tx_desc = txq->descs + + txq->txq_get_index; +- struct sk_buff *skb = txq->tx_skb[txq->txq_get_index]; +- +- if (skb) { +- bytes_compl += skb->len; +- pkts_compl++; +- } + + mvneta_txq_inc_get(txq); + +@@ -1808,9 +1817,12 @@ static void mvneta_txq_bufs_free(struct + dma_unmap_single(pp->dev->dev.parent, + tx_desc->buf_phys_addr, + tx_desc->data_size, DMA_TO_DEVICE); +- if (!skb) ++ if (!buf->skb) + continue; +- dev_kfree_skb_any(skb); ++ ++ bytes_compl += buf->skb->len; ++ pkts_compl++; ++ dev_kfree_skb_any(buf->skb); + } + + netdev_tx_completed_queue(nq, pkts_compl, bytes_compl); +@@ -2335,16 +2347,19 @@ static inline void + mvneta_tso_put_hdr(struct sk_buff *skb, + struct mvneta_port *pp, struct mvneta_tx_queue *txq) + { +- struct mvneta_tx_desc *tx_desc; + int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); ++ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; ++ struct mvneta_tx_desc *tx_desc; + +- txq->tx_skb[txq->txq_put_index] = NULL; + tx_desc = mvneta_txq_next_desc_get(txq); + tx_desc->data_size = hdr_len; + tx_desc->command = mvneta_skb_tx_csum(pp, skb); + tx_desc->command |= MVNETA_TXD_F_DESC; + tx_desc->buf_phys_addr = txq->tso_hdrs_phys + + txq->txq_put_index * TSO_HEADER_SIZE; ++ buf->type = MVNETA_TYPE_SKB; ++ buf->skb = NULL; ++ + mvneta_txq_inc_put(txq); + } + +@@ -2353,6 +2368,7 @@ mvneta_tso_put_data(struct net_device *d + struct sk_buff *skb, char *data, int size, + bool last_tcp, bool is_last) + { ++ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; + struct mvneta_tx_desc *tx_desc; + + tx_desc = mvneta_txq_next_desc_get(txq); +@@ -2366,7 +2382,8 @@ mvneta_tso_put_data(struct net_device *d + } + + tx_desc->command = 0; +- txq->tx_skb[txq->txq_put_index] = NULL; ++ buf->type = MVNETA_TYPE_SKB; ++ buf->skb = NULL; + + if (last_tcp) { + /* last descriptor in the TCP packet */ +@@ -2374,7 +2391,7 @@ mvneta_tso_put_data(struct net_device *d + + /* last descriptor in SKB */ + if (is_last) +- txq->tx_skb[txq->txq_put_index] = skb; ++ buf->skb = skb; + } + mvneta_txq_inc_put(txq); + return 0; +@@ -2459,6 +2476,7 @@ static int mvneta_tx_frag_process(struct + int i, nr_frags = skb_shinfo(skb)->nr_frags; + + for (i = 0; i < nr_frags; i++) { ++ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + void *addr = skb_frag_address(frag); + +@@ -2478,12 +2496,13 @@ static int mvneta_tx_frag_process(struct + if (i == nr_frags - 1) { + /* Last descriptor */ + tx_desc->command = MVNETA_TXD_L_DESC | MVNETA_TXD_Z_PAD; +- txq->tx_skb[txq->txq_put_index] = skb; ++ buf->skb = skb; + } else { + /* Descriptor in the middle: Not First, Not Last */ + tx_desc->command = 0; +- txq->tx_skb[txq->txq_put_index] = NULL; ++ buf->skb = NULL; + } ++ buf->type = MVNETA_TYPE_SKB; + mvneta_txq_inc_put(txq); + } + +@@ -2511,6 +2530,7 @@ static netdev_tx_t mvneta_tx(struct sk_b + struct mvneta_port *pp = netdev_priv(dev); + u16 txq_id = skb_get_queue_mapping(skb); + struct mvneta_tx_queue *txq = &pp->txqs[txq_id]; ++ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; + struct mvneta_tx_desc *tx_desc; + int len = skb->len; + int frags = 0; +@@ -2543,16 +2563,17 @@ static netdev_tx_t mvneta_tx(struct sk_b + goto out; + } + ++ buf->type = MVNETA_TYPE_SKB; + if (frags == 1) { + /* First and Last descriptor */ + tx_cmd |= MVNETA_TXD_FLZ_DESC; + tx_desc->command = tx_cmd; +- txq->tx_skb[txq->txq_put_index] = skb; ++ buf->skb = skb; + mvneta_txq_inc_put(txq); + } else { + /* First but not Last */ + tx_cmd |= MVNETA_TXD_F_DESC; +- txq->tx_skb[txq->txq_put_index] = NULL; ++ buf->skb = NULL; + mvneta_txq_inc_put(txq); + tx_desc->command = tx_cmd; + /* Continue with other skb fragments */ +@@ -3138,9 +3159,8 @@ static int mvneta_txq_sw_init(struct mvn + + txq->last_desc = txq->size - 1; + +- txq->tx_skb = kmalloc_array(txq->size, sizeof(*txq->tx_skb), +- GFP_KERNEL); +- if (!txq->tx_skb) { ++ txq->buf = kmalloc_array(txq->size, sizeof(*txq->buf), GFP_KERNEL); ++ if (!txq->buf) { + dma_free_coherent(pp->dev->dev.parent, + txq->size * MVNETA_DESC_ALIGNED_SIZE, + txq->descs, txq->descs_phys); +@@ -3152,7 +3172,7 @@ static int mvneta_txq_sw_init(struct mvn + txq->size * TSO_HEADER_SIZE, + &txq->tso_hdrs_phys, GFP_KERNEL); + if (!txq->tso_hdrs) { +- kfree(txq->tx_skb); ++ kfree(txq->buf); + dma_free_coherent(pp->dev->dev.parent, + txq->size * MVNETA_DESC_ALIGNED_SIZE, + txq->descs, txq->descs_phys); +@@ -3205,7 +3225,7 @@ static void mvneta_txq_sw_deinit(struct + { + struct netdev_queue *nq = netdev_get_tx_queue(pp->dev, txq->id); + +- kfree(txq->tx_skb); ++ kfree(txq->buf); + + if (txq->tso_hdrs) + dma_free_coherent(pp->dev->dev.parent, diff --git a/target/linux/mvebu/patches-5.10/009-net-mvneta-add-XDP_TX-support.patch b/target/linux/mvebu/patches-5.10/009-net-mvneta-add-XDP_TX-support.patch new file mode 100644 index 0000000000..c971030a1e --- /dev/null +++ b/target/linux/mvebu/patches-5.10/009-net-mvneta-add-XDP_TX-support.patch @@ -0,0 +1,175 @@ +From b0a43db9087a21d96e1a0b716b8d9963064b2d58 Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 19 Oct 2019 10:13:27 +0200 +Subject: [PATCH 7/7] net: mvneta: add XDP_TX support + +Implement XDP_TX verdict and ndo_xdp_xmit net_device_ops function +pointer + +Signed-off-by: Lorenzo Bianconi +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 128 ++++++++++++++++++++++++-- + 1 file changed, 121 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -1813,16 +1813,19 @@ static void mvneta_txq_bufs_free(struct + + mvneta_txq_inc_get(txq); + +- if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr)) ++ if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr) && ++ buf->type != MVNETA_TYPE_XDP_TX) + dma_unmap_single(pp->dev->dev.parent, + tx_desc->buf_phys_addr, + tx_desc->data_size, DMA_TO_DEVICE); +- if (!buf->skb) +- continue; +- +- bytes_compl += buf->skb->len; +- pkts_compl++; +- dev_kfree_skb_any(buf->skb); ++ if (buf->type == MVNETA_TYPE_SKB && buf->skb) { ++ bytes_compl += buf->skb->len; ++ pkts_compl++; ++ dev_kfree_skb_any(buf->skb); ++ } else if (buf->type == MVNETA_TYPE_XDP_TX || ++ buf->type == MVNETA_TYPE_XDP_NDO) { ++ xdp_return_frame(buf->xdpf); ++ } + } + + netdev_tx_completed_queue(nq, pkts_compl, bytes_compl); +@@ -1987,6 +1990,111 @@ int mvneta_rx_refill_queue(struct mvneta + } + + static int ++mvneta_xdp_submit_frame(struct mvneta_port *pp, struct mvneta_tx_queue *txq, ++ struct xdp_frame *xdpf, bool dma_map) ++{ ++ struct mvneta_tx_desc *tx_desc; ++ struct mvneta_tx_buf *buf; ++ dma_addr_t dma_addr; ++ ++ if (txq->count >= txq->tx_stop_threshold) ++ return MVNETA_XDP_DROPPED; ++ ++ tx_desc = mvneta_txq_next_desc_get(txq); ++ ++ buf = &txq->buf[txq->txq_put_index]; ++ if (dma_map) { ++ /* ndo_xdp_xmit */ ++ dma_addr = dma_map_single(pp->dev->dev.parent, xdpf->data, ++ xdpf->len, DMA_TO_DEVICE); ++ if (dma_mapping_error(pp->dev->dev.parent, dma_addr)) { ++ mvneta_txq_desc_put(txq); ++ return MVNETA_XDP_DROPPED; ++ } ++ buf->type = MVNETA_TYPE_XDP_NDO; ++ } else { ++ struct page *page = virt_to_page(xdpf->data); ++ ++ dma_addr = page_pool_get_dma_addr(page) + ++ sizeof(*xdpf) + xdpf->headroom; ++ dma_sync_single_for_device(pp->dev->dev.parent, dma_addr, ++ xdpf->len, DMA_BIDIRECTIONAL); ++ buf->type = MVNETA_TYPE_XDP_TX; ++ } ++ buf->xdpf = xdpf; ++ ++ tx_desc->command = MVNETA_TXD_FLZ_DESC; ++ tx_desc->buf_phys_addr = dma_addr; ++ tx_desc->data_size = xdpf->len; ++ ++ mvneta_update_stats(pp, 1, xdpf->len, true); ++ mvneta_txq_inc_put(txq); ++ txq->pending++; ++ txq->count++; ++ ++ return MVNETA_XDP_TX; ++} ++ ++static int ++mvneta_xdp_xmit_back(struct mvneta_port *pp, struct xdp_buff *xdp) ++{ ++ struct mvneta_tx_queue *txq; ++ struct netdev_queue *nq; ++ struct xdp_frame *xdpf; ++ int cpu; ++ u32 ret; ++ ++ xdpf = convert_to_xdp_frame(xdp); ++ if (unlikely(!xdpf)) ++ return MVNETA_XDP_DROPPED; ++ ++ cpu = smp_processor_id(); ++ txq = &pp->txqs[cpu % txq_number]; ++ nq = netdev_get_tx_queue(pp->dev, txq->id); ++ ++ __netif_tx_lock(nq, cpu); ++ ret = mvneta_xdp_submit_frame(pp, txq, xdpf, false); ++ if (ret == MVNETA_XDP_TX) ++ mvneta_txq_pend_desc_add(pp, txq, 0); ++ __netif_tx_unlock(nq); ++ ++ return ret; ++} ++ ++static int ++mvneta_xdp_xmit(struct net_device *dev, int num_frame, ++ struct xdp_frame **frames, u32 flags) ++{ ++ struct mvneta_port *pp = netdev_priv(dev); ++ int cpu = smp_processor_id(); ++ struct mvneta_tx_queue *txq; ++ struct netdev_queue *nq; ++ int i, drops = 0; ++ u32 ret; ++ ++ if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK)) ++ return -EINVAL; ++ ++ txq = &pp->txqs[cpu % txq_number]; ++ nq = netdev_get_tx_queue(pp->dev, txq->id); ++ ++ __netif_tx_lock(nq, cpu); ++ for (i = 0; i < num_frame; i++) { ++ ret = mvneta_xdp_submit_frame(pp, txq, frames[i], true); ++ if (ret != MVNETA_XDP_TX) { ++ xdp_return_frame_rx_napi(frames[i]); ++ drops++; ++ } ++ } ++ ++ if (unlikely(flags & XDP_XMIT_FLUSH)) ++ mvneta_txq_pend_desc_add(pp, txq, 0); ++ __netif_tx_unlock(nq); ++ ++ return num_frame - drops; ++} ++ ++static int + mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, + struct bpf_prog *prog, struct xdp_buff *xdp) + { +@@ -2008,6 +2116,11 @@ mvneta_run_xdp(struct mvneta_port *pp, s + } + break; + } ++ case XDP_TX: ++ ret = mvneta_xdp_xmit_back(pp, xdp); ++ if (ret != MVNETA_XDP_TX) ++ xdp_return_buff(xdp); ++ break; + default: + bpf_warn_invalid_xdp_action(act); + /* fall through */ +@@ -4574,6 +4687,7 @@ static const struct net_device_ops mvnet + .ndo_get_stats64 = mvneta_get_stats64, + .ndo_do_ioctl = mvneta_ioctl, + .ndo_bpf = mvneta_xdp, ++ .ndo_xdp_xmit = mvneta_xdp_xmit, + }; + + static const struct ethtool_ops mvneta_eth_tool_ops = { diff --git a/target/linux/mvebu/patches-5.10/010-net-mvneta-fix-build-skb-for-bm-capable-devices.patch b/target/linux/mvebu/patches-5.10/010-net-mvneta-fix-build-skb-for-bm-capable-devices.patch new file mode 100644 index 0000000000..adfa51e4e8 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/010-net-mvneta-fix-build-skb-for-bm-capable-devices.patch @@ -0,0 +1,41 @@ +From b37fa92e20ef28aada852cbf03b368d29a20478c Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Thu, 14 Nov 2019 01:25:55 +0200 +Subject: [PATCH] net: mvneta: fix build skb for bm capable devices + +Fix build_skb for bm capable devices when they fall-back using swbm path +(e.g. when bm properties are configured in device tree but +CONFIG_MVNETA_BM_ENABLE is not set). In this case rx_offset_correction is +overwritten so we need to use it building skb instead of +MVNETA_SKB_HEADROOM directly + +Fixes: 8dc9a0888f4c ("net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine") +Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support") +Signed-off-by: Lorenzo Bianconi +Reported-by: Andrew Lunn +Tested-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -2167,7 +2167,7 @@ mvneta_swbm_rx_frame(struct mvneta_port + prefetch(data); + + xdp->data_hard_start = data; +- xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE; ++ xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE; + xdp->data_end = xdp->data + data_len; + xdp_set_data_meta_invalid(xdp); + +@@ -2232,7 +2232,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet + /* refill descriptor with new buffer later */ + skb_add_rx_frag(rxq->skb, + skb_shinfo(rxq->skb)->nr_frags, +- page, MVNETA_SKB_HEADROOM, data_len, ++ page, pp->rx_offset_correction, data_len, + PAGE_SIZE); + } + page_pool_release_page(rxq->page_pool, page); diff --git a/target/linux/mvebu/patches-5.10/011-arm64-dts-uDPU-remove-i2c-fast-mode.patch b/target/linux/mvebu/patches-5.10/011-arm64-dts-uDPU-remove-i2c-fast-mode.patch new file mode 100644 index 0000000000..2922d49f44 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/011-arm64-dts-uDPU-remove-i2c-fast-mode.patch @@ -0,0 +1,31 @@ +From fe3ec631a77ded87817f449691710a436a80caa7 Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Sat, 16 Nov 2019 11:07:01 +0000 +Subject: [PATCH] arm64: dts: uDPU: remove i2c-fast-mode + +The I2C bus violates the timing specifications when run in fast mode +on the uDPU, so switch to 100kHz mode. + +Signed-off-by: Russell King +Signed-off-by: Gregory CLEMENT +--- + arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts +@@ -119,12 +119,14 @@ + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; ++ /delete-property/mrvl,i2c-fast-mode; + }; + + &i2c1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; ++ /delete-property/mrvl,i2c-fast-mode; + + lm75@48 { + status = "okay"; diff --git a/target/linux/mvebu/patches-5.10/012-arm64-dts-uDPU-SFP-cages-support-3W-modules.patch b/target/linux/mvebu/patches-5.10/012-arm64-dts-uDPU-SFP-cages-support-3W-modules.patch new file mode 100644 index 0000000000..1884def2c6 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/012-arm64-dts-uDPU-SFP-cages-support-3W-modules.patch @@ -0,0 +1,34 @@ +From cd592187f9de3c6305d6c1c66f7fac084cb5b846 Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Tue, 19 Nov 2019 22:53:04 +0000 +Subject: [PATCH] arm64: dts: uDPU: SFP cages support 3W modules + +The SFP cages are designed to support up to 3W modules, such as G.hn, +G.fast and MoCA modules. Although there is no way for such modules to +declare to software that they consume 3W, we document in DT that this +is the designed power level for these cages. + +Signed-off-by: Russell King +Signed-off-by: Gregory CLEMENT +--- + arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts +@@ -69,6 +69,7 @@ + mod-def0-gpio = <&gpiosb 3 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpiosb 4 GPIO_ACTIVE_HIGH>; + tx-fault-gpio = <&gpiosb 5 GPIO_ACTIVE_HIGH>; ++ maximum-power-milliwatt = <3000>; + }; + + sfp_eth1: sfp-eth1 { +@@ -78,6 +79,7 @@ + mod-def0-gpio = <&gpiosb 8 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpiosb 9 GPIO_ACTIVE_HIGH>; + tx-fault-gpio = <&gpiosb 10 GPIO_ACTIVE_HIGH>; ++ maximum-power-milliwatt = <3000>; + }; + }; + diff --git a/target/linux/mvebu/patches-5.10/013-net-mvneta-rely-on-page_pool_recycle_direct-in-mvnet.patch b/target/linux/mvebu/patches-5.10/013-net-mvneta-rely-on-page_pool_recycle_direct-in-mvnet.patch new file mode 100644 index 0000000000..6e79aeb358 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/013-net-mvneta-rely-on-page_pool_recycle_direct-in-mvnet.patch @@ -0,0 +1,39 @@ +From f383b2950070ce4f34e74db94f70bb565b746e97 Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Wed, 20 Nov 2019 16:54:17 +0200 +Subject: [PATCH] net: mvneta: rely on page_pool_recycle_direct in + mvneta_run_xdp + +Rely on page_pool_recycle_direct and not on xdp_return_buff in +mvneta_run_xdp. This is a preliminary patch to limit the dma sync len +to the one strictly necessary + +Signed-off-by: Lorenzo Bianconi +Acked-by: Jesper Dangaard Brouer +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -2110,7 +2110,8 @@ mvneta_run_xdp(struct mvneta_port *pp, s + err = xdp_do_redirect(pp->dev, xdp, prog); + if (err) { + ret = MVNETA_XDP_DROPPED; +- xdp_return_buff(xdp); ++ page_pool_recycle_direct(rxq->page_pool, ++ virt_to_head_page(xdp->data)); + } else { + ret = MVNETA_XDP_REDIR; + } +@@ -2119,7 +2120,8 @@ mvneta_run_xdp(struct mvneta_port *pp, s + case XDP_TX: + ret = mvneta_xdp_xmit_back(pp, xdp); + if (ret != MVNETA_XDP_TX) +- xdp_return_buff(xdp); ++ page_pool_recycle_direct(rxq->page_pool, ++ virt_to_head_page(xdp->data)); + break; + default: + bpf_warn_invalid_xdp_action(act); diff --git a/target/linux/mvebu/patches-5.10/014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch b/target/linux/mvebu/patches-5.10/014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch new file mode 100644 index 0000000000..e8a41d9eb2 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch @@ -0,0 +1,53 @@ +From 79572c98c554dcdb080bca547c871a51716dcdf8 Mon Sep 17 00:00:00 2001 +From: Sven Auhagen +Date: Sat, 25 Jan 2020 08:07:03 +0000 +Subject: [PATCH] mvneta driver disallow XDP program on hardware buffer + management + +Recently XDP Support was added to the mvneta driver +for software buffer management only. +It is still possible to attach an XDP program if +hardware buffer management is used. +It is not doing anything at that point. + +The patch disallows attaching XDP programs to mvneta +if hardware buffer management is used. + +I am sorry about that. It is my first submission and I am having +some troubles with the format of my emails. + +v4 -> v5: +- Remove extra tabs + +v3 -> v4: +- Please ignore v3 I accidentally submitted + my other patch with git-send-mail and v4 is correct + +v2 -> v3: +- My mailserver corrupted the patch + resubmission with git-send-email + +v1 -> v2: +- Fixing the patches indentation + +Signed-off-by: Sven Auhagen +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -4263,6 +4263,12 @@ static int mvneta_xdp_setup(struct net_d + return -EOPNOTSUPP; + } + ++ if (pp->bm_priv) { ++ NL_SET_ERR_MSG_MOD(extack, ++ "Hardware Buffer Management not supported on XDP"); ++ return -EOPNOTSUPP; ++ } ++ + need_update = !!pp->xdp_prog != !!prog; + if (running && need_update) + mvneta_stop(dev); diff --git a/target/linux/mvebu/patches-5.10/015-net-mvneta-fix-XDP-support-if-sw-bm-is-used-as-fallb.patch b/target/linux/mvebu/patches-5.10/015-net-mvneta-fix-XDP-support-if-sw-bm-is-used-as-fallb.patch new file mode 100644 index 0000000000..86bffa538a --- /dev/null +++ b/target/linux/mvebu/patches-5.10/015-net-mvneta-fix-XDP-support-if-sw-bm-is-used-as-fallb.patch @@ -0,0 +1,67 @@ +From 44efc78d0e464ce70b45b165c005f8bedc17952e Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Wed, 29 Jan 2020 12:50:53 +0100 +Subject: [PATCH] net: mvneta: fix XDP support if sw bm is used as fallback + +In order to fix XDP support if sw buffer management is used as fallback +for hw bm devices, define MVNETA_SKB_HEADROOM as maximum between +XDP_PACKET_HEADROOM and NET_SKB_PAD and let the hw aligns the IP header +to 4-byte boundary. +Fix rx_offset_correction initialization if mvneta_bm_port_init fails in +mvneta_resume routine + +Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support") +Tested-by: Sven Auhagen +Signed-off-by: Lorenzo Bianconi +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -326,8 +326,7 @@ + ETH_HLEN + ETH_FCS_LEN, \ + cache_line_size()) + +-#define MVNETA_SKB_HEADROOM (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) + \ +- NET_IP_ALIGN) ++#define MVNETA_SKB_HEADROOM max(XDP_PACKET_HEADROOM, NET_SKB_PAD) + #define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \ + MVNETA_SKB_HEADROOM)) + #define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD) +@@ -1174,6 +1173,7 @@ bm_mtu_err: + mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_short, 1 << pp->id); + + pp->bm_priv = NULL; ++ pp->rx_offset_correction = MVNETA_SKB_HEADROOM; + mvreg_write(pp, MVNETA_ACC_MODE, MVNETA_ACC_MODE_EXT1); + netdev_info(pp->dev, "fail to update MTU, fall back to software BM\n"); + } +@@ -4984,7 +4984,6 @@ static int mvneta_probe(struct platform_ + SET_NETDEV_DEV(dev, &pdev->dev); + + pp->id = global_port_id++; +- pp->rx_offset_correction = MVNETA_SKB_HEADROOM; + + /* Obtain access to BM resources if enabled and already initialized */ + bm_node = of_parse_phandle(dn, "buffer-manager", 0); +@@ -5009,6 +5008,10 @@ static int mvneta_probe(struct platform_ + } + of_node_put(bm_node); + ++ /* sw buffer management */ ++ if (!pp->bm_priv) ++ pp->rx_offset_correction = MVNETA_SKB_HEADROOM; ++ + err = mvneta_init(&pdev->dev, pp); + if (err < 0) + goto err_netdev; +@@ -5166,6 +5169,7 @@ static int mvneta_resume(struct device * + err = mvneta_bm_port_init(pdev, pp); + if (err < 0) { + dev_info(&pdev->dev, "use SW buffer management\n"); ++ pp->rx_offset_correction = MVNETA_SKB_HEADROOM; + pp->bm_priv = NULL; + } + } diff --git a/target/linux/mvebu/patches-5.10/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch b/target/linux/mvebu/patches-5.10/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch new file mode 100644 index 0000000000..c9e49ac2f1 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch @@ -0,0 +1,60 @@ +From 6964494582f56a3882c2c53b0edbfe99eb32b2e1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Thu, 30 Apr 2020 10:06:14 +0200 +Subject: [PATCH] PCI: aardvark: Train link immediately after enabling training +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Adding even 100ms (PCI_PM_D3COLD_WAIT) delay between enabling link +training and starting link training causes detection issues with some +buggy cards (such as Compex WLE900VX). + +Move the code which enables link training immediately before the one +which starts link traning. + +This fixes detection issues of Compex WLE900VX card on Turris MOX after +cold boot. + +Link: https://lore.kernel.org/r/20200430080625.26070-2-pali@kernel.org +Fixes: f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready...") +Tested-by: Tomasz Maciej Nowak +Signed-off-by: Pali Rohár +Signed-off-by: Lorenzo Pieralisi +Acked-by: Rob Herring +Acked-by: Thomas Petazzoni +--- + drivers/pci/controller/pci-aardvark.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -300,11 +300,6 @@ static void advk_pcie_setup_hw(struct ad + reg |= LANE_COUNT_1; + advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); + +- /* Enable link training */ +- reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); +- reg |= LINK_TRAINING_EN; +- advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); +- + /* Enable MSI */ + reg = advk_readl(pcie, PCIE_CORE_CTRL2_REG); + reg |= PCIE_CORE_CTRL2_MSI_ENABLE; +@@ -346,7 +341,15 @@ static void advk_pcie_setup_hw(struct ad + */ + msleep(PCI_PM_D3COLD_WAIT); + +- /* Start link training */ ++ /* Enable link training */ ++ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); ++ reg |= LINK_TRAINING_EN; ++ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); ++ ++ /* ++ * Start link training immediately after enabling it. ++ * This solves problems for some buggy cards. ++ */ + reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); + reg |= PCIE_CORE_LINK_TRAINING; + advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG); diff --git a/target/linux/mvebu/patches-5.10/017-PCI-aardvark-Improve-link-training.patch b/target/linux/mvebu/patches-5.10/017-PCI-aardvark-Improve-link-training.patch new file mode 100644 index 0000000000..2bf838432f --- /dev/null +++ b/target/linux/mvebu/patches-5.10/017-PCI-aardvark-Improve-link-training.patch @@ -0,0 +1,208 @@ +From 43fc679ced18006b12d918d7a8a4af392b7fbfe7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Thu, 30 Apr 2020 10:06:17 +0200 +Subject: [PATCH] PCI: aardvark: Improve link training +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Currently the aardvark driver trains link in PCIe gen2 mode. This may +cause some buggy gen1 cards (such as Compex WLE900VX) to be unstable or +even not detected. Moreover when ASPM code tries to retrain link second +time, these cards may stop responding and link goes down. If gen1 is +used this does not happen. + +Unconditionally forcing gen1 is not a good solution since it may have +performance impact on gen2 cards. + +To overcome this, read 'max-link-speed' property (as defined in PCI +device tree bindings) and use this as max gen mode. Then iteratively try +link training at this mode or lower until successful. After successful +link training choose final controller gen based on Negotiated Link Speed +from Link Status register, which should match card speed. + +Link: https://lore.kernel.org/r/20200430080625.26070-5-pali@kernel.org +Tested-by: Tomasz Maciej Nowak +Signed-off-by: Pali Rohár +Signed-off-by: Marek Behún +Signed-off-by: Lorenzo Pieralisi +Reviewed-by: Rob Herring +Acked-by: Thomas Petazzoni +--- + drivers/pci/controller/pci-aardvark.c | 114 ++++++++++++++++++++------ + 1 file changed, 89 insertions(+), 25 deletions(-) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -39,6 +39,7 @@ + #define PCIE_CORE_LINK_CTRL_STAT_REG 0xd0 + #define PCIE_CORE_LINK_L0S_ENTRY BIT(0) + #define PCIE_CORE_LINK_TRAINING BIT(5) ++#define PCIE_CORE_LINK_SPEED_SHIFT 16 + #define PCIE_CORE_LINK_WIDTH_SHIFT 20 + #define PCIE_CORE_ERR_CAPCTL_REG 0x118 + #define PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX BIT(5) +@@ -201,6 +202,7 @@ struct advk_pcie { + struct mutex msi_used_lock; + u16 msi_msg; + int root_bus_nr; ++ int link_gen; + struct pci_bridge_emul bridge; + }; + +@@ -225,20 +227,16 @@ static int advk_pcie_link_up(struct advk + + static int advk_pcie_wait_for_link(struct advk_pcie *pcie) + { +- struct device *dev = &pcie->pdev->dev; + int retries; + + /* check if the link is up or not */ + for (retries = 0; retries < LINK_WAIT_MAX_RETRIES; retries++) { +- if (advk_pcie_link_up(pcie)) { +- dev_info(dev, "link up\n"); ++ if (advk_pcie_link_up(pcie)) + return 0; +- } + + usleep_range(LINK_WAIT_USLEEP_MIN, LINK_WAIT_USLEEP_MAX); + } + +- dev_err(dev, "link never came up\n"); + return -ETIMEDOUT; + } + +@@ -253,6 +251,85 @@ static void advk_pcie_wait_for_retrain(s + } + } + ++static int advk_pcie_train_at_gen(struct advk_pcie *pcie, int gen) ++{ ++ int ret, neg_gen; ++ u32 reg; ++ ++ /* Setup link speed */ ++ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); ++ reg &= ~PCIE_GEN_SEL_MSK; ++ if (gen == 3) ++ reg |= SPEED_GEN_3; ++ else if (gen == 2) ++ reg |= SPEED_GEN_2; ++ else ++ reg |= SPEED_GEN_1; ++ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); ++ ++ /* ++ * Enable link training. This is not needed in every call to this ++ * function, just once suffices, but it does not break anything either. ++ */ ++ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); ++ reg |= LINK_TRAINING_EN; ++ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); ++ ++ /* ++ * Start link training immediately after enabling it. ++ * This solves problems for some buggy cards. ++ */ ++ reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); ++ reg |= PCIE_CORE_LINK_TRAINING; ++ advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG); ++ ++ ret = advk_pcie_wait_for_link(pcie); ++ if (ret) ++ return ret; ++ ++ reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); ++ neg_gen = (reg >> PCIE_CORE_LINK_SPEED_SHIFT) & 0xf; ++ ++ return neg_gen; ++} ++ ++static void advk_pcie_train_link(struct advk_pcie *pcie) ++{ ++ struct device *dev = &pcie->pdev->dev; ++ int neg_gen = -1, gen; ++ ++ /* ++ * Try link training at link gen specified by device tree property ++ * 'max-link-speed'. If this fails, iteratively train at lower gen. ++ */ ++ for (gen = pcie->link_gen; gen > 0; --gen) { ++ neg_gen = advk_pcie_train_at_gen(pcie, gen); ++ if (neg_gen > 0) ++ break; ++ } ++ ++ if (neg_gen < 0) ++ goto err; ++ ++ /* ++ * After successful training if negotiated gen is lower than requested, ++ * train again on negotiated gen. This solves some stability issues for ++ * some buggy gen1 cards. ++ */ ++ if (neg_gen < gen) { ++ gen = neg_gen; ++ neg_gen = advk_pcie_train_at_gen(pcie, gen); ++ } ++ ++ if (neg_gen == gen) { ++ dev_info(dev, "link up at gen %i\n", gen); ++ return; ++ } ++ ++err: ++ dev_err(dev, "link never came up\n"); ++} ++ + static void advk_pcie_setup_hw(struct advk_pcie *pcie) + { + u32 reg; +@@ -288,12 +365,6 @@ static void advk_pcie_setup_hw(struct ad + PCIE_CORE_CTRL2_TD_ENABLE; + advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG); + +- /* Set GEN2 */ +- reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); +- reg &= ~PCIE_GEN_SEL_MSK; +- reg |= SPEED_GEN_2; +- advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); +- + /* Set lane X1 */ + reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); + reg &= ~LANE_CNT_MSK; +@@ -341,20 +412,7 @@ static void advk_pcie_setup_hw(struct ad + */ + msleep(PCI_PM_D3COLD_WAIT); + +- /* Enable link training */ +- reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); +- reg |= LINK_TRAINING_EN; +- advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); +- +- /* +- * Start link training immediately after enabling it. +- * This solves problems for some buggy cards. +- */ +- reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); +- reg |= PCIE_CORE_LINK_TRAINING; +- advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG); +- +- advk_pcie_wait_for_link(pcie); ++ advk_pcie_train_link(pcie); + + reg = advk_readl(pcie, PCIE_CORE_CMD_STATUS_REG); + reg |= PCIE_CORE_CMD_MEM_ACCESS_EN | +@@ -1035,6 +1093,12 @@ static int advk_pcie_probe(struct platfo + return ret; + } + ++ ret = of_pci_get_max_link_speed(dev->of_node); ++ if (ret <= 0 || ret > 3) ++ pcie->link_gen = 3; ++ else ++ pcie->link_gen = ret; ++ + advk_pcie_setup_hw(pcie); + + ret = advk_sw_pci_bridge_init(pcie); diff --git a/target/linux/mvebu/patches-5.10/018-PCI-aardvark-Issue-PERST-via-GPIO.patch b/target/linux/mvebu/patches-5.10/018-PCI-aardvark-Issue-PERST-via-GPIO.patch new file mode 100644 index 0000000000..83212ec475 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/018-PCI-aardvark-Issue-PERST-via-GPIO.patch @@ -0,0 +1,123 @@ +From 5169a9851daaa2782a7bd2bb83d5b1bd224b2879 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Thu, 30 Apr 2020 10:06:18 +0200 +Subject: [PATCH] PCI: aardvark: Issue PERST via GPIO +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for issuing PERST via GPIO specified in 'reset-gpios' +property (as described in PCI device tree bindings). + +Some buggy cards (e.g. Compex WLE900VX or WLE1216) are not detected +after reboot when PERST is not issued during driver initialization. + +If bootloader already enabled link training then issuing PERST has no +effect for some buggy cards (e.g. Compex WLE900VX) and these cards are +not detected. We therefore clear the LINK_TRAINING_EN register before. + +It was observed that Compex WLE900VX card needs to be in PERST reset +for at least 10ms if bootloader enabled link training. + +Tested on Turris MOX. + +Link: https://lore.kernel.org/r/20200430080625.26070-6-pali@kernel.org +Tested-by: Tomasz Maciej Nowak +Signed-off-by: Pali Rohár +Signed-off-by: Lorenzo Pieralisi +Acked-by: Thomas Petazzoni +--- + drivers/pci/controller/pci-aardvark.c | 43 ++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -9,6 +9,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -17,6 +18,7 @@ + #include + #include + #include ++#include + #include + + #include "../pci.h" +@@ -204,6 +206,7 @@ struct advk_pcie { + int root_bus_nr; + int link_gen; + struct pci_bridge_emul bridge; ++ struct gpio_desc *reset_gpio; + }; + + static inline void advk_writel(struct advk_pcie *pcie, u32 val, u64 reg) +@@ -330,10 +333,31 @@ err: + dev_err(dev, "link never came up\n"); + } + ++static void advk_pcie_issue_perst(struct advk_pcie *pcie) ++{ ++ u32 reg; ++ ++ if (!pcie->reset_gpio) ++ return; ++ ++ /* PERST does not work for some cards when link training is enabled */ ++ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); ++ reg &= ~LINK_TRAINING_EN; ++ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); ++ ++ /* 10ms delay is needed for some cards */ ++ dev_info(&pcie->pdev->dev, "issuing PERST via reset GPIO for 10ms\n"); ++ gpiod_set_value_cansleep(pcie->reset_gpio, 1); ++ usleep_range(10000, 11000); ++ gpiod_set_value_cansleep(pcie->reset_gpio, 0); ++} ++ + static void advk_pcie_setup_hw(struct advk_pcie *pcie) + { + u32 reg; + ++ advk_pcie_issue_perst(pcie); ++ + /* Set to Direct mode */ + reg = advk_readl(pcie, CTRL_CONFIG_REG); + reg &= ~(CTRL_MODE_MASK << CTRL_MODE_SHIFT); +@@ -406,7 +430,8 @@ static void advk_pcie_setup_hw(struct ad + + /* + * PERST# signal could have been asserted by pinctrl subsystem before +- * probe() callback has been called, making the endpoint going into ++ * probe() callback has been called or issued explicitly by reset gpio ++ * function advk_pcie_issue_perst(), making the endpoint going into + * fundamental reset. As required by PCI Express spec a delay for at + * least 100ms after such a reset before link training is needed. + */ +@@ -1093,6 +1118,22 @@ static int advk_pcie_probe(struct platfo + return ret; + } + ++ pcie->reset_gpio = devm_gpiod_get_from_of_node(dev, dev->of_node, ++ "reset-gpios", 0, ++ GPIOD_OUT_LOW, ++ "pcie1-reset"); ++ ret = PTR_ERR_OR_ZERO(pcie->reset_gpio); ++ if (ret) { ++ if (ret == -ENOENT) { ++ pcie->reset_gpio = NULL; ++ } else { ++ if (ret != -EPROBE_DEFER) ++ dev_err(dev, "Failed to get reset-gpio: %i\n", ++ ret); ++ return ret; ++ } ++ } ++ + ret = of_pci_get_max_link_speed(dev->of_node); + if (ret <= 0 || ret > 3) + pcie->link_gen = 3; diff --git a/target/linux/mvebu/patches-5.10/019-PCI-aardvark-Add-PHY-support.patch b/target/linux/mvebu/patches-5.10/019-PCI-aardvark-Add-PHY-support.patch new file mode 100644 index 0000000000..fa04861e80 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/019-PCI-aardvark-Add-PHY-support.patch @@ -0,0 +1,152 @@ +From 366697018c9a2aa67d457bfdc495115cface6ae8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Thu, 30 Apr 2020 10:06:20 +0200 +Subject: [PATCH] PCI: aardvark: Add PHY support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With recent proposed changes for U-Boot it is possible that bootloader +won't initialize the PHY for this controller (currently the PHY is +initialized regardless whether PCI is used in U-Boot, but with these +proposed changes the PHY is initialized only on request). + +Since the mvebu-a3700-comphy driver by Miquèl Raynal supports enabling +PCIe PHY, and since Linux' functionality should be independent on what +bootloader did, add code for enabling generic PHY if found in device OF +node. + +The mvebu-a3700-comphy driver does PHY powering via SMC calls to ARM +Trusted Firmware. The corresponding code in ARM Trusted Firmware skips +one register write which U-Boot does not: step 7 ("Enable TX"), see [1]. +Instead ARM Trusted Firmware expects PCIe driver to do this step, +probably because the register is in PCIe controller address space, +instead of PHY address space. We therefore add this step into the +advk_pcie_setup_hw function. + +[1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/drivers/marvell/comphy/phy-comphy-3700.c?h=v2.3-rc2#n836 + +Link: https://lore.kernel.org/r/20200430080625.26070-8-pali@kernel.org +Tested-by: Tomasz Maciej Nowak +Signed-off-by: Marek Behún +Signed-off-by: Lorenzo Pieralisi +Reviewed-by: Rob Herring +Acked-by: Thomas Petazzoni +Cc: Miquèl Raynal +--- + drivers/pci/controller/pci-aardvark.c | 69 +++++++++++++++++++++++++++ + 1 file changed, 69 insertions(+) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -103,6 +104,8 @@ + #define PCIE_CORE_CTRL2_STRICT_ORDER_ENABLE BIT(5) + #define PCIE_CORE_CTRL2_OB_WIN_ENABLE BIT(6) + #define PCIE_CORE_CTRL2_MSI_ENABLE BIT(10) ++#define PCIE_CORE_REF_CLK_REG (CONTROL_BASE_ADDR + 0x14) ++#define PCIE_CORE_REF_CLK_TX_ENABLE BIT(1) + #define PCIE_MSG_LOG_REG (CONTROL_BASE_ADDR + 0x30) + #define PCIE_ISR0_REG (CONTROL_BASE_ADDR + 0x40) + #define PCIE_MSG_PM_PME_MASK BIT(7) +@@ -207,6 +210,7 @@ struct advk_pcie { + int link_gen; + struct pci_bridge_emul bridge; + struct gpio_desc *reset_gpio; ++ struct phy *phy; + }; + + static inline void advk_writel(struct advk_pcie *pcie, u32 val, u64 reg) +@@ -358,6 +362,11 @@ static void advk_pcie_setup_hw(struct ad + + advk_pcie_issue_perst(pcie); + ++ /* Enable TX */ ++ reg = advk_readl(pcie, PCIE_CORE_REF_CLK_REG); ++ reg |= PCIE_CORE_REF_CLK_TX_ENABLE; ++ advk_writel(pcie, reg, PCIE_CORE_REF_CLK_REG); ++ + /* Set to Direct mode */ + reg = advk_readl(pcie, CTRL_CONFIG_REG); + reg &= ~(CTRL_MODE_MASK << CTRL_MODE_SHIFT); +@@ -1083,6 +1092,62 @@ out_release_res: + return err; + } + ++static void __maybe_unused advk_pcie_disable_phy(struct advk_pcie *pcie) ++{ ++ phy_power_off(pcie->phy); ++ phy_exit(pcie->phy); ++} ++ ++static int advk_pcie_enable_phy(struct advk_pcie *pcie) ++{ ++ int ret; ++ ++ if (!pcie->phy) ++ return 0; ++ ++ ret = phy_init(pcie->phy); ++ if (ret) ++ return ret; ++ ++ ret = phy_set_mode(pcie->phy, PHY_MODE_PCIE); ++ if (ret) { ++ phy_exit(pcie->phy); ++ return ret; ++ } ++ ++ ret = phy_power_on(pcie->phy); ++ if (ret) { ++ phy_exit(pcie->phy); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int advk_pcie_setup_phy(struct advk_pcie *pcie) ++{ ++ struct device *dev = &pcie->pdev->dev; ++ struct device_node *node = dev->of_node; ++ int ret = 0; ++ ++ pcie->phy = devm_of_phy_get(dev, node, NULL); ++ if (IS_ERR(pcie->phy) && (PTR_ERR(pcie->phy) == -EPROBE_DEFER)) ++ return PTR_ERR(pcie->phy); ++ ++ /* Old bindings miss the PHY handle */ ++ if (IS_ERR(pcie->phy)) { ++ dev_warn(dev, "PHY unavailable (%ld)\n", PTR_ERR(pcie->phy)); ++ pcie->phy = NULL; ++ return 0; ++ } ++ ++ ret = advk_pcie_enable_phy(pcie); ++ if (ret) ++ dev_err(dev, "Failed to initialize PHY (%d)\n", ret); ++ ++ return ret; ++} ++ + static int advk_pcie_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; +@@ -1140,6 +1205,10 @@ static int advk_pcie_probe(struct platfo + else + pcie->link_gen = ret; + ++ ret = advk_pcie_setup_phy(pcie); ++ if (ret) ++ return ret; ++ + advk_pcie_setup_hw(pcie); + + ret = advk_sw_pci_bridge_init(pcie); diff --git a/target/linux/mvebu/patches-5.10/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch b/target/linux/mvebu/patches-5.10/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch new file mode 100644 index 0000000000..87247b63ad --- /dev/null +++ b/target/linux/mvebu/patches-5.10/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch @@ -0,0 +1,93 @@ +From 715878016984b2617f6c1f177c50039e12e7bd5b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Thu, 30 Apr 2020 10:06:23 +0200 +Subject: [PATCH] arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio + function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We found out that we are unable to control the PERST# signal via the +default pin dedicated to be PERST# pin (GPIO2[3] pin) on A3700 SOC when +this pin is in EP_PCIE1_Resetn mode. There is a register in the PCIe +register space called PERSTN_GPIO_EN (D0088004[3]), but changing the +value of this register does not change the pin output when measuring +with voltmeter. + +We do not know if this is a bug in the SOC, or if it works only when +PCIe controller is in a certain state. + +Commit f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready +before training link") says that when this pin changes pinctrl mode +from EP_PCIE1_Resetn to GPIO, the PERST# signal is asserted for a brief +moment. + +So currently the situation is that on A3700 boards the PERST# signal is +asserted in U-Boot (because the code in U-Boot issues reset via this pin +via GPIO mode), and then in Linux by the obscure and undocumented +mechanism described by the above mentioned commit. + +We want to issue PERST# signal in a known way, therefore this patch +changes the pcie_reset_pin function from "pcie" to "gpio" and adds the +reset-gpios property to the PCIe node in device tree files of +EspressoBin and Armada 3720 Dev Board (Turris Mox device tree already +has this property and uDPU does not have a PCIe port). + +Signed-off-by: Marek Behún +Cc: Remi Pommarel +Tested-by: Tomasz Maciej Nowak +Acked-by: Thomas Petazzoni +Signed-off-by: Gregory CLEMENT +--- + arch/arm64/boot/dts/marvell/armada-3720-db.dts | 3 +++ + arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi | 1 + + arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 4 ---- + arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-db.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-db.dts +@@ -128,6 +128,9 @@ + + /* CON15(V2.0)/CON17(V1.4) : PCIe / CON15(V2.0)/CON12(V1.4) :mini-PCIe */ + &pcie0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; ++ reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; + status = "okay"; + }; + +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts +@@ -59,6 +59,7 @@ + phys = <&comphy1 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; ++ reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; + }; + + /* J6 */ +--- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +@@ -120,10 +120,6 @@ + }; + }; + +-&pcie_reset_pins { +- function = "gpio"; +-}; +- + &pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; +--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +@@ -317,7 +317,7 @@ + + pcie_reset_pins: pcie-reset-pins { + groups = "pcie1"; +- function = "pcie"; ++ function = "gpio"; + }; + + pcie_clkreq_pins: pcie-clkreq-pins { diff --git a/target/linux/mvebu/patches-5.10/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch b/target/linux/mvebu/patches-5.10/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch new file mode 100644 index 0000000000..e92393ff6f --- /dev/null +++ b/target/linux/mvebu/patches-5.10/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch @@ -0,0 +1,57 @@ +From df749cdb015011e9ed8b60ebb84b4e76a9f35735 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Thu, 30 Apr 2020 10:06:24 +0200 +Subject: [PATCH] arm64: dts: marvell: armada-37xx: Move PCIe comphy handle + property +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Move the comphy handle property of the PCIe node from board specific +device tree files (EspressoBin and Turris Mox) to the generic +armada-37xx.dtsi. + +This is correct since this is the only possible PCIe PHY configuration +on Armada 37xx, so when PCIe is enabled on any board, this handle is +correct. + +Signed-off-by: Marek Behún +Tested-by: Tomasz Maciej Nowak +Acked-by: Thomas Petazzoni +Signed-off-by: Gregory CLEMENT +--- + arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi | 1 - + arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 1 - + arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 + + 3 files changed, 1 insertion(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts +@@ -56,7 +56,6 @@ + /* J9 */ + &pcie0 { + status = "okay"; +- phys = <&comphy1 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; + reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; +--- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +@@ -126,7 +126,6 @@ + status = "okay"; + max-link-speed = <2>; + reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; +- phys = <&comphy1 0>; + + /* enabled by U-Boot if PCIe module is present */ + status = "disabled"; +--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +@@ -493,6 +493,7 @@ + <0 0 0 2 &pcie_intc 1>, + <0 0 0 3 &pcie_intc 2>, + <0 0 0 4 &pcie_intc 3>; ++ phys = <&comphy1 0>; + pcie_intc: interrupt-controller { + interrupt-controller; + #interrupt-cells = <1>; diff --git a/target/linux/mvebu/patches-5.10/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch b/target/linux/mvebu/patches-5.10/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch new file mode 100644 index 0000000000..ad918bef88 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch @@ -0,0 +1,44 @@ +From 1b5a2dd9e266d78d5fddd7e6b116e47ba9577b5e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Thu, 30 Apr 2020 10:06:25 +0200 +Subject: [PATCH] arm64: dts: marvell: armada-37xx: Move PCIe max-link-speed + property +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Move the max-link-speed property of the PCIe node from board specific +device tree files to the generic armada-37xx.dtsi. + +Armada 37xx supports only PCIe gen2 speed so max-link-speed property +should be in the generic armada-37xx.dtsi file. + +Signed-off-by: Pali Rohár +Tested-by: Tomasz Maciej Nowak +Acked-by: Thomas Petazzoni +Signed-off-by: Gregory CLEMENT +--- + arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 1 - + arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 + + 2 files changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +@@ -124,7 +124,6 @@ + pinctrl-names = "default"; + pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; + status = "okay"; +- max-link-speed = <2>; + reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; + + /* enabled by U-Boot if PCIe module is present */ +--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +@@ -493,6 +493,7 @@ + <0 0 0 2 &pcie_intc 1>, + <0 0 0 3 &pcie_intc 2>, + <0 0 0 4 &pcie_intc 3>; ++ max-link-speed = <2>; + phys = <&comphy1 0>; + pcie_intc: interrupt-controller { + interrupt-controller; diff --git a/target/linux/mvebu/patches-5.10/023-arm64-dts-add-uDPU-i2c-bus-recovery.patch b/target/linux/mvebu/patches-5.10/023-arm64-dts-add-uDPU-i2c-bus-recovery.patch new file mode 100644 index 0000000000..818fce85a8 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/023-arm64-dts-add-uDPU-i2c-bus-recovery.patch @@ -0,0 +1,53 @@ +From 11b2af36cc874027ce701c5784cb957c99c7de3d Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Wed, 6 May 2020 10:40:37 +0100 +Subject: [PATCH] arm64: dts: add uDPU i2c bus recovery + +Signed-off-by: Russell King +Reviewed-by: Andrew Lunn +Signed-off-by: Gregory CLEMENT +--- + .../boot/dts/marvell/armada-3720-uDPU.dts | 22 +++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts +@@ -117,18 +117,36 @@ + }; + }; + ++&pinctrl_nb { ++ i2c1_recovery_pins: i2c1-recovery-pins { ++ groups = "i2c1"; ++ function = "gpio"; ++ }; ++ ++ i2c2_recovery_pins: i2c2-recovery-pins { ++ groups = "i2c2"; ++ function = "gpio"; ++ }; ++}; ++ + &i2c0 { + status = "okay"; +- pinctrl-names = "default"; ++ pinctrl-names = "default", "recovery"; + pinctrl-0 = <&i2c1_pins>; ++ pinctrl-1 = <&i2c1_recovery_pins>; + /delete-property/mrvl,i2c-fast-mode; ++ scl-gpios = <&gpionb 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; ++ sda-gpios = <&gpionb 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + }; + + &i2c1 { + status = "okay"; +- pinctrl-names = "default"; ++ pinctrl-names = "default", "recovery"; + pinctrl-0 = <&i2c2_pins>; ++ pinctrl-1 = <&i2c2_recovery_pins>; + /delete-property/mrvl,i2c-fast-mode; ++ scl-gpios = <&gpionb 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; ++ sda-gpios = <&gpionb 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + + lm75@48 { + status = "okay"; diff --git a/target/linux/mvebu/patches-5.10/024-PCI-aardvark-Don-t-touch-PCIe-registers-if-no-card-c.patch b/target/linux/mvebu/patches-5.10/024-PCI-aardvark-Don-t-touch-PCIe-registers-if-no-card-c.patch new file mode 100644 index 0000000000..dfc068c8cb --- /dev/null +++ b/target/linux/mvebu/patches-5.10/024-PCI-aardvark-Don-t-touch-PCIe-registers-if-no-card-c.patch @@ -0,0 +1,50 @@ +From 70e380250c3621c55ff218cbaf2272830d9dbb1d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Thu, 2 Jul 2020 10:30:36 +0200 +Subject: [PATCH] PCI: aardvark: Don't touch PCIe registers if no card + connected +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When there is no PCIe card connected and advk_pcie_rd_conf() or +advk_pcie_wr_conf() is called for PCI bus which doesn't belong to emulated +root bridge, the aardvark driver throws the following error message: + + advk-pcie d0070000.pcie: config read/write timed out + +Obviously accessing PCIe registers of disconnected card is not possible. + +Extend check in advk_pcie_valid_device() function for validating +availability of PCIe bus. If PCIe link is down, then the device is marked +as Not Found and the driver does not try to access these registers. + +This is just an optimization to prevent accessing PCIe registers when card +is disconnected. Trying to access PCIe registers of disconnected card does +not cause any crash, kernel just needs to wait for a timeout. So if card +disappear immediately after checking for PCIe link (before accessing PCIe +registers), it does not cause any problems. + +Link: https://lore.kernel.org/r/20200702083036.12230-1-pali@kernel.org +Signed-off-by: Pali Rohár +Signed-off-by: Lorenzo Pieralisi +--- + drivers/pci/controller/pci-aardvark.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -639,6 +639,13 @@ static bool advk_pcie_valid_device(struc + if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0) + return false; + ++ /* ++ * If the link goes down after we check for link-up, nothing bad ++ * happens but the config access times out. ++ */ ++ if (bus->number != pcie->root_bus_nr && !advk_pcie_link_up(pcie)) ++ return false; ++ + return true; + } + diff --git a/target/linux/mvebu/patches-5.10/025-power-reset-add-driver-for-LinkStation-power-off.patch b/target/linux/mvebu/patches-5.10/025-power-reset-add-driver-for-LinkStation-power-off.patch new file mode 100644 index 0000000000..64ea26559e --- /dev/null +++ b/target/linux/mvebu/patches-5.10/025-power-reset-add-driver-for-LinkStation-power-off.patch @@ -0,0 +1,207 @@ +From a7f79f99541eff4e6bcae0014eb08d3019337565 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= +Date: Wed, 15 Jul 2020 15:35:14 +0200 +Subject: [PATCH] power: reset: add driver for LinkStation power off +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some Buffalo LinkStations perform the power off operation, at restart +time, depending on the state of an output pin (LED2/INTn) at the ethernet +PHY. This pin is also used to wake the machine when a WoL packet is +received by the PHY. + +The driver is required by the Buffalo LinkStation LS421DE (ARM MVEBU), +and other models. Without it, the board remains forever halted if a +power off command is executed, unless the PSU is disconnected and +connected again. + +Add the driver to provide the power off function and also make the WoL +feature to be available. + +Signed-off-by: Daniel González Cabanelas +Signed-off-by: Sebastian Reichel +--- + drivers/power/reset/Kconfig | 11 ++ + drivers/power/reset/Makefile | 1 + + drivers/power/reset/linkstation-poweroff.c | 136 +++++++++++++++++++++ + 3 files changed, 148 insertions(+) + create mode 100644 drivers/power/reset/linkstation-poweroff.c + +--- a/drivers/power/reset/Kconfig ++++ b/drivers/power/reset/Kconfig +@@ -99,6 +99,17 @@ config POWER_RESET_HISI + help + Reboot support for Hisilicon boards. + ++config POWER_RESET_LINKSTATION ++ tristate "Buffalo LinkStation power-off driver" ++ depends on ARCH_MVEBU || COMPILE_TEST ++ depends on OF_MDIO && PHYLIB ++ help ++ This driver supports turning off some Buffalo LinkStations by ++ setting an output pin at the ethernet PHY to the correct state. ++ It also makes the device compatible with the WoL function. ++ ++ Say Y here if you have a Buffalo LinkStation LS421D/E. ++ + config POWER_RESET_MSM + bool "Qualcomm MSM power-off driver" + depends on ARCH_QCOM +--- a/drivers/power/reset/Makefile ++++ b/drivers/power/reset/Makefile +@@ -10,6 +10,7 @@ obj-$(CONFIG_POWER_RESET_GEMINI_POWEROFF + obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o + obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o + obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o ++obj-${CONFIG_POWER_RESET_LINKSTATION} += linkstation-poweroff.o + obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o + obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o + obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o +--- /dev/null ++++ b/drivers/power/reset/linkstation-poweroff.c +@@ -0,0 +1,144 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * LinkStation power off restart driver ++ * Copyright (C) 2020 Daniel González Cabanelas ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Defines from the eth phy Marvell driver */ ++#define MII_MARVELL_COPPER_PAGE 0 ++#define MII_MARVELL_LED_PAGE 3 ++#define MII_MARVELL_WOL_PAGE 17 ++#define MII_MARVELL_PHY_PAGE 22 ++ ++#define MII_PHY_LED_CTRL 16 ++#define MII_88E1318S_PHY_LED_TCR 18 ++#define MII_88E1318S_PHY_WOL_CTRL 16 ++#define MII_M1011_IEVENT 19 ++ ++#define MII_88E1318S_PHY_LED_TCR_INTn_ENABLE BIT(7) ++#define MII_88E1318S_PHY_LED_TCR_FORCE_INT BIT(15) ++#define MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS BIT(12) ++#define LED2_FORCE_ON (0x8 << 8) ++#define LEDMASK GENMASK(11,8) ++ ++static struct phy_device *phydev; ++ ++static void mvphy_reg_intn(u16 data) ++{ ++ int rc = 0, saved_page; ++ ++ saved_page = phy_select_page(phydev, MII_MARVELL_LED_PAGE); ++ if (saved_page < 0) ++ goto err; ++ ++ /* Force manual LED2 control to let INTn work */ ++ __phy_modify(phydev, MII_PHY_LED_CTRL, LEDMASK, LED2_FORCE_ON); ++ ++ /* Set the LED[2]/INTn pin to the required state */ ++ __phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, ++ MII_88E1318S_PHY_LED_TCR_FORCE_INT, ++ MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | data); ++ ++ if (!data) { ++ /* Clear interrupts to ensure INTn won't be holded in high state */ ++ __phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_COPPER_PAGE); ++ __phy_read(phydev, MII_M1011_IEVENT); ++ ++ /* If WOL was enabled and a magic packet was received before powering ++ * off, we won't be able to wake up by sending another magic packet. ++ * Clear WOL status. ++ */ ++ __phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_WOL_PAGE); ++ __phy_set_bits(phydev, MII_88E1318S_PHY_WOL_CTRL, ++ MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS); ++ } ++err: ++ rc = phy_restore_page(phydev, saved_page, rc); ++ if (rc < 0) ++ dev_err(&phydev->mdio.dev, "Write register failed, %d\n", rc); ++ ++ if (!data) { ++ /* Slow down the PHY to save energy */ ++ rc= phy_speed_down(phydev, false); ++ if (rc < 0) ++ dev_err(&phydev->mdio.dev, "PHY speed down failed, %d\n", rc); ++ } ++} ++ ++static int linkstation_reboot_notifier(struct notifier_block *nb, ++ unsigned long action, void *unused) ++{ ++ if (action == SYS_RESTART) ++ mvphy_reg_intn(MII_88E1318S_PHY_LED_TCR_FORCE_INT); ++ ++ return NOTIFY_DONE; ++} ++ ++static struct notifier_block linkstation_reboot_nb = { ++ .notifier_call = linkstation_reboot_notifier, ++}; ++ ++static void linkstation_poweroff(void) ++{ ++ unregister_reboot_notifier(&linkstation_reboot_nb); ++ mvphy_reg_intn(0); ++ ++ kernel_restart("Power off"); ++} ++ ++static const struct of_device_id ls_poweroff_of_match[] = { ++ { .compatible = "buffalo,ls421d" }, ++ { .compatible = "buffalo,ls421de" }, ++ { }, ++}; ++ ++static int __init linkstation_poweroff_init(void) ++{ ++ struct mii_bus *bus; ++ struct device_node *dn; ++ ++ dn = of_find_matching_node(NULL, ls_poweroff_of_match); ++ if (!dn) ++ return -ENODEV; ++ of_node_put(dn); ++ ++ dn = of_find_node_by_name(NULL, "mdio"); ++ if (!dn) ++ return -ENODEV; ++ ++ bus = of_mdio_find_bus(dn); ++ of_node_put(dn); ++ if (!bus) ++ return -EPROBE_DEFER; ++ ++ phydev = phy_find_first(bus); ++ if (!phydev) ++ return -EPROBE_DEFER; ++ ++ register_reboot_notifier(&linkstation_reboot_nb); ++ pm_power_off = linkstation_poweroff; ++ ++ pr_info("LinkStation power off driver registered\n"); ++ return 0; ++} ++ ++static void __exit linkstation_poweroff_exit(void) ++{ ++ pm_power_off = NULL; ++ unregister_reboot_notifier(&linkstation_reboot_nb); ++} ++ ++module_init(linkstation_poweroff_init); ++module_exit(linkstation_poweroff_exit); ++ ++MODULE_AUTHOR("Daniel González Cabanelas "); ++MODULE_DESCRIPTION("LinkStation power off driver"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/mvebu/patches-5.10/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch b/target/linux/mvebu/patches-5.10/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch new file mode 100644 index 0000000000..bb9d7b7849 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch @@ -0,0 +1,44 @@ +From b0c6ae0f8948a2be6bf4e8b4bbab9ca1343289b6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Wed, 2 Sep 2020 16:43:44 +0200 +Subject: [PATCH] PCI: aardvark: Fix initialization with old Marvell's Arm + Trusted Firmware +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Old ATF automatically power on pcie phy and does not provide SMC call for +phy power on functionality which leads to aardvark initialization failure: + +[ 0.330134] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware +[ 0.338846] phy phy-d0018300.phy.1: phy poweron failed --> -95 +[ 0.344753] advk-pcie d0070000.pcie: Failed to initialize PHY (-95) +[ 0.351160] advk-pcie: probe of d0070000.pcie failed with error -95 + +This patch fixes above failure by ignoring 'not supported' error in +aardvark driver. In this case it is expected that phy is already power on. + +Tested-by: Tomasz Maciej Nowak +Link: https://lore.kernel.org/r/20200902144344.16684-3-pali@kernel.org +Fixes: 366697018c9a ("PCI: aardvark: Add PHY support") +Signed-off-by: Pali Rohár +Signed-off-by: Lorenzo Pieralisi +Reviewed-by: Rob Herring +Cc: # 5.8+: ea17a0f153af: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno +--- + drivers/pci/controller/pci-aardvark.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/pci/controller/pci-aardvark.c ++++ b/drivers/pci/controller/pci-aardvark.c +@@ -1123,7 +1123,9 @@ static int advk_pcie_enable_phy(struct a + } + + ret = phy_power_on(pcie->phy); +- if (ret) { ++ if (ret == -EOPNOTSUPP) { ++ dev_warn(&pcie->pdev->dev, "PHY unsupported by firmware\n"); ++ } else if (ret) { + phy_exit(pcie->phy); + return ret; + } diff --git a/target/linux/mvebu/patches-5.10/027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch b/target/linux/mvebu/patches-5.10/027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch new file mode 100644 index 0000000000..927670d8b3 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch @@ -0,0 +1,88 @@ +From b64d814257b027e29a474bcd660f6372490138c7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Mon, 7 Sep 2020 13:27:17 +0200 +Subject: [PATCH] arm64: dts: marvell: espressobin: Add ethernet switch aliases +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Espressobin boards have 3 ethernet ports and some of them got assigned more +then one MAC address. MAC addresses are stored in U-Boot environment. + +Since commit a2c7023f7075c ("net: dsa: read mac address from DT for slave +device") kernel can use MAC addresses from DT for particular DSA port. + +Currently Espressobin DTS file contains alias just for ethernet0. + +This patch defines additional ethernet aliases in Espressobin DTS files, so +bootloader can fill correct MAC address for DSA switch ports if more MAC +addresses were specified. + +DT alias ethernet1 is used for wan port, DT aliases ethernet2 and ethernet3 +are used for lan ports for both Espressobin revisions (V5 and V7). + +Fixes: 5253cb8c00a6f ("arm64: dts: marvell: espressobin: add ethernet alias") +Cc: # a2c7023f7075c: dsa: read mac address +Signed-off-by: Pali Rohár +Reviewed-by: Andrew Lunn +Reviewed-by: Andre Heider +Signed-off-by: Gregory CLEMENT +--- + .../dts/marvell/armada-3720-espressobin-v7-emmc.dts | 10 ++++++++-- + .../boot/dts/marvell/armada-3720-espressobin-v7.dts | 10 ++++++++-- + 3 files changed, 24 insertions(+), 8 deletions(-) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts +@@ -15,16 +15,22 @@ + compatible = "globalscale,espressobin-v7-emmc", "globalscale,espressobin-v7", + "globalscale,espressobin", "marvell,armada3720", + "marvell,armada3710"; ++ ++ aliases { ++ /* ethernet1 is wan port */ ++ ethernet1 = &switch0port3; ++ ethernet3 = &switch0port1; ++ }; + }; + + &ports { +- port@1 { ++ switch0port1: port@1 { + reg = <1>; + label = "lan1"; + phy-handle = <&switch0phy0>; + }; + +- port@3 { ++ switch0port3: port@3 { + reg = <3>; + label = "wan"; + phy-handle = <&switch0phy2>; +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts +@@ -14,16 +14,22 @@ + model = "Globalscale Marvell ESPRESSOBin Board V7"; + compatible = "globalscale,espressobin-v7", "globalscale,espressobin", + "marvell,armada3720", "marvell,armada3710"; ++ ++ aliases { ++ /* ethernet1 is wan port */ ++ ethernet1 = &switch0port3; ++ ethernet3 = &switch0port1; ++ }; + }; + + &ports { +- port@1 { ++ switch0port1: port@1 { + reg = <1>; + label = "lan1"; + phy-handle = <&switch0phy0>; + }; + +- port@3 { ++ switch0port3: port@3 { + reg = <3>; + label = "wan"; + phy-handle = <&switch0phy2>; diff --git a/target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch b/target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch new file mode 100644 index 0000000000..c3abae60a6 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch @@ -0,0 +1,65 @@ +From da57203dc7fd556fbb3f0ec7d7d7c0b0e893b386 Mon Sep 17 00:00:00 2001 +From: Tomasz Maciej Nowak +Date: Tue, 10 Nov 2020 16:38:31 +0100 +Subject: [PATCH] arm64: dts: mcbin-singleshot: add heartbeat LED + +With board revision 1.3, SolidRun moved the power LED to the middle of +the board. In old place of power LED a GPIO controllable heartbeat LED +was added. This commit only touches Single Shot variant, since only this +variant is all revision 1.3. + +Note: +This is slightly modified patch. Some boards could be placed in an +enclosure, so the LED18 is enabled by default, since that'll be the only +visible indicator that the board is operating. + +Reported-by: Alexandra Alth +Signed-off-by: Tomasz Maciej Nowak +Signed-off-by: Gregory CLEMENT +--- + .../marvell/armada-8040-mcbin-singleshot.dts | 22 +++++++++++++++++++ + 1 file changed, 22 insertions(+) + +--- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin-singleshot.dts ++++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin-singleshot.dts +@@ -5,6 +5,8 @@ + * Device Tree file for MACCHIATOBin Armada 8040 community board platform + */ + ++#include ++ + #include "armada-8040-mcbin.dtsi" + + / { +@@ -12,6 +14,20 @@ + compatible = "marvell,armada8040-mcbin-singleshot", + "marvell,armada8040-mcbin", "marvell,armada8040", + "marvell,armada-ap806-quad", "marvell,armada-ap806"; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-0 = <&cp0_led18_pins>; ++ pinctrl-names = "default"; ++ ++ led18 { ++ gpios = <&cp0_gpio2 1 GPIO_ACTIVE_LOW>; ++ function = LED_FUNCTION_HEARTBEAT; ++ color = ; ++ linux,default-trigger = "heartbeat"; ++ default-state = "on"; ++ }; ++ }; + }; + + &cp0_eth0 { +@@ -27,3 +43,10 @@ + managed = "in-band-status"; + sfp = <&sfp_eth1>; + }; ++ ++&cp0_pinctrl { ++ cp0_led18_pins: led18-pins { ++ marvell,pins = "mpp33"; ++ marvell,function = "gpio"; ++ }; ++}; diff --git a/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch new file mode 100644 index 0000000000..fd60cdb322 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -0,0 +1,208 @@ +From 71270226b14733a4b1f2cde58ea9265caa50b38d Mon Sep 17 00:00:00 2001 +From: Adrian Panella +Date: Thu, 9 Mar 2017 09:37:17 +0100 +Subject: [PATCH 67/69] generic: Mangle bootloader's kernel arguments + +The command-line arguments provided by the boot loader will be +appended to a new device tree property: bootloader-args. +If there is a property "append-rootblock" in DT under /chosen +and a root= option in bootloaders command line it will be parsed +and added to DT bootargs with the form: XX. +Only command line ATAG will be processed, the rest of the ATAGs +sent by bootloader will be ignored. +This is usefull in dual boot systems, to get the current root partition +without afecting the rest of the system. + +Signed-off-by: Adrian Panella + +This patch has been modified to be mvebu specific. The original patch +did not pass the bootloader cmdline on if no append-rootblock stanza +was found, resulting in blank cmdline and failure to boot. + +Signed-off-by: Michael Gray +--- + arch/arm/Kconfig | 11 ++++ + arch/arm/boot/compressed/atags_to_fdt.c | 85 ++++++++++++++++++++++++- + init/main.c | 16 +++++ + 3 files changed, 111 insertions(+), 1 deletion(-) + +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN + The command-line arguments provided by the boot loader will be + appended to the the device tree bootargs property. + ++config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE ++ bool "Append rootblock parsing bootloader's kernel arguments" ++ help ++ The command-line arguments provided by the boot loader will be ++ appended to a new device tree property: bootloader-args. ++ If there is a property "append-rootblock" in DT under /chosen ++ and a root= option in bootloaders command line it will be parsed ++ and added to DT bootargs with the form: XX. ++ Only command line ATAG will be processed, the rest of the ATAGs ++ sent by bootloader will be ignored. ++ + endchoice + + config CMDLINE +--- a/arch/arm/boot/compressed/atags_to_fdt.c ++++ b/arch/arm/boot/compressed/atags_to_fdt.c +@@ -4,6 +4,8 @@ + + #if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND) + #define do_extend_cmdline 1 ++#elif defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) ++#define do_extend_cmdline 1 + #else + #define do_extend_cmdline 0 + #endif +@@ -67,6 +69,72 @@ static uint32_t get_cell_size(const void + return cell_size; + } + ++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) ++ ++static char *append_rootblock(char *dest, const char *str, int len, void *fdt) ++{ ++ char *ptr, *end; ++ char *root="root="; ++ int i, l; ++ const char *rootblock; ++ ++ //ARM doesn't have __HAVE_ARCH_STRSTR, so search manually ++ ptr = str - 1; ++ ++ do { ++ //first find an 'r' at the begining or after a space ++ do { ++ ptr++; ++ ptr = strchr(ptr, 'r'); ++ if (!ptr) ++ goto no_append; ++ ++ } while (ptr != str && *(ptr-1) != ' '); ++ ++ //then check for the rest ++ for(i = 1; i <= 4; i++) ++ if(*(ptr+i) != *(root+i)) break; ++ ++ } while (i != 5); ++ ++ end = strchr(ptr, ' '); ++ end = end ? (end - 1) : (strchr(ptr, 0) - 1); ++ ++ //find partition number (assumes format root=/dev/mtdXX | /dev/mtdblockXX | yy:XX ) ++ for( i = 0; end >= ptr && *end >= '0' && *end <= '9'; end--, i++); ++ ptr = end + 1; ++ ++ /* if append-rootblock property is set use it to append to command line */ ++ rootblock = getprop(fdt, "/chosen", "append-rootblock", &l); ++ if (rootblock == NULL) ++ goto no_append; ++ ++ if (*dest != ' ') { ++ *dest = ' '; ++ dest++; ++ len++; ++ } ++ ++ if (len + l + i <= COMMAND_LINE_SIZE) { ++ memcpy(dest, rootblock, l); ++ dest += l - 1; ++ memcpy(dest, ptr, i); ++ dest += i; ++ } ++ ++ return dest; ++ ++no_append: ++ len = strlen(str); ++ if (len + 1 < COMMAND_LINE_SIZE) { ++ memcpy(dest, str, len); ++ dest += len; ++ } ++ ++ return dest; ++} ++#endif ++ + static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline) + { + char cmdline[COMMAND_LINE_SIZE]; +@@ -86,12 +154,21 @@ static void merge_fdt_bootargs(void *fdt + + /* and append the ATAG_CMDLINE */ + if (fdt_cmdline) { ++ ++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) ++ //save original bootloader args ++ //and append ubi.mtd with root partition number to current cmdline ++ setprop_string(fdt, "/chosen", "bootloader-args", fdt_cmdline); ++ ptr = append_rootblock(ptr, fdt_cmdline, len, fdt); ++ ++#else + len = strlen(fdt_cmdline); + if (ptr - cmdline + len + 2 < COMMAND_LINE_SIZE) { + *ptr++ = ' '; + memcpy(ptr, fdt_cmdline, len); + ptr += len; + } ++#endif + } + *ptr = '\0'; + +@@ -166,7 +243,9 @@ int atags_to_fdt(void *atag_list, void * + else + setprop_string(fdt, "/chosen", "bootargs", + atag->u.cmdline.cmdline); +- } else if (atag->hdr.tag == ATAG_MEM) { ++ } ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE ++ else if (atag->hdr.tag == ATAG_MEM) { + if (memcount >= sizeof(mem_reg_property)/4) + continue; + if (!atag->u.mem.size) +@@ -210,6 +289,10 @@ int atags_to_fdt(void *atag_list, void * + setprop(fdt, "/memory", "reg", mem_reg_property, + 4 * memcount * memsize); + } ++#else ++ ++ } ++#endif + + return fdt_pack(fdt); + } +--- a/init/main.c ++++ b/init/main.c +@@ -104,6 +104,10 @@ + #define CREATE_TRACE_POINTS + #include + ++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) ++#include ++#endif ++ + static int kernel_init(void *); + + extern void init_IRQ(void); +@@ -631,6 +635,18 @@ asmlinkage __visible void __init start_k + page_alloc_init(); + + pr_notice("Kernel command line: %s\n", boot_command_line); ++ ++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) ++ //Show bootloader's original command line for reference ++ if(of_chosen) { ++ const char *prop = of_get_property(of_chosen, "bootloader-args", NULL); ++ if(prop) ++ pr_notice("Bootloader command line (ignored): %s\n", prop); ++ else ++ pr_notice("Bootloader command line not present\n"); ++ } ++#endif ++ + /* parameters may set static keys */ + jump_label_init(); + parse_early_param(); diff --git a/target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch b/target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch new file mode 100644 index 0000000000..b8ab700c97 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/mach-mvebu/Kconfig ++++ b/arch/arm/mach-mvebu/Kconfig +@@ -69,6 +69,7 @@ config MACH_ARMADA_38X + select HAVE_SMP + select MACH_MVEBU_V7 + select PINCTRL_ARMADA_38X ++ select ARCH_WANT_LIBATA_LEDS + help + Say 'Y' here if you want your kernel to support boards based + on the Marvell Armada 380/385 SoC with device tree. diff --git a/target/linux/mvebu/patches-5.10/302-add_powertables.patch b/target/linux/mvebu/patches-5.10/302-add_powertables.patch new file mode 100644 index 0000000000..efbbbc7d78 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/302-add_powertables.patch @@ -0,0 +1,770 @@ +--- a/arch/arm/boot/dts/armada-385-linksys.dtsi ++++ b/arch/arm/boot/dts/armada-385-linksys.dtsi +@@ -212,11 +212,19 @@ + &pcie1 { + /* Marvell 88W8864, 5GHz-only */ + status = "okay"; ++ ++ mwlwifi { ++ marvell,2ghz = <0>; ++ }; + }; + + &pcie2 { + /* Marvell 88W8864, 2GHz-only */ + status = "okay"; ++ ++ mwlwifi { ++ marvell,5ghz = <0>; ++ }; + }; + + &pinctrl { +--- a/arch/arm/boot/dts/armada-385-linksys-caiman.dts ++++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts +@@ -142,3 +142,205 @@ + }; + }; + }; ++ ++&pcie1 { ++ mwlwifi { ++ marvell,chainmask = <2 2>; ++ marvell,powertable { ++ AU = ++ <36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <100 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <104 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <108 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <112 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <116 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <120 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <124 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <128 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <132 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <136 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <140 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, ++ <149 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>, ++ <153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>, ++ <157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>, ++ <161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>, ++ <165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>; ++ CA = ++ <36 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>, ++ <40 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>, ++ <44 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>, ++ <48 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, ++ <153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, ++ <157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, ++ <161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, ++ <165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>; ++ CN = ++ <36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <149 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x11 0x11 0x11 0x11 0 0xf>, ++ <153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>, ++ <157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>, ++ <161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>, ++ <165 0 0x15 0x15 0x15 0x15 0x16 0x16 0x16 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>; ++ ETSI = ++ <36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, ++ <149 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>; ++ FCC = ++ <36 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <40 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <44 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <48 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, ++ <153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, ++ <157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, ++ <161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, ++ <165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>; ++ }; ++ }; ++}; ++ ++&pcie2 { ++ mwlwifi { ++ marvell,chainmask = <2 2>; ++ marvell,powertable { ++ AU = ++ <1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>; ++ CA = ++ <1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x00 0x00 0x00 0x00 0 0xf>, ++ <2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, ++ <11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x00 0x00 0x00 0x00 0 0xf>; ++ CN = ++ <1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <14 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>; ++ ETSI = ++ <1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, ++ <13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>; ++ FCC = ++ <1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x0 0x0 0x0 0x0 0 0xf>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/armada-385-linksys-cobra.dts ++++ b/arch/arm/boot/dts/armada-385-linksys-cobra.dts +@@ -142,3 +142,205 @@ + }; + }; + }; ++ ++&pcie1 { ++ mwlwifi { ++ marvell,chainmask = <4 4>; ++ marvell,powertable { ++ AU = ++ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, ++ <153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, ++ <157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, ++ <161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, ++ <165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>; ++ CA = ++ <36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>; ++ CN = ++ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>; ++ ETSI = ++ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>; ++ FCC = ++ <36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>, ++ <40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, ++ <44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, ++ <48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>; ++ }; ++ }; ++}; ++ ++&pcie2 { ++ mwlwifi { ++ marvell,chainmask = <4 4>; ++ marvell,powertable { ++ AU = ++ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; ++ CA = ++ <1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>; ++ CN = ++ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; ++ ETSI = ++ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; ++ FCC = ++ <1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/armada-385-linksys-shelby.dts ++++ b/arch/arm/boot/dts/armada-385-linksys-shelby.dts +@@ -142,3 +142,205 @@ + }; + }; + }; ++ ++&pcie1 { ++ mwlwifi { ++ marvell,chainmask = <4 4>; ++ marvell,powertable { ++ AU = ++ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, ++ <153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, ++ <157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, ++ <161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, ++ <165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>; ++ CA = ++ <36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>; ++ CN = ++ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, ++ <165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>; ++ ETSI = ++ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, ++ <149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>; ++ FCC = ++ <36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>, ++ <40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, ++ <44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, ++ <48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, ++ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, ++ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, ++ <149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, ++ <165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>; ++ }; ++ }; ++}; ++ ++&pcie2 { ++ mwlwifi { ++ marvell,chainmask = <4 4>; ++ marvell,powertable { ++ AU = ++ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; ++ CA = ++ <1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>; ++ CN = ++ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; ++ ETSI = ++ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, ++ <13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; ++ FCC = ++ <1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/armada-385-linksys-rango.dts ++++ b/arch/arm/boot/dts/armada-385-linksys-rango.dts +@@ -157,6 +157,18 @@ + }; + }; + ++&pcie1 { ++ mwlwifi { ++ marvell,chainmask = <4 4>; ++ }; ++}; ++ ++&pcie2 { ++ mwlwifi { ++ marvell,chainmask = <4 4>; ++ }; ++}; ++ + &sdhci { + pinctrl-names = "default"; + pinctrl-0 = <&sdhci_pins>; +--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts ++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts +@@ -225,12 +225,100 @@ + pcie@2,0 { + /* Port 0, Lane 1 */ + status = "okay"; ++ ++ mwlwifi { ++ marvell,5ghz = <0>; ++ marvell,chainmask = <4 4>; ++ marvell,powertable { ++ FCC = ++ <1 0 0x17 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0x17 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>; ++ ++ ETSI = ++ <1 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <2 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <3 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <4 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <5 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <6 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <7 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <8 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <9 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <10 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <11 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <12 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, ++ <13 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>; ++ }; ++ }; + }; + + /* Second mini-PCIe port */ + pcie@3,0 { + /* Port 0, Lane 3 */ + status = "okay"; ++ ++ mwlwifi { ++ marvell,2ghz = <0>; ++ marvell,chainmask = <4 4>; ++ marvell,powertable { ++ FCC = ++ <36 0 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <40 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <44 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <48 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, ++ <52 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>, ++ <56 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>, ++ <60 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>, ++ <64 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>, ++ <100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, ++ <149 0 0x16 0x16 0x16 0x16 0x14 0x14 0x14 0x14 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>, ++ <153 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>, ++ <157 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>, ++ <161 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>, ++ <165 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>; ++ ++ ETSI = ++ <36 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <40 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <44 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <48 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <52 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <56 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <60 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <64 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <100 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <104 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <108 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <112 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <116 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <120 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <124 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <128 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <132 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <136 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <140 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, ++ <149 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>; ++ }; ++ }; + }; + }; + diff --git a/target/linux/mvebu/patches-5.10/303-linksys_hardcode_nand_ecc_settings.patch b/target/linux/mvebu/patches-5.10/303-linksys_hardcode_nand_ecc_settings.patch new file mode 100644 index 0000000000..89a5e19803 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/303-linksys_hardcode_nand_ecc_settings.patch @@ -0,0 +1,17 @@ +Newer Linksys boards might come with a Winbond W29N02GV which can be +configured in different ways. Make sure we configure it the same way +as the older chips so everything keeps working. + +Signed-off-by: Imre Kaloz + +--- a/arch/arm/boot/dts/armada-385-linksys.dtsi ++++ b/arch/arm/boot/dts/armada-385-linksys.dtsi +@@ -148,6 +148,8 @@ + reg = <0>; + label = "pxa3xx_nand-0"; + nand-rb = <0>; ++ nand-ecc-strength = <4>; ++ nand-ecc-step-size = <512>; + marvell,nand-keep-config; + nand-on-flash-bbt; + }; diff --git a/target/linux/mvebu/patches-5.10/304-revert_i2c_delay.patch b/target/linux/mvebu/patches-5.10/304-revert_i2c_delay.patch new file mode 100644 index 0000000000..930c0f9494 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/304-revert_i2c_delay.patch @@ -0,0 +1,15 @@ +--- a/arch/arm/boot/dts/armada-xp.dtsi ++++ b/arch/arm/boot/dts/armada-xp.dtsi +@@ -237,12 +237,10 @@ + }; + + &i2c0 { +- compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c"; + reg = <0x11000 0x100>; + }; + + &i2c1 { +- compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c"; + reg = <0x11100 0x100>; + }; + diff --git a/target/linux/mvebu/patches-5.10/305-armada-385-rd-mtd-partitions.patch b/target/linux/mvebu/patches-5.10/305-armada-385-rd-mtd-partitions.patch new file mode 100644 index 0000000000..31bd53b1f3 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/305-armada-385-rd-mtd-partitions.patch @@ -0,0 +1,19 @@ +--- a/arch/arm/boot/dts/armada-388-rd.dts ++++ b/arch/arm/boot/dts/armada-388-rd.dts +@@ -103,6 +103,16 @@ + compatible = "st,m25p128", "jedec,spi-nor"; + reg = <0>; /* Chip select 0 */ + spi-max-frequency = <108000000>; ++ ++ partition@0 { ++ label = "uboot"; ++ reg = <0 0x400000>; ++ }; ++ ++ partition@1 { ++ label = "firmware"; ++ reg = <0x400000 0xc00000>; ++ }; + }; + }; + diff --git a/target/linux/mvebu/patches-5.10/306-ARM-mvebu-385-ap-Add-partitions.patch b/target/linux/mvebu/patches-5.10/306-ARM-mvebu-385-ap-Add-partitions.patch new file mode 100644 index 0000000000..2057e31c7e --- /dev/null +++ b/target/linux/mvebu/patches-5.10/306-ARM-mvebu-385-ap-Add-partitions.patch @@ -0,0 +1,35 @@ +From 9861f93a59142a3131870df2521eb2deb73026d7 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 13 Jan 2015 11:14:09 +0100 +Subject: [PATCH 2/2] ARM: mvebu: 385-ap: Add partitions + +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/armada-385-db-ap.dts | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/arch/arm/boot/dts/armada-385-db-ap.dts ++++ b/arch/arm/boot/dts/armada-385-db-ap.dts +@@ -218,19 +218,19 @@ + #size-cells = <1>; + + partition@0 { +- label = "U-Boot"; ++ label = "u-boot"; + reg = <0x00000000 0x00800000>; + read-only; + }; + + partition@800000 { +- label = "uImage"; ++ label = "kernel"; + reg = <0x00800000 0x00400000>; + read-only; + }; + + partition@c00000 { +- label = "Root"; ++ label = "ubi"; + reg = <0x00c00000 0x3f400000>; + }; + }; diff --git a/target/linux/mvebu/patches-5.10/307-armada-xp-linksys-mamba-broken-idle.patch b/target/linux/mvebu/patches-5.10/307-armada-xp-linksys-mamba-broken-idle.patch new file mode 100644 index 0000000000..16112d53fc --- /dev/null +++ b/target/linux/mvebu/patches-5.10/307-armada-xp-linksys-mamba-broken-idle.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts ++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts +@@ -485,3 +485,7 @@ + }; + }; + }; ++ ++&coherencyfab { ++ broken-idle; ++}; diff --git a/target/linux/mvebu/patches-5.10/308-armada-xp-linksys-mamba-wan.patch b/target/linux/mvebu/patches-5.10/308-armada-xp-linksys-mamba-wan.patch new file mode 100644 index 0000000000..4315abc7d2 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/308-armada-xp-linksys-mamba-wan.patch @@ -0,0 +1,11 @@ +--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts ++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts +@@ -387,7 +387,7 @@ + + port@4 { + reg = <4>; +- label = "internet"; ++ label = "wan"; + }; + + port@5 { diff --git a/target/linux/mvebu/patches-5.10/309-linksys-status-led.patch b/target/linux/mvebu/patches-5.10/309-linksys-status-led.patch new file mode 100644 index 0000000000..e5e83572c9 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/309-linksys-status-led.patch @@ -0,0 +1,50 @@ +--- a/arch/arm/boot/dts/armada-385-linksys.dtsi ++++ b/arch/arm/boot/dts/armada-385-linksys.dtsi +@@ -14,6 +14,13 @@ + compatible = "linksys,armada385", "marvell,armada385", + "marvell,armada380"; + ++ aliases { ++ led-boot = &led_power; ++ led-failsafe = &led_power; ++ led-running = &led_power; ++ led-upgrade = &led_power; ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; +@@ -71,7 +78,7 @@ + pinctrl-0 = <&gpio_leds_pins>; + pinctrl-names = "default"; + +- power { ++ led_power: power { + gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; +--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts ++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts +@@ -26,6 +26,13 @@ + compatible = "linksys,mamba", "marvell,armadaxp-mv78230", + "marvell,armadaxp", "marvell,armada-370-xp"; + ++ aliases { ++ led-boot = &led_power; ++ led-failsafe = &led_power; ++ led-running = &led_power; ++ led-upgrade = &led_power; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; +@@ -197,7 +204,7 @@ + pinctrl-0 = <&power_led_pin>; + pinctrl-names = "default"; + +- power { ++ led_power: power { + label = "mamba:white:power"; + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + default-state = "on"; diff --git a/target/linux/mvebu/patches-5.10/310-linksys-use-eth0-as-cpu-port.patch b/target/linux/mvebu/patches-5.10/310-linksys-use-eth0-as-cpu-port.patch new file mode 100644 index 0000000000..84d49a004b --- /dev/null +++ b/target/linux/mvebu/patches-5.10/310-linksys-use-eth0-as-cpu-port.patch @@ -0,0 +1,25 @@ +--- a/arch/arm/boot/dts/armada-385-linksys.dtsi ++++ b/arch/arm/boot/dts/armada-385-linksys.dtsi +@@ -116,7 +116,7 @@ + }; + + ð2 { +- status = "okay"; ++ status = "disabled"; + phy-mode = "sgmii"; + buffer-manager = <&bm>; + bm,pool-long = <2>; +@@ -200,10 +200,10 @@ + label = "wan"; + }; + +- port@5 { +- reg = <5>; ++ port@6 { ++ reg = <6>; + label = "cpu"; +- ethernet = <ð2>; ++ ethernet = <ð0>; + + fixed-link { + speed = <1000>; diff --git a/target/linux/mvebu/patches-5.10/311-adjust-compatible-for-linksys.patch b/target/linux/mvebu/patches-5.10/311-adjust-compatible-for-linksys.patch new file mode 100644 index 0000000000..a5d3e63810 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/311-adjust-compatible-for-linksys.patch @@ -0,0 +1,68 @@ +--- a/arch/arm/boot/dts/armada-385-linksys-rango.dts ++++ b/arch/arm/boot/dts/armada-385-linksys-rango.dts +@@ -12,8 +12,8 @@ + + / { + model = "Linksys WRT3200ACM"; +- compatible = "linksys,rango", "linksys,armada385", "marvell,armada385", +- "marvell,armada380"; ++ compatible = "linksys,wrt3200acm", "linksys,rango", "linksys,armada385", ++ "marvell,armada385", "marvell,armada380"; + }; + + &expander0 { +--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts ++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts +@@ -22,9 +22,10 @@ + #include "armada-xp-mv78230.dtsi" + + / { +- model = "Linksys WRT1900AC"; +- compatible = "linksys,mamba", "marvell,armadaxp-mv78230", +- "marvell,armadaxp", "marvell,armada-370-xp"; ++ model = "Linksys WRT1900AC v1"; ++ compatible = "linksys,wrt1900ac-v1", "linksys,mamba", ++ "marvell,armadaxp-mv78230", "marvell,armadaxp", ++ "marvell,armada-370-xp"; + + aliases { + led-boot = &led_power; +--- a/arch/arm/boot/dts/armada-385-linksys-cobra.dts ++++ b/arch/arm/boot/dts/armada-385-linksys-cobra.dts +@@ -9,8 +9,9 @@ + #include "armada-385-linksys.dtsi" + + / { +- model = "Linksys WRT1900ACv2"; +- compatible = "linksys,cobra", "linksys,armada385", "marvell,armada385", ++ model = "Linksys WRT1900AC v2"; ++ compatible = "linksys,wrt1900ac-v2", "linksys,cobra", ++ "linksys,armada385", "marvell,armada385", + "marvell,armada380"; + }; + +--- a/arch/arm/boot/dts/armada-385-linksys-caiman.dts ++++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts +@@ -10,8 +10,8 @@ + + / { + model = "Linksys WRT1200AC"; +- compatible = "linksys,caiman", "linksys,armada385", "marvell,armada385", +- "marvell,armada380"; ++ compatible = "linksys,wrt1200ac", "linksys,caiman", "linksys,armada385", ++ "marvell,armada385", "marvell,armada380"; + }; + + &expander0 { +--- a/arch/arm/boot/dts/armada-385-linksys-shelby.dts ++++ b/arch/arm/boot/dts/armada-385-linksys-shelby.dts +@@ -10,7 +10,8 @@ + + / { + model = "Linksys WRT1900ACS"; +- compatible = "linksys,shelby", "linksys,armada385", "marvell,armada385", ++ compatible = "linksys,wrt1900acs", "linksys,shelby", ++ "linksys,armada385", "marvell,armada385", + "marvell,armada380"; + }; + diff --git a/target/linux/mvebu/patches-5.10/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch b/target/linux/mvebu/patches-5.10/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch new file mode 100644 index 0000000000..dd2bef7f63 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch @@ -0,0 +1,87 @@ +From 8137da20701c776ad3481115305a5e8e410871ba Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Tue, 29 Nov 2016 10:15:45 +0000 +Subject: ARM: dts: armada388-clearfog: emmc on clearfog base + +Signed-off-by: Russell King +--- + arch/arm/boot/dts/armada-388-clearfog-base.dts | 1 + + .../dts/armada-38x-solidrun-microsom-emmc.dtsi | 62 ++++++++++++++++++++++ + 2 files changed, 63 insertions(+) + create mode 100644 arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi + +--- a/arch/arm/boot/dts/armada-388-clearfog-base.dts ++++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts +@@ -7,6 +7,7 @@ + + /dts-v1/; + #include "armada-388-clearfog.dtsi" ++#include "armada-38x-solidrun-microsom-emmc.dtsi" + + / { + model = "SolidRun Clearfog Base A1"; +--- /dev/null ++++ b/arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi +@@ -0,0 +1,62 @@ ++/* ++ * Device Tree file for SolidRun Armada 38x Microsom add-on for eMMC ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This file is distributed in the hope that it will be useful ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++/ { ++ soc { ++ internal-regs { ++ sdhci@d8000 { ++ bus-width = <4>; ++ no-1-8-v; ++ non-removable; ++ pinctrl-0 = <µsom_sdhci_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ wp-inverted; ++ }; ++ }; ++ }; ++}; diff --git a/target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch b/target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch new file mode 100644 index 0000000000..4c4fbec764 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch @@ -0,0 +1,28 @@ +--- a/arch/arm/boot/dts/armada-388-helios4.dts ++++ b/arch/arm/boot/dts/armada-388-helios4.dts +@@ -15,6 +15,13 @@ + model = "Helios4"; + compatible = "kobol,helios4", "marvell,armada388", + "marvell,armada385", "marvell,armada380"; ++ ++ aliases { ++ led-boot = &led_status; ++ led-failsafe = &led_status; ++ led-running = &led_status; ++ led-upgrade = &led_status; ++ }; + + memory { + device_type = "memory"; +@@ -70,10 +77,9 @@ + + system-leds { + compatible = "gpio-leds"; +- status-led { ++ led_status: status-led { + label = "helios4:green:status"; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; +- linux,default-trigger = "heartbeat"; + default-state = "on"; + }; + diff --git a/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch b/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch new file mode 100644 index 0000000000..e989f59d5c --- /dev/null +++ b/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch @@ -0,0 +1,20 @@ +From be893f672e340b56ca60f2f6c32fdd713a5852f5 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Tue, 4 Jul 2017 19:25:28 -0600 +Subject: arm64: dts: marvell: armada37xx: Add eth0 alias + +Signed-off-by: Kevin Mihelich +--- + arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +@@ -18,6 +18,7 @@ + #size-cells = <2>; + + aliases { ++ ethernet0 = ð0; + serial0 = &uart0; + serial1 = &uart1; + }; diff --git a/target/linux/mvebu/patches-5.10/315-arm64-dts-marvell-armada-3720-espressobin-add-ports-.patch b/target/linux/mvebu/patches-5.10/315-arm64-dts-marvell-armada-3720-espressobin-add-ports-.patch new file mode 100644 index 0000000000..a741e378d9 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/315-arm64-dts-marvell-armada-3720-espressobin-add-ports-.patch @@ -0,0 +1,26 @@ +From 6ea9a1ee9367fb35acff1c08a0dc4213ff4687a0 Mon Sep 17 00:00:00 2001 +From: Tomasz Maciej Nowak +Date: Tue, 9 Apr 2019 15:53:42 +0200 +Subject: [PATCH] arm64: dts: marvell: armada-3720-espressobin: add ports + phandle + +Instead of referencing the whole mdio node, add ports phandle to adjust +port labels in dts for different hardware iterations of ESPRESSObin +boards. + +Signed-off-by: Tomasz Maciej Nowak +--- + arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts +@@ -147,7 +147,7 @@ + + dsa,member = <0 0>; + +- ports { ++ ports: ports { + #address-cells = <1>; + #size-cells = <0>; + diff --git a/target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch b/target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch new file mode 100644 index 0000000000..2240d0b39e --- /dev/null +++ b/target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch @@ -0,0 +1,34 @@ +Certain SFP modules (most notably Nokia GPON ones) first check +connectivity on 1000base-x, and switch to 2500base-x afterwards. This +is considered a quirk so the phylink switches the interface to +2500base-x as well. + +However, after power-cycling the uDPU device, network interface/SFP module +will not work correctly until the module is re-seated. This patch +resolves this issue by forcing the interface to be brought up in +2500base-x mode by default. + +Signed-off-by: Jakov Petrina +Signed-off-by: Vladimir Vid +Cc: Luka Perkov + +--- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts +@@ -162,7 +162,7 @@ + }; + + ð0 { +- phy-mode = "sgmii"; ++ phy-mode = "2500base-x"; + status = "okay"; + managed = "in-band-status"; + phys = <&comphy1 0>; +@@ -170,7 +170,7 @@ + }; + + ð1 { +- phy-mode = "sgmii"; ++ phy-mode = "2500base-x"; + status = "okay"; + managed = "in-band-status"; + phys = <&comphy0 1>; diff --git a/target/linux/mvebu/patches-5.10/400-find_active_root.patch b/target/linux/mvebu/patches-5.10/400-find_active_root.patch new file mode 100644 index 0000000000..854031b0d5 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/400-find_active_root.patch @@ -0,0 +1,60 @@ +The WRT1900AC among other Linksys routers uses a dual-firmware layout. +Dynamically rename the active partition to "ubi". + +Signed-off-by: Imre Kaloz + +--- a/drivers/mtd/parsers/ofpart.c ++++ b/drivers/mtd/parsers/ofpart.c +@@ -21,6 +21,8 @@ static bool node_has_compatible(struct d + return of_get_property(pp, "compatible", NULL); + } + ++static int mangled_rootblock; ++ + static int parse_fixed_partitions(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) +@@ -29,6 +31,7 @@ static int parse_fixed_partitions(struct + struct device_node *mtd_node; + struct device_node *ofpart_node; + const char *partname; ++ const char *owrtpart = "ubi"; + struct device_node *pp; + int nr_parts, i, ret = 0; + bool dedicated = true; +@@ -106,9 +109,13 @@ static int parse_fixed_partitions(struct + parts[i].size = of_read_number(reg + a_cells, s_cells); + parts[i].of_node = pp; + +- partname = of_get_property(pp, "label", &len); +- if (!partname) +- partname = of_get_property(pp, "name", &len); ++ if (mangled_rootblock && (i == mangled_rootblock)) { ++ partname = owrtpart; ++ } else { ++ partname = of_get_property(pp, "label", &len); ++ if (!partname) ++ partname = of_get_property(pp, "name", &len); ++ } + parts[i].name = partname; + + if (of_get_property(pp, "read-only", &len)) +@@ -215,6 +222,18 @@ static int __init ofpart_parser_init(voi + return 0; + } + ++static int __init active_root(char *str) ++{ ++ get_option(&str, &mangled_rootblock); ++ ++ if (!mangled_rootblock) ++ return 1; ++ ++ return 1; ++} ++ ++__setup("mangled_rootblock=", active_root); ++ + static void __exit ofpart_parser_exit(void) + { + deregister_mtd_parser(&ofpart_parser); diff --git a/target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch new file mode 100644 index 0000000000..a82a4c0d62 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch @@ -0,0 +1,34 @@ +The hardware queue scheduling is apparently configured with fixed +priorities, which creates a nasty fairness issue where traffic from one +CPU can starve traffic from all other CPUs. + +Work around this issue by forcing all tx packets to go through one CPU, +until this issue is fixed properly. + +Signed-off-by: Felix Fietkau +--- +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -4684,6 +4684,14 @@ static int mvneta_ethtool_set_eee(struct + return phylink_ethtool_set_eee(pp->phylink, eee); + } + ++static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb, ++ struct net_device *sb_dev) ++{ ++ /* XXX: hardware queue scheduling is broken, ++ * use only one queue until it is fixed */ ++ return 0; ++} ++ + static const struct net_device_ops mvneta_netdev_ops = { + .ndo_open = mvneta_open, + .ndo_stop = mvneta_stop, +@@ -4694,6 +4702,7 @@ static const struct net_device_ops mvnet + .ndo_fix_features = mvneta_fix_features, + .ndo_get_stats64 = mvneta_get_stats64, + .ndo_do_ioctl = mvneta_ioctl, ++ .ndo_select_queue = mvneta_select_queue, + .ndo_bpf = mvneta_xdp, + .ndo_xdp_xmit = mvneta_xdp_xmit, + }; diff --git a/target/linux/mvebu/patches-5.10/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch b/target/linux/mvebu/patches-5.10/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch new file mode 100644 index 0000000000..29f36be460 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch @@ -0,0 +1,40 @@ +From c28b2d367da8a471482e6a4aa8337ab6369a80c2 Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Sat, 3 Oct 2015 09:13:05 +0100 +Subject: cpuidle: mvebu: indicate failure to enter deeper sleep states + +The cpuidle ->enter method expects the return value to be the sleep +state we entered. Returning negative numbers or other codes is not +permissible since coupled CPU idle was merged. + +At least some of the mvebu_v7_cpu_suspend() implementations return the +value from cpu_suspend(), which returns zero if the CPU vectors back +into the kernel via cpu_resume() (the success case), or the non-zero +return value of the suspend actor, or one (failure cases). + +We do not want to be returning the failure case value back to CPU idle +as that indicates that we successfully entered one of the deeper idle +states. Always return zero instead, indicating that we slept for the +shortest amount of time. + +Signed-off-by: Russell King +--- + drivers/cpuidle/cpuidle-mvebu-v7.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/cpuidle/cpuidle-mvebu-v7.c ++++ b/drivers/cpuidle/cpuidle-mvebu-v7.c +@@ -39,8 +39,12 @@ static int mvebu_v7_enter_idle(struct cp + ret = mvebu_v7_cpu_suspend(deepidle); + cpu_pm_exit(); + ++ /* ++ * If we failed to enter the desired state, indicate that we ++ * slept lightly. ++ */ + if (ret) +- return ret; ++ return 0; + + return index; + } diff --git a/target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch b/target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch new file mode 100644 index 0000000000..4058dc8ed5 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch @@ -0,0 +1,60 @@ +From 287b9df160b6159f8d385424904f8bac501280c1 Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Sat, 9 Jul 2016 10:58:16 +0100 +Subject: pci: mvebu: time out reset on link up + +If the port reports that the link is up while we are resetting, there's +little point in waiting for the full duration. + +Signed-off-by: Russell King +--- + drivers/pci/controller/pci-mvebu.c | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +--- a/drivers/pci/controller/pci-mvebu.c ++++ b/drivers/pci/controller/pci-mvebu.c +@@ -928,6 +928,7 @@ static int mvebu_pcie_powerup(struct mve + + if (port->reset_gpio) { + u32 reset_udelay = PCI_PM_D3COLD_WAIT * 1000; ++ unsigned int i; + + of_property_read_u32(port->dn, "reset-delay-us", + &reset_udelay); +@@ -935,7 +936,13 @@ static int mvebu_pcie_powerup(struct mve + udelay(100); + + gpiod_set_value_cansleep(port->reset_gpio, 0); +- msleep(reset_udelay / 1000); ++ for (i = 0; i < reset_udelay; i += 1000) { ++ if (mvebu_pcie_link_up(port)) ++ break; ++ msleep(1); ++ } ++ ++ printk("%s: reset completed in %dus\n", port->name, i); + } + + return 0; +@@ -1099,15 +1106,16 @@ static int mvebu_pcie_probe(struct platf + if (!child) + continue; + +- ret = mvebu_pcie_powerup(port); +- if (ret < 0) +- continue; +- + port->base = mvebu_pcie_map_registers(pdev, child, port); + if (IS_ERR(port->base)) { + dev_err(dev, "%s: cannot map registers\n", port->name); + port->base = NULL; +- mvebu_pcie_powerdown(port); ++ continue; ++ } ++ ++ ret = mvebu_pcie_powerup(port); ++ if (ret < 0) { ++ port->base = NULL; + continue; + } + From 7be8ab4f7b582924bca6594103735d888989d804 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 23 Feb 2021 11:43:33 +0100 Subject: [PATCH 13/45] mvebu: remove upstreamed DTS files in 5.10 Some armada-3720-espressobin-* files have been upstreamed, move these to files-5.4. Signed-off-by: Adrian Schmutzler --- .../arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts | 0 .../arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts | 0 .../arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/mvebu/{files => files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts (100%) rename target/linux/mvebu/{files => files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts (100%) rename target/linux/mvebu/{files => files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts (100%) diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts b/target/linux/mvebu/files-5.4/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts similarity index 100% rename from target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts rename to target/linux/mvebu/files-5.4/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts b/target/linux/mvebu/files-5.4/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts similarity index 100% rename from target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts rename to target/linux/mvebu/files-5.4/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts b/target/linux/mvebu/files-5.4/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts similarity index 100% rename from target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts rename to target/linux/mvebu/files-5.4/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts From b43f5a935922fbcbd19e62fd6ad3299a19a0375a Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 22 Feb 2021 17:37:11 +0000 Subject: [PATCH 14/45] mvebu: refresh 5.10 kconfigs/patches Also delete already upstreamed patches/changes. Reviewed-by: Tomasz Maciej Nowak Tested-by: Tomasz Maciej Nowak Signed-off-by: Rui Salvaterra --- target/linux/mvebu/config-5.10 | 17 +- target/linux/mvebu/cortexa53/config-5.10 | 10 +- target/linux/mvebu/cortexa72/config-5.10 | 10 +- ...t-for-endpoint-to-be-ready-before-tr.patch | 50 --- ...-t-rely-on-jiffies-while-holding-spi.patch | 54 --- ...ntroduce-mvneta_update_stats-routine.patch | 95 ------ ...duce-page-pool-API-for-sw-buffer-man.patch | 181 ---------- ...on-build_skb-in-mvneta_rx_swbm-poll-.patch | 303 ----------------- ...006-net-mvneta-add-basic-XDP-support.patch | 311 ------------------ ...avoid_error_message_for_optional_IRQ.patch | 31 -- ...header-prefetch-in-mvneta_swbm_rx_fr.patch | 43 --- ...mvneta-make-tx-buffer-array-agnostic.patch | 210 ------------ .../009-net-mvneta-add-XDP_TX-support.patch | 175 ---------- ...fix-build-skb-for-bm-capable-devices.patch | 41 --- ...-arm64-dts-uDPU-remove-i2c-fast-mode.patch | 31 -- ...ts-uDPU-SFP-cages-support-3W-modules.patch | 34 -- ...on-page_pool_recycle_direct-in-mvnet.patch | 39 --- ...sallow-XDP-program-on-hardware-buffe.patch | 53 --- ...DP-support-if-sw-bm-is-used-as-fallb.patch | 67 ---- ...in-link-immediately-after-enabling-t.patch | 60 ---- ...7-PCI-aardvark-Improve-link-training.patch | 208 ------------ ...18-PCI-aardvark-Issue-PERST-via-GPIO.patch | 123 ------- .../019-PCI-aardvark-Add-PHY-support.patch | 152 --------- ...l-armada-37xx-Set-pcie_reset_pin-to-.patch | 93 ------ ...l-armada-37xx-Move-PCIe-comphy-handl.patch | 57 ---- ...l-armada-37xx-Move-PCIe-max-link-spe.patch | 44 --- ...-arm64-dts-add-uDPU-i2c-bus-recovery.patch | 53 --- ...-t-touch-PCIe-registers-if-no-card-c.patch | 50 --- ...add-driver-for-LinkStation-power-off.patch | 207 ------------ ...-initialization-with-old-Marvell-s-A.patch | 44 --- ...l-espressobin-Add-ethernet-switch-al.patch | 88 ----- ...Mangle-bootloader-s-kernel-arguments.patch | 22 +- ...-mvebu-armada-38x-enable-libata-leds.patch | 4 +- ...l-armada-3720-espressobin-add-ports-.patch | 26 -- .../patches-5.10/400-find_active_root.patch | 2 +- .../700-mvneta-tx-queue-workaround.patch | 6 +- ...-pci-mvebu-time-out-reset-on-link-up.patch | 6 +- 37 files changed, 33 insertions(+), 2967 deletions(-) delete mode 100644 target/linux/mvebu/patches-5.10/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch delete mode 100644 target/linux/mvebu/patches-5.10/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch delete mode 100644 target/linux/mvebu/patches-5.10/003-net-mvneta-introduce-mvneta_update_stats-routine.patch delete mode 100644 target/linux/mvebu/patches-5.10/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch delete mode 100644 target/linux/mvebu/patches-5.10/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch delete mode 100644 target/linux/mvebu/patches-5.10/006-net-mvneta-add-basic-XDP-support.patch delete mode 100644 target/linux/mvebu/patches-5.10/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch delete mode 100644 target/linux/mvebu/patches-5.10/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch delete mode 100644 target/linux/mvebu/patches-5.10/008-net-mvneta-make-tx-buffer-array-agnostic.patch delete mode 100644 target/linux/mvebu/patches-5.10/009-net-mvneta-add-XDP_TX-support.patch delete mode 100644 target/linux/mvebu/patches-5.10/010-net-mvneta-fix-build-skb-for-bm-capable-devices.patch delete mode 100644 target/linux/mvebu/patches-5.10/011-arm64-dts-uDPU-remove-i2c-fast-mode.patch delete mode 100644 target/linux/mvebu/patches-5.10/012-arm64-dts-uDPU-SFP-cages-support-3W-modules.patch delete mode 100644 target/linux/mvebu/patches-5.10/013-net-mvneta-rely-on-page_pool_recycle_direct-in-mvnet.patch delete mode 100644 target/linux/mvebu/patches-5.10/014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch delete mode 100644 target/linux/mvebu/patches-5.10/015-net-mvneta-fix-XDP-support-if-sw-bm-is-used-as-fallb.patch delete mode 100644 target/linux/mvebu/patches-5.10/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch delete mode 100644 target/linux/mvebu/patches-5.10/017-PCI-aardvark-Improve-link-training.patch delete mode 100644 target/linux/mvebu/patches-5.10/018-PCI-aardvark-Issue-PERST-via-GPIO.patch delete mode 100644 target/linux/mvebu/patches-5.10/019-PCI-aardvark-Add-PHY-support.patch delete mode 100644 target/linux/mvebu/patches-5.10/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch delete mode 100644 target/linux/mvebu/patches-5.10/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch delete mode 100644 target/linux/mvebu/patches-5.10/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch delete mode 100644 target/linux/mvebu/patches-5.10/023-arm64-dts-add-uDPU-i2c-bus-recovery.patch delete mode 100644 target/linux/mvebu/patches-5.10/024-PCI-aardvark-Don-t-touch-PCIe-registers-if-no-card-c.patch delete mode 100644 target/linux/mvebu/patches-5.10/025-power-reset-add-driver-for-LinkStation-power-off.patch delete mode 100644 target/linux/mvebu/patches-5.10/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch delete mode 100644 target/linux/mvebu/patches-5.10/027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch delete mode 100644 target/linux/mvebu/patches-5.10/315-arm64-dts-marvell-armada-3720-espressobin-add-ports-.patch diff --git a/target/linux/mvebu/config-5.10 b/target/linux/mvebu/config-5.10 index beeecd138e..4b0e9b16ab 100644 --- a/target/linux/mvebu/config-5.10 +++ b/target/linux/mvebu/config-5.10 @@ -1,7 +1,6 @@ CONFIG_AHCI_MVEBU=y CONFIG_ALIGNMENT_TRAP=y CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y @@ -12,6 +11,8 @@ CONFIG_ARCH_MVEBU=y CONFIG_ARCH_NR_GPIO=0 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARM=y CONFIG_ARMADA_370_CLK=y @@ -22,6 +23,8 @@ CONFIG_ARMADA_38X_CLK=y CONFIG_ARMADA_THERMAL=y CONFIG_ARMADA_XP_CLK=y CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y # CONFIG_ARM_ARMADA_37XX_CPUFREQ is not set # CONFIG_ARM_ARMADA_8K_CPUFREQ is not set CONFIG_ARM_ATAG_DTB_COMPAT=y @@ -107,6 +110,7 @@ CONFIG_CRYPTO_CRC32C=y CONFIG_CRYPTO_CRYPTD=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_MARVELL=y CONFIG_CRYPTO_DEV_MARVELL_CESA=y CONFIG_CRYPTO_ESSIV=y CONFIG_CRYPTO_HASH=y @@ -135,9 +139,7 @@ CONFIG_DEBUG_MVEBU_UART0=y # CONFIG_DEBUG_MVEBU_UART0_ALTERNATE is not set # CONFIG_DEBUG_MVEBU_UART1_ALTERNATE is not set CONFIG_DEBUG_UART_8250=y -# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set CONFIG_DEBUG_UART_8250_SHIFT=2 -# CONFIG_DEBUG_UART_8250_WORD is not set CONFIG_DEBUG_UART_PHYS=0xd0012000 CONFIG_DEBUG_UART_VIRT=0xfec12000 CONFIG_DEBUG_UNCOMPRESS=y @@ -146,6 +148,7 @@ CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y CONFIG_DMA_ENGINE_RAID=y CONFIG_DMA_OF=y +CONFIG_DMA_OPS=y CONFIG_DMA_REMAP=y CONFIG_DTC=y CONFIG_EARLY_PRINTK=y @@ -166,6 +169,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_GETTIMEOFDAY=y CONFIG_GENERIC_IDLE_POLL_SETUP=y CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y @@ -182,6 +186,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_VDSO_32=y CONFIG_GLOB=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y @@ -226,6 +231,7 @@ CONFIG_LEDS_PCA963X=y CONFIG_LEDS_TLC591XX=y CONFIG_LEDS_TRIGGER_DISK=y CONFIG_LIBFDT=y +CONFIG_LLD_VERSION=0 CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_LZO_COMPRESS=y @@ -259,6 +265,7 @@ CONFIG_MMC_SDHCI_PXAV3=y CONFIG_MODULES_USE_ELF_REL=y CONFIG_MTD_CFI_STAA=y CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_ECC_SW_HAMMING=y CONFIG_MTD_NAND_MARVELL=y CONFIG_MTD_RAW_NAND=y @@ -286,7 +293,6 @@ CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y CONFIG_NET_DSA_MV88E6XXX=y CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y -# CONFIG_NET_DSA_MV88E6XXX_PTP is not set CONFIG_NET_DSA_TAG_DSA=y CONFIG_NET_DSA_TAG_EDSA=y CONFIG_NET_FLOW_LIMIT=y @@ -343,7 +349,6 @@ CONFIG_PWM_SYSFS=y CONFIG_RATIONAL=y CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y -CONFIG_REFCOUNT_FULL=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y CONFIG_REGMAP_MMIO=y @@ -358,10 +363,10 @@ CONFIG_RTC_I2C_AND_SPI=y CONFIG_RTC_MC146818_LIB=y CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_SATA_HOST=y CONFIG_SATA_MV=y CONFIG_SATA_PMP=y CONFIG_SCSI=y -# CONFIG_SENSORS_DRIVETEMP is not set CONFIG_SENSORS_PWM_FAN=y CONFIG_SENSORS_TMP421=y CONFIG_SERIAL_8250_DW=y diff --git a/target/linux/mvebu/cortexa53/config-5.10 b/target/linux/mvebu/cortexa53/config-5.10 index 79d53932d0..a3de912b99 100644 --- a/target/linux/mvebu/cortexa53/config-5.10 +++ b/target/linux/mvebu/cortexa53/config-5.10 @@ -5,19 +5,16 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=24 CONFIG_ARCH_MMAP_RND_BITS_MIN=18 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_DEFAULT=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_STACKWALK=y CONFIG_ARM64=y CONFIG_ARM64_4K_PAGES=y -CONFIG_ARM64_CONT_SHIFT=4 # CONFIG_ARM64_ERRATUM_1165522 is not set # CONFIG_ARM64_ERRATUM_1286807 is not set CONFIG_ARM64_PAGE_SHIFT=12 CONFIG_ARM64_PA_BITS=48 CONFIG_ARM64_PA_BITS_48=y CONFIG_ARM64_PTR_AUTH=y -CONFIG_ARM64_SSBD=y CONFIG_ARM64_SVE=y CONFIG_ARM64_TAGGED_ADDR_ABI=y CONFIG_ARM64_VA_BITS=39 @@ -27,8 +24,6 @@ CONFIG_ARMADA_AP806_SYSCON=y CONFIG_ARMADA_AP_CP_HELPER=y CONFIG_ARMADA_CP110_SYSCON=y CONFIG_ARM_AMBA=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y CONFIG_ARM_ARMADA_37XX_CPUFREQ=y CONFIG_ARM_GIC_V2M=y CONFIG_ARM_GIC_V3=y @@ -40,16 +35,13 @@ CONFIG_ARM_PSCI_FW=y CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y # CONFIG_CAVIUM_TX2_ERRATUM_219 is not set CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -# CONFIG_DEBUG_ALIGN_RODATA is not set CONFIG_DMA_DIRECT_REMAP=y -CONFIG_DRM_RCAR_WRITEBACK=y # CONFIG_FLATMEM_MANUAL is not set CONFIG_FRAME_POINTER=y # CONFIG_FUJITSU_ERRATUM_010001 is not set CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU_VULNERABILITIES=y CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_GETTIMEOFDAY=y CONFIG_GENERIC_PINCONF=y CONFIG_HOLES_IN_ZONE=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 diff --git a/target/linux/mvebu/cortexa72/config-5.10 b/target/linux/mvebu/cortexa72/config-5.10 index db50baf1a9..6ffe6c9f13 100644 --- a/target/linux/mvebu/cortexa72/config-5.10 +++ b/target/linux/mvebu/cortexa72/config-5.10 @@ -5,19 +5,16 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=24 CONFIG_ARCH_MMAP_RND_BITS_MIN=18 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_DEFAULT=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_STACKWALK=y CONFIG_ARM64=y CONFIG_ARM64_4K_PAGES=y -CONFIG_ARM64_CONT_SHIFT=4 # CONFIG_ARM64_ERRATUM_1165522 is not set # CONFIG_ARM64_ERRATUM_1286807 is not set CONFIG_ARM64_PAGE_SHIFT=12 CONFIG_ARM64_PA_BITS=48 CONFIG_ARM64_PA_BITS_48=y # CONFIG_ARM64_PTR_AUTH is not set -CONFIG_ARM64_SSBD=y CONFIG_ARM64_SVE=y # CONFIG_ARM64_TAGGED_ADDR_ABI is not set CONFIG_ARM64_VA_BITS=39 @@ -27,8 +24,6 @@ CONFIG_ARMADA_AP806_SYSCON=y CONFIG_ARMADA_AP_CP_HELPER=y CONFIG_ARMADA_CP110_SYSCON=y CONFIG_ARM_AMBA=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y CONFIG_ARM_GIC_V2M=y CONFIG_ARM_GIC_V3=y CONFIG_ARM_GIC_V3_ITS=y @@ -39,16 +34,13 @@ CONFIG_ARM_PSCI_FW=y CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y # CONFIG_CAVIUM_TX2_ERRATUM_219 is not set CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -# CONFIG_DEBUG_ALIGN_RODATA is not set CONFIG_DMA_DIRECT_REMAP=y -CONFIG_DRM_RCAR_WRITEBACK=y # CONFIG_FLATMEM_MANUAL is not set CONFIG_FRAME_POINTER=y # CONFIG_FUJITSU_ERRATUM_010001 is not set CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU_VULNERABILITIES=y CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_GETTIMEOFDAY=y CONFIG_GENERIC_PINCONF=y CONFIG_HOLES_IN_ZONE=y CONFIG_HW_RANDOM_OMAP=y diff --git a/target/linux/mvebu/patches-5.10/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch b/target/linux/mvebu/patches-5.10/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch deleted file mode 100644 index 95abbce002..0000000000 --- a/target/linux/mvebu/patches-5.10/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch +++ /dev/null @@ -1,50 +0,0 @@ -From f4c7d053d7f77cd5c1a1ba7c7ce085ddba13d1d7 Mon Sep 17 00:00:00 2001 -From: Remi Pommarel -Date: Wed, 22 May 2019 23:33:50 +0200 -Subject: [PATCH] PCI: aardvark: Wait for endpoint to be ready before training - link - -When configuring pcie reset pin from gpio (e.g. initially set by -u-boot) to pcie function this pin goes low for a brief moment -asserting the PERST# signal. Thus connected device enters fundamental -reset process and link configuration can only begin after a minimal -100ms delay (see [1]). - -Because the pin configuration comes from the "default" pinctrl it is -implicitly configured before the probe callback is called: - -driver_probe_device() - really_probe() - ... - pinctrl_bind_pins() /* Here pin goes from gpio to PCIE reset - function and PERST# is asserted */ - ... - drv->probe() - -[1] "PCI Express Base Specification", REV. 4.0 - PCI Express, February 19 2014, 6.6.1 Conventional Reset - -Signed-off-by: Remi Pommarel -Signed-off-by: Lorenzo Pieralisi -Acked-by: Thomas Petazzoni ---- - drivers/pci/controller/pci-aardvark.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -337,6 +337,14 @@ static void advk_pcie_setup_hw(struct ad - reg |= PIO_CTRL_ADDR_WIN_DISABLE; - advk_writel(pcie, reg, PIO_CTRL); - -+ /* -+ * PERST# signal could have been asserted by pinctrl subsystem before -+ * probe() callback has been called, making the endpoint going into -+ * fundamental reset. As required by PCI Express spec a delay for at -+ * least 100ms after such a reset before link training is needed. -+ */ -+ msleep(PCI_PM_D3COLD_WAIT); -+ - /* Start link training */ - reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); - reg |= PCIE_CORE_LINK_TRAINING; diff --git a/target/linux/mvebu/patches-5.10/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch b/target/linux/mvebu/patches-5.10/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch deleted file mode 100644 index db4afd22a2..0000000000 --- a/target/linux/mvebu/patches-5.10/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 7fbcb5da811be7d47468417c7795405058abb3da Mon Sep 17 00:00:00 2001 -From: Remi Pommarel -Date: Fri, 27 Sep 2019 10:55:02 +0200 -Subject: [PATCH] PCI: aardvark: Don't rely on jiffies while holding spinlock - -advk_pcie_wait_pio() can be called while holding a spinlock (from -pci_bus_read_config_dword()), then depends on jiffies in order to -timeout while polling on PIO state registers. In the case the PIO -transaction failed, the timeout will never happen and will also cause -the cpu to stall. - -This decrements a variable and wait instead of using jiffies. - -Signed-off-by: Remi Pommarel -Signed-off-by: Lorenzo Pieralisi -Reviewed-by: Andrew Murray -Acked-by: Thomas Petazzoni ---- - drivers/pci/controller/pci-aardvark.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -175,7 +175,8 @@ - (PCIE_CONF_BUS(bus) | PCIE_CONF_DEV(PCI_SLOT(devfn)) | \ - PCIE_CONF_FUNC(PCI_FUNC(devfn)) | PCIE_CONF_REG(where)) - --#define PIO_TIMEOUT_MS 1 -+#define PIO_RETRY_CNT 500 -+#define PIO_RETRY_DELAY 2 /* 2 us*/ - - #define LINK_WAIT_MAX_RETRIES 10 - #define LINK_WAIT_USLEEP_MIN 90000 -@@ -400,17 +401,16 @@ static void advk_pcie_check_pio_status(s - static int advk_pcie_wait_pio(struct advk_pcie *pcie) - { - struct device *dev = &pcie->pdev->dev; -- unsigned long timeout; -+ int i; - -- timeout = jiffies + msecs_to_jiffies(PIO_TIMEOUT_MS); -- -- while (time_before(jiffies, timeout)) { -+ for (i = 0; i < PIO_RETRY_CNT; i++) { - u32 start, isr; - - start = advk_readl(pcie, PIO_START); - isr = advk_readl(pcie, PIO_ISR); - if (!start && isr) - return 0; -+ udelay(PIO_RETRY_DELAY); - } - - dev_err(dev, "config read/write timed out\n"); diff --git a/target/linux/mvebu/patches-5.10/003-net-mvneta-introduce-mvneta_update_stats-routine.patch b/target/linux/mvebu/patches-5.10/003-net-mvneta-introduce-mvneta_update_stats-routine.patch deleted file mode 100644 index f6ce6163cf..0000000000 --- a/target/linux/mvebu/patches-5.10/003-net-mvneta-introduce-mvneta_update_stats-routine.patch +++ /dev/null @@ -1,95 +0,0 @@ -From ff519e2acd463bff6c5bb4e8d7ed350c9bae885b Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Sat, 19 Oct 2019 10:13:21 +0200 -Subject: [PATCH 1/7] net: mvneta: introduce mvneta_update_stats routine - -Introduce mvneta_update_stats routine to collect {rx/tx} statistics -(packets and bytes). This is a preliminary patch to add XDP support to -mvneta driver - -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 43 ++++++++++++++------------- - 1 file changed, 22 insertions(+), 21 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1913,6 +1913,23 @@ static void mvneta_rxq_drop_pkts(struct - } - } - -+static void -+mvneta_update_stats(struct mvneta_port *pp, u32 pkts, -+ u32 len, bool tx) -+{ -+ struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); -+ -+ u64_stats_update_begin(&stats->syncp); -+ if (tx) { -+ stats->tx_packets += pkts; -+ stats->tx_bytes += len; -+ } else { -+ stats->rx_packets += pkts; -+ stats->rx_bytes += len; -+ } -+ u64_stats_update_end(&stats->syncp); -+} -+ - static inline - int mvneta_rx_refill_queue(struct mvneta_port *pp, struct mvneta_rx_queue *rxq) - { -@@ -2093,14 +2110,8 @@ static int mvneta_rx_swbm(struct napi_st - rxq->left_size = 0; - } - -- if (rcvd_pkts) { -- struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); -- -- u64_stats_update_begin(&stats->syncp); -- stats->rx_packets += rcvd_pkts; -- stats->rx_bytes += rcvd_bytes; -- u64_stats_update_end(&stats->syncp); -- } -+ if (rcvd_pkts) -+ mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false); - - /* return some buffers to hardware queue, one at a time is too slow */ - refill = mvneta_rx_refill_queue(pp, rxq); -@@ -2223,14 +2234,8 @@ err_drop_frame: - napi_gro_receive(napi, skb); - } - -- if (rcvd_pkts) { -- struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); -- -- u64_stats_update_begin(&stats->syncp); -- stats->rx_packets += rcvd_pkts; -- stats->rx_bytes += rcvd_bytes; -- u64_stats_update_end(&stats->syncp); -- } -+ if (rcvd_pkts) -+ mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false); - - /* Update rxq management counters */ - mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_done); -@@ -2476,7 +2481,6 @@ static netdev_tx_t mvneta_tx(struct sk_b - - out: - if (frags > 0) { -- struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); - struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id); - - netdev_tx_sent_queue(nq, len); -@@ -2491,10 +2495,7 @@ out: - else - txq->pending += frags; - -- u64_stats_update_begin(&stats->syncp); -- stats->tx_packets++; -- stats->tx_bytes += len; -- u64_stats_update_end(&stats->syncp); -+ mvneta_update_stats(pp, 1, len, true); - } else { - dev->stats.tx_dropped++; - dev_kfree_skb_any(skb); diff --git a/target/linux/mvebu/patches-5.10/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch b/target/linux/mvebu/patches-5.10/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch deleted file mode 100644 index fbcae20f74..0000000000 --- a/target/linux/mvebu/patches-5.10/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch +++ /dev/null @@ -1,181 +0,0 @@ -From 568a3fa24a95476d40afe3f8616bafb543bc4182 Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Sat, 19 Oct 2019 10:13:22 +0200 -Subject: [PATCH 2/7] net: mvneta: introduce page pool API for sw buffer - manager - -Use the page_pool api for allocations and DMA handling instead of -__dev_alloc_page()/dma_map_page() and free_page()/dma_unmap_page(). -Pages are unmapped using page_pool_release_page before packets -go into the network stack. - -The page_pool API offers buffer recycling capabilities for XDP but -allocates one page per packet, unless the driver splits and manages -the allocated page. -This is a preliminary patch to add XDP support to mvneta driver - -Signed-off-by: Ilias Apalodimas -Signed-off-by: Jesper Dangaard Brouer -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/Kconfig | 1 + - drivers/net/ethernet/marvell/mvneta.c | 83 +++++++++++++++++++++------ - 2 files changed, 65 insertions(+), 19 deletions(-) - ---- a/drivers/net/ethernet/marvell/Kconfig -+++ b/drivers/net/ethernet/marvell/Kconfig -@@ -61,6 +61,7 @@ config MVNETA - depends on ARCH_MVEBU || COMPILE_TEST - select MVMDIO - select PHYLINK -+ select PAGE_POOL - ---help--- - This driver supports the network interface units in the - Marvell ARMADA XP, ARMADA 370, ARMADA 38x and ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - - /* Registers */ - #define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2)) -@@ -607,6 +608,10 @@ struct mvneta_rx_queue { - u32 pkts_coal; - u32 time_coal; - -+ /* page_pool */ -+ struct page_pool *page_pool; -+ struct xdp_rxq_info xdp_rxq; -+ - /* Virtual address of the RX buffer */ - void **buf_virt_addr; - -@@ -1825,23 +1830,21 @@ static int mvneta_rx_refill(struct mvnet - struct mvneta_rx_queue *rxq, - gfp_t gfp_mask) - { -+ enum dma_data_direction dma_dir; - dma_addr_t phys_addr; - struct page *page; - -- page = __dev_alloc_page(gfp_mask); -+ page = page_pool_alloc_pages(rxq->page_pool, -+ gfp_mask | __GFP_NOWARN); - if (!page) - return -ENOMEM; - -- /* map page for use */ -- phys_addr = dma_map_page(pp->dev->dev.parent, page, 0, PAGE_SIZE, -- DMA_FROM_DEVICE); -- if (unlikely(dma_mapping_error(pp->dev->dev.parent, phys_addr))) { -- __free_page(page); -- return -ENOMEM; -- } -- -- phys_addr += pp->rx_offset_correction; -+ phys_addr = page_pool_get_dma_addr(page) + pp->rx_offset_correction; -+ dma_dir = page_pool_get_dma_dir(rxq->page_pool); -+ dma_sync_single_for_device(pp->dev->dev.parent, phys_addr, -+ PAGE_SIZE, dma_dir); - mvneta_rx_desc_fill(rx_desc, phys_addr, page, rxq); -+ - return 0; - } - -@@ -1907,10 +1910,12 @@ static void mvneta_rxq_drop_pkts(struct - if (!data || !(rx_desc->buf_phys_addr)) - continue; - -- dma_unmap_page(pp->dev->dev.parent, rx_desc->buf_phys_addr, -- PAGE_SIZE, DMA_FROM_DEVICE); -- __free_page(data); -+ page_pool_put_page(rxq->page_pool, data, false); - } -+ if (xdp_rxq_info_is_reg(&rxq->xdp_rxq)) -+ xdp_rxq_info_unreg(&rxq->xdp_rxq); -+ page_pool_destroy(rxq->page_pool); -+ rxq->page_pool = NULL; - } - - static void -@@ -2047,8 +2052,7 @@ static int mvneta_rx_swbm(struct napi_st - skb_add_rx_frag(rxq->skb, frag_num, page, - frag_offset, frag_size, - PAGE_SIZE); -- dma_unmap_page(dev->dev.parent, phys_addr, -- PAGE_SIZE, DMA_FROM_DEVICE); -+ page_pool_release_page(rxq->page_pool, page); - rxq->left_size -= frag_size; - } - } else { -@@ -2078,9 +2082,7 @@ static int mvneta_rx_swbm(struct napi_st - frag_offset, frag_size, - PAGE_SIZE); - -- dma_unmap_page(dev->dev.parent, phys_addr, -- PAGE_SIZE, DMA_FROM_DEVICE); -- -+ page_pool_release_page(rxq->page_pool, page); - rxq->left_size -= frag_size; - } - } /* Middle or Last descriptor */ -@@ -2847,11 +2849,54 @@ static int mvneta_poll(struct napi_struc - return rx_done; - } - -+static int mvneta_create_page_pool(struct mvneta_port *pp, -+ struct mvneta_rx_queue *rxq, int size) -+{ -+ struct page_pool_params pp_params = { -+ .order = 0, -+ .flags = PP_FLAG_DMA_MAP, -+ .pool_size = size, -+ .nid = cpu_to_node(0), -+ .dev = pp->dev->dev.parent, -+ .dma_dir = DMA_FROM_DEVICE, -+ }; -+ int err; -+ -+ rxq->page_pool = page_pool_create(&pp_params); -+ if (IS_ERR(rxq->page_pool)) { -+ err = PTR_ERR(rxq->page_pool); -+ rxq->page_pool = NULL; -+ return err; -+ } -+ -+ err = xdp_rxq_info_reg(&rxq->xdp_rxq, pp->dev, rxq->id); -+ if (err < 0) -+ goto err_free_pp; -+ -+ err = xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq, MEM_TYPE_PAGE_POOL, -+ rxq->page_pool); -+ if (err) -+ goto err_unregister_rxq; -+ -+ return 0; -+ -+err_unregister_rxq: -+ xdp_rxq_info_unreg(&rxq->xdp_rxq); -+err_free_pp: -+ page_pool_destroy(rxq->page_pool); -+ rxq->page_pool = NULL; -+ return err; -+} -+ - /* Handle rxq fill: allocates rxq skbs; called when initializing a port */ - static int mvneta_rxq_fill(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, - int num) - { -- int i; -+ int i, err; -+ -+ err = mvneta_create_page_pool(pp, rxq, num); -+ if (err < 0) -+ return err; - - for (i = 0; i < num; i++) { - memset(rxq->descs + i, 0, sizeof(struct mvneta_rx_desc)); diff --git a/target/linux/mvebu/patches-5.10/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch b/target/linux/mvebu/patches-5.10/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch deleted file mode 100644 index 9038ca8ca8..0000000000 --- a/target/linux/mvebu/patches-5.10/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch +++ /dev/null @@ -1,303 +0,0 @@ -From 8dc9a0888f4c8e27b25e48ff1b4bc2b3a845cc2d Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Sat, 19 Oct 2019 10:13:23 +0200 -Subject: [PATCH 3/7] net: mvneta: rely on build_skb in mvneta_rx_swbm poll - routine - -Refactor mvneta_rx_swbm code introducing mvneta_swbm_rx_frame and -mvneta_swbm_add_rx_fragment routines. Rely on build_skb in oreder to -allocate skb since the previous patch introduced buffer recycling using -the page_pool API. -This patch fixes even an issue in the original driver where dma buffers -are accessed before dma sync. -mvneta driver can run on not cache coherent devices so it is -necessary to sync DMA buffers before sending them to the device -in order to avoid memory corruptions. Running perf analysis we can -see a performance cost associated with this DMA-sync (anyway it is -already there in the original driver code). In follow up patches we -will add more logic to reduce DMA-sync as much as possible. - -Signed-off-by: Ilias Apalodimas -Signed-off-by: Jesper Dangaard Brouer -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 185 +++++++++++++------------- - 1 file changed, 95 insertions(+), 90 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -325,6 +325,11 @@ - ETH_HLEN + ETH_FCS_LEN, \ - cache_line_size()) - -+#define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \ -+ NET_SKB_PAD)) -+#define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD) -+#define MVNETA_MAX_RX_BUF_SIZE (PAGE_SIZE - MVNETA_SKB_PAD) -+ - #define IS_TSO_HEADER(txq, addr) \ - ((addr >= txq->tso_hdrs_phys) && \ - (addr < txq->tso_hdrs_phys + txq->size * TSO_HEADER_SIZE)) -@@ -650,7 +655,6 @@ static int txq_number = 8; - static int rxq_def; - - static int rx_copybreak __read_mostly = 256; --static int rx_header_size __read_mostly = 128; - - /* HW BM need that each port be identify by a unique ID */ - static int global_port_id; -@@ -1842,7 +1846,7 @@ static int mvneta_rx_refill(struct mvnet - phys_addr = page_pool_get_dma_addr(page) + pp->rx_offset_correction; - dma_dir = page_pool_get_dma_dir(rxq->page_pool); - dma_sync_single_for_device(pp->dev->dev.parent, phys_addr, -- PAGE_SIZE, dma_dir); -+ MVNETA_MAX_RX_BUF_SIZE, dma_dir); - mvneta_rx_desc_fill(rx_desc, phys_addr, page, rxq); - - return 0; -@@ -1960,30 +1964,102 @@ int mvneta_rx_refill_queue(struct mvneta - return i; - } - -+static int -+mvneta_swbm_rx_frame(struct mvneta_port *pp, -+ struct mvneta_rx_desc *rx_desc, -+ struct mvneta_rx_queue *rxq, -+ struct page *page) -+{ -+ unsigned char *data = page_address(page); -+ int data_len = -MVNETA_MH_SIZE, len; -+ struct net_device *dev = pp->dev; -+ enum dma_data_direction dma_dir; -+ -+ if (MVNETA_SKB_SIZE(rx_desc->data_size) > PAGE_SIZE) { -+ len = MVNETA_MAX_RX_BUF_SIZE; -+ data_len += len; -+ } else { -+ len = rx_desc->data_size; -+ data_len += len - ETH_FCS_LEN; -+ } -+ -+ dma_dir = page_pool_get_dma_dir(rxq->page_pool); -+ dma_sync_single_for_cpu(dev->dev.parent, -+ rx_desc->buf_phys_addr, -+ len, dma_dir); -+ -+ rxq->skb = build_skb(data, PAGE_SIZE); -+ if (unlikely(!rxq->skb)) { -+ netdev_err(dev, -+ "Can't allocate skb on queue %d\n", -+ rxq->id); -+ dev->stats.rx_dropped++; -+ rxq->skb_alloc_err++; -+ return -ENOMEM; -+ } -+ page_pool_release_page(rxq->page_pool, page); -+ -+ skb_reserve(rxq->skb, MVNETA_MH_SIZE + NET_SKB_PAD); -+ skb_put(rxq->skb, data_len); -+ mvneta_rx_csum(pp, rx_desc->status, rxq->skb); -+ -+ rxq->left_size = rx_desc->data_size - len; -+ rx_desc->buf_phys_addr = 0; -+ -+ return 0; -+} -+ -+static void -+mvneta_swbm_add_rx_fragment(struct mvneta_port *pp, -+ struct mvneta_rx_desc *rx_desc, -+ struct mvneta_rx_queue *rxq, -+ struct page *page) -+{ -+ struct net_device *dev = pp->dev; -+ enum dma_data_direction dma_dir; -+ int data_len, len; -+ -+ if (rxq->left_size > MVNETA_MAX_RX_BUF_SIZE) { -+ len = MVNETA_MAX_RX_BUF_SIZE; -+ data_len = len; -+ } else { -+ len = rxq->left_size; -+ data_len = len - ETH_FCS_LEN; -+ } -+ dma_dir = page_pool_get_dma_dir(rxq->page_pool); -+ dma_sync_single_for_cpu(dev->dev.parent, -+ rx_desc->buf_phys_addr, -+ len, dma_dir); -+ if (data_len > 0) { -+ /* refill descriptor with new buffer later */ -+ skb_add_rx_frag(rxq->skb, -+ skb_shinfo(rxq->skb)->nr_frags, -+ page, NET_SKB_PAD, data_len, -+ PAGE_SIZE); -+ } -+ page_pool_release_page(rxq->page_pool, page); -+ rx_desc->buf_phys_addr = 0; -+ rxq->left_size -= len; -+} -+ - /* Main rx processing when using software buffer management */ - static int mvneta_rx_swbm(struct napi_struct *napi, - struct mvneta_port *pp, int budget, - struct mvneta_rx_queue *rxq) - { -+ int rcvd_pkts = 0, rcvd_bytes = 0, rx_proc = 0; - struct net_device *dev = pp->dev; -- int rx_todo, rx_proc; -- int refill = 0; -- u32 rcvd_pkts = 0; -- u32 rcvd_bytes = 0; -+ int rx_todo, refill; - - /* Get number of received packets */ - rx_todo = mvneta_rxq_busy_desc_num_get(pp, rxq); -- rx_proc = 0; - - /* Fairness NAPI loop */ -- while ((rcvd_pkts < budget) && (rx_proc < rx_todo)) { -+ while (rx_proc < budget && rx_proc < rx_todo) { - struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); -+ u32 rx_status, index; - unsigned char *data; - struct page *page; -- dma_addr_t phys_addr; -- u32 rx_status, index; -- int rx_bytes, skb_size, copy_size; -- int frag_num, frag_size, frag_offset; - - index = rx_desc - rxq->descs; - page = (struct page *)rxq->buf_virt_addr[index]; -@@ -1991,100 +2067,30 @@ static int mvneta_rx_swbm(struct napi_st - /* Prefetch header */ - prefetch(data); - -- phys_addr = rx_desc->buf_phys_addr; - rx_status = rx_desc->status; - rx_proc++; - rxq->refill_num++; - - if (rx_status & MVNETA_RXD_FIRST_DESC) { -+ int err; -+ - /* Check errors only for FIRST descriptor */ - if (rx_status & MVNETA_RXD_ERR_SUMMARY) { - mvneta_rx_error(pp, rx_desc); - /* leave the descriptor untouched */ - continue; - } -- rx_bytes = rx_desc->data_size - -- (ETH_FCS_LEN + MVNETA_MH_SIZE); -- -- /* Allocate small skb for each new packet */ -- skb_size = max(rx_copybreak, rx_header_size); -- rxq->skb = netdev_alloc_skb_ip_align(dev, skb_size); -- if (unlikely(!rxq->skb)) { -- struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); -- -- netdev_err(dev, -- "Can't allocate skb on queue %d\n", -- rxq->id); -- -- rxq->skb_alloc_err++; - -- u64_stats_update_begin(&stats->syncp); -- stats->rx_dropped++; -- u64_stats_update_end(&stats->syncp); -+ err = mvneta_swbm_rx_frame(pp, rx_desc, rxq, page); -+ if (err) - continue; -- } -- copy_size = min(skb_size, rx_bytes); -- -- /* Copy data from buffer to SKB, skip Marvell header */ -- memcpy(rxq->skb->data, data + MVNETA_MH_SIZE, -- copy_size); -- skb_put(rxq->skb, copy_size); -- rxq->left_size = rx_bytes - copy_size; -- -- mvneta_rx_csum(pp, rx_status, rxq->skb); -- if (rxq->left_size == 0) { -- int size = copy_size + MVNETA_MH_SIZE; -- -- dma_sync_single_range_for_cpu(dev->dev.parent, -- phys_addr, 0, -- size, -- DMA_FROM_DEVICE); -- -- /* leave the descriptor and buffer untouched */ -- } else { -- /* refill descriptor with new buffer later */ -- rx_desc->buf_phys_addr = 0; -- -- frag_num = 0; -- frag_offset = copy_size + MVNETA_MH_SIZE; -- frag_size = min(rxq->left_size, -- (int)(PAGE_SIZE - frag_offset)); -- skb_add_rx_frag(rxq->skb, frag_num, page, -- frag_offset, frag_size, -- PAGE_SIZE); -- page_pool_release_page(rxq->page_pool, page); -- rxq->left_size -= frag_size; -- } - } else { -- /* Middle or Last descriptor */ - if (unlikely(!rxq->skb)) { - pr_debug("no skb for rx_status 0x%x\n", - rx_status); - continue; - } -- if (!rxq->left_size) { -- /* last descriptor has only FCS */ -- /* and can be discarded */ -- dma_sync_single_range_for_cpu(dev->dev.parent, -- phys_addr, 0, -- ETH_FCS_LEN, -- DMA_FROM_DEVICE); -- /* leave the descriptor and buffer untouched */ -- } else { -- /* refill descriptor with new buffer later */ -- rx_desc->buf_phys_addr = 0; -- -- frag_num = skb_shinfo(rxq->skb)->nr_frags; -- frag_offset = 0; -- frag_size = min(rxq->left_size, -- (int)(PAGE_SIZE - frag_offset)); -- skb_add_rx_frag(rxq->skb, frag_num, page, -- frag_offset, frag_size, -- PAGE_SIZE); -- -- page_pool_release_page(rxq->page_pool, page); -- rxq->left_size -= frag_size; -- } -+ mvneta_swbm_add_rx_fragment(pp, rx_desc, rxq, page); - } /* Middle or Last descriptor */ - - if (!(rx_status & MVNETA_RXD_LAST_DESC)) -@@ -2109,7 +2115,6 @@ static int mvneta_rx_swbm(struct napi_st - - /* clean uncomplete skb pointer in queue */ - rxq->skb = NULL; -- rxq->left_size = 0; - } - - if (rcvd_pkts) -@@ -2970,7 +2975,7 @@ static void mvneta_rxq_hw_init(struct mv - /* Set Offset */ - mvneta_rxq_offset_set(pp, rxq, 0); - mvneta_rxq_buf_size_set(pp, rxq, PAGE_SIZE < SZ_64K ? -- PAGE_SIZE : -+ MVNETA_MAX_RX_BUF_SIZE : - MVNETA_RX_BUF_SIZE(pp->pkt_size)); - mvneta_rxq_bm_disable(pp, rxq); - mvneta_rxq_fill(pp, rxq, rxq->size); -@@ -4708,7 +4713,7 @@ static int mvneta_probe(struct platform_ - SET_NETDEV_DEV(dev, &pdev->dev); - - pp->id = global_port_id++; -- pp->rx_offset_correction = 0; /* not relevant for SW BM */ -+ pp->rx_offset_correction = NET_SKB_PAD; - - /* Obtain access to BM resources if enabled and already initialized */ - bm_node = of_parse_phandle(dn, "buffer-manager", 0); diff --git a/target/linux/mvebu/patches-5.10/006-net-mvneta-add-basic-XDP-support.patch b/target/linux/mvebu/patches-5.10/006-net-mvneta-add-basic-XDP-support.patch deleted file mode 100644 index 163632df51..0000000000 --- a/target/linux/mvebu/patches-5.10/006-net-mvneta-add-basic-XDP-support.patch +++ /dev/null @@ -1,311 +0,0 @@ -From 0db51da7a8e99f0803ec3a8e25c1a66234a219cb Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Sat, 19 Oct 2019 10:13:24 +0200 -Subject: [PATCH 4/7] net: mvneta: add basic XDP support - -Add basic XDP support to mvneta driver for devices that rely on software -buffer management. Currently supported verdicts are: -- XDP_DROP -- XDP_PASS -- XDP_REDIRECT -- XDP_ABORTED - -- iptables drop: -$iptables -t raw -I PREROUTING -p udp --dport 9 -j DROP -$nstat -n && sleep 1 && nstat -IpInReceives 151169 0.0 -IpExtInOctets 6953544 0.0 -IpExtInNoECTPkts 151165 0.0 - -- XDP_DROP via xdp1 -$./samples/bpf/xdp1 3 -proto 0: 421419 pkt/s -proto 0: 421444 pkt/s -proto 0: 421393 pkt/s -proto 0: 421440 pkt/s -proto 0: 421184 pkt/s - -Tested-by: Matteo Croce -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 148 ++++++++++++++++++++++++-- - 1 file changed, 139 insertions(+), 9 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -38,6 +38,7 @@ - #include - #include - #include -+#include - - /* Registers */ - #define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2)) -@@ -325,8 +326,10 @@ - ETH_HLEN + ETH_FCS_LEN, \ - cache_line_size()) - -+#define MVNETA_SKB_HEADROOM (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) + \ -+ NET_IP_ALIGN) - #define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \ -- NET_SKB_PAD)) -+ MVNETA_SKB_HEADROOM)) - #define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD) - #define MVNETA_MAX_RX_BUF_SIZE (PAGE_SIZE - MVNETA_SKB_PAD) - -@@ -354,6 +357,11 @@ struct mvneta_statistic { - #define T_REG_64 64 - #define T_SW 1 - -+#define MVNETA_XDP_PASS BIT(0) -+#define MVNETA_XDP_DROPPED BIT(1) -+#define MVNETA_XDP_TX BIT(2) -+#define MVNETA_XDP_REDIR BIT(3) -+ - static const struct mvneta_statistic mvneta_statistics[] = { - { 0x3000, T_REG_64, "good_octets_received", }, - { 0x3010, T_REG_32, "good_frames_received", }, -@@ -435,6 +443,8 @@ struct mvneta_port { - u32 cause_rx_tx; - struct napi_struct napi; - -+ struct bpf_prog *xdp_prog; -+ - /* Core clock */ - struct clk *clk; - /* AXI clock */ -@@ -1965,10 +1975,50 @@ int mvneta_rx_refill_queue(struct mvneta - } - - static int -+mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, -+ struct bpf_prog *prog, struct xdp_buff *xdp) -+{ -+ u32 ret, act = bpf_prog_run_xdp(prog, xdp); -+ -+ switch (act) { -+ case XDP_PASS: -+ ret = MVNETA_XDP_PASS; -+ break; -+ case XDP_REDIRECT: { -+ int err; -+ -+ err = xdp_do_redirect(pp->dev, xdp, prog); -+ if (err) { -+ ret = MVNETA_XDP_DROPPED; -+ xdp_return_buff(xdp); -+ } else { -+ ret = MVNETA_XDP_REDIR; -+ } -+ break; -+ } -+ default: -+ bpf_warn_invalid_xdp_action(act); -+ /* fall through */ -+ case XDP_ABORTED: -+ trace_xdp_exception(pp->dev, prog, act); -+ /* fall through */ -+ case XDP_DROP: -+ page_pool_recycle_direct(rxq->page_pool, -+ virt_to_head_page(xdp->data)); -+ ret = MVNETA_XDP_DROPPED; -+ break; -+ } -+ -+ return ret; -+} -+ -+static int - mvneta_swbm_rx_frame(struct mvneta_port *pp, - struct mvneta_rx_desc *rx_desc, - struct mvneta_rx_queue *rxq, -- struct page *page) -+ struct xdp_buff *xdp, -+ struct bpf_prog *xdp_prog, -+ struct page *page, u32 *xdp_ret) - { - unsigned char *data = page_address(page); - int data_len = -MVNETA_MH_SIZE, len; -@@ -1988,7 +2038,26 @@ mvneta_swbm_rx_frame(struct mvneta_port - rx_desc->buf_phys_addr, - len, dma_dir); - -- rxq->skb = build_skb(data, PAGE_SIZE); -+ xdp->data_hard_start = data; -+ xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE; -+ xdp->data_end = xdp->data + data_len; -+ xdp_set_data_meta_invalid(xdp); -+ -+ if (xdp_prog) { -+ u32 ret; -+ -+ ret = mvneta_run_xdp(pp, rxq, xdp_prog, xdp); -+ if (ret != MVNETA_XDP_PASS) { -+ mvneta_update_stats(pp, 1, -+ xdp->data_end - xdp->data, -+ false); -+ rx_desc->buf_phys_addr = 0; -+ *xdp_ret |= ret; -+ return ret; -+ } -+ } -+ -+ rxq->skb = build_skb(xdp->data_hard_start, PAGE_SIZE); - if (unlikely(!rxq->skb)) { - netdev_err(dev, - "Can't allocate skb on queue %d\n", -@@ -1999,8 +2068,9 @@ mvneta_swbm_rx_frame(struct mvneta_port - } - page_pool_release_page(rxq->page_pool, page); - -- skb_reserve(rxq->skb, MVNETA_MH_SIZE + NET_SKB_PAD); -- skb_put(rxq->skb, data_len); -+ skb_reserve(rxq->skb, -+ xdp->data - xdp->data_hard_start); -+ skb_put(rxq->skb, xdp->data_end - xdp->data); - mvneta_rx_csum(pp, rx_desc->status, rxq->skb); - - rxq->left_size = rx_desc->data_size - len; -@@ -2034,7 +2104,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet - /* refill descriptor with new buffer later */ - skb_add_rx_frag(rxq->skb, - skb_shinfo(rxq->skb)->nr_frags, -- page, NET_SKB_PAD, data_len, -+ page, MVNETA_SKB_HEADROOM, data_len, - PAGE_SIZE); - } - page_pool_release_page(rxq->page_pool, page); -@@ -2049,11 +2119,18 @@ static int mvneta_rx_swbm(struct napi_st - { - int rcvd_pkts = 0, rcvd_bytes = 0, rx_proc = 0; - struct net_device *dev = pp->dev; -+ struct bpf_prog *xdp_prog; -+ struct xdp_buff xdp_buf; - int rx_todo, refill; -+ u32 xdp_ret = 0; - - /* Get number of received packets */ - rx_todo = mvneta_rxq_busy_desc_num_get(pp, rxq); - -+ rcu_read_lock(); -+ xdp_prog = READ_ONCE(pp->xdp_prog); -+ xdp_buf.rxq = &rxq->xdp_rxq; -+ - /* Fairness NAPI loop */ - while (rx_proc < budget && rx_proc < rx_todo) { - struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); -@@ -2081,7 +2158,8 @@ static int mvneta_rx_swbm(struct napi_st - continue; - } - -- err = mvneta_swbm_rx_frame(pp, rx_desc, rxq, page); -+ err = mvneta_swbm_rx_frame(pp, rx_desc, rxq, &xdp_buf, -+ xdp_prog, page, &xdp_ret); - if (err) - continue; - } else { -@@ -2116,6 +2194,10 @@ static int mvneta_rx_swbm(struct napi_st - /* clean uncomplete skb pointer in queue */ - rxq->skb = NULL; - } -+ rcu_read_unlock(); -+ -+ if (xdp_ret & MVNETA_XDP_REDIR) -+ xdp_do_flush_map(); - - if (rcvd_pkts) - mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false); -@@ -2857,13 +2939,14 @@ static int mvneta_poll(struct napi_struc - static int mvneta_create_page_pool(struct mvneta_port *pp, - struct mvneta_rx_queue *rxq, int size) - { -+ struct bpf_prog *xdp_prog = READ_ONCE(pp->xdp_prog); - struct page_pool_params pp_params = { - .order = 0, - .flags = PP_FLAG_DMA_MAP, - .pool_size = size, - .nid = cpu_to_node(0), - .dev = pp->dev->dev.parent, -- .dma_dir = DMA_FROM_DEVICE, -+ .dma_dir = xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE, - }; - int err; - -@@ -3364,6 +3447,11 @@ static int mvneta_change_mtu(struct net_ - mtu = ALIGN(MVNETA_RX_PKT_SIZE(mtu), 8); - } - -+ if (pp->xdp_prog && mtu > MVNETA_MAX_RX_BUF_SIZE) { -+ netdev_info(dev, "Illegal MTU value %d for XDP mode\n", mtu); -+ return -EINVAL; -+ } -+ - dev->mtu = mtu; - - if (!netif_running(dev)) { -@@ -4029,6 +4117,47 @@ static int mvneta_ioctl(struct net_devic - return phylink_mii_ioctl(pp->phylink, ifr, cmd); - } - -+static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog, -+ struct netlink_ext_ack *extack) -+{ -+ bool need_update, running = netif_running(dev); -+ struct mvneta_port *pp = netdev_priv(dev); -+ struct bpf_prog *old_prog; -+ -+ if (prog && dev->mtu > MVNETA_MAX_RX_BUF_SIZE) { -+ NL_SET_ERR_MSG_MOD(extack, "Jumbo frames not supported on XDP"); -+ return -EOPNOTSUPP; -+ } -+ -+ need_update = !!pp->xdp_prog != !!prog; -+ if (running && need_update) -+ mvneta_stop(dev); -+ -+ old_prog = xchg(&pp->xdp_prog, prog); -+ if (old_prog) -+ bpf_prog_put(old_prog); -+ -+ if (running && need_update) -+ return mvneta_open(dev); -+ -+ return 0; -+} -+ -+static int mvneta_xdp(struct net_device *dev, struct netdev_bpf *xdp) -+{ -+ struct mvneta_port *pp = netdev_priv(dev); -+ -+ switch (xdp->command) { -+ case XDP_SETUP_PROG: -+ return mvneta_xdp_setup(dev, xdp->prog, xdp->extack); -+ case XDP_QUERY_PROG: -+ xdp->prog_id = pp->xdp_prog ? pp->xdp_prog->aux->id : 0; -+ return 0; -+ default: -+ return -EINVAL; -+ } -+} -+ - /* Ethtool methods */ - - /* Set link ksettings (phy address, speed) for ethtools */ -@@ -4425,6 +4554,7 @@ static const struct net_device_ops mvnet - .ndo_fix_features = mvneta_fix_features, - .ndo_get_stats64 = mvneta_get_stats64, - .ndo_do_ioctl = mvneta_ioctl, -+ .ndo_bpf = mvneta_xdp, - }; - - static const struct ethtool_ops mvneta_eth_tool_ops = { -@@ -4713,7 +4843,7 @@ static int mvneta_probe(struct platform_ - SET_NETDEV_DEV(dev, &pdev->dev); - - pp->id = global_port_id++; -- pp->rx_offset_correction = NET_SKB_PAD; -+ pp->rx_offset_correction = MVNETA_SKB_HEADROOM; - - /* Obtain access to BM resources if enabled and already initialized */ - bm_node = of_parse_phandle(dn, "buffer-manager", 0); diff --git a/target/linux/mvebu/patches-5.10/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch b/target/linux/mvebu/patches-5.10/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch deleted file mode 100644 index 00d2b30d58..0000000000 --- a/target/linux/mvebu/patches-5.10/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 525b0858ff2fdb78defec2d4d6d63baaa423d5fd Mon Sep 17 00:00:00 2001 -From: Chris Packham -Date: Fri, 13 Mar 2020 16:42:44 +1300 -Subject: [PATCH] gpio: mvebu: avoid error message for optional IRQ - -platform_get_irq() will generate an error message if the requested irq -is not present - - mvebu-gpio f1010140.gpio: IRQ index 3 not found - -use platform_get_irq_optional() to avoid the error message being -generated. - -Signed-off-by: Chris Packham -Acked-by: Uwe Kleine-König -Signed-off-by: Bartosz Golaszewski ---- - drivers/gpio/gpio-mvebu.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/gpio/gpio-mvebu.c -+++ b/drivers/gpio/gpio-mvebu.c -@@ -1248,7 +1248,7 @@ static int mvebu_gpio_probe(struct platf - * pins. - */ - for (i = 0; i < 4; i++) { -- int irq = platform_get_irq(pdev, i); -+ int irq = platform_get_irq_optional(pdev, i); - - if (irq < 0) - continue; diff --git a/target/linux/mvebu/patches-5.10/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch b/target/linux/mvebu/patches-5.10/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch deleted file mode 100644 index e075796e41..0000000000 --- a/target/linux/mvebu/patches-5.10/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch +++ /dev/null @@ -1,43 +0,0 @@ -From fa383f6b77a2ed788266fa8fbfb659aa284d2f58 Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Sat, 19 Oct 2019 10:13:25 +0200 -Subject: [PATCH 5/7] net: mvneta: move header prefetch in mvneta_swbm_rx_frame - -Move data buffer prefetch in mvneta_swbm_rx_frame after -dma_sync_single_range_for_cpu - -Signed-off-by: Ilias Apalodimas -Signed-off-by: Jesper Dangaard Brouer -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2038,6 +2038,9 @@ mvneta_swbm_rx_frame(struct mvneta_port - rx_desc->buf_phys_addr, - len, dma_dir); - -+ /* Prefetch header */ -+ prefetch(data); -+ - xdp->data_hard_start = data; - xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE; - xdp->data_end = xdp->data + data_len; -@@ -2135,14 +2138,10 @@ static int mvneta_rx_swbm(struct napi_st - while (rx_proc < budget && rx_proc < rx_todo) { - struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); - u32 rx_status, index; -- unsigned char *data; - struct page *page; - - index = rx_desc - rxq->descs; - page = (struct page *)rxq->buf_virt_addr[index]; -- data = page_address(page); -- /* Prefetch header */ -- prefetch(data); - - rx_status = rx_desc->status; - rx_proc++; diff --git a/target/linux/mvebu/patches-5.10/008-net-mvneta-make-tx-buffer-array-agnostic.patch b/target/linux/mvebu/patches-5.10/008-net-mvneta-make-tx-buffer-array-agnostic.patch deleted file mode 100644 index e79aa816b8..0000000000 --- a/target/linux/mvebu/patches-5.10/008-net-mvneta-make-tx-buffer-array-agnostic.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 9e58c8b410650b5a6eb5b8fad8474bd8425a4023 Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Sat, 19 Oct 2019 10:13:26 +0200 -Subject: [PATCH 6/7] net: mvneta: make tx buffer array agnostic - -Allow tx buffer array to contain both skb and xdp buffers in order to -enable xdp frame recycling adding XDP_TX verdict support - -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 66 +++++++++++++++++---------- - 1 file changed, 43 insertions(+), 23 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -565,6 +565,20 @@ struct mvneta_rx_desc { - }; - #endif - -+enum mvneta_tx_buf_type { -+ MVNETA_TYPE_SKB, -+ MVNETA_TYPE_XDP_TX, -+ MVNETA_TYPE_XDP_NDO, -+}; -+ -+struct mvneta_tx_buf { -+ enum mvneta_tx_buf_type type; -+ union { -+ struct xdp_frame *xdpf; -+ struct sk_buff *skb; -+ }; -+}; -+ - struct mvneta_tx_queue { - /* Number of this TX queue, in the range 0-7 */ - u8 id; -@@ -580,8 +594,8 @@ struct mvneta_tx_queue { - int tx_stop_threshold; - int tx_wake_threshold; - -- /* Array of transmitted skb */ -- struct sk_buff **tx_skb; -+ /* Array of transmitted buffers */ -+ struct mvneta_tx_buf *buf; - - /* Index of last TX DMA descriptor that was inserted */ - int txq_put_index; -@@ -1793,14 +1807,9 @@ static void mvneta_txq_bufs_free(struct - int i; - - for (i = 0; i < num; i++) { -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_get_index]; - struct mvneta_tx_desc *tx_desc = txq->descs + - txq->txq_get_index; -- struct sk_buff *skb = txq->tx_skb[txq->txq_get_index]; -- -- if (skb) { -- bytes_compl += skb->len; -- pkts_compl++; -- } - - mvneta_txq_inc_get(txq); - -@@ -1808,9 +1817,12 @@ static void mvneta_txq_bufs_free(struct - dma_unmap_single(pp->dev->dev.parent, - tx_desc->buf_phys_addr, - tx_desc->data_size, DMA_TO_DEVICE); -- if (!skb) -+ if (!buf->skb) - continue; -- dev_kfree_skb_any(skb); -+ -+ bytes_compl += buf->skb->len; -+ pkts_compl++; -+ dev_kfree_skb_any(buf->skb); - } - - netdev_tx_completed_queue(nq, pkts_compl, bytes_compl); -@@ -2335,16 +2347,19 @@ static inline void - mvneta_tso_put_hdr(struct sk_buff *skb, - struct mvneta_port *pp, struct mvneta_tx_queue *txq) - { -- struct mvneta_tx_desc *tx_desc; - int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; -+ struct mvneta_tx_desc *tx_desc; - -- txq->tx_skb[txq->txq_put_index] = NULL; - tx_desc = mvneta_txq_next_desc_get(txq); - tx_desc->data_size = hdr_len; - tx_desc->command = mvneta_skb_tx_csum(pp, skb); - tx_desc->command |= MVNETA_TXD_F_DESC; - tx_desc->buf_phys_addr = txq->tso_hdrs_phys + - txq->txq_put_index * TSO_HEADER_SIZE; -+ buf->type = MVNETA_TYPE_SKB; -+ buf->skb = NULL; -+ - mvneta_txq_inc_put(txq); - } - -@@ -2353,6 +2368,7 @@ mvneta_tso_put_data(struct net_device *d - struct sk_buff *skb, char *data, int size, - bool last_tcp, bool is_last) - { -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; - struct mvneta_tx_desc *tx_desc; - - tx_desc = mvneta_txq_next_desc_get(txq); -@@ -2366,7 +2382,8 @@ mvneta_tso_put_data(struct net_device *d - } - - tx_desc->command = 0; -- txq->tx_skb[txq->txq_put_index] = NULL; -+ buf->type = MVNETA_TYPE_SKB; -+ buf->skb = NULL; - - if (last_tcp) { - /* last descriptor in the TCP packet */ -@@ -2374,7 +2391,7 @@ mvneta_tso_put_data(struct net_device *d - - /* last descriptor in SKB */ - if (is_last) -- txq->tx_skb[txq->txq_put_index] = skb; -+ buf->skb = skb; - } - mvneta_txq_inc_put(txq); - return 0; -@@ -2459,6 +2476,7 @@ static int mvneta_tx_frag_process(struct - int i, nr_frags = skb_shinfo(skb)->nr_frags; - - for (i = 0; i < nr_frags; i++) { -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; - skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; - void *addr = skb_frag_address(frag); - -@@ -2478,12 +2496,13 @@ static int mvneta_tx_frag_process(struct - if (i == nr_frags - 1) { - /* Last descriptor */ - tx_desc->command = MVNETA_TXD_L_DESC | MVNETA_TXD_Z_PAD; -- txq->tx_skb[txq->txq_put_index] = skb; -+ buf->skb = skb; - } else { - /* Descriptor in the middle: Not First, Not Last */ - tx_desc->command = 0; -- txq->tx_skb[txq->txq_put_index] = NULL; -+ buf->skb = NULL; - } -+ buf->type = MVNETA_TYPE_SKB; - mvneta_txq_inc_put(txq); - } - -@@ -2511,6 +2530,7 @@ static netdev_tx_t mvneta_tx(struct sk_b - struct mvneta_port *pp = netdev_priv(dev); - u16 txq_id = skb_get_queue_mapping(skb); - struct mvneta_tx_queue *txq = &pp->txqs[txq_id]; -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; - struct mvneta_tx_desc *tx_desc; - int len = skb->len; - int frags = 0; -@@ -2543,16 +2563,17 @@ static netdev_tx_t mvneta_tx(struct sk_b - goto out; - } - -+ buf->type = MVNETA_TYPE_SKB; - if (frags == 1) { - /* First and Last descriptor */ - tx_cmd |= MVNETA_TXD_FLZ_DESC; - tx_desc->command = tx_cmd; -- txq->tx_skb[txq->txq_put_index] = skb; -+ buf->skb = skb; - mvneta_txq_inc_put(txq); - } else { - /* First but not Last */ - tx_cmd |= MVNETA_TXD_F_DESC; -- txq->tx_skb[txq->txq_put_index] = NULL; -+ buf->skb = NULL; - mvneta_txq_inc_put(txq); - tx_desc->command = tx_cmd; - /* Continue with other skb fragments */ -@@ -3138,9 +3159,8 @@ static int mvneta_txq_sw_init(struct mvn - - txq->last_desc = txq->size - 1; - -- txq->tx_skb = kmalloc_array(txq->size, sizeof(*txq->tx_skb), -- GFP_KERNEL); -- if (!txq->tx_skb) { -+ txq->buf = kmalloc_array(txq->size, sizeof(*txq->buf), GFP_KERNEL); -+ if (!txq->buf) { - dma_free_coherent(pp->dev->dev.parent, - txq->size * MVNETA_DESC_ALIGNED_SIZE, - txq->descs, txq->descs_phys); -@@ -3152,7 +3172,7 @@ static int mvneta_txq_sw_init(struct mvn - txq->size * TSO_HEADER_SIZE, - &txq->tso_hdrs_phys, GFP_KERNEL); - if (!txq->tso_hdrs) { -- kfree(txq->tx_skb); -+ kfree(txq->buf); - dma_free_coherent(pp->dev->dev.parent, - txq->size * MVNETA_DESC_ALIGNED_SIZE, - txq->descs, txq->descs_phys); -@@ -3205,7 +3225,7 @@ static void mvneta_txq_sw_deinit(struct - { - struct netdev_queue *nq = netdev_get_tx_queue(pp->dev, txq->id); - -- kfree(txq->tx_skb); -+ kfree(txq->buf); - - if (txq->tso_hdrs) - dma_free_coherent(pp->dev->dev.parent, diff --git a/target/linux/mvebu/patches-5.10/009-net-mvneta-add-XDP_TX-support.patch b/target/linux/mvebu/patches-5.10/009-net-mvneta-add-XDP_TX-support.patch deleted file mode 100644 index c971030a1e..0000000000 --- a/target/linux/mvebu/patches-5.10/009-net-mvneta-add-XDP_TX-support.patch +++ /dev/null @@ -1,175 +0,0 @@ -From b0a43db9087a21d96e1a0b716b8d9963064b2d58 Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Sat, 19 Oct 2019 10:13:27 +0200 -Subject: [PATCH 7/7] net: mvneta: add XDP_TX support - -Implement XDP_TX verdict and ndo_xdp_xmit net_device_ops function -pointer - -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 128 ++++++++++++++++++++++++-- - 1 file changed, 121 insertions(+), 7 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1813,16 +1813,19 @@ static void mvneta_txq_bufs_free(struct - - mvneta_txq_inc_get(txq); - -- if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr)) -+ if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr) && -+ buf->type != MVNETA_TYPE_XDP_TX) - dma_unmap_single(pp->dev->dev.parent, - tx_desc->buf_phys_addr, - tx_desc->data_size, DMA_TO_DEVICE); -- if (!buf->skb) -- continue; -- -- bytes_compl += buf->skb->len; -- pkts_compl++; -- dev_kfree_skb_any(buf->skb); -+ if (buf->type == MVNETA_TYPE_SKB && buf->skb) { -+ bytes_compl += buf->skb->len; -+ pkts_compl++; -+ dev_kfree_skb_any(buf->skb); -+ } else if (buf->type == MVNETA_TYPE_XDP_TX || -+ buf->type == MVNETA_TYPE_XDP_NDO) { -+ xdp_return_frame(buf->xdpf); -+ } - } - - netdev_tx_completed_queue(nq, pkts_compl, bytes_compl); -@@ -1987,6 +1990,111 @@ int mvneta_rx_refill_queue(struct mvneta - } - - static int -+mvneta_xdp_submit_frame(struct mvneta_port *pp, struct mvneta_tx_queue *txq, -+ struct xdp_frame *xdpf, bool dma_map) -+{ -+ struct mvneta_tx_desc *tx_desc; -+ struct mvneta_tx_buf *buf; -+ dma_addr_t dma_addr; -+ -+ if (txq->count >= txq->tx_stop_threshold) -+ return MVNETA_XDP_DROPPED; -+ -+ tx_desc = mvneta_txq_next_desc_get(txq); -+ -+ buf = &txq->buf[txq->txq_put_index]; -+ if (dma_map) { -+ /* ndo_xdp_xmit */ -+ dma_addr = dma_map_single(pp->dev->dev.parent, xdpf->data, -+ xdpf->len, DMA_TO_DEVICE); -+ if (dma_mapping_error(pp->dev->dev.parent, dma_addr)) { -+ mvneta_txq_desc_put(txq); -+ return MVNETA_XDP_DROPPED; -+ } -+ buf->type = MVNETA_TYPE_XDP_NDO; -+ } else { -+ struct page *page = virt_to_page(xdpf->data); -+ -+ dma_addr = page_pool_get_dma_addr(page) + -+ sizeof(*xdpf) + xdpf->headroom; -+ dma_sync_single_for_device(pp->dev->dev.parent, dma_addr, -+ xdpf->len, DMA_BIDIRECTIONAL); -+ buf->type = MVNETA_TYPE_XDP_TX; -+ } -+ buf->xdpf = xdpf; -+ -+ tx_desc->command = MVNETA_TXD_FLZ_DESC; -+ tx_desc->buf_phys_addr = dma_addr; -+ tx_desc->data_size = xdpf->len; -+ -+ mvneta_update_stats(pp, 1, xdpf->len, true); -+ mvneta_txq_inc_put(txq); -+ txq->pending++; -+ txq->count++; -+ -+ return MVNETA_XDP_TX; -+} -+ -+static int -+mvneta_xdp_xmit_back(struct mvneta_port *pp, struct xdp_buff *xdp) -+{ -+ struct mvneta_tx_queue *txq; -+ struct netdev_queue *nq; -+ struct xdp_frame *xdpf; -+ int cpu; -+ u32 ret; -+ -+ xdpf = convert_to_xdp_frame(xdp); -+ if (unlikely(!xdpf)) -+ return MVNETA_XDP_DROPPED; -+ -+ cpu = smp_processor_id(); -+ txq = &pp->txqs[cpu % txq_number]; -+ nq = netdev_get_tx_queue(pp->dev, txq->id); -+ -+ __netif_tx_lock(nq, cpu); -+ ret = mvneta_xdp_submit_frame(pp, txq, xdpf, false); -+ if (ret == MVNETA_XDP_TX) -+ mvneta_txq_pend_desc_add(pp, txq, 0); -+ __netif_tx_unlock(nq); -+ -+ return ret; -+} -+ -+static int -+mvneta_xdp_xmit(struct net_device *dev, int num_frame, -+ struct xdp_frame **frames, u32 flags) -+{ -+ struct mvneta_port *pp = netdev_priv(dev); -+ int cpu = smp_processor_id(); -+ struct mvneta_tx_queue *txq; -+ struct netdev_queue *nq; -+ int i, drops = 0; -+ u32 ret; -+ -+ if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK)) -+ return -EINVAL; -+ -+ txq = &pp->txqs[cpu % txq_number]; -+ nq = netdev_get_tx_queue(pp->dev, txq->id); -+ -+ __netif_tx_lock(nq, cpu); -+ for (i = 0; i < num_frame; i++) { -+ ret = mvneta_xdp_submit_frame(pp, txq, frames[i], true); -+ if (ret != MVNETA_XDP_TX) { -+ xdp_return_frame_rx_napi(frames[i]); -+ drops++; -+ } -+ } -+ -+ if (unlikely(flags & XDP_XMIT_FLUSH)) -+ mvneta_txq_pend_desc_add(pp, txq, 0); -+ __netif_tx_unlock(nq); -+ -+ return num_frame - drops; -+} -+ -+static int - mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, - struct bpf_prog *prog, struct xdp_buff *xdp) - { -@@ -2008,6 +2116,11 @@ mvneta_run_xdp(struct mvneta_port *pp, s - } - break; - } -+ case XDP_TX: -+ ret = mvneta_xdp_xmit_back(pp, xdp); -+ if (ret != MVNETA_XDP_TX) -+ xdp_return_buff(xdp); -+ break; - default: - bpf_warn_invalid_xdp_action(act); - /* fall through */ -@@ -4574,6 +4687,7 @@ static const struct net_device_ops mvnet - .ndo_get_stats64 = mvneta_get_stats64, - .ndo_do_ioctl = mvneta_ioctl, - .ndo_bpf = mvneta_xdp, -+ .ndo_xdp_xmit = mvneta_xdp_xmit, - }; - - static const struct ethtool_ops mvneta_eth_tool_ops = { diff --git a/target/linux/mvebu/patches-5.10/010-net-mvneta-fix-build-skb-for-bm-capable-devices.patch b/target/linux/mvebu/patches-5.10/010-net-mvneta-fix-build-skb-for-bm-capable-devices.patch deleted file mode 100644 index adfa51e4e8..0000000000 --- a/target/linux/mvebu/patches-5.10/010-net-mvneta-fix-build-skb-for-bm-capable-devices.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b37fa92e20ef28aada852cbf03b368d29a20478c Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Thu, 14 Nov 2019 01:25:55 +0200 -Subject: [PATCH] net: mvneta: fix build skb for bm capable devices - -Fix build_skb for bm capable devices when they fall-back using swbm path -(e.g. when bm properties are configured in device tree but -CONFIG_MVNETA_BM_ENABLE is not set). In this case rx_offset_correction is -overwritten so we need to use it building skb instead of -MVNETA_SKB_HEADROOM directly - -Fixes: 8dc9a0888f4c ("net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine") -Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support") -Signed-off-by: Lorenzo Bianconi -Reported-by: Andrew Lunn -Tested-by: Andrew Lunn -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2167,7 +2167,7 @@ mvneta_swbm_rx_frame(struct mvneta_port - prefetch(data); - - xdp->data_hard_start = data; -- xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE; -+ xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE; - xdp->data_end = xdp->data + data_len; - xdp_set_data_meta_invalid(xdp); - -@@ -2232,7 +2232,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet - /* refill descriptor with new buffer later */ - skb_add_rx_frag(rxq->skb, - skb_shinfo(rxq->skb)->nr_frags, -- page, MVNETA_SKB_HEADROOM, data_len, -+ page, pp->rx_offset_correction, data_len, - PAGE_SIZE); - } - page_pool_release_page(rxq->page_pool, page); diff --git a/target/linux/mvebu/patches-5.10/011-arm64-dts-uDPU-remove-i2c-fast-mode.patch b/target/linux/mvebu/patches-5.10/011-arm64-dts-uDPU-remove-i2c-fast-mode.patch deleted file mode 100644 index 2922d49f44..0000000000 --- a/target/linux/mvebu/patches-5.10/011-arm64-dts-uDPU-remove-i2c-fast-mode.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fe3ec631a77ded87817f449691710a436a80caa7 Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Sat, 16 Nov 2019 11:07:01 +0000 -Subject: [PATCH] arm64: dts: uDPU: remove i2c-fast-mode - -The I2C bus violates the timing specifications when run in fast mode -on the uDPU, so switch to 100kHz mode. - -Signed-off-by: Russell King -Signed-off-by: Gregory CLEMENT ---- - arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts -@@ -119,12 +119,14 @@ - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; -+ /delete-property/mrvl,i2c-fast-mode; - }; - - &i2c1 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins>; -+ /delete-property/mrvl,i2c-fast-mode; - - lm75@48 { - status = "okay"; diff --git a/target/linux/mvebu/patches-5.10/012-arm64-dts-uDPU-SFP-cages-support-3W-modules.patch b/target/linux/mvebu/patches-5.10/012-arm64-dts-uDPU-SFP-cages-support-3W-modules.patch deleted file mode 100644 index 1884def2c6..0000000000 --- a/target/linux/mvebu/patches-5.10/012-arm64-dts-uDPU-SFP-cages-support-3W-modules.patch +++ /dev/null @@ -1,34 +0,0 @@ -From cd592187f9de3c6305d6c1c66f7fac084cb5b846 Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Tue, 19 Nov 2019 22:53:04 +0000 -Subject: [PATCH] arm64: dts: uDPU: SFP cages support 3W modules - -The SFP cages are designed to support up to 3W modules, such as G.hn, -G.fast and MoCA modules. Although there is no way for such modules to -declare to software that they consume 3W, we document in DT that this -is the designed power level for these cages. - -Signed-off-by: Russell King -Signed-off-by: Gregory CLEMENT ---- - arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts -@@ -69,6 +69,7 @@ - mod-def0-gpio = <&gpiosb 3 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpiosb 4 GPIO_ACTIVE_HIGH>; - tx-fault-gpio = <&gpiosb 5 GPIO_ACTIVE_HIGH>; -+ maximum-power-milliwatt = <3000>; - }; - - sfp_eth1: sfp-eth1 { -@@ -78,6 +79,7 @@ - mod-def0-gpio = <&gpiosb 8 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpiosb 9 GPIO_ACTIVE_HIGH>; - tx-fault-gpio = <&gpiosb 10 GPIO_ACTIVE_HIGH>; -+ maximum-power-milliwatt = <3000>; - }; - }; - diff --git a/target/linux/mvebu/patches-5.10/013-net-mvneta-rely-on-page_pool_recycle_direct-in-mvnet.patch b/target/linux/mvebu/patches-5.10/013-net-mvneta-rely-on-page_pool_recycle_direct-in-mvnet.patch deleted file mode 100644 index 6e79aeb358..0000000000 --- a/target/linux/mvebu/patches-5.10/013-net-mvneta-rely-on-page_pool_recycle_direct-in-mvnet.patch +++ /dev/null @@ -1,39 +0,0 @@ -From f383b2950070ce4f34e74db94f70bb565b746e97 Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Wed, 20 Nov 2019 16:54:17 +0200 -Subject: [PATCH] net: mvneta: rely on page_pool_recycle_direct in - mvneta_run_xdp - -Rely on page_pool_recycle_direct and not on xdp_return_buff in -mvneta_run_xdp. This is a preliminary patch to limit the dma sync len -to the one strictly necessary - -Signed-off-by: Lorenzo Bianconi -Acked-by: Jesper Dangaard Brouer -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2110,7 +2110,8 @@ mvneta_run_xdp(struct mvneta_port *pp, s - err = xdp_do_redirect(pp->dev, xdp, prog); - if (err) { - ret = MVNETA_XDP_DROPPED; -- xdp_return_buff(xdp); -+ page_pool_recycle_direct(rxq->page_pool, -+ virt_to_head_page(xdp->data)); - } else { - ret = MVNETA_XDP_REDIR; - } -@@ -2119,7 +2120,8 @@ mvneta_run_xdp(struct mvneta_port *pp, s - case XDP_TX: - ret = mvneta_xdp_xmit_back(pp, xdp); - if (ret != MVNETA_XDP_TX) -- xdp_return_buff(xdp); -+ page_pool_recycle_direct(rxq->page_pool, -+ virt_to_head_page(xdp->data)); - break; - default: - bpf_warn_invalid_xdp_action(act); diff --git a/target/linux/mvebu/patches-5.10/014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch b/target/linux/mvebu/patches-5.10/014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch deleted file mode 100644 index e8a41d9eb2..0000000000 --- a/target/linux/mvebu/patches-5.10/014-mvneta-driver-disallow-XDP-program-on-hardware-buffe.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 79572c98c554dcdb080bca547c871a51716dcdf8 Mon Sep 17 00:00:00 2001 -From: Sven Auhagen -Date: Sat, 25 Jan 2020 08:07:03 +0000 -Subject: [PATCH] mvneta driver disallow XDP program on hardware buffer - management - -Recently XDP Support was added to the mvneta driver -for software buffer management only. -It is still possible to attach an XDP program if -hardware buffer management is used. -It is not doing anything at that point. - -The patch disallows attaching XDP programs to mvneta -if hardware buffer management is used. - -I am sorry about that. It is my first submission and I am having -some troubles with the format of my emails. - -v4 -> v5: -- Remove extra tabs - -v3 -> v4: -- Please ignore v3 I accidentally submitted - my other patch with git-send-mail and v4 is correct - -v2 -> v3: -- My mailserver corrupted the patch - resubmission with git-send-email - -v1 -> v2: -- Fixing the patches indentation - -Signed-off-by: Sven Auhagen -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4263,6 +4263,12 @@ static int mvneta_xdp_setup(struct net_d - return -EOPNOTSUPP; - } - -+ if (pp->bm_priv) { -+ NL_SET_ERR_MSG_MOD(extack, -+ "Hardware Buffer Management not supported on XDP"); -+ return -EOPNOTSUPP; -+ } -+ - need_update = !!pp->xdp_prog != !!prog; - if (running && need_update) - mvneta_stop(dev); diff --git a/target/linux/mvebu/patches-5.10/015-net-mvneta-fix-XDP-support-if-sw-bm-is-used-as-fallb.patch b/target/linux/mvebu/patches-5.10/015-net-mvneta-fix-XDP-support-if-sw-bm-is-used-as-fallb.patch deleted file mode 100644 index 86bffa538a..0000000000 --- a/target/linux/mvebu/patches-5.10/015-net-mvneta-fix-XDP-support-if-sw-bm-is-used-as-fallb.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 44efc78d0e464ce70b45b165c005f8bedc17952e Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Wed, 29 Jan 2020 12:50:53 +0100 -Subject: [PATCH] net: mvneta: fix XDP support if sw bm is used as fallback - -In order to fix XDP support if sw buffer management is used as fallback -for hw bm devices, define MVNETA_SKB_HEADROOM as maximum between -XDP_PACKET_HEADROOM and NET_SKB_PAD and let the hw aligns the IP header -to 4-byte boundary. -Fix rx_offset_correction initialization if mvneta_bm_port_init fails in -mvneta_resume routine - -Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support") -Tested-by: Sven Auhagen -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -326,8 +326,7 @@ - ETH_HLEN + ETH_FCS_LEN, \ - cache_line_size()) - --#define MVNETA_SKB_HEADROOM (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) + \ -- NET_IP_ALIGN) -+#define MVNETA_SKB_HEADROOM max(XDP_PACKET_HEADROOM, NET_SKB_PAD) - #define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \ - MVNETA_SKB_HEADROOM)) - #define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD) -@@ -1174,6 +1173,7 @@ bm_mtu_err: - mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_short, 1 << pp->id); - - pp->bm_priv = NULL; -+ pp->rx_offset_correction = MVNETA_SKB_HEADROOM; - mvreg_write(pp, MVNETA_ACC_MODE, MVNETA_ACC_MODE_EXT1); - netdev_info(pp->dev, "fail to update MTU, fall back to software BM\n"); - } -@@ -4984,7 +4984,6 @@ static int mvneta_probe(struct platform_ - SET_NETDEV_DEV(dev, &pdev->dev); - - pp->id = global_port_id++; -- pp->rx_offset_correction = MVNETA_SKB_HEADROOM; - - /* Obtain access to BM resources if enabled and already initialized */ - bm_node = of_parse_phandle(dn, "buffer-manager", 0); -@@ -5009,6 +5008,10 @@ static int mvneta_probe(struct platform_ - } - of_node_put(bm_node); - -+ /* sw buffer management */ -+ if (!pp->bm_priv) -+ pp->rx_offset_correction = MVNETA_SKB_HEADROOM; -+ - err = mvneta_init(&pdev->dev, pp); - if (err < 0) - goto err_netdev; -@@ -5166,6 +5169,7 @@ static int mvneta_resume(struct device * - err = mvneta_bm_port_init(pdev, pp); - if (err < 0) { - dev_info(&pdev->dev, "use SW buffer management\n"); -+ pp->rx_offset_correction = MVNETA_SKB_HEADROOM; - pp->bm_priv = NULL; - } - } diff --git a/target/linux/mvebu/patches-5.10/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch b/target/linux/mvebu/patches-5.10/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch deleted file mode 100644 index c9e49ac2f1..0000000000 --- a/target/linux/mvebu/patches-5.10/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 6964494582f56a3882c2c53b0edbfe99eb32b2e1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Thu, 30 Apr 2020 10:06:14 +0200 -Subject: [PATCH] PCI: aardvark: Train link immediately after enabling training -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Adding even 100ms (PCI_PM_D3COLD_WAIT) delay between enabling link -training and starting link training causes detection issues with some -buggy cards (such as Compex WLE900VX). - -Move the code which enables link training immediately before the one -which starts link traning. - -This fixes detection issues of Compex WLE900VX card on Turris MOX after -cold boot. - -Link: https://lore.kernel.org/r/20200430080625.26070-2-pali@kernel.org -Fixes: f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready...") -Tested-by: Tomasz Maciej Nowak -Signed-off-by: Pali Rohár -Signed-off-by: Lorenzo Pieralisi -Acked-by: Rob Herring -Acked-by: Thomas Petazzoni ---- - drivers/pci/controller/pci-aardvark.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -300,11 +300,6 @@ static void advk_pcie_setup_hw(struct ad - reg |= LANE_COUNT_1; - advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); - -- /* Enable link training */ -- reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); -- reg |= LINK_TRAINING_EN; -- advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); -- - /* Enable MSI */ - reg = advk_readl(pcie, PCIE_CORE_CTRL2_REG); - reg |= PCIE_CORE_CTRL2_MSI_ENABLE; -@@ -346,7 +341,15 @@ static void advk_pcie_setup_hw(struct ad - */ - msleep(PCI_PM_D3COLD_WAIT); - -- /* Start link training */ -+ /* Enable link training */ -+ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); -+ reg |= LINK_TRAINING_EN; -+ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); -+ -+ /* -+ * Start link training immediately after enabling it. -+ * This solves problems for some buggy cards. -+ */ - reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); - reg |= PCIE_CORE_LINK_TRAINING; - advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG); diff --git a/target/linux/mvebu/patches-5.10/017-PCI-aardvark-Improve-link-training.patch b/target/linux/mvebu/patches-5.10/017-PCI-aardvark-Improve-link-training.patch deleted file mode 100644 index 2bf838432f..0000000000 --- a/target/linux/mvebu/patches-5.10/017-PCI-aardvark-Improve-link-training.patch +++ /dev/null @@ -1,208 +0,0 @@ -From 43fc679ced18006b12d918d7a8a4af392b7fbfe7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Thu, 30 Apr 2020 10:06:17 +0200 -Subject: [PATCH] PCI: aardvark: Improve link training -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Currently the aardvark driver trains link in PCIe gen2 mode. This may -cause some buggy gen1 cards (such as Compex WLE900VX) to be unstable or -even not detected. Moreover when ASPM code tries to retrain link second -time, these cards may stop responding and link goes down. If gen1 is -used this does not happen. - -Unconditionally forcing gen1 is not a good solution since it may have -performance impact on gen2 cards. - -To overcome this, read 'max-link-speed' property (as defined in PCI -device tree bindings) and use this as max gen mode. Then iteratively try -link training at this mode or lower until successful. After successful -link training choose final controller gen based on Negotiated Link Speed -from Link Status register, which should match card speed. - -Link: https://lore.kernel.org/r/20200430080625.26070-5-pali@kernel.org -Tested-by: Tomasz Maciej Nowak -Signed-off-by: Pali Rohár -Signed-off-by: Marek Behún -Signed-off-by: Lorenzo Pieralisi -Reviewed-by: Rob Herring -Acked-by: Thomas Petazzoni ---- - drivers/pci/controller/pci-aardvark.c | 114 ++++++++++++++++++++------ - 1 file changed, 89 insertions(+), 25 deletions(-) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -39,6 +39,7 @@ - #define PCIE_CORE_LINK_CTRL_STAT_REG 0xd0 - #define PCIE_CORE_LINK_L0S_ENTRY BIT(0) - #define PCIE_CORE_LINK_TRAINING BIT(5) -+#define PCIE_CORE_LINK_SPEED_SHIFT 16 - #define PCIE_CORE_LINK_WIDTH_SHIFT 20 - #define PCIE_CORE_ERR_CAPCTL_REG 0x118 - #define PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX BIT(5) -@@ -201,6 +202,7 @@ struct advk_pcie { - struct mutex msi_used_lock; - u16 msi_msg; - int root_bus_nr; -+ int link_gen; - struct pci_bridge_emul bridge; - }; - -@@ -225,20 +227,16 @@ static int advk_pcie_link_up(struct advk - - static int advk_pcie_wait_for_link(struct advk_pcie *pcie) - { -- struct device *dev = &pcie->pdev->dev; - int retries; - - /* check if the link is up or not */ - for (retries = 0; retries < LINK_WAIT_MAX_RETRIES; retries++) { -- if (advk_pcie_link_up(pcie)) { -- dev_info(dev, "link up\n"); -+ if (advk_pcie_link_up(pcie)) - return 0; -- } - - usleep_range(LINK_WAIT_USLEEP_MIN, LINK_WAIT_USLEEP_MAX); - } - -- dev_err(dev, "link never came up\n"); - return -ETIMEDOUT; - } - -@@ -253,6 +251,85 @@ static void advk_pcie_wait_for_retrain(s - } - } - -+static int advk_pcie_train_at_gen(struct advk_pcie *pcie, int gen) -+{ -+ int ret, neg_gen; -+ u32 reg; -+ -+ /* Setup link speed */ -+ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); -+ reg &= ~PCIE_GEN_SEL_MSK; -+ if (gen == 3) -+ reg |= SPEED_GEN_3; -+ else if (gen == 2) -+ reg |= SPEED_GEN_2; -+ else -+ reg |= SPEED_GEN_1; -+ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); -+ -+ /* -+ * Enable link training. This is not needed in every call to this -+ * function, just once suffices, but it does not break anything either. -+ */ -+ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); -+ reg |= LINK_TRAINING_EN; -+ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); -+ -+ /* -+ * Start link training immediately after enabling it. -+ * This solves problems for some buggy cards. -+ */ -+ reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); -+ reg |= PCIE_CORE_LINK_TRAINING; -+ advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG); -+ -+ ret = advk_pcie_wait_for_link(pcie); -+ if (ret) -+ return ret; -+ -+ reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); -+ neg_gen = (reg >> PCIE_CORE_LINK_SPEED_SHIFT) & 0xf; -+ -+ return neg_gen; -+} -+ -+static void advk_pcie_train_link(struct advk_pcie *pcie) -+{ -+ struct device *dev = &pcie->pdev->dev; -+ int neg_gen = -1, gen; -+ -+ /* -+ * Try link training at link gen specified by device tree property -+ * 'max-link-speed'. If this fails, iteratively train at lower gen. -+ */ -+ for (gen = pcie->link_gen; gen > 0; --gen) { -+ neg_gen = advk_pcie_train_at_gen(pcie, gen); -+ if (neg_gen > 0) -+ break; -+ } -+ -+ if (neg_gen < 0) -+ goto err; -+ -+ /* -+ * After successful training if negotiated gen is lower than requested, -+ * train again on negotiated gen. This solves some stability issues for -+ * some buggy gen1 cards. -+ */ -+ if (neg_gen < gen) { -+ gen = neg_gen; -+ neg_gen = advk_pcie_train_at_gen(pcie, gen); -+ } -+ -+ if (neg_gen == gen) { -+ dev_info(dev, "link up at gen %i\n", gen); -+ return; -+ } -+ -+err: -+ dev_err(dev, "link never came up\n"); -+} -+ - static void advk_pcie_setup_hw(struct advk_pcie *pcie) - { - u32 reg; -@@ -288,12 +365,6 @@ static void advk_pcie_setup_hw(struct ad - PCIE_CORE_CTRL2_TD_ENABLE; - advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG); - -- /* Set GEN2 */ -- reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); -- reg &= ~PCIE_GEN_SEL_MSK; -- reg |= SPEED_GEN_2; -- advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); -- - /* Set lane X1 */ - reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); - reg &= ~LANE_CNT_MSK; -@@ -341,20 +412,7 @@ static void advk_pcie_setup_hw(struct ad - */ - msleep(PCI_PM_D3COLD_WAIT); - -- /* Enable link training */ -- reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); -- reg |= LINK_TRAINING_EN; -- advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); -- -- /* -- * Start link training immediately after enabling it. -- * This solves problems for some buggy cards. -- */ -- reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); -- reg |= PCIE_CORE_LINK_TRAINING; -- advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG); -- -- advk_pcie_wait_for_link(pcie); -+ advk_pcie_train_link(pcie); - - reg = advk_readl(pcie, PCIE_CORE_CMD_STATUS_REG); - reg |= PCIE_CORE_CMD_MEM_ACCESS_EN | -@@ -1035,6 +1093,12 @@ static int advk_pcie_probe(struct platfo - return ret; - } - -+ ret = of_pci_get_max_link_speed(dev->of_node); -+ if (ret <= 0 || ret > 3) -+ pcie->link_gen = 3; -+ else -+ pcie->link_gen = ret; -+ - advk_pcie_setup_hw(pcie); - - ret = advk_sw_pci_bridge_init(pcie); diff --git a/target/linux/mvebu/patches-5.10/018-PCI-aardvark-Issue-PERST-via-GPIO.patch b/target/linux/mvebu/patches-5.10/018-PCI-aardvark-Issue-PERST-via-GPIO.patch deleted file mode 100644 index 83212ec475..0000000000 --- a/target/linux/mvebu/patches-5.10/018-PCI-aardvark-Issue-PERST-via-GPIO.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 5169a9851daaa2782a7bd2bb83d5b1bd224b2879 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Thu, 30 Apr 2020 10:06:18 +0200 -Subject: [PATCH] PCI: aardvark: Issue PERST via GPIO -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for issuing PERST via GPIO specified in 'reset-gpios' -property (as described in PCI device tree bindings). - -Some buggy cards (e.g. Compex WLE900VX or WLE1216) are not detected -after reboot when PERST is not issued during driver initialization. - -If bootloader already enabled link training then issuing PERST has no -effect for some buggy cards (e.g. Compex WLE900VX) and these cards are -not detected. We therefore clear the LINK_TRAINING_EN register before. - -It was observed that Compex WLE900VX card needs to be in PERST reset -for at least 10ms if bootloader enabled link training. - -Tested on Turris MOX. - -Link: https://lore.kernel.org/r/20200430080625.26070-6-pali@kernel.org -Tested-by: Tomasz Maciej Nowak -Signed-off-by: Pali Rohár -Signed-off-by: Lorenzo Pieralisi -Acked-by: Thomas Petazzoni ---- - drivers/pci/controller/pci-aardvark.c | 43 ++++++++++++++++++++++++++- - 1 file changed, 42 insertions(+), 1 deletion(-) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -9,6 +9,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -17,6 +18,7 @@ - #include - #include - #include -+#include - #include - - #include "../pci.h" -@@ -204,6 +206,7 @@ struct advk_pcie { - int root_bus_nr; - int link_gen; - struct pci_bridge_emul bridge; -+ struct gpio_desc *reset_gpio; - }; - - static inline void advk_writel(struct advk_pcie *pcie, u32 val, u64 reg) -@@ -330,10 +333,31 @@ err: - dev_err(dev, "link never came up\n"); - } - -+static void advk_pcie_issue_perst(struct advk_pcie *pcie) -+{ -+ u32 reg; -+ -+ if (!pcie->reset_gpio) -+ return; -+ -+ /* PERST does not work for some cards when link training is enabled */ -+ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); -+ reg &= ~LINK_TRAINING_EN; -+ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); -+ -+ /* 10ms delay is needed for some cards */ -+ dev_info(&pcie->pdev->dev, "issuing PERST via reset GPIO for 10ms\n"); -+ gpiod_set_value_cansleep(pcie->reset_gpio, 1); -+ usleep_range(10000, 11000); -+ gpiod_set_value_cansleep(pcie->reset_gpio, 0); -+} -+ - static void advk_pcie_setup_hw(struct advk_pcie *pcie) - { - u32 reg; - -+ advk_pcie_issue_perst(pcie); -+ - /* Set to Direct mode */ - reg = advk_readl(pcie, CTRL_CONFIG_REG); - reg &= ~(CTRL_MODE_MASK << CTRL_MODE_SHIFT); -@@ -406,7 +430,8 @@ static void advk_pcie_setup_hw(struct ad - - /* - * PERST# signal could have been asserted by pinctrl subsystem before -- * probe() callback has been called, making the endpoint going into -+ * probe() callback has been called or issued explicitly by reset gpio -+ * function advk_pcie_issue_perst(), making the endpoint going into - * fundamental reset. As required by PCI Express spec a delay for at - * least 100ms after such a reset before link training is needed. - */ -@@ -1093,6 +1118,22 @@ static int advk_pcie_probe(struct platfo - return ret; - } - -+ pcie->reset_gpio = devm_gpiod_get_from_of_node(dev, dev->of_node, -+ "reset-gpios", 0, -+ GPIOD_OUT_LOW, -+ "pcie1-reset"); -+ ret = PTR_ERR_OR_ZERO(pcie->reset_gpio); -+ if (ret) { -+ if (ret == -ENOENT) { -+ pcie->reset_gpio = NULL; -+ } else { -+ if (ret != -EPROBE_DEFER) -+ dev_err(dev, "Failed to get reset-gpio: %i\n", -+ ret); -+ return ret; -+ } -+ } -+ - ret = of_pci_get_max_link_speed(dev->of_node); - if (ret <= 0 || ret > 3) - pcie->link_gen = 3; diff --git a/target/linux/mvebu/patches-5.10/019-PCI-aardvark-Add-PHY-support.patch b/target/linux/mvebu/patches-5.10/019-PCI-aardvark-Add-PHY-support.patch deleted file mode 100644 index fa04861e80..0000000000 --- a/target/linux/mvebu/patches-5.10/019-PCI-aardvark-Add-PHY-support.patch +++ /dev/null @@ -1,152 +0,0 @@ -From 366697018c9a2aa67d457bfdc495115cface6ae8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Thu, 30 Apr 2020 10:06:20 +0200 -Subject: [PATCH] PCI: aardvark: Add PHY support -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -With recent proposed changes for U-Boot it is possible that bootloader -won't initialize the PHY for this controller (currently the PHY is -initialized regardless whether PCI is used in U-Boot, but with these -proposed changes the PHY is initialized only on request). - -Since the mvebu-a3700-comphy driver by Miquèl Raynal supports enabling -PCIe PHY, and since Linux' functionality should be independent on what -bootloader did, add code for enabling generic PHY if found in device OF -node. - -The mvebu-a3700-comphy driver does PHY powering via SMC calls to ARM -Trusted Firmware. The corresponding code in ARM Trusted Firmware skips -one register write which U-Boot does not: step 7 ("Enable TX"), see [1]. -Instead ARM Trusted Firmware expects PCIe driver to do this step, -probably because the register is in PCIe controller address space, -instead of PHY address space. We therefore add this step into the -advk_pcie_setup_hw function. - -[1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/drivers/marvell/comphy/phy-comphy-3700.c?h=v2.3-rc2#n836 - -Link: https://lore.kernel.org/r/20200430080625.26070-8-pali@kernel.org -Tested-by: Tomasz Maciej Nowak -Signed-off-by: Marek Behún -Signed-off-by: Lorenzo Pieralisi -Reviewed-by: Rob Herring -Acked-by: Thomas Petazzoni -Cc: Miquèl Raynal ---- - drivers/pci/controller/pci-aardvark.c | 69 +++++++++++++++++++++++++++ - 1 file changed, 69 insertions(+) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -103,6 +104,8 @@ - #define PCIE_CORE_CTRL2_STRICT_ORDER_ENABLE BIT(5) - #define PCIE_CORE_CTRL2_OB_WIN_ENABLE BIT(6) - #define PCIE_CORE_CTRL2_MSI_ENABLE BIT(10) -+#define PCIE_CORE_REF_CLK_REG (CONTROL_BASE_ADDR + 0x14) -+#define PCIE_CORE_REF_CLK_TX_ENABLE BIT(1) - #define PCIE_MSG_LOG_REG (CONTROL_BASE_ADDR + 0x30) - #define PCIE_ISR0_REG (CONTROL_BASE_ADDR + 0x40) - #define PCIE_MSG_PM_PME_MASK BIT(7) -@@ -207,6 +210,7 @@ struct advk_pcie { - int link_gen; - struct pci_bridge_emul bridge; - struct gpio_desc *reset_gpio; -+ struct phy *phy; - }; - - static inline void advk_writel(struct advk_pcie *pcie, u32 val, u64 reg) -@@ -358,6 +362,11 @@ static void advk_pcie_setup_hw(struct ad - - advk_pcie_issue_perst(pcie); - -+ /* Enable TX */ -+ reg = advk_readl(pcie, PCIE_CORE_REF_CLK_REG); -+ reg |= PCIE_CORE_REF_CLK_TX_ENABLE; -+ advk_writel(pcie, reg, PCIE_CORE_REF_CLK_REG); -+ - /* Set to Direct mode */ - reg = advk_readl(pcie, CTRL_CONFIG_REG); - reg &= ~(CTRL_MODE_MASK << CTRL_MODE_SHIFT); -@@ -1083,6 +1092,62 @@ out_release_res: - return err; - } - -+static void __maybe_unused advk_pcie_disable_phy(struct advk_pcie *pcie) -+{ -+ phy_power_off(pcie->phy); -+ phy_exit(pcie->phy); -+} -+ -+static int advk_pcie_enable_phy(struct advk_pcie *pcie) -+{ -+ int ret; -+ -+ if (!pcie->phy) -+ return 0; -+ -+ ret = phy_init(pcie->phy); -+ if (ret) -+ return ret; -+ -+ ret = phy_set_mode(pcie->phy, PHY_MODE_PCIE); -+ if (ret) { -+ phy_exit(pcie->phy); -+ return ret; -+ } -+ -+ ret = phy_power_on(pcie->phy); -+ if (ret) { -+ phy_exit(pcie->phy); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int advk_pcie_setup_phy(struct advk_pcie *pcie) -+{ -+ struct device *dev = &pcie->pdev->dev; -+ struct device_node *node = dev->of_node; -+ int ret = 0; -+ -+ pcie->phy = devm_of_phy_get(dev, node, NULL); -+ if (IS_ERR(pcie->phy) && (PTR_ERR(pcie->phy) == -EPROBE_DEFER)) -+ return PTR_ERR(pcie->phy); -+ -+ /* Old bindings miss the PHY handle */ -+ if (IS_ERR(pcie->phy)) { -+ dev_warn(dev, "PHY unavailable (%ld)\n", PTR_ERR(pcie->phy)); -+ pcie->phy = NULL; -+ return 0; -+ } -+ -+ ret = advk_pcie_enable_phy(pcie); -+ if (ret) -+ dev_err(dev, "Failed to initialize PHY (%d)\n", ret); -+ -+ return ret; -+} -+ - static int advk_pcie_probe(struct platform_device *pdev) - { - struct device *dev = &pdev->dev; -@@ -1140,6 +1205,10 @@ static int advk_pcie_probe(struct platfo - else - pcie->link_gen = ret; - -+ ret = advk_pcie_setup_phy(pcie); -+ if (ret) -+ return ret; -+ - advk_pcie_setup_hw(pcie); - - ret = advk_sw_pci_bridge_init(pcie); diff --git a/target/linux/mvebu/patches-5.10/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch b/target/linux/mvebu/patches-5.10/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch deleted file mode 100644 index 87247b63ad..0000000000 --- a/target/linux/mvebu/patches-5.10/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 715878016984b2617f6c1f177c50039e12e7bd5b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Thu, 30 Apr 2020 10:06:23 +0200 -Subject: [PATCH] arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio - function -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -We found out that we are unable to control the PERST# signal via the -default pin dedicated to be PERST# pin (GPIO2[3] pin) on A3700 SOC when -this pin is in EP_PCIE1_Resetn mode. There is a register in the PCIe -register space called PERSTN_GPIO_EN (D0088004[3]), but changing the -value of this register does not change the pin output when measuring -with voltmeter. - -We do not know if this is a bug in the SOC, or if it works only when -PCIe controller is in a certain state. - -Commit f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready -before training link") says that when this pin changes pinctrl mode -from EP_PCIE1_Resetn to GPIO, the PERST# signal is asserted for a brief -moment. - -So currently the situation is that on A3700 boards the PERST# signal is -asserted in U-Boot (because the code in U-Boot issues reset via this pin -via GPIO mode), and then in Linux by the obscure and undocumented -mechanism described by the above mentioned commit. - -We want to issue PERST# signal in a known way, therefore this patch -changes the pcie_reset_pin function from "pcie" to "gpio" and adds the -reset-gpios property to the PCIe node in device tree files of -EspressoBin and Armada 3720 Dev Board (Turris Mox device tree already -has this property and uDPU does not have a PCIe port). - -Signed-off-by: Marek Behún -Cc: Remi Pommarel -Tested-by: Tomasz Maciej Nowak -Acked-by: Thomas Petazzoni -Signed-off-by: Gregory CLEMENT ---- - arch/arm64/boot/dts/marvell/armada-3720-db.dts | 3 +++ - arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi | 1 + - arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 4 ---- - arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +- - 4 files changed, 5 insertions(+), 5 deletions(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-db.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-db.dts -@@ -128,6 +128,9 @@ - - /* CON15(V2.0)/CON17(V1.4) : PCIe / CON15(V2.0)/CON12(V1.4) :mini-PCIe */ - &pcie0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; -+ reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; - status = "okay"; - }; - ---- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts -@@ -59,6 +59,7 @@ - phys = <&comphy1 0>; - pinctrl-names = "default"; - pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; -+ reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; - }; - - /* J6 */ ---- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts -@@ -120,10 +120,6 @@ - }; - }; - --&pcie_reset_pins { -- function = "gpio"; --}; -- - &pcie0 { - pinctrl-names = "default"; - pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; ---- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -@@ -317,7 +317,7 @@ - - pcie_reset_pins: pcie-reset-pins { - groups = "pcie1"; -- function = "pcie"; -+ function = "gpio"; - }; - - pcie_clkreq_pins: pcie-clkreq-pins { diff --git a/target/linux/mvebu/patches-5.10/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch b/target/linux/mvebu/patches-5.10/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch deleted file mode 100644 index e92393ff6f..0000000000 --- a/target/linux/mvebu/patches-5.10/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch +++ /dev/null @@ -1,57 +0,0 @@ -From df749cdb015011e9ed8b60ebb84b4e76a9f35735 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Thu, 30 Apr 2020 10:06:24 +0200 -Subject: [PATCH] arm64: dts: marvell: armada-37xx: Move PCIe comphy handle - property -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Move the comphy handle property of the PCIe node from board specific -device tree files (EspressoBin and Turris Mox) to the generic -armada-37xx.dtsi. - -This is correct since this is the only possible PCIe PHY configuration -on Armada 37xx, so when PCIe is enabled on any board, this handle is -correct. - -Signed-off-by: Marek Behún -Tested-by: Tomasz Maciej Nowak -Acked-by: Thomas Petazzoni -Signed-off-by: Gregory CLEMENT ---- - arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi | 1 - - arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 1 - - arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 + - 3 files changed, 1 insertion(+), 2 deletions(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts -@@ -56,7 +56,6 @@ - /* J9 */ - &pcie0 { - status = "okay"; -- phys = <&comphy1 0>; - pinctrl-names = "default"; - pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; - reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; ---- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts -@@ -126,7 +126,6 @@ - status = "okay"; - max-link-speed = <2>; - reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; -- phys = <&comphy1 0>; - - /* enabled by U-Boot if PCIe module is present */ - status = "disabled"; ---- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -@@ -493,6 +493,7 @@ - <0 0 0 2 &pcie_intc 1>, - <0 0 0 3 &pcie_intc 2>, - <0 0 0 4 &pcie_intc 3>; -+ phys = <&comphy1 0>; - pcie_intc: interrupt-controller { - interrupt-controller; - #interrupt-cells = <1>; diff --git a/target/linux/mvebu/patches-5.10/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch b/target/linux/mvebu/patches-5.10/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch deleted file mode 100644 index ad918bef88..0000000000 --- a/target/linux/mvebu/patches-5.10/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 1b5a2dd9e266d78d5fddd7e6b116e47ba9577b5e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Thu, 30 Apr 2020 10:06:25 +0200 -Subject: [PATCH] arm64: dts: marvell: armada-37xx: Move PCIe max-link-speed - property -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Move the max-link-speed property of the PCIe node from board specific -device tree files to the generic armada-37xx.dtsi. - -Armada 37xx supports only PCIe gen2 speed so max-link-speed property -should be in the generic armada-37xx.dtsi file. - -Signed-off-by: Pali Rohár -Tested-by: Tomasz Maciej Nowak -Acked-by: Thomas Petazzoni -Signed-off-by: Gregory CLEMENT ---- - arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 1 - - arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 + - 2 files changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts -@@ -124,7 +124,6 @@ - pinctrl-names = "default"; - pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; - status = "okay"; -- max-link-speed = <2>; - reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; - - /* enabled by U-Boot if PCIe module is present */ ---- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -@@ -493,6 +493,7 @@ - <0 0 0 2 &pcie_intc 1>, - <0 0 0 3 &pcie_intc 2>, - <0 0 0 4 &pcie_intc 3>; -+ max-link-speed = <2>; - phys = <&comphy1 0>; - pcie_intc: interrupt-controller { - interrupt-controller; diff --git a/target/linux/mvebu/patches-5.10/023-arm64-dts-add-uDPU-i2c-bus-recovery.patch b/target/linux/mvebu/patches-5.10/023-arm64-dts-add-uDPU-i2c-bus-recovery.patch deleted file mode 100644 index 818fce85a8..0000000000 --- a/target/linux/mvebu/patches-5.10/023-arm64-dts-add-uDPU-i2c-bus-recovery.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 11b2af36cc874027ce701c5784cb957c99c7de3d Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Wed, 6 May 2020 10:40:37 +0100 -Subject: [PATCH] arm64: dts: add uDPU i2c bus recovery - -Signed-off-by: Russell King -Reviewed-by: Andrew Lunn -Signed-off-by: Gregory CLEMENT ---- - .../boot/dts/marvell/armada-3720-uDPU.dts | 22 +++++++++++++++++-- - 1 file changed, 20 insertions(+), 2 deletions(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts -@@ -117,18 +117,36 @@ - }; - }; - -+&pinctrl_nb { -+ i2c1_recovery_pins: i2c1-recovery-pins { -+ groups = "i2c1"; -+ function = "gpio"; -+ }; -+ -+ i2c2_recovery_pins: i2c2-recovery-pins { -+ groups = "i2c2"; -+ function = "gpio"; -+ }; -+}; -+ - &i2c0 { - status = "okay"; -- pinctrl-names = "default"; -+ pinctrl-names = "default", "recovery"; - pinctrl-0 = <&i2c1_pins>; -+ pinctrl-1 = <&i2c1_recovery_pins>; - /delete-property/mrvl,i2c-fast-mode; -+ scl-gpios = <&gpionb 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; -+ sda-gpios = <&gpionb 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; - }; - - &i2c1 { - status = "okay"; -- pinctrl-names = "default"; -+ pinctrl-names = "default", "recovery"; - pinctrl-0 = <&i2c2_pins>; -+ pinctrl-1 = <&i2c2_recovery_pins>; - /delete-property/mrvl,i2c-fast-mode; -+ scl-gpios = <&gpionb 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; -+ sda-gpios = <&gpionb 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; - - lm75@48 { - status = "okay"; diff --git a/target/linux/mvebu/patches-5.10/024-PCI-aardvark-Don-t-touch-PCIe-registers-if-no-card-c.patch b/target/linux/mvebu/patches-5.10/024-PCI-aardvark-Don-t-touch-PCIe-registers-if-no-card-c.patch deleted file mode 100644 index dfc068c8cb..0000000000 --- a/target/linux/mvebu/patches-5.10/024-PCI-aardvark-Don-t-touch-PCIe-registers-if-no-card-c.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 70e380250c3621c55ff218cbaf2272830d9dbb1d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Thu, 2 Jul 2020 10:30:36 +0200 -Subject: [PATCH] PCI: aardvark: Don't touch PCIe registers if no card - connected -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When there is no PCIe card connected and advk_pcie_rd_conf() or -advk_pcie_wr_conf() is called for PCI bus which doesn't belong to emulated -root bridge, the aardvark driver throws the following error message: - - advk-pcie d0070000.pcie: config read/write timed out - -Obviously accessing PCIe registers of disconnected card is not possible. - -Extend check in advk_pcie_valid_device() function for validating -availability of PCIe bus. If PCIe link is down, then the device is marked -as Not Found and the driver does not try to access these registers. - -This is just an optimization to prevent accessing PCIe registers when card -is disconnected. Trying to access PCIe registers of disconnected card does -not cause any crash, kernel just needs to wait for a timeout. So if card -disappear immediately after checking for PCIe link (before accessing PCIe -registers), it does not cause any problems. - -Link: https://lore.kernel.org/r/20200702083036.12230-1-pali@kernel.org -Signed-off-by: Pali Rohár -Signed-off-by: Lorenzo Pieralisi ---- - drivers/pci/controller/pci-aardvark.c | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -639,6 +639,13 @@ static bool advk_pcie_valid_device(struc - if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0) - return false; - -+ /* -+ * If the link goes down after we check for link-up, nothing bad -+ * happens but the config access times out. -+ */ -+ if (bus->number != pcie->root_bus_nr && !advk_pcie_link_up(pcie)) -+ return false; -+ - return true; - } - diff --git a/target/linux/mvebu/patches-5.10/025-power-reset-add-driver-for-LinkStation-power-off.patch b/target/linux/mvebu/patches-5.10/025-power-reset-add-driver-for-LinkStation-power-off.patch deleted file mode 100644 index 64ea26559e..0000000000 --- a/target/linux/mvebu/patches-5.10/025-power-reset-add-driver-for-LinkStation-power-off.patch +++ /dev/null @@ -1,207 +0,0 @@ -From a7f79f99541eff4e6bcae0014eb08d3019337565 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= -Date: Wed, 15 Jul 2020 15:35:14 +0200 -Subject: [PATCH] power: reset: add driver for LinkStation power off -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Some Buffalo LinkStations perform the power off operation, at restart -time, depending on the state of an output pin (LED2/INTn) at the ethernet -PHY. This pin is also used to wake the machine when a WoL packet is -received by the PHY. - -The driver is required by the Buffalo LinkStation LS421DE (ARM MVEBU), -and other models. Without it, the board remains forever halted if a -power off command is executed, unless the PSU is disconnected and -connected again. - -Add the driver to provide the power off function and also make the WoL -feature to be available. - -Signed-off-by: Daniel González Cabanelas -Signed-off-by: Sebastian Reichel ---- - drivers/power/reset/Kconfig | 11 ++ - drivers/power/reset/Makefile | 1 + - drivers/power/reset/linkstation-poweroff.c | 136 +++++++++++++++++++++ - 3 files changed, 148 insertions(+) - create mode 100644 drivers/power/reset/linkstation-poweroff.c - ---- a/drivers/power/reset/Kconfig -+++ b/drivers/power/reset/Kconfig -@@ -99,6 +99,17 @@ config POWER_RESET_HISI - help - Reboot support for Hisilicon boards. - -+config POWER_RESET_LINKSTATION -+ tristate "Buffalo LinkStation power-off driver" -+ depends on ARCH_MVEBU || COMPILE_TEST -+ depends on OF_MDIO && PHYLIB -+ help -+ This driver supports turning off some Buffalo LinkStations by -+ setting an output pin at the ethernet PHY to the correct state. -+ It also makes the device compatible with the WoL function. -+ -+ Say Y here if you have a Buffalo LinkStation LS421D/E. -+ - config POWER_RESET_MSM - bool "Qualcomm MSM power-off driver" - depends on ARCH_QCOM ---- a/drivers/power/reset/Makefile -+++ b/drivers/power/reset/Makefile -@@ -10,6 +10,7 @@ obj-$(CONFIG_POWER_RESET_GEMINI_POWEROFF - obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o - obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o - obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o -+obj-${CONFIG_POWER_RESET_LINKSTATION} += linkstation-poweroff.o - obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o - obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o - obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o ---- /dev/null -+++ b/drivers/power/reset/linkstation-poweroff.c -@@ -0,0 +1,144 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * LinkStation power off restart driver -+ * Copyright (C) 2020 Daniel González Cabanelas -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Defines from the eth phy Marvell driver */ -+#define MII_MARVELL_COPPER_PAGE 0 -+#define MII_MARVELL_LED_PAGE 3 -+#define MII_MARVELL_WOL_PAGE 17 -+#define MII_MARVELL_PHY_PAGE 22 -+ -+#define MII_PHY_LED_CTRL 16 -+#define MII_88E1318S_PHY_LED_TCR 18 -+#define MII_88E1318S_PHY_WOL_CTRL 16 -+#define MII_M1011_IEVENT 19 -+ -+#define MII_88E1318S_PHY_LED_TCR_INTn_ENABLE BIT(7) -+#define MII_88E1318S_PHY_LED_TCR_FORCE_INT BIT(15) -+#define MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS BIT(12) -+#define LED2_FORCE_ON (0x8 << 8) -+#define LEDMASK GENMASK(11,8) -+ -+static struct phy_device *phydev; -+ -+static void mvphy_reg_intn(u16 data) -+{ -+ int rc = 0, saved_page; -+ -+ saved_page = phy_select_page(phydev, MII_MARVELL_LED_PAGE); -+ if (saved_page < 0) -+ goto err; -+ -+ /* Force manual LED2 control to let INTn work */ -+ __phy_modify(phydev, MII_PHY_LED_CTRL, LEDMASK, LED2_FORCE_ON); -+ -+ /* Set the LED[2]/INTn pin to the required state */ -+ __phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, -+ MII_88E1318S_PHY_LED_TCR_FORCE_INT, -+ MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | data); -+ -+ if (!data) { -+ /* Clear interrupts to ensure INTn won't be holded in high state */ -+ __phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_COPPER_PAGE); -+ __phy_read(phydev, MII_M1011_IEVENT); -+ -+ /* If WOL was enabled and a magic packet was received before powering -+ * off, we won't be able to wake up by sending another magic packet. -+ * Clear WOL status. -+ */ -+ __phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_WOL_PAGE); -+ __phy_set_bits(phydev, MII_88E1318S_PHY_WOL_CTRL, -+ MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS); -+ } -+err: -+ rc = phy_restore_page(phydev, saved_page, rc); -+ if (rc < 0) -+ dev_err(&phydev->mdio.dev, "Write register failed, %d\n", rc); -+ -+ if (!data) { -+ /* Slow down the PHY to save energy */ -+ rc= phy_speed_down(phydev, false); -+ if (rc < 0) -+ dev_err(&phydev->mdio.dev, "PHY speed down failed, %d\n", rc); -+ } -+} -+ -+static int linkstation_reboot_notifier(struct notifier_block *nb, -+ unsigned long action, void *unused) -+{ -+ if (action == SYS_RESTART) -+ mvphy_reg_intn(MII_88E1318S_PHY_LED_TCR_FORCE_INT); -+ -+ return NOTIFY_DONE; -+} -+ -+static struct notifier_block linkstation_reboot_nb = { -+ .notifier_call = linkstation_reboot_notifier, -+}; -+ -+static void linkstation_poweroff(void) -+{ -+ unregister_reboot_notifier(&linkstation_reboot_nb); -+ mvphy_reg_intn(0); -+ -+ kernel_restart("Power off"); -+} -+ -+static const struct of_device_id ls_poweroff_of_match[] = { -+ { .compatible = "buffalo,ls421d" }, -+ { .compatible = "buffalo,ls421de" }, -+ { }, -+}; -+ -+static int __init linkstation_poweroff_init(void) -+{ -+ struct mii_bus *bus; -+ struct device_node *dn; -+ -+ dn = of_find_matching_node(NULL, ls_poweroff_of_match); -+ if (!dn) -+ return -ENODEV; -+ of_node_put(dn); -+ -+ dn = of_find_node_by_name(NULL, "mdio"); -+ if (!dn) -+ return -ENODEV; -+ -+ bus = of_mdio_find_bus(dn); -+ of_node_put(dn); -+ if (!bus) -+ return -EPROBE_DEFER; -+ -+ phydev = phy_find_first(bus); -+ if (!phydev) -+ return -EPROBE_DEFER; -+ -+ register_reboot_notifier(&linkstation_reboot_nb); -+ pm_power_off = linkstation_poweroff; -+ -+ pr_info("LinkStation power off driver registered\n"); -+ return 0; -+} -+ -+static void __exit linkstation_poweroff_exit(void) -+{ -+ pm_power_off = NULL; -+ unregister_reboot_notifier(&linkstation_reboot_nb); -+} -+ -+module_init(linkstation_poweroff_init); -+module_exit(linkstation_poweroff_exit); -+ -+MODULE_AUTHOR("Daniel González Cabanelas "); -+MODULE_DESCRIPTION("LinkStation power off driver"); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/mvebu/patches-5.10/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch b/target/linux/mvebu/patches-5.10/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch deleted file mode 100644 index bb9d7b7849..0000000000 --- a/target/linux/mvebu/patches-5.10/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b0c6ae0f8948a2be6bf4e8b4bbab9ca1343289b6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Wed, 2 Sep 2020 16:43:44 +0200 -Subject: [PATCH] PCI: aardvark: Fix initialization with old Marvell's Arm - Trusted Firmware -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Old ATF automatically power on pcie phy and does not provide SMC call for -phy power on functionality which leads to aardvark initialization failure: - -[ 0.330134] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware -[ 0.338846] phy phy-d0018300.phy.1: phy poweron failed --> -95 -[ 0.344753] advk-pcie d0070000.pcie: Failed to initialize PHY (-95) -[ 0.351160] advk-pcie: probe of d0070000.pcie failed with error -95 - -This patch fixes above failure by ignoring 'not supported' error in -aardvark driver. In this case it is expected that phy is already power on. - -Tested-by: Tomasz Maciej Nowak -Link: https://lore.kernel.org/r/20200902144344.16684-3-pali@kernel.org -Fixes: 366697018c9a ("PCI: aardvark: Add PHY support") -Signed-off-by: Pali Rohár -Signed-off-by: Lorenzo Pieralisi -Reviewed-by: Rob Herring -Cc: # 5.8+: ea17a0f153af: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno ---- - drivers/pci/controller/pci-aardvark.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -1123,7 +1123,9 @@ static int advk_pcie_enable_phy(struct a - } - - ret = phy_power_on(pcie->phy); -- if (ret) { -+ if (ret == -EOPNOTSUPP) { -+ dev_warn(&pcie->pdev->dev, "PHY unsupported by firmware\n"); -+ } else if (ret) { - phy_exit(pcie->phy); - return ret; - } diff --git a/target/linux/mvebu/patches-5.10/027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch b/target/linux/mvebu/patches-5.10/027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch deleted file mode 100644 index 927670d8b3..0000000000 --- a/target/linux/mvebu/patches-5.10/027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch +++ /dev/null @@ -1,88 +0,0 @@ -From b64d814257b027e29a474bcd660f6372490138c7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Mon, 7 Sep 2020 13:27:17 +0200 -Subject: [PATCH] arm64: dts: marvell: espressobin: Add ethernet switch aliases -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Espressobin boards have 3 ethernet ports and some of them got assigned more -then one MAC address. MAC addresses are stored in U-Boot environment. - -Since commit a2c7023f7075c ("net: dsa: read mac address from DT for slave -device") kernel can use MAC addresses from DT for particular DSA port. - -Currently Espressobin DTS file contains alias just for ethernet0. - -This patch defines additional ethernet aliases in Espressobin DTS files, so -bootloader can fill correct MAC address for DSA switch ports if more MAC -addresses were specified. - -DT alias ethernet1 is used for wan port, DT aliases ethernet2 and ethernet3 -are used for lan ports for both Espressobin revisions (V5 and V7). - -Fixes: 5253cb8c00a6f ("arm64: dts: marvell: espressobin: add ethernet alias") -Cc: # a2c7023f7075c: dsa: read mac address -Signed-off-by: Pali Rohár -Reviewed-by: Andrew Lunn -Reviewed-by: Andre Heider -Signed-off-by: Gregory CLEMENT ---- - .../dts/marvell/armada-3720-espressobin-v7-emmc.dts | 10 ++++++++-- - .../boot/dts/marvell/armada-3720-espressobin-v7.dts | 10 ++++++++-- - 3 files changed, 24 insertions(+), 8 deletions(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts -@@ -15,16 +15,22 @@ - compatible = "globalscale,espressobin-v7-emmc", "globalscale,espressobin-v7", - "globalscale,espressobin", "marvell,armada3720", - "marvell,armada3710"; -+ -+ aliases { -+ /* ethernet1 is wan port */ -+ ethernet1 = &switch0port3; -+ ethernet3 = &switch0port1; -+ }; - }; - - &ports { -- port@1 { -+ switch0port1: port@1 { - reg = <1>; - label = "lan1"; - phy-handle = <&switch0phy0>; - }; - -- port@3 { -+ switch0port3: port@3 { - reg = <3>; - label = "wan"; - phy-handle = <&switch0phy2>; ---- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts -@@ -14,16 +14,22 @@ - model = "Globalscale Marvell ESPRESSOBin Board V7"; - compatible = "globalscale,espressobin-v7", "globalscale,espressobin", - "marvell,armada3720", "marvell,armada3710"; -+ -+ aliases { -+ /* ethernet1 is wan port */ -+ ethernet1 = &switch0port3; -+ ethernet3 = &switch0port1; -+ }; - }; - - &ports { -- port@1 { -+ switch0port1: port@1 { - reg = <1>; - label = "lan1"; - phy-handle = <&switch0phy0>; - }; - -- port@3 { -+ switch0port3: port@3 { - reg = <3>; - label = "wan"; - phy-handle = <&switch0phy2>; diff --git a/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch index fd60cdb322..f2a0478693 100644 --- a/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -28,7 +28,7 @@ Signed-off-by: Michael Gray --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1780,6 +1780,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. @@ -48,7 +48,7 @@ Signed-off-by: Michael Gray config CMDLINE --- a/arch/arm/boot/compressed/atags_to_fdt.c +++ b/arch/arm/boot/compressed/atags_to_fdt.c -@@ -4,6 +4,8 @@ +@@ -5,6 +5,8 @@ #if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND) #define do_extend_cmdline 1 @@ -57,7 +57,7 @@ Signed-off-by: Michael Gray #else #define do_extend_cmdline 0 #endif -@@ -67,6 +69,72 @@ static uint32_t get_cell_size(const void +@@ -69,6 +71,72 @@ static uint32_t get_cell_size(const void return cell_size; } @@ -130,7 +130,7 @@ Signed-off-by: Michael Gray static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline) { char cmdline[COMMAND_LINE_SIZE]; -@@ -86,12 +154,21 @@ static void merge_fdt_bootargs(void *fdt +@@ -88,12 +156,21 @@ static void merge_fdt_bootargs(void *fdt /* and append the ATAG_CMDLINE */ if (fdt_cmdline) { @@ -152,7 +152,7 @@ Signed-off-by: Michael Gray } *ptr = '\0'; -@@ -166,7 +243,9 @@ int atags_to_fdt(void *atag_list, void * +@@ -168,7 +245,9 @@ int atags_to_fdt(void *atag_list, void * else setprop_string(fdt, "/chosen", "bootargs", atag->u.cmdline.cmdline); @@ -163,7 +163,7 @@ Signed-off-by: Michael Gray if (memcount >= sizeof(mem_reg_property)/4) continue; if (!atag->u.mem.size) -@@ -210,6 +289,10 @@ int atags_to_fdt(void *atag_list, void * +@@ -212,6 +291,10 @@ int atags_to_fdt(void *atag_list, void * setprop(fdt, "/memory", "reg", mem_reg_property, 4 * memcount * memsize); } @@ -176,9 +176,9 @@ Signed-off-by: Michael Gray } --- a/init/main.c +++ b/init/main.c -@@ -104,6 +104,10 @@ - #define CREATE_TRACE_POINTS - #include +@@ -110,6 +110,10 @@ + + #include +#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) +#include @@ -187,10 +187,10 @@ Signed-off-by: Michael Gray static int kernel_init(void *); extern void init_IRQ(void); -@@ -631,6 +635,18 @@ asmlinkage __visible void __init start_k +@@ -903,6 +907,18 @@ asmlinkage __visible void __init __no_sa page_alloc_init(); - pr_notice("Kernel command line: %s\n", boot_command_line); + pr_notice("Kernel command line: %s\n", saved_command_line); + +#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) + //Show bootloader's original command line for reference diff --git a/target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch b/target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch index b8ab700c97..615caac24f 100644 --- a/target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch +++ b/target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch @@ -1,7 +1,7 @@ --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig -@@ -69,6 +69,7 @@ config MACH_ARMADA_38X - select HAVE_SMP +@@ -67,6 +67,7 @@ config MACH_ARMADA_38X + select HAVE_ARM_TWD if SMP select MACH_MVEBU_V7 select PINCTRL_ARMADA_38X + select ARCH_WANT_LIBATA_LEDS diff --git a/target/linux/mvebu/patches-5.10/315-arm64-dts-marvell-armada-3720-espressobin-add-ports-.patch b/target/linux/mvebu/patches-5.10/315-arm64-dts-marvell-armada-3720-espressobin-add-ports-.patch deleted file mode 100644 index a741e378d9..0000000000 --- a/target/linux/mvebu/patches-5.10/315-arm64-dts-marvell-armada-3720-espressobin-add-ports-.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 6ea9a1ee9367fb35acff1c08a0dc4213ff4687a0 Mon Sep 17 00:00:00 2001 -From: Tomasz Maciej Nowak -Date: Tue, 9 Apr 2019 15:53:42 +0200 -Subject: [PATCH] arm64: dts: marvell: armada-3720-espressobin: add ports - phandle - -Instead of referencing the whole mdio node, add ports phandle to adjust -port labels in dts for different hardware iterations of ESPRESSObin -boards. - -Signed-off-by: Tomasz Maciej Nowak ---- - arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts -@@ -147,7 +147,7 @@ - - dsa,member = <0 0>; - -- ports { -+ ports: ports { - #address-cells = <1>; - #size-cells = <0>; - diff --git a/target/linux/mvebu/patches-5.10/400-find_active_root.patch b/target/linux/mvebu/patches-5.10/400-find_active_root.patch index 854031b0d5..f61d85bc05 100644 --- a/target/linux/mvebu/patches-5.10/400-find_active_root.patch +++ b/target/linux/mvebu/patches-5.10/400-find_active_root.patch @@ -39,7 +39,7 @@ Signed-off-by: Imre Kaloz parts[i].name = partname; if (of_get_property(pp, "read-only", &len)) -@@ -215,6 +222,18 @@ static int __init ofpart_parser_init(voi +@@ -218,6 +225,18 @@ static int __init ofpart_parser_init(voi return 0; } diff --git a/target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch index a82a4c0d62..2e840fd787 100644 --- a/target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4684,6 +4684,14 @@ static int mvneta_ethtool_set_eee(struct +@@ -4896,6 +4896,14 @@ static int mvneta_ethtool_set_eee(struct return phylink_ethtool_set_eee(pp->phylink, eee); } @@ -24,11 +24,11 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -4694,6 +4702,7 @@ static const struct net_device_ops mvnet +@@ -4906,6 +4914,7 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_do_ioctl = mvneta_ioctl, + .ndo_select_queue = mvneta_select_queue, - .ndo_bpf = mvneta_xdp, + .ndo_bpf = mvneta_xdp, .ndo_xdp_xmit = mvneta_xdp_xmit, }; diff --git a/target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch b/target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch index 4058dc8ed5..42f890e48c 100644 --- a/target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch +++ b/target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch @@ -13,7 +13,7 @@ Signed-off-by: Russell King --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c -@@ -928,6 +928,7 @@ static int mvebu_pcie_powerup(struct mve +@@ -933,6 +933,7 @@ static int mvebu_pcie_powerup(struct mve if (port->reset_gpio) { u32 reset_udelay = PCI_PM_D3COLD_WAIT * 1000; @@ -21,7 +21,7 @@ Signed-off-by: Russell King of_property_read_u32(port->dn, "reset-delay-us", &reset_udelay); -@@ -935,7 +936,13 @@ static int mvebu_pcie_powerup(struct mve +@@ -940,7 +941,13 @@ static int mvebu_pcie_powerup(struct mve udelay(100); gpiod_set_value_cansleep(port->reset_gpio, 0); @@ -36,7 +36,7 @@ Signed-off-by: Russell King } return 0; -@@ -1099,15 +1106,16 @@ static int mvebu_pcie_probe(struct platf +@@ -1100,15 +1107,16 @@ static int mvebu_pcie_probe(struct platf if (!child) continue; From 23ebb2e9c3b843dc7eaa3ddae4faee7f8ba00aef Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 22 Feb 2021 17:37:12 +0000 Subject: [PATCH 15/45] mvebu: fix the patch numbering Make each logical patch group numbering contiguous. Reviewed-by: Tomasz Maciej Nowak Tested-by: Tomasz Maciej Nowak Signed-off-by: Rui Salvaterra [add kernel version to backport] Signed-off-by: Adrian Schmutzler --- ... 001-v5.11-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch} | 0 ...tus-led-alias.patch => 313-helios4-dts-status-led-alias.patch} | 0 ...15-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/mvebu/patches-5.10/{028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch => 001-v5.11-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch} (100%) rename target/linux/mvebu/patches-5.10/{312-helios4-dts-status-led-alias.patch => 313-helios4-dts-status-led-alias.patch} (100%) rename target/linux/mvebu/patches-5.10/{316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch => 315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch} (100%) diff --git a/target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch b/target/linux/mvebu/patches-5.10/001-v5.11-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch similarity index 100% rename from target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch rename to target/linux/mvebu/patches-5.10/001-v5.11-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch diff --git a/target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch b/target/linux/mvebu/patches-5.10/313-helios4-dts-status-led-alias.patch similarity index 100% rename from target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch rename to target/linux/mvebu/patches-5.10/313-helios4-dts-status-led-alias.patch diff --git a/target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch b/target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch similarity index 100% rename from target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch rename to target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch From b0cdc5ae46d79b2d9155a3ef7ea1c63afcdfa804 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 22 Feb 2021 17:37:13 +0000 Subject: [PATCH 16/45] mvebu: fix the Turris Omnia device tree Enable and fix hardware buffer management. Also fix the IRQ storm caused by a misconfiguration of the PCA9538 interrupt pin. Reviewed-by: Tomasz Maciej Nowak Tested-by: Tomasz Maciej Nowak Signed-off-by: Rui Salvaterra --- ...is-omnia-enable-HW-buffer-management.patch | 74 +++++++++++++++++++ ...omnia-fix-hardware-buffer-management.patch | 27 +++++++ ...ure-LED-2--INTn-pin-as-interrupt-pin.patch | 64 ++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 target/linux/mvebu/patches-5.10/002-v5.11-ARM-dts-turris-omnia-enable-HW-buffer-management.patch create mode 100644 target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch create mode 100644 target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch diff --git a/target/linux/mvebu/patches-5.10/002-v5.11-ARM-dts-turris-omnia-enable-HW-buffer-management.patch b/target/linux/mvebu/patches-5.10/002-v5.11-ARM-dts-turris-omnia-enable-HW-buffer-management.patch new file mode 100644 index 0000000000..7a4b511998 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/002-v5.11-ARM-dts-turris-omnia-enable-HW-buffer-management.patch @@ -0,0 +1,74 @@ +From 018b88eee1a2efda26ed2f09aab33ccdc40ef18f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:17 +0100 +Subject: ARM: dts: turris-omnia: enable HW buffer management +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The buffer manager is available on Turris Omnia but needs to be +described in device-tree to be used. + +Signed-off-by: Marek Behún +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Andrew Lunn +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +(limited to 'arch/arm/boot/dts/armada-385-turris-omnia.dts') + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -84,12 +84,23 @@ + }; + }; + ++&bm { ++ status = "okay"; ++}; ++ ++&bm_bppi { ++ status = "okay"; ++}; ++ + /* Connected to 88E6176 switch, port 6 */ + ð0 { + pinctrl-names = "default"; + pinctrl-0 = <&ge0_rgmii_pins>; + status = "okay"; + phy-mode = "rgmii"; ++ buffer-manager = <&bm>; ++ bm,pool-long = <0>; ++ bm,pool-short = <3>; + + fixed-link { + speed = <1000>; +@@ -103,6 +114,9 @@ + pinctrl-0 = <&ge1_rgmii_pins>; + status = "okay"; + phy-mode = "rgmii"; ++ buffer-manager = <&bm>; ++ bm,pool-long = <1>; ++ bm,pool-short = <3>; + + fixed-link { + speed = <1000>; +@@ -115,6 +129,9 @@ + status = "okay"; + phy-mode = "sgmii"; + phy = <&phy1>; ++ buffer-manager = <&bm>; ++ bm,pool-long = <2>; ++ bm,pool-short = <3>; + }; + + &i2c0 { diff --git a/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch b/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch new file mode 100644 index 0000000000..2ebdc06f61 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch @@ -0,0 +1,27 @@ +From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001 +From: Rui Salvaterra +Date: Wed, 17 Feb 2021 15:19:30 +0000 +Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management + +Hardware buffer management has never worked on the Turris Omnia, as the +required MBus window hadn't been reserved. Fix thusly. + +Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management") + +Signed-off-by: Rui Salvaterra +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -32,7 +32,8 @@ + ranges = ; ++ MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 ++ MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; + + internal-regs { + diff --git a/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch b/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch new file mode 100644 index 0000000000..c7509950e0 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch @@ -0,0 +1,64 @@ +From: "Marek Behún" +To: Gregory CLEMENT +Cc: "Marek Behún" , Rui Salvaterra , "Uwe Kleine-König" , linux-arm-kernel@lists.infradead.org, Andrew Lunn , stable@vger.kernel.org +Subject: [PATCH mvebu-dt] ARM: dts: turris-omnia: configure LED[2]/INTn pin as interrupt pin +Date: Sun, 21 Feb 2021 00:11:44 +0100 +Message-Id: <20210220231144.32325-1-kabel@kernel.org> +X-Mailer: git-send-email 2.26.2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the `marvell,reg-init` DT property to configure the LED[2]/INTn pin +of the Marvell 88E1514 ethernet PHY on Turris Omnia into interrupt mode. + +Without this the pin is by default in LED[2] mode, and the Marvell PHY +driver configures LED[2] into "On - Link, Blink - Activity" mode. + +This fixes the issue where the pca9538 GPIO/interrupt controller (which +can't mask interrupts in HW) received too many interrupts and after a +time started ignoring the interrupt with error message: + IRQ 71: nobody cared + +There is a work in progress to have the Marvell PHY driver support +parsing PHY LED nodes from OF and registering the LEDs as Linux LED +class devices. Once this is done the PHY driver can also automatically +set the pin into INTn mode if it does not find LED[2] in OF. + +Until then, though, we fix this via `marvell,reg-init` DT property. + +Signed-off-by: Marek Behún +Reported-by: Rui Salvaterra +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Cc: Uwe Kleine-König +Cc: linux-arm-kernel@lists.infradead.org +Cc: Andrew Lunn +Cc: Gregory CLEMENT +Cc: + +--- + +This patch fixes bug introduced with the commit that added Turris +Omnia's DTS (26ca8b52d6e1), but will not apply cleanly because there is +commit 8ee4a5f4f40d which changed node name and node compatible +property and this commit did not go into stable. + +So either commit 8ee4a5f4f40d has also to go into stable before this, or +this patch has to be fixed a little in order to apply to 4.14+. + +Please let me know how should I handle this. + +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -390,6 +390,7 @@ + phy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; ++ marvell,reg-init = <3 18 0 0x4985>; + + /* irq is connected to &pcawan pin 7 */ + }; From fde9703a48e96a05ed3ee378e93af78739dff420 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 22 Feb 2021 17:37:14 +0000 Subject: [PATCH 17/45] mvebu: add 5.10 as a testing kernel Keep 5.4 as stable until further validation. Tested on Turris Omnia (Rui Salvaterra) and ESPRESSObin v5 (Tomasz Maciej Nowak). Cortex-A{53,72} subtargets are only build-tested. Reviewed-by: Tomasz Maciej Nowak Tested-by: Tomasz Maciej Nowak Signed-off-by: Rui Salvaterra [added comment about tests] Signed-off-by: Adrian Schmutzler --- target/linux/mvebu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile index 1e67bcfacb..1550309a92 100644 --- a/target/linux/mvebu/Makefile +++ b/target/linux/mvebu/Makefile @@ -10,7 +10,7 @@ FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk boot-part rootfs-part SUBTARGETS:=cortexa9 cortexa53 cortexa72 KERNEL_PATCHVER:=5.4 -KERNEL_TESTING_PATCHVER:=5.4 +KERNEL_TESTING_PATCHVER:=5.10 include $(INCLUDE_DIR)/target.mk From d1176ad95a82495c3745465da902de11ea2f88ea Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Tue, 23 Feb 2021 00:10:45 +0800 Subject: [PATCH 18/45] ramips: improve gpio control for Phicomm PSG1218 Description: 1. From key and led config setting, we can find only "uartf" and "i2c" are used as gpio by check mt7620 datasheet. It's time to remove unused pin group. 2. PSG1218 only have three led, so we can remove ethernet led pinctrl. refer to Phicomm K2G. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7620a_phicomm_psg1218.dtsi | 7 +++++++ target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts | 10 ---------- target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts | 10 ---------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1218.dtsi b/target/linux/ramips/dts/mt7620a_phicomm_psg1218.dtsi index 4163a9cd43..c3ec73b681 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1218.dtsi +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1218.dtsi @@ -84,6 +84,13 @@ }; }; +&state_default { + gpio { + groups = "i2c", "uartf"; + function = "gpio"; + }; +}; + &pcie { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts index baa0d8b261..d17f2fce59 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1218a.dts @@ -5,17 +5,7 @@ model = "Phicomm PSG1218 rev.A"; }; -&state_default { - gpio { - groups = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd"; - function = "gpio"; - }; -}; - ðernet { - pinctrl-names = "default"; - pinctrl-0 = <&ephy_pins>; - mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts index f7e70c92c8..822fb13b6f 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1218b.dts @@ -5,16 +5,6 @@ model = "Phicomm PSG1218 rev.B"; }; -&state_default { - gpio { - groups = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd", "pa"; - function = "gpio"; - }; -}; - ðernet { - pinctrl-names = "default"; - pinctrl-0 = <&ephy_pins>; - mtd-mac-address = <&factory 0x28>; }; From 9cd089dbbfe07b61590dd214957bc21bfdc7fd5d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 23 Feb 2021 18:02:40 +0000 Subject: [PATCH 19/45] arm-trusted-firmware-mediatek: use @OPENWRT mirror for blobs Now that mirrors have picked it up, switch to using the @OPENWRT mirror instead of hosting those files on Github. Signed-off-by: Daniel Golle --- package/boot/arm-trusted-firmware-mediatek/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index ad85c6ad2b..520ae2e8fe 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/trusted-firmware-a.mk include $(INCLUDE_DIR)/package.mk define Download/tfa-files - URL:=https://codeload.github.com/openwrt/arm-trusted-firmware-mediatek-files/tar.gz/for-2020-11-09? + URL:=@OPENWRT URL_FILE:=$(BLOBS_TARBALL) FILE:=$(BLOBS_TARBALL) HASH:=689b097e4531d3eeca0c477675ab3dc3cace6ba4ed8a339116a9ede6537839d7 From 57fdcf66f0c2ae4410a169dfbc1bd5a2c66771b0 Mon Sep 17 00:00:00 2001 From: Ilya Lipnitskiy Date: Thu, 18 Feb 2021 16:34:43 -0800 Subject: [PATCH 20/45] kernel: 5.10: fix rtl8812au-ct build Pull in upstream: https://github.com/greearb/rtl8812AU_8821AU_linux/commit/c8d243936fed0c5fe1d77a06b36d26f41c8c46f4 https://github.com/greearb/rtl8812AU_8821AU_linux/commit/1e9689c89fa627d2d764ba0e8359fd444fe8458f Signed-off-by: Ilya Lipnitskiy --- package/kernel/rtl8812au-ct/Makefile | 8 ++++---- .../rtl8812au-ct/patches/003-wireless-5.8.patch | 17 +++++------------ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/package/kernel/rtl8812au-ct/Makefile b/package/kernel/rtl8812au-ct/Makefile index aac754de7f..9c6cf6e7f2 100644 --- a/package/kernel/rtl8812au-ct/Makefile +++ b/package/kernel/rtl8812au-ct/Makefile @@ -1,16 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtl8812au-ct -PKG_RELEASE=2 +PKG_RELEASE=1 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/greearb/rtl8812AU_8821AU_linux.git -PKG_MIRROR_HASH:=fa689e034cad9e4683ea784b8f3cb590492ab5c68e8babd492a4e8bf2de3b114 +PKG_MIRROR_HASH:=09e33b1cede3f4457d4324fe30ea5fb92b240bcd6e647bbb689fa336f3b07968 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-01-12 -PKG_SOURCE_VERSION:=e0d586aa93cb8687dd7dc0e593b6a820df2d6e1d +PKG_SOURCE_DATE:=2020-12-07 +PKG_SOURCE_VERSION:=1e9689c89fa627d2d764ba0e8359fd444fe8458f PKG_MAINTAINER:=Ben Greear PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/rtl8812au-ct/patches/003-wireless-5.8.patch b/package/kernel/rtl8812au-ct/patches/003-wireless-5.8.patch index 64c5ab162b..67ebb82b38 100644 --- a/package/kernel/rtl8812au-ct/patches/003-wireless-5.8.patch +++ b/package/kernel/rtl8812au-ct/patches/003-wireless-5.8.patch @@ -1,6 +1,6 @@ --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c -@@ -5177,6 +5177,14 @@ exit: +@@ -5177,6 +5177,15 @@ exit: return ret; } @@ -11,19 +11,12 @@ +{ + +} -+#else - static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) - struct wireless_dev *wdev, -@@ -5205,6 +5213,7 @@ static void cfg80211_rtw_mgmt_frame_regi - exit: - return; - } +#endif - ++ #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, -@@ -6019,7 +6028,10 @@ static struct cfg80211_ops rtw_cfg80211_ + struct net_device *ndev, +@@ -5990,7 +5999,10 @@ static struct cfg80211_ops rtw_cfg80211_ .cancel_remain_on_channel = cfg80211_rtw_cancel_remain_on_channel, #endif @@ -33,5 +26,5 @@ + .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_registrations, +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) .mgmt_tx = cfg80211_rtw_mgmt_tx, - .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35)) + .action = cfg80211_rtw_mgmt_tx, From 30b482551d838f0a4a2d0d024a28ac6393f6ab9c Mon Sep 17 00:00:00 2001 From: Ilya Lipnitskiy Date: Fri, 19 Feb 2021 08:21:24 -0800 Subject: [PATCH 21/45] kernel: 5.10: fix kmod build failures Modify existing modules to reflect their new location in Linux 5.10. Add missing dependenices. Signed-off-by: Ilya Lipnitskiy [enable CRYPTO_USER_API_ENABLE_OBSOLETE; add kmod-crypto-hash dependency to usb-net-rtl8152] Signed-off-by: David Bauer --- package/kernel/linux/modules/block.mk | 2 +- package/kernel/linux/modules/crypto.mk | 13 ++++++++--- package/kernel/linux/modules/fs.mk | 3 ++- package/kernel/linux/modules/netdevices.mk | 12 ++++++---- package/kernel/linux/modules/other.mk | 4 +++- package/kernel/linux/modules/usb.mk | 26 +++++++++++++++++----- 6 files changed, 44 insertions(+), 16 deletions(-) diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk index b7767b3d16..e5822d95d7 100644 --- a/package/kernel/linux/modules/block.mk +++ b/package/kernel/linux/modules/block.mk @@ -218,7 +218,7 @@ $(eval $(call KernelPackage,dax)) define KernelPackage/dm SUBMENU:=$(BLOCK_MENU) TITLE:=Device Mapper - DEPENDS:=+kmod-crypto-manager +kmod-dax + DEPENDS:=+kmod-crypto-manager +kmod-dax +KERNEL_KEYS:kmod-keys-encrypted # All the "=n" are unnecessary, they're only there # to stop the config from asking the question. # MIRROR is M because I've needed it for pvmove. diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index e9e78e7967..ba3211c10a 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -38,7 +38,9 @@ define KernelPackage/crypto-aead KCONFIG:= \ CONFIG_CRYPTO_AEAD \ CONFIG_CRYPTO_AEAD2 - FILES:=$(LINUX_DIR)/crypto/aead.ko + FILES:= \ + $(LINUX_DIR)/crypto/aead.ko \ + $(LINUX_DIR)/crypto/geniv.ko@ge5.10 AUTOLOAD:=$(call AutoLoad,09,aead,1) $(call AddDepends/crypto, +kmod-crypto-null) endef @@ -48,8 +50,12 @@ $(eval $(call KernelPackage,crypto-aead)) define KernelPackage/crypto-arc4 TITLE:=ARC4 cipher CryptoAPI module - KCONFIG:=CONFIG_CRYPTO_ARC4 - FILES:=$(LINUX_DIR)/crypto/arc4.ko + KCONFIG:= \ + CONFIG_CRYPTO_ARC4 \ + CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y + FILES:= \ + $(LINUX_DIR)/crypto/arc4.ko \ + $(LINUX_DIR)/lib/crypto/libarc4.ko AUTOLOAD:=$(call AutoLoad,09,arc4) $(call AddDepends/crypto) endef @@ -492,6 +498,7 @@ define KernelPackage/crypto-misc TITLE:=Other CryptoAPI modules DEPENDS:=+kmod-crypto-xts KCONFIG:= \ + CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y \ CONFIG_CRYPTO_CAMELLIA_X86_64 \ CONFIG_CRYPTO_BLOWFISH_X86_64 \ CONFIG_CRYPTO_TWOFISH_X86_64 \ diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index a0db14ecfe..91ef535821 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -368,7 +368,8 @@ define KernelPackage/fs-nfs-common FILES:= \ $(LINUX_DIR)/fs/lockd/lockd.ko \ $(LINUX_DIR)/net/sunrpc/sunrpc.ko \ - $(LINUX_DIR)/fs/nfs_common/grace.ko + $(LINUX_DIR)/fs/nfs_common/grace.ko \ + $(LINUX_DIR)/fs/nfs_common/nfs_ssc.ko@ge5.10 AUTOLOAD:=$(call AutoLoad,30,grace sunrpc lockd) endef diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 5f7a80bf22..76675589fc 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -146,8 +146,10 @@ define KernelPackage/mdio-gpio CONFIG_MDIO_BITBANG \ CONFIG_MDIO_GPIO FILES:= \ - $(LINUX_DIR)/drivers/net/phy/mdio-gpio.ko \ - $(LINUX_DIR)/drivers/net/phy/mdio-bitbang.ko + $(LINUX_DIR)/drivers/net/phy/mdio-gpio.ko@lt5.10 \ + $(LINUX_DIR)/drivers/net/phy/mdio-bitbang.ko@lt5.10 \ + $(LINUX_DIR)/drivers/net/mdio/mdio-gpio.ko@ge5.10 \ + $(LINUX_DIR)/drivers/net/mdio/mdio-bitbang.ko@ge5.10 AUTOLOAD:=$(call AutoProbe,mdio-gpio) endef @@ -990,7 +992,8 @@ define KernelPackage/of-mdio KCONFIG:=CONFIG_OF_MDIO FILES:= \ $(LINUX_DIR)/drivers/net/phy/fixed_phy.ko \ - $(LINUX_DIR)/drivers/of/of_mdio.ko + $(LINUX_DIR)/drivers/of/of_mdio.ko@lt5.10 \ + $(LINUX_DIR)/drivers/net/mdio/of_mdio.ko@ge5.10 AUTOLOAD:=$(call AutoLoad,41,of_mdio) endef @@ -1165,7 +1168,8 @@ define KernelPackage/sfp CONFIG_MDIO_I2C FILES:= \ $(LINUX_DIR)/drivers/net/phy/sfp.ko \ - $(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko + $(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko@lt5.10 \ + $(LINUX_DIR)/drivers/net/mdio/mdio-i2c.ko@ge5.10 AUTOLOAD:=$(call AutoProbe,mdio-i2c sfp) endef diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 83d998c83a..cfd133f19f 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -1126,7 +1126,9 @@ define KernelPackage/keys-trusted TITLE:=TPM trusted keys on kernel keyring DEPENDS:=@KERNEL_KEYS +kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha1 +kmod-tpm KCONFIG:=CONFIG_TRUSTED_KEYS - FILES:=$(LINUX_DIR)/security/keys/trusted.ko + FILES:= \ + $(LINUX_DIR)/security/keys/trusted.ko@lt5.10 \ + $(LINUX_DIR)/security/keys/trusted-keys/trusted.ko@ge5.10 AUTOLOAD:=$(call AutoLoad,01,trusted-keys,1) endef diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 3dd20a0696..e7498af31c 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -412,7 +412,7 @@ $(eval $(call KernelPackage,usb2-pci)) define KernelPackage/usb-dwc2 TITLE:=DWC2 USB controller driver - DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget + DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget +kmod-usb-roles KCONFIG:= \ CONFIG_USB_PCI=y \ CONFIG_USB_DWC2 \ @@ -1325,7 +1325,7 @@ define KernelPackage/usb-net-rtl8152 KCONFIG:=CONFIG_USB_RTL8152 FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko AUTOLOAD:=$(call AutoProbe,r8152) - $(call AddDepends/usb-net) + $(call AddDepends/usb-net, +LINUX_5_10:kmod-crypto-hash) endef define KernelPackage/usb-net-rtl8152/description @@ -1587,21 +1587,20 @@ endef $(eval $(call KernelPackage,usbip-server)) - define KernelPackage/usb-chipidea TITLE:=Host and device support for Chipidea controllers - DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget @TARGET_ath79 +kmod-usb-ehci +kmod-usb-phy-nop + DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget @TARGET_ath79 +kmod-usb-ehci +kmod-usb-phy-nop +kmod-usb-roles KCONFIG:= \ CONFIG_EXTCON \ CONFIG_USB_CHIPIDEA \ + CONFIG_USB_CHIPIDEA_GENERIC \ CONFIG_USB_CHIPIDEA_HOST=y \ CONFIG_USB_CHIPIDEA_UDC=y \ CONFIG_USB_CHIPIDEA_DEBUG=y FILES:= \ $(LINUX_DIR)/drivers/extcon/extcon-core.ko \ $(LINUX_DIR)/drivers/usb/chipidea/ci_hdrc.ko \ - $(LINUX_DIR)/drivers/usb/common/ulpi.ko \ - $(LINUX_DIR)/drivers/usb/roles/roles.ko + $(LINUX_DIR)/drivers/usb/common/ulpi.ko AUTOLOAD:=$(call AutoLoad,39,ci_hdrc,1) $(call AddDepends/usb) endef @@ -1699,6 +1698,21 @@ endef $(eval $(call KernelPackage,usb-net2280)) +define KernelPackage/usb-roles + TITLE:=USB Role Switch Library Module + KCONFIG:=CONFIG_USB_ROLE_SWITCH + HIDDEN:=1 + FILES:=$(LINUX_DIR)/drivers/usb/roles/roles.ko + $(call AddDepends/usb) +endef + +define KernelPackage/usb-roles/description + Support for USB Role Switch +endef + +$(eval $(call KernelPackage,usb-roles)) + + define KernelPackage/chaoskey SUBMENU:=$(USB_MENU) TITLE:=Chaoskey hardware RNG support From 17f7b217d3cb61dccbda3300054272c303e408c4 Mon Sep 17 00:00:00 2001 From: Ilya Lipnitskiy Date: Sun, 21 Feb 2021 16:03:12 -0800 Subject: [PATCH 22/45] wireguard: don't build on Linux 5.10 There are efforts underway to bring wireguard in-tree for Linux 5.4 and to have a common build infrastructure for both 5.4 and 5.10 for kmod-wireguard[0]. Until then, restrict kmod-wireguard to build only on Linux 5.4, because the wireguard-compat package will not build on Linux 5.10. [0]: https://github.com/openwrt/openwrt/pull/3885 Signed-off-by: Ilya Lipnitskiy --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 91bdb0d7a7..5a4d7ee871 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -50,7 +50,7 @@ endef define Package/wireguard $(call Package/wireguard/Default) TITLE:=WireGuard meta-package - DEPENDS:=+wireguard-tools +kmod-wireguard + DEPENDS:=+wireguard-tools +kmod-wireguard @LINUX_5_4 endef include $(INCLUDE_DIR)/kernel-defaults.mk @@ -73,7 +73,7 @@ define KernelPackage/wireguard CATEGORY:=Kernel modules SUBMENU:=Network Support TITLE:=WireGuard kernel module - DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 + DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 @LINUX_5_4 FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoProbe,wireguard) endef From 55ed4bf6d7bf80b705d015c3b73f772db485ba9c Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 22 Feb 2021 02:00:02 +0100 Subject: [PATCH 23/45] generic: add missing symbols Signed-off-by: David Bauer --- target/linux/generic/config-5.10 | 1 + target/linux/generic/config-5.4 | 1 + 2 files changed, 2 insertions(+) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index 36ab9dc66b..b0cf7c7d42 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -4713,6 +4713,7 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_ISL12026 is not set # CONFIG_RTC_DRV_ISL12057 is not set # CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_JZ4740 is not set # CONFIG_RTC_DRV_M41T80 is not set # CONFIG_RTC_DRV_M41T93 is not set # CONFIG_RTC_DRV_M41T94 is not set diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 9929688a61..4ace100b01 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -4373,6 +4373,7 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_ISL12026 is not set # CONFIG_RTC_DRV_ISL12057 is not set # CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_JZ4740 is not set # CONFIG_RTC_DRV_M41T80 is not set # CONFIG_RTC_DRV_M41T93 is not set # CONFIG_RTC_DRV_M41T94 is not set From 5e9b07ff365fc89e8eea271e63f202ff1afc33bd Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 23 Feb 2021 19:23:06 +0100 Subject: [PATCH 24/45] kernel: add symbol CONFIG_POWER_RESET_LINKSTATION Add symbol to generic config (this was added between 5.4 and 5.10), and remove it from the targets where it was added by kernel_oldconfig in the meantime. Signed-off-by: Adrian Schmutzler --- target/linux/generic/config-5.10 | 1 + target/linux/mvebu/cortexa53/config-5.10 | 1 - target/linux/mvebu/cortexa72/config-5.10 | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index b0cf7c7d42..d8c5017083 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -4384,6 +4384,7 @@ CONFIG_POSIX_TIMERS=y # CONFIG_POWER_RESET_BRCMSTB is not set # CONFIG_POWER_RESET_GPIO is not set # CONFIG_POWER_RESET_GPIO_RESTART is not set +# CONFIG_POWER_RESET_LINKSTATION is not set # CONFIG_POWER_RESET_LTC2952 is not set # CONFIG_POWER_RESET_PIIX4_POWEROFF is not set # CONFIG_POWER_RESET_RESTART is not set diff --git a/target/linux/mvebu/cortexa53/config-5.10 b/target/linux/mvebu/cortexa53/config-5.10 index a3de912b99..c70bea5ae5 100644 --- a/target/linux/mvebu/cortexa53/config-5.10 +++ b/target/linux/mvebu/cortexa53/config-5.10 @@ -66,7 +66,6 @@ CONFIG_PINCTRL_ARMADA_37XX=y CONFIG_PINCTRL_ARMADA_AP806=y CONFIG_PINCTRL_ARMADA_CP110=y CONFIG_POWER_RESET=y -# CONFIG_POWER_RESET_LINKSTATION is not set CONFIG_POWER_SUPPLY=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y diff --git a/target/linux/mvebu/cortexa72/config-5.10 b/target/linux/mvebu/cortexa72/config-5.10 index 6ffe6c9f13..a9b7e20dc1 100644 --- a/target/linux/mvebu/cortexa72/config-5.10 +++ b/target/linux/mvebu/cortexa72/config-5.10 @@ -73,7 +73,6 @@ CONFIG_PINCTRL_ARMADA_37XX=y CONFIG_PINCTRL_ARMADA_AP806=y CONFIG_PINCTRL_ARMADA_CP110=y CONFIG_POWER_RESET=y -# CONFIG_POWER_RESET_LINKSTATION is not set CONFIG_POWER_SUPPLY=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y From 90b1524f75023ad0f441e82773ca9e9b5d513e1a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 17 Feb 2021 02:51:10 -0800 Subject: [PATCH 25/45] autotools.mk: fix gettext fixup The update to gettext 0.21 broke packages that use autotools and gettext because the sed line was failing with the new version. Fix with a better sed expression. Signed-off-by: Rosen Penev --- include/autotools.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/autotools.mk b/include/autotools.mk index 4b48b38992..eb52b55924 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -90,7 +90,7 @@ endef define gettext_version_target (cd $(PKG_BUILD_DIR) && \ - GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \ + GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -rne '1s/.*\b([0-9]\.[0-9]+(\.[0-9]+)?)\b.*/\1/p' ) && \ $(STAGING_DIR_HOST)/bin/sed \ -i $(PKG_BUILD_DIR)/configure.ac \ -e "s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[$$$$GETTEXT_VERSION\])/g" && \ From 920eaab1d8179035d0ae1047e75cf9a50da6a6eb Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Mon, 22 Feb 2021 13:38:11 +0800 Subject: [PATCH 26/45] kernel: DSA roaming fix for Marvell mv88e6xxx Marvell mv88e6xxx switch series cannot perform MAC learning from CPU-injected (FROM_CPU) DSA frames, which results in 2 issues. - excessive flooding, due to the fact that DSA treats those addresses as unknown - the risk of stale routes, which can lead to temporary packet loss Backport those patch series from netdev mailing list, which solve these issues by adding and clearing static entries to the switch's FDB. Add a hack patch to set default VID to 1 in port_fdb_{add,del}. Otherwise the static entries will be added to the switch's private FDB if VLAN filtering disabled, which will not work. The switch may generate an "ATU violation" warning when a client moves from the CPU port to a switch port because the static ATU entry added by DSA core still points to the CPU port. DSA core will then clear the static entry so it is not fatal. Disable the warning so it will not confuse users. Link: https://lore.kernel.org/netdev/20210106095136.224739-1-olteanv@gmail.com/ Link: https://lore.kernel.org/netdev/20210116012515.3152-1-tobias@waldekranz.com/ Ref: https://gitlab.nic.cz/turris/turris-build/-/issues/165 Signed-off-by: DENG Qingfang --- ...y-switchdev-of-disappearance-of-old-.patch | 126 +++++++++ ...r-when-a-non-legacy-FDB-operation-fa.patch | 52 ++++ ...e-switchdev_notifier_fdb_info-in-dsa.patch | 226 +++++++++++++++ ...tchdev-event-implementation-under-th.patch | 85 ++++++ ...ly-in-dsa_slave_switchdev_event-if-w.patch | 42 +++ ...or-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch | 264 ++++++++++++++++++ ...y-switchdev-of-disappearance-of-old-.patch | 126 +++++++++ ...r-when-a-non-legacy-FDB-operation-fa.patch | 52 ++++ ...e-switchdev_notifier_fdb_info-in-dsa.patch | 226 +++++++++++++++ ...tchdev-event-implementation-under-th.patch | 85 ++++++ ...ly-in-dsa_slave_switchdev_event-if-w.patch | 42 +++ ...or-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch | 263 +++++++++++++++++ .../710-net-dsa-mv88e6xxx-default-VID-1.patch | 18 ++ ...-dsa-mv88e6xxx-disable-ATU-violation.patch | 12 + .../710-net-dsa-mv88e6xxx-default-VID-1.patch | 18 ++ ...-dsa-mv88e6xxx-disable-ATU-violation.patch | 12 + ...hdev-Refactor-br_switchdev_fdb_notif.patch | 75 +++++ ...hdev-Include-local-flag-in-FDB-notif.patch | 42 +++ ...hdev-Send-FDB-notifications-for-host.patch | 94 +++++++ ...local-addresses-in-assisted-CPU-port.patch | 36 +++ ...bridge-addresses-in-assisted-CPU-por.patch | 30 ++ ...tic-FDB-entries-on-foreign-interface.patch | 56 ++++ ...equest-assisted-learning-on-CPU-port.patch | 27 ++ ...hdev-Refactor-br_switchdev_fdb_notif.patch | 71 +++++ ...hdev-Include-local-flag-in-FDB-notif.patch | 42 +++ ...hdev-Send-FDB-notifications-for-host.patch | 94 +++++++ ...local-addresses-in-assisted-CPU-port.patch | 36 +++ ...bridge-addresses-in-assisted-CPU-por.patch | 30 ++ ...tic-FDB-entries-on-foreign-interface.patch | 56 ++++ ...equest-assisted-learning-on-CPU-port.patch | 27 ++ 30 files changed, 2365 insertions(+) create mode 100644 target/linux/generic/backport-5.10/770-v5.12-net-bridge-notify-switchdev-of-disappearance-of-old-.patch create mode 100644 target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch create mode 100644 target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch create mode 100644 target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch create mode 100644 target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch create mode 100644 target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch create mode 100644 target/linux/generic/backport-5.4/770-v5.12-net-bridge-notify-switchdev-of-disappearance-of-old-.patch create mode 100644 target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch create mode 100644 target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch create mode 100644 target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch create mode 100644 target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch create mode 100644 target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch create mode 100644 target/linux/generic/hack-5.10/710-net-dsa-mv88e6xxx-default-VID-1.patch create mode 100644 target/linux/generic/hack-5.10/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch create mode 100644 target/linux/generic/hack-5.4/710-net-dsa-mv88e6xxx-default-VID-1.patch create mode 100644 target/linux/generic/hack-5.4/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch create mode 100644 target/linux/generic/pending-5.10/762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch create mode 100644 target/linux/generic/pending-5.10/763-net-bridge-switchdev-Include-local-flag-in-FDB-notif.patch create mode 100644 target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch create mode 100644 target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch create mode 100644 target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch create mode 100644 target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch create mode 100644 target/linux/generic/pending-5.10/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch create mode 100644 target/linux/generic/pending-5.4/762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch create mode 100644 target/linux/generic/pending-5.4/763-net-bridge-switchdev-Include-local-flag-in-FDB-notif.patch create mode 100644 target/linux/generic/pending-5.4/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch create mode 100644 target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch create mode 100644 target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch create mode 100644 target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch create mode 100644 target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch diff --git a/target/linux/generic/backport-5.10/770-v5.12-net-bridge-notify-switchdev-of-disappearance-of-old-.patch b/target/linux/generic/backport-5.10/770-v5.12-net-bridge-notify-switchdev-of-disappearance-of-old-.patch new file mode 100644 index 0000000000..c43cb4d1f2 --- /dev/null +++ b/target/linux/generic/backport-5.10/770-v5.12-net-bridge-notify-switchdev-of-disappearance-of-old-.patch @@ -0,0 +1,126 @@ +From 90dc8fd36078a536671adae884d0b929cce6480a Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:30 +0200 +Subject: [PATCH] net: bridge: notify switchdev of disappearance of old FDB + entry upon migration + +Currently the bridge emits atomic switchdev notifications for +dynamically learnt FDB entries. Monitoring these notifications works +wonders for switchdev drivers that want to keep their hardware FDB in +sync with the bridge's FDB. + +For example station A wants to talk to station B in the diagram below, +and we are concerned with the behavior of the bridge on the DUT device: + + DUT + +-------------------------------------+ + | br0 | + | +------+ +------+ +------+ +------+ | + | | | | | | | | | | + | | swp0 | | swp1 | | swp2 | | eth0 | | + +-------------------------------------+ + | | | + Station A | | + | | + +--+------+--+ +--+------+--+ + | | | | | | | | + | | swp0 | | | | swp0 | | + Another | +------+ | | +------+ | Another + switch | br0 | | br0 | switch + | +------+ | | +------+ | + | | | | | | | | + | | swp1 | | | | swp1 | | + +--+------+--+ +--+------+--+ + | + Station B + +Interfaces swp0, swp1, swp2 are handled by a switchdev driver that has +the following property: frames injected from its control interface bypass +the internal address analyzer logic, and therefore, this hardware does +not learn from the source address of packets transmitted by the network +stack through it. So, since bridging between eth0 (where Station B is +attached) and swp0 (where Station A is attached) is done in software, +the switchdev hardware will never learn the source address of Station B. +So the traffic towards that destination will be treated as unknown, i.e. +flooded. + +This is where the bridge notifications come in handy. When br0 on the +DUT sees frames with Station B's MAC address on eth0, the switchdev +driver gets these notifications and can install a rule to send frames +towards Station B's address that are incoming from swp0, swp1, swp2, +only towards the control interface. This is all switchdev driver private +business, which the notification makes possible. + +All is fine until someone unplugs Station B's cable and moves it to the +other switch: + + DUT + +-------------------------------------+ + | br0 | + | +------+ +------+ +------+ +------+ | + | | | | | | | | | | + | | swp0 | | swp1 | | swp2 | | eth0 | | + +-------------------------------------+ + | | | + Station A | | + | | + +--+------+--+ +--+------+--+ + | | | | | | | | + | | swp0 | | | | swp0 | | + Another | +------+ | | +------+ | Another + switch | br0 | | br0 | switch + | +------+ | | +------+ | + | | | | | | | | + | | swp1 | | | | swp1 | | + +--+------+--+ +--+------+--+ + | + Station B + +Luckily for the use cases we care about, Station B is noisy enough that +the DUT hears it (on swp1 this time). swp1 receives the frames and +delivers them to the bridge, who enters the unlikely path in br_fdb_update +of updating an existing entry. It moves the entry in the software bridge +to swp1 and emits an addition notification towards that. + +As far as the switchdev driver is concerned, all that it needs to ensure +is that traffic between Station A and Station B is not forever broken. +If it does nothing, then the stale rule to send frames for Station B +towards the control interface remains in place. But Station B is no +longer reachable via the control interface, but via a port that can +offload the bridge port learning attribute. It's just that the port is +prevented from learning this address, since the rule overrides FDB +updates. So the rule needs to go. The question is via what mechanism. + +It sure would be possible for this switchdev driver to keep track of all +addresses which are sent to the control interface, and then also listen +for bridge notifier events on its own ports, searching for the ones that +have a MAC address which was previously sent to the control interface. +But this is cumbersome and inefficient. Instead, with one small change, +the bridge could notify of the address deletion from the old port, in a +symmetrical manner with how it did for the insertion. Then the switchdev +driver would not be required to monitor learn/forget events for its own +ports. It could just delete the rule towards the control interface upon +bridge entry migration. This would make hardware address learning be +possible again. Then it would take a few more packets until the hardware +and software FDB would be in sync again. + +Signed-off-by: Vladimir Oltean +Acked-by: Nikolay Aleksandrov +Reviewed-by: Ido Schimmel +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + net/bridge/br_fdb.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/bridge/br_fdb.c ++++ b/net/bridge/br_fdb.c +@@ -602,6 +602,7 @@ void br_fdb_update(struct net_bridge *br + /* fastpath: update of existing entry */ + if (unlikely(source != fdb->dst && + !test_bit(BR_FDB_STICKY, &fdb->flags))) { ++ br_switchdev_fdb_notify(fdb, RTM_DELNEIGH); + fdb->dst = source; + fdb_modified = true; + /* Take over HW learned entry */ diff --git a/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch new file mode 100644 index 0000000000..e4fd9eb2e4 --- /dev/null +++ b/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch @@ -0,0 +1,52 @@ +From 2fd186501b1cff155cc4a755c210793cfc0dffb5 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:31 +0200 +Subject: [PATCH] net: dsa: be louder when a non-legacy FDB operation fails + +The dev_close() call was added in commit c9eb3e0f8701 ("net: dsa: Add +support for learning FDB through notification") "to indicate inconsistent +situation" when we could not delete an FDB entry from the port. + +bridge fdb del d8:58:d7:00:ca:6d dev swp0 self master + +It is a bit drastic and at the same time not helpful if the above fails +to only print with netdev_dbg log level, but on the other hand to bring +the interface down. + +So increase the verbosity of the error message, and drop dev_close(). + +Signed-off-by: Vladimir Oltean +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + net/dsa/slave.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -2030,7 +2030,9 @@ static void dsa_slave_switchdev_event_wo + + err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid); + if (err) { +- netdev_dbg(dev, "fdb add failed err=%d\n", err); ++ netdev_err(dev, ++ "failed to add %pM vid %d to fdb: %d\n", ++ fdb_info->addr, fdb_info->vid, err); + break; + } + fdb_info->offloaded = true; +@@ -2045,9 +2047,11 @@ static void dsa_slave_switchdev_event_wo + + err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid); + if (err) { +- netdev_dbg(dev, "fdb del failed err=%d\n", err); +- dev_close(dev); ++ netdev_err(dev, ++ "failed to delete %pM vid %d from fdb: %d\n", ++ fdb_info->addr, fdb_info->vid, err); + } ++ + break; + } + rtnl_unlock(); diff --git a/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch new file mode 100644 index 0000000000..31502f5b23 --- /dev/null +++ b/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch @@ -0,0 +1,226 @@ +From c4bb76a9a0ef87c4cc1f636defed5f12deb9f5a7 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:32 +0200 +Subject: [PATCH] net: dsa: don't use switchdev_notifier_fdb_info in + dsa_switchdev_event_work + +Currently DSA doesn't add FDB entries on the CPU port, because it only +does so through switchdev, which is associated with a net_device, and +there are none of those for the CPU port. + +But actually FDB addresses on the CPU port have some use cases of their +own, if the switchdev operations are initiated from within the DSA +layer. There is just one problem with the existing code: it passes a +structure in dsa_switchdev_event_work which was retrieved directly from +switchdev, so it contains a net_device. We need to generalize the +contents to something that covers the CPU port as well: the "ds, port" +tuple is fine for that. + +Note that the new procedure for notifying the successful FDB offload is +inspired from the rocker model. + +Also, nothing was being done if added_by_user was false. Let's check for +that a lot earlier, and don't actually bother to schedule the worker +for nothing. + +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + net/dsa/dsa_priv.h | 12 +++++ + net/dsa/slave.c | 106 ++++++++++++++++++++++----------------------- + 2 files changed, 65 insertions(+), 53 deletions(-) + +--- a/net/dsa/dsa_priv.h ++++ b/net/dsa/dsa_priv.h +@@ -73,6 +73,18 @@ struct dsa_notifier_mtu_info { + int mtu; + }; + ++struct dsa_switchdev_event_work { ++ struct dsa_switch *ds; ++ int port; ++ struct work_struct work; ++ unsigned long event; ++ /* Specific for SWITCHDEV_FDB_ADD_TO_DEVICE and ++ * SWITCHDEV_FDB_DEL_TO_DEVICE ++ */ ++ unsigned char addr[ETH_ALEN]; ++ u16 vid; ++}; ++ + struct dsa_slave_priv { + /* Copy of CPU port xmit for faster access in slave transmit hot path */ + struct sk_buff * (*xmit)(struct sk_buff *skb, +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -2005,76 +2005,66 @@ static int dsa_slave_netdevice_event(str + return NOTIFY_DONE; + } + +-struct dsa_switchdev_event_work { +- struct work_struct work; +- struct switchdev_notifier_fdb_info fdb_info; +- struct net_device *dev; +- unsigned long event; +-}; ++static void ++dsa_fdb_offload_notify(struct dsa_switchdev_event_work *switchdev_work) ++{ ++ struct dsa_switch *ds = switchdev_work->ds; ++ struct switchdev_notifier_fdb_info info; ++ struct dsa_port *dp; ++ ++ if (!dsa_is_user_port(ds, switchdev_work->port)) ++ return; ++ ++ info.addr = switchdev_work->addr; ++ info.vid = switchdev_work->vid; ++ info.offloaded = true; ++ dp = dsa_to_port(ds, switchdev_work->port); ++ call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED, ++ dp->slave, &info.info, NULL); ++} + + static void dsa_slave_switchdev_event_work(struct work_struct *work) + { + struct dsa_switchdev_event_work *switchdev_work = + container_of(work, struct dsa_switchdev_event_work, work); +- struct net_device *dev = switchdev_work->dev; +- struct switchdev_notifier_fdb_info *fdb_info; +- struct dsa_port *dp = dsa_slave_to_port(dev); ++ struct dsa_switch *ds = switchdev_work->ds; ++ struct dsa_port *dp; + int err; + ++ dp = dsa_to_port(ds, switchdev_work->port); ++ + rtnl_lock(); + switch (switchdev_work->event) { + case SWITCHDEV_FDB_ADD_TO_DEVICE: +- fdb_info = &switchdev_work->fdb_info; +- if (!fdb_info->added_by_user) +- break; +- +- err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid); ++ err = dsa_port_fdb_add(dp, switchdev_work->addr, ++ switchdev_work->vid); + if (err) { +- netdev_err(dev, +- "failed to add %pM vid %d to fdb: %d\n", +- fdb_info->addr, fdb_info->vid, err); ++ dev_err(ds->dev, ++ "port %d failed to add %pM vid %d to fdb: %d\n", ++ dp->index, switchdev_work->addr, ++ switchdev_work->vid, err); + break; + } +- fdb_info->offloaded = true; +- call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED, dev, +- &fdb_info->info, NULL); ++ dsa_fdb_offload_notify(switchdev_work); + break; + + case SWITCHDEV_FDB_DEL_TO_DEVICE: +- fdb_info = &switchdev_work->fdb_info; +- if (!fdb_info->added_by_user) +- break; +- +- err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid); ++ err = dsa_port_fdb_del(dp, switchdev_work->addr, ++ switchdev_work->vid); + if (err) { +- netdev_err(dev, +- "failed to delete %pM vid %d from fdb: %d\n", +- fdb_info->addr, fdb_info->vid, err); ++ dev_err(ds->dev, ++ "port %d failed to delete %pM vid %d from fdb: %d\n", ++ dp->index, switchdev_work->addr, ++ switchdev_work->vid, err); + } + + break; + } + rtnl_unlock(); + +- kfree(switchdev_work->fdb_info.addr); + kfree(switchdev_work); +- dev_put(dev); +-} +- +-static int +-dsa_slave_switchdev_fdb_work_init(struct dsa_switchdev_event_work * +- switchdev_work, +- const struct switchdev_notifier_fdb_info * +- fdb_info) +-{ +- memcpy(&switchdev_work->fdb_info, fdb_info, +- sizeof(switchdev_work->fdb_info)); +- switchdev_work->fdb_info.addr = kzalloc(ETH_ALEN, GFP_ATOMIC); +- if (!switchdev_work->fdb_info.addr) +- return -ENOMEM; +- ether_addr_copy((u8 *)switchdev_work->fdb_info.addr, +- fdb_info->addr); +- return 0; ++ if (dsa_is_user_port(ds, dp->index)) ++ dev_put(dp->slave); + } + + /* Called under rcu_read_lock() */ +@@ -2082,7 +2072,9 @@ static int dsa_slave_switchdev_event(str + unsigned long event, void *ptr) + { + struct net_device *dev = switchdev_notifier_info_to_dev(ptr); ++ const struct switchdev_notifier_fdb_info *fdb_info; + struct dsa_switchdev_event_work *switchdev_work; ++ struct dsa_port *dp; + int err; + + if (event == SWITCHDEV_PORT_ATTR_SET) { +@@ -2095,20 +2087,32 @@ static int dsa_slave_switchdev_event(str + if (!dsa_slave_dev_check(dev)) + return NOTIFY_DONE; + ++ dp = dsa_slave_to_port(dev); ++ + switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + if (!switchdev_work) + return NOTIFY_BAD; + + INIT_WORK(&switchdev_work->work, + dsa_slave_switchdev_event_work); +- switchdev_work->dev = dev; ++ switchdev_work->ds = dp->ds; ++ switchdev_work->port = dp->index; + switchdev_work->event = event; + + switch (event) { + case SWITCHDEV_FDB_ADD_TO_DEVICE: + case SWITCHDEV_FDB_DEL_TO_DEVICE: +- if (dsa_slave_switchdev_fdb_work_init(switchdev_work, ptr)) +- goto err_fdb_work_init; ++ fdb_info = ptr; ++ ++ if (!fdb_info->added_by_user) { ++ kfree(switchdev_work); ++ return NOTIFY_OK; ++ } ++ ++ ether_addr_copy(switchdev_work->addr, ++ fdb_info->addr); ++ switchdev_work->vid = fdb_info->vid; ++ + dev_hold(dev); + break; + default: +@@ -2118,10 +2122,6 @@ static int dsa_slave_switchdev_event(str + + dsa_schedule_work(&switchdev_work->work); + return NOTIFY_OK; +- +-err_fdb_work_init: +- kfree(switchdev_work); +- return NOTIFY_BAD; + } + + static int dsa_slave_switchdev_blocking_event(struct notifier_block *unused, diff --git a/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch new file mode 100644 index 0000000000..49e095a587 --- /dev/null +++ b/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch @@ -0,0 +1,85 @@ +From 447d290a58bd335d68f665713842365d3d6447df Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:33 +0200 +Subject: [PATCH] net: dsa: move switchdev event implementation under the same + switch/case statement + +We'll need to start listening to SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE +events even for interfaces where dsa_slave_dev_check returns false, so +we need that check inside the switch-case statement for SWITCHDEV_FDB_*. + +This movement also avoids a useless allocation / free of switchdev_work +on the untreated "default event" case. + +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + net/dsa/slave.c | 35 ++++++++++++++++------------------- + 1 file changed, 16 insertions(+), 19 deletions(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -2077,31 +2077,29 @@ static int dsa_slave_switchdev_event(str + struct dsa_port *dp; + int err; + +- if (event == SWITCHDEV_PORT_ATTR_SET) { ++ switch (event) { ++ case SWITCHDEV_PORT_ATTR_SET: + err = switchdev_handle_port_attr_set(dev, ptr, + dsa_slave_dev_check, + dsa_slave_port_attr_set); + return notifier_from_errno(err); +- } +- +- if (!dsa_slave_dev_check(dev)) +- return NOTIFY_DONE; ++ case SWITCHDEV_FDB_ADD_TO_DEVICE: ++ case SWITCHDEV_FDB_DEL_TO_DEVICE: ++ if (!dsa_slave_dev_check(dev)) ++ return NOTIFY_DONE; + +- dp = dsa_slave_to_port(dev); ++ dp = dsa_slave_to_port(dev); + +- switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); +- if (!switchdev_work) +- return NOTIFY_BAD; +- +- INIT_WORK(&switchdev_work->work, +- dsa_slave_switchdev_event_work); +- switchdev_work->ds = dp->ds; +- switchdev_work->port = dp->index; +- switchdev_work->event = event; ++ switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); ++ if (!switchdev_work) ++ return NOTIFY_BAD; ++ ++ INIT_WORK(&switchdev_work->work, ++ dsa_slave_switchdev_event_work); ++ switchdev_work->ds = dp->ds; ++ switchdev_work->port = dp->index; ++ switchdev_work->event = event; + +- switch (event) { +- case SWITCHDEV_FDB_ADD_TO_DEVICE: +- case SWITCHDEV_FDB_DEL_TO_DEVICE: + fdb_info = ptr; + + if (!fdb_info->added_by_user) { +@@ -2114,13 +2112,12 @@ static int dsa_slave_switchdev_event(str + switchdev_work->vid = fdb_info->vid; + + dev_hold(dev); ++ dsa_schedule_work(&switchdev_work->work); + break; + default: +- kfree(switchdev_work); + return NOTIFY_DONE; + } + +- dsa_schedule_work(&switchdev_work->work); + return NOTIFY_OK; + } + diff --git a/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch new file mode 100644 index 0000000000..cbf2739469 --- /dev/null +++ b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch @@ -0,0 +1,42 @@ +From 5fb4a451a87d8ed3363d28b63a3295399373d6c4 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:34 +0200 +Subject: [PATCH] net: dsa: exit early in dsa_slave_switchdev_event if we can't + program the FDB + +Right now, the following would happen for a switch driver that does not +implement .port_fdb_add or .port_fdb_del. + +dsa_slave_switchdev_event returns NOTIFY_OK and schedules: +-> dsa_slave_switchdev_event_work + -> dsa_port_fdb_add + -> dsa_port_notify(DSA_NOTIFIER_FDB_ADD) + -> dsa_switch_fdb_add + -> if (!ds->ops->port_fdb_add) return -EOPNOTSUPP; + -> an error is printed with dev_dbg, and + dsa_fdb_offload_notify(switchdev_work) is not called. + +We can avoid scheduling the worker for nothing and say NOTIFY_DONE. +Because we don't call dsa_fdb_offload_notify, the static FDB entry will +remain just in the software bridge. + +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +--- + net/dsa/slave.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -2090,6 +2090,9 @@ static int dsa_slave_switchdev_event(str + + dp = dsa_slave_to_port(dev); + ++ if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del) ++ return NOTIFY_DONE; ++ + switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + if (!switchdev_work) + return NOTIFY_BAD; diff --git a/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch new file mode 100644 index 0000000000..978ece93b3 --- /dev/null +++ b/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch @@ -0,0 +1,264 @@ +From d5f19486cee79d04c054427577ac96ed123706db Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:35 +0200 +Subject: [PATCH] net: dsa: listen for SWITCHDEV_{FDB,DEL}_ADD_TO_DEVICE on + foreign bridge neighbors + +Some DSA switches (and not only) cannot learn source MAC addresses from +packets injected from the CPU. They only perform hardware address +learning from inbound traffic. + +This can be problematic when we have a bridge spanning some DSA switch +ports and some non-DSA ports (which we'll call "foreign interfaces" from +DSA's perspective). + +There are 2 classes of problems created by the lack of learning on +CPU-injected traffic: +- excessive flooding, due to the fact that DSA treats those addresses as + unknown +- the risk of stale routes, which can lead to temporary packet loss + +To illustrate the second class, consider the following situation, which +is common in production equipment (wireless access points, where there +is a WLAN interface and an Ethernet switch, and these form a single +bridging domain). + + AP 1: + +------------------------------------------------------------------------+ + | br0 | + +------------------------------------------------------------------------+ + +------------+ +------------+ +------------+ +------------+ +------------+ + | swp0 | | swp1 | | swp2 | | swp3 | | wlan0 | + +------------+ +------------+ +------------+ +------------+ +------------+ + | ^ ^ + | | | + | | | + | Client A Client B + | + | + | + +------------+ +------------+ +------------+ +------------+ +------------+ + | swp0 | | swp1 | | swp2 | | swp3 | | wlan0 | + +------------+ +------------+ +------------+ +------------+ +------------+ + +------------------------------------------------------------------------+ + | br0 | + +------------------------------------------------------------------------+ + AP 2 + +- br0 of AP 1 will know that Clients A and B are reachable via wlan0 +- the hardware fdb of a DSA switch driver today is not kept in sync with + the software entries on other bridge ports, so it will not know that + clients A and B are reachable via the CPU port UNLESS the hardware + switch itself performs SA learning from traffic injected from the CPU. + Nonetheless, a substantial number of switches don't. +- the hardware fdb of the DSA switch on AP 2 may autonomously learn that + Client A and B are reachable through swp0. Therefore, the software br0 + of AP 2 also may or may not learn this. In the example we're + illustrating, some Ethernet traffic has been going on, and br0 from AP + 2 has indeed learnt that it can reach Client B through swp0. + +One of the wireless clients, say Client B, disconnects from AP 1 and +roams to AP 2. The topology now looks like this: + + AP 1: + +------------------------------------------------------------------------+ + | br0 | + +------------------------------------------------------------------------+ + +------------+ +------------+ +------------+ +------------+ +------------+ + | swp0 | | swp1 | | swp2 | | swp3 | | wlan0 | + +------------+ +------------+ +------------+ +------------+ +------------+ + | ^ + | | + | Client A + | + | + | Client B + | | + | v + +------------+ +------------+ +------------+ +------------+ +------------+ + | swp0 | | swp1 | | swp2 | | swp3 | | wlan0 | + +------------+ +------------+ +------------+ +------------+ +------------+ + +------------------------------------------------------------------------+ + | br0 | + +------------------------------------------------------------------------+ + AP 2 + +- br0 of AP 1 still knows that Client A is reachable via wlan0 (no change) +- br0 of AP 1 will (possibly) know that Client B has left wlan0. There + are cases where it might never find out though. Either way, DSA today + does not process that notification in any way. +- the hardware FDB of the DSA switch on AP 1 may learn autonomously that + Client B can be reached via swp0, if it receives any packet with + Client 1's source MAC address over Ethernet. +- the hardware FDB of the DSA switch on AP 2 still thinks that Client B + can be reached via swp0. It does not know that it has roamed to wlan0, + because it doesn't perform SA learning from the CPU port. + +Now Client A contacts Client B. +AP 1 routes the packet fine towards swp0 and delivers it on the Ethernet +segment. +AP 2 sees a frame on swp0 and its fdb says that the destination is swp0. +Hairpinning is disabled => drop. + +This problem comes from the fact that these switches have a 'blind spot' +for addresses coming from software bridging. The generic solution is not +to assume that hardware learning can be enabled somehow, but to listen +to more bridge learning events. It turns out that the bridge driver does +learn in software from all inbound frames, in __br_handle_local_finish. +A proper SWITCHDEV_FDB_ADD_TO_DEVICE notification is emitted for the +addresses serviced by the bridge on 'foreign' interfaces. The software +bridge also does the right thing on migration, by notifying that the old +entry is deleted, so that does not need to be special-cased in DSA. When +it is deleted, we just need to delete our static FDB entry towards the +CPU too, and wait. + +The problem is that DSA currently only cares about SWITCHDEV_FDB_ADD_TO_DEVICE +events received on its own interfaces, such as static FDB entries. + +Luckily we can change that, and DSA can listen to all switchdev FDB +add/del events in the system and figure out if those events were emitted +by a bridge that spans at least one of DSA's own ports. In case that is +true, DSA will also offload that address towards its own CPU port, in +the eventuality that there might be bridge clients attached to the DSA +switch who want to talk to the station connected to the foreign +interface. + +In terms of implementation, we need to keep the fdb_info->added_by_user +check for the case where the switchdev event was targeted directly at a +DSA switch port. But we don't need to look at that flag for snooped +events. So the check is currently too late, we need to move it earlier. +This also simplifies the code a bit, since we avoid uselessly allocating +and freeing switchdev_work. + +We could probably do some improvements in the future. For example, +multi-bridge support is rudimentary at the moment. If there are two +bridges spanning a DSA switch's ports, and both of them need to service +the same MAC address, then what will happen is that the migration of one +of those stations will trigger the deletion of the FDB entry from the +CPU port while it is still used by other bridge. That could be improved +with reference counting but is left for another time. + +This behavior needs to be enabled at driver level by setting +ds->assisted_learning_on_cpu_port = true. This is because we don't want +to inflict a potential performance penalty (accesses through +MDIO/I2C/SPI are expensive) to hardware that really doesn't need it +because address learning on the CPU port works there. + +Reported-by: DENG Qingfang +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +--- + include/net/dsa.h | 5 +++++ + net/dsa/slave.c | 66 +++++++++++++++++++++++++++++++++++++++++++++---------- + 2 files changed, 60 insertions(+), 11 deletions(-) + +--- a/include/net/dsa.h ++++ b/include/net/dsa.h +@@ -317,6 +317,11 @@ struct dsa_switch { + */ + bool untag_bridge_pvid; + ++ /* Let DSA manage the FDB entries towards the CPU, based on the ++ * software bridge database. ++ */ ++ bool assisted_learning_on_cpu_port; ++ + /* In case vlan_filtering_is_global is set, the VLAN awareness state + * should be retrieved from here and not from the per-port settings. + */ +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -2067,6 +2067,28 @@ static void dsa_slave_switchdev_event_wo + dev_put(dp->slave); + } + ++static int dsa_lower_dev_walk(struct net_device *lower_dev, ++ struct netdev_nested_priv *priv) ++{ ++ if (dsa_slave_dev_check(lower_dev)) { ++ priv->data = (void *)netdev_priv(lower_dev); ++ return 1; ++ } ++ ++ return 0; ++} ++ ++static struct dsa_slave_priv *dsa_slave_dev_lower_find(struct net_device *dev) ++{ ++ struct netdev_nested_priv priv = { ++ .data = NULL, ++ }; ++ ++ netdev_walk_all_lower_dev_rcu(dev, dsa_lower_dev_walk, &priv); ++ ++ return (struct dsa_slave_priv *)priv.data; ++} ++ + /* Called under rcu_read_lock() */ + static int dsa_slave_switchdev_event(struct notifier_block *unused, + unsigned long event, void *ptr) +@@ -2085,10 +2107,37 @@ static int dsa_slave_switchdev_event(str + return notifier_from_errno(err); + case SWITCHDEV_FDB_ADD_TO_DEVICE: + case SWITCHDEV_FDB_DEL_TO_DEVICE: +- if (!dsa_slave_dev_check(dev)) +- return NOTIFY_DONE; ++ fdb_info = ptr; ++ ++ if (dsa_slave_dev_check(dev)) { ++ if (!fdb_info->added_by_user) ++ return NOTIFY_OK; ++ ++ dp = dsa_slave_to_port(dev); ++ } else { ++ /* Snoop addresses learnt on foreign interfaces ++ * bridged with us, for switches that don't ++ * automatically learn SA from CPU-injected traffic ++ */ ++ struct net_device *br_dev; ++ struct dsa_slave_priv *p; ++ ++ br_dev = netdev_master_upper_dev_get_rcu(dev); ++ if (!br_dev) ++ return NOTIFY_DONE; ++ ++ if (!netif_is_bridge_master(br_dev)) ++ return NOTIFY_DONE; ++ ++ p = dsa_slave_dev_lower_find(br_dev); ++ if (!p) ++ return NOTIFY_DONE; + +- dp = dsa_slave_to_port(dev); ++ dp = p->dp->cpu_dp; ++ ++ if (!dp->ds->assisted_learning_on_cpu_port) ++ return NOTIFY_DONE; ++ } + + if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del) + return NOTIFY_DONE; +@@ -2103,18 +2152,13 @@ static int dsa_slave_switchdev_event(str + switchdev_work->port = dp->index; + switchdev_work->event = event; + +- fdb_info = ptr; +- +- if (!fdb_info->added_by_user) { +- kfree(switchdev_work); +- return NOTIFY_OK; +- } +- + ether_addr_copy(switchdev_work->addr, + fdb_info->addr); + switchdev_work->vid = fdb_info->vid; + +- dev_hold(dev); ++ /* Hold a reference on the slave for dsa_fdb_offload_notify */ ++ if (dsa_is_user_port(dp->ds, dp->index)) ++ dev_hold(dev); + dsa_schedule_work(&switchdev_work->work); + break; + default: diff --git a/target/linux/generic/backport-5.4/770-v5.12-net-bridge-notify-switchdev-of-disappearance-of-old-.patch b/target/linux/generic/backport-5.4/770-v5.12-net-bridge-notify-switchdev-of-disappearance-of-old-.patch new file mode 100644 index 0000000000..df4e74cd96 --- /dev/null +++ b/target/linux/generic/backport-5.4/770-v5.12-net-bridge-notify-switchdev-of-disappearance-of-old-.patch @@ -0,0 +1,126 @@ +From 90dc8fd36078a536671adae884d0b929cce6480a Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:30 +0200 +Subject: [PATCH] net: bridge: notify switchdev of disappearance of old FDB + entry upon migration + +Currently the bridge emits atomic switchdev notifications for +dynamically learnt FDB entries. Monitoring these notifications works +wonders for switchdev drivers that want to keep their hardware FDB in +sync with the bridge's FDB. + +For example station A wants to talk to station B in the diagram below, +and we are concerned with the behavior of the bridge on the DUT device: + + DUT + +-------------------------------------+ + | br0 | + | +------+ +------+ +------+ +------+ | + | | | | | | | | | | + | | swp0 | | swp1 | | swp2 | | eth0 | | + +-------------------------------------+ + | | | + Station A | | + | | + +--+------+--+ +--+------+--+ + | | | | | | | | + | | swp0 | | | | swp0 | | + Another | +------+ | | +------+ | Another + switch | br0 | | br0 | switch + | +------+ | | +------+ | + | | | | | | | | + | | swp1 | | | | swp1 | | + +--+------+--+ +--+------+--+ + | + Station B + +Interfaces swp0, swp1, swp2 are handled by a switchdev driver that has +the following property: frames injected from its control interface bypass +the internal address analyzer logic, and therefore, this hardware does +not learn from the source address of packets transmitted by the network +stack through it. So, since bridging between eth0 (where Station B is +attached) and swp0 (where Station A is attached) is done in software, +the switchdev hardware will never learn the source address of Station B. +So the traffic towards that destination will be treated as unknown, i.e. +flooded. + +This is where the bridge notifications come in handy. When br0 on the +DUT sees frames with Station B's MAC address on eth0, the switchdev +driver gets these notifications and can install a rule to send frames +towards Station B's address that are incoming from swp0, swp1, swp2, +only towards the control interface. This is all switchdev driver private +business, which the notification makes possible. + +All is fine until someone unplugs Station B's cable and moves it to the +other switch: + + DUT + +-------------------------------------+ + | br0 | + | +------+ +------+ +------+ +------+ | + | | | | | | | | | | + | | swp0 | | swp1 | | swp2 | | eth0 | | + +-------------------------------------+ + | | | + Station A | | + | | + +--+------+--+ +--+------+--+ + | | | | | | | | + | | swp0 | | | | swp0 | | + Another | +------+ | | +------+ | Another + switch | br0 | | br0 | switch + | +------+ | | +------+ | + | | | | | | | | + | | swp1 | | | | swp1 | | + +--+------+--+ +--+------+--+ + | + Station B + +Luckily for the use cases we care about, Station B is noisy enough that +the DUT hears it (on swp1 this time). swp1 receives the frames and +delivers them to the bridge, who enters the unlikely path in br_fdb_update +of updating an existing entry. It moves the entry in the software bridge +to swp1 and emits an addition notification towards that. + +As far as the switchdev driver is concerned, all that it needs to ensure +is that traffic between Station A and Station B is not forever broken. +If it does nothing, then the stale rule to send frames for Station B +towards the control interface remains in place. But Station B is no +longer reachable via the control interface, but via a port that can +offload the bridge port learning attribute. It's just that the port is +prevented from learning this address, since the rule overrides FDB +updates. So the rule needs to go. The question is via what mechanism. + +It sure would be possible for this switchdev driver to keep track of all +addresses which are sent to the control interface, and then also listen +for bridge notifier events on its own ports, searching for the ones that +have a MAC address which was previously sent to the control interface. +But this is cumbersome and inefficient. Instead, with one small change, +the bridge could notify of the address deletion from the old port, in a +symmetrical manner with how it did for the insertion. Then the switchdev +driver would not be required to monitor learn/forget events for its own +ports. It could just delete the rule towards the control interface upon +bridge entry migration. This would make hardware address learning be +possible again. Then it would take a few more packets until the hardware +and software FDB would be in sync again. + +Signed-off-by: Vladimir Oltean +Acked-by: Nikolay Aleksandrov +Reviewed-by: Ido Schimmel +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + net/bridge/br_fdb.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/bridge/br_fdb.c ++++ b/net/bridge/br_fdb.c +@@ -581,6 +581,7 @@ void br_fdb_update(struct net_bridge *br + + /* fastpath: update of existing entry */ + if (unlikely(source != fdb->dst && !fdb->is_sticky)) { ++ br_switchdev_fdb_notify(fdb, RTM_DELNEIGH); + fdb->dst = source; + fdb_modified = true; + /* Take over HW learned entry */ diff --git a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch new file mode 100644 index 0000000000..967502f022 --- /dev/null +++ b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch @@ -0,0 +1,52 @@ +From 2fd186501b1cff155cc4a755c210793cfc0dffb5 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:31 +0200 +Subject: [PATCH] net: dsa: be louder when a non-legacy FDB operation fails + +The dev_close() call was added in commit c9eb3e0f8701 ("net: dsa: Add +support for learning FDB through notification") "to indicate inconsistent +situation" when we could not delete an FDB entry from the port. + +bridge fdb del d8:58:d7:00:ca:6d dev swp0 self master + +It is a bit drastic and at the same time not helpful if the above fails +to only print with netdev_dbg log level, but on the other hand to bring +the interface down. + +So increase the verbosity of the error message, and drop dev_close(). + +Signed-off-by: Vladimir Oltean +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + net/dsa/slave.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -1590,7 +1590,9 @@ static void dsa_slave_switchdev_event_wo + + err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid); + if (err) { +- netdev_dbg(dev, "fdb add failed err=%d\n", err); ++ netdev_err(dev, ++ "failed to add %pM vid %d to fdb: %d\n", ++ fdb_info->addr, fdb_info->vid, err); + break; + } + fdb_info->offloaded = true; +@@ -1605,9 +1607,11 @@ static void dsa_slave_switchdev_event_wo + + err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid); + if (err) { +- netdev_dbg(dev, "fdb del failed err=%d\n", err); +- dev_close(dev); ++ netdev_err(dev, ++ "failed to delete %pM vid %d from fdb: %d\n", ++ fdb_info->addr, fdb_info->vid, err); + } ++ + break; + } + rtnl_unlock(); diff --git a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch new file mode 100644 index 0000000000..ad7c242280 --- /dev/null +++ b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch @@ -0,0 +1,226 @@ +From c4bb76a9a0ef87c4cc1f636defed5f12deb9f5a7 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:32 +0200 +Subject: [PATCH] net: dsa: don't use switchdev_notifier_fdb_info in + dsa_switchdev_event_work + +Currently DSA doesn't add FDB entries on the CPU port, because it only +does so through switchdev, which is associated with a net_device, and +there are none of those for the CPU port. + +But actually FDB addresses on the CPU port have some use cases of their +own, if the switchdev operations are initiated from within the DSA +layer. There is just one problem with the existing code: it passes a +structure in dsa_switchdev_event_work which was retrieved directly from +switchdev, so it contains a net_device. We need to generalize the +contents to something that covers the CPU port as well: the "ds, port" +tuple is fine for that. + +Note that the new procedure for notifying the successful FDB offload is +inspired from the rocker model. + +Also, nothing was being done if added_by_user was false. Let's check for +that a lot earlier, and don't actually bother to schedule the worker +for nothing. + +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + net/dsa/dsa_priv.h | 12 +++++ + net/dsa/slave.c | 106 ++++++++++++++++++++++----------------------- + 2 files changed, 65 insertions(+), 53 deletions(-) + +--- a/net/dsa/dsa_priv.h ++++ b/net/dsa/dsa_priv.h +@@ -62,6 +62,18 @@ struct dsa_notifier_vlan_info { + int port; + }; + ++struct dsa_switchdev_event_work { ++ struct dsa_switch *ds; ++ int port; ++ struct work_struct work; ++ unsigned long event; ++ /* Specific for SWITCHDEV_FDB_ADD_TO_DEVICE and ++ * SWITCHDEV_FDB_DEL_TO_DEVICE ++ */ ++ unsigned char addr[ETH_ALEN]; ++ u16 vid; ++}; ++ + struct dsa_slave_priv { + /* Copy of CPU port xmit for faster access in slave transmit hot path */ + struct sk_buff * (*xmit)(struct sk_buff *skb, +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -1565,76 +1565,66 @@ static int dsa_slave_netdevice_event(str + return NOTIFY_DONE; + } + +-struct dsa_switchdev_event_work { +- struct work_struct work; +- struct switchdev_notifier_fdb_info fdb_info; +- struct net_device *dev; +- unsigned long event; +-}; ++static void ++dsa_fdb_offload_notify(struct dsa_switchdev_event_work *switchdev_work) ++{ ++ struct dsa_switch *ds = switchdev_work->ds; ++ struct switchdev_notifier_fdb_info info; ++ struct dsa_port *dp; ++ ++ if (!dsa_is_user_port(ds, switchdev_work->port)) ++ return; ++ ++ info.addr = switchdev_work->addr; ++ info.vid = switchdev_work->vid; ++ info.offloaded = true; ++ dp = dsa_to_port(ds, switchdev_work->port); ++ call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED, ++ dp->slave, &info.info, NULL); ++} + + static void dsa_slave_switchdev_event_work(struct work_struct *work) + { + struct dsa_switchdev_event_work *switchdev_work = + container_of(work, struct dsa_switchdev_event_work, work); +- struct net_device *dev = switchdev_work->dev; +- struct switchdev_notifier_fdb_info *fdb_info; +- struct dsa_port *dp = dsa_slave_to_port(dev); ++ struct dsa_switch *ds = switchdev_work->ds; ++ struct dsa_port *dp; + int err; + ++ dp = dsa_to_port(ds, switchdev_work->port); ++ + rtnl_lock(); + switch (switchdev_work->event) { + case SWITCHDEV_FDB_ADD_TO_DEVICE: +- fdb_info = &switchdev_work->fdb_info; +- if (!fdb_info->added_by_user) +- break; +- +- err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid); ++ err = dsa_port_fdb_add(dp, switchdev_work->addr, ++ switchdev_work->vid); + if (err) { +- netdev_err(dev, +- "failed to add %pM vid %d to fdb: %d\n", +- fdb_info->addr, fdb_info->vid, err); ++ dev_err(ds->dev, ++ "port %d failed to add %pM vid %d to fdb: %d\n", ++ dp->index, switchdev_work->addr, ++ switchdev_work->vid, err); + break; + } +- fdb_info->offloaded = true; +- call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED, dev, +- &fdb_info->info, NULL); ++ dsa_fdb_offload_notify(switchdev_work); + break; + + case SWITCHDEV_FDB_DEL_TO_DEVICE: +- fdb_info = &switchdev_work->fdb_info; +- if (!fdb_info->added_by_user) +- break; +- +- err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid); ++ err = dsa_port_fdb_del(dp, switchdev_work->addr, ++ switchdev_work->vid); + if (err) { +- netdev_err(dev, +- "failed to delete %pM vid %d from fdb: %d\n", +- fdb_info->addr, fdb_info->vid, err); ++ dev_err(ds->dev, ++ "port %d failed to delete %pM vid %d from fdb: %d\n", ++ dp->index, switchdev_work->addr, ++ switchdev_work->vid, err); + } + + break; + } + rtnl_unlock(); + +- kfree(switchdev_work->fdb_info.addr); + kfree(switchdev_work); +- dev_put(dev); +-} +- +-static int +-dsa_slave_switchdev_fdb_work_init(struct dsa_switchdev_event_work * +- switchdev_work, +- const struct switchdev_notifier_fdb_info * +- fdb_info) +-{ +- memcpy(&switchdev_work->fdb_info, fdb_info, +- sizeof(switchdev_work->fdb_info)); +- switchdev_work->fdb_info.addr = kzalloc(ETH_ALEN, GFP_ATOMIC); +- if (!switchdev_work->fdb_info.addr) +- return -ENOMEM; +- ether_addr_copy((u8 *)switchdev_work->fdb_info.addr, +- fdb_info->addr); +- return 0; ++ if (dsa_is_user_port(ds, dp->index)) ++ dev_put(dp->slave); + } + + /* Called under rcu_read_lock() */ +@@ -1642,7 +1632,9 @@ static int dsa_slave_switchdev_event(str + unsigned long event, void *ptr) + { + struct net_device *dev = switchdev_notifier_info_to_dev(ptr); ++ const struct switchdev_notifier_fdb_info *fdb_info; + struct dsa_switchdev_event_work *switchdev_work; ++ struct dsa_port *dp; + int err; + + if (event == SWITCHDEV_PORT_ATTR_SET) { +@@ -1655,20 +1647,32 @@ static int dsa_slave_switchdev_event(str + if (!dsa_slave_dev_check(dev)) + return NOTIFY_DONE; + ++ dp = dsa_slave_to_port(dev); ++ + switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + if (!switchdev_work) + return NOTIFY_BAD; + + INIT_WORK(&switchdev_work->work, + dsa_slave_switchdev_event_work); +- switchdev_work->dev = dev; ++ switchdev_work->ds = dp->ds; ++ switchdev_work->port = dp->index; + switchdev_work->event = event; + + switch (event) { + case SWITCHDEV_FDB_ADD_TO_DEVICE: /* fall through */ + case SWITCHDEV_FDB_DEL_TO_DEVICE: +- if (dsa_slave_switchdev_fdb_work_init(switchdev_work, ptr)) +- goto err_fdb_work_init; ++ fdb_info = ptr; ++ ++ if (!fdb_info->added_by_user) { ++ kfree(switchdev_work); ++ return NOTIFY_OK; ++ } ++ ++ ether_addr_copy(switchdev_work->addr, ++ fdb_info->addr); ++ switchdev_work->vid = fdb_info->vid; ++ + dev_hold(dev); + break; + default: +@@ -1678,10 +1682,6 @@ static int dsa_slave_switchdev_event(str + + dsa_schedule_work(&switchdev_work->work); + return NOTIFY_OK; +- +-err_fdb_work_init: +- kfree(switchdev_work); +- return NOTIFY_BAD; + } + + static int dsa_slave_switchdev_blocking_event(struct notifier_block *unused, diff --git a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch new file mode 100644 index 0000000000..619c71c7bb --- /dev/null +++ b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch @@ -0,0 +1,85 @@ +From 447d290a58bd335d68f665713842365d3d6447df Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:33 +0200 +Subject: [PATCH] net: dsa: move switchdev event implementation under the same + switch/case statement + +We'll need to start listening to SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE +events even for interfaces where dsa_slave_dev_check returns false, so +we need that check inside the switch-case statement for SWITCHDEV_FDB_*. + +This movement also avoids a useless allocation / free of switchdev_work +on the untreated "default event" case. + +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + net/dsa/slave.c | 35 ++++++++++++++++------------------- + 1 file changed, 16 insertions(+), 19 deletions(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -1637,31 +1637,29 @@ static int dsa_slave_switchdev_event(str + struct dsa_port *dp; + int err; + +- if (event == SWITCHDEV_PORT_ATTR_SET) { ++ switch (event) { ++ case SWITCHDEV_PORT_ATTR_SET: + err = switchdev_handle_port_attr_set(dev, ptr, + dsa_slave_dev_check, + dsa_slave_port_attr_set); + return notifier_from_errno(err); +- } +- +- if (!dsa_slave_dev_check(dev)) +- return NOTIFY_DONE; ++ case SWITCHDEV_FDB_ADD_TO_DEVICE: ++ case SWITCHDEV_FDB_DEL_TO_DEVICE: ++ if (!dsa_slave_dev_check(dev)) ++ return NOTIFY_DONE; + +- dp = dsa_slave_to_port(dev); ++ dp = dsa_slave_to_port(dev); + +- switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); +- if (!switchdev_work) +- return NOTIFY_BAD; +- +- INIT_WORK(&switchdev_work->work, +- dsa_slave_switchdev_event_work); +- switchdev_work->ds = dp->ds; +- switchdev_work->port = dp->index; +- switchdev_work->event = event; ++ switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); ++ if (!switchdev_work) ++ return NOTIFY_BAD; ++ ++ INIT_WORK(&switchdev_work->work, ++ dsa_slave_switchdev_event_work); ++ switchdev_work->ds = dp->ds; ++ switchdev_work->port = dp->index; ++ switchdev_work->event = event; + +- switch (event) { +- case SWITCHDEV_FDB_ADD_TO_DEVICE: /* fall through */ +- case SWITCHDEV_FDB_DEL_TO_DEVICE: + fdb_info = ptr; + + if (!fdb_info->added_by_user) { +@@ -1674,13 +1672,12 @@ static int dsa_slave_switchdev_event(str + switchdev_work->vid = fdb_info->vid; + + dev_hold(dev); ++ dsa_schedule_work(&switchdev_work->work); + break; + default: +- kfree(switchdev_work); + return NOTIFY_DONE; + } + +- dsa_schedule_work(&switchdev_work->work); + return NOTIFY_OK; + } + diff --git a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch new file mode 100644 index 0000000000..25e0d30e1a --- /dev/null +++ b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch @@ -0,0 +1,42 @@ +From 5fb4a451a87d8ed3363d28b63a3295399373d6c4 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:34 +0200 +Subject: [PATCH] net: dsa: exit early in dsa_slave_switchdev_event if we can't + program the FDB + +Right now, the following would happen for a switch driver that does not +implement .port_fdb_add or .port_fdb_del. + +dsa_slave_switchdev_event returns NOTIFY_OK and schedules: +-> dsa_slave_switchdev_event_work + -> dsa_port_fdb_add + -> dsa_port_notify(DSA_NOTIFIER_FDB_ADD) + -> dsa_switch_fdb_add + -> if (!ds->ops->port_fdb_add) return -EOPNOTSUPP; + -> an error is printed with dev_dbg, and + dsa_fdb_offload_notify(switchdev_work) is not called. + +We can avoid scheduling the worker for nothing and say NOTIFY_DONE. +Because we don't call dsa_fdb_offload_notify, the static FDB entry will +remain just in the software bridge. + +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +--- + net/dsa/slave.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -1650,6 +1650,9 @@ static int dsa_slave_switchdev_event(str + + dp = dsa_slave_to_port(dev); + ++ if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del) ++ return NOTIFY_DONE; ++ + switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + if (!switchdev_work) + return NOTIFY_BAD; diff --git a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch new file mode 100644 index 0000000000..ecc74ea050 --- /dev/null +++ b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch @@ -0,0 +1,263 @@ +From d5f19486cee79d04c054427577ac96ed123706db Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 6 Jan 2021 11:51:35 +0200 +Subject: [PATCH] net: dsa: listen for SWITCHDEV_{FDB,DEL}_ADD_TO_DEVICE on + foreign bridge neighbors + +Some DSA switches (and not only) cannot learn source MAC addresses from +packets injected from the CPU. They only perform hardware address +learning from inbound traffic. + +This can be problematic when we have a bridge spanning some DSA switch +ports and some non-DSA ports (which we'll call "foreign interfaces" from +DSA's perspective). + +There are 2 classes of problems created by the lack of learning on +CPU-injected traffic: +- excessive flooding, due to the fact that DSA treats those addresses as + unknown +- the risk of stale routes, which can lead to temporary packet loss + +To illustrate the second class, consider the following situation, which +is common in production equipment (wireless access points, where there +is a WLAN interface and an Ethernet switch, and these form a single +bridging domain). + + AP 1: + +------------------------------------------------------------------------+ + | br0 | + +------------------------------------------------------------------------+ + +------------+ +------------+ +------------+ +------------+ +------------+ + | swp0 | | swp1 | | swp2 | | swp3 | | wlan0 | + +------------+ +------------+ +------------+ +------------+ +------------+ + | ^ ^ + | | | + | | | + | Client A Client B + | + | + | + +------------+ +------------+ +------------+ +------------+ +------------+ + | swp0 | | swp1 | | swp2 | | swp3 | | wlan0 | + +------------+ +------------+ +------------+ +------------+ +------------+ + +------------------------------------------------------------------------+ + | br0 | + +------------------------------------------------------------------------+ + AP 2 + +- br0 of AP 1 will know that Clients A and B are reachable via wlan0 +- the hardware fdb of a DSA switch driver today is not kept in sync with + the software entries on other bridge ports, so it will not know that + clients A and B are reachable via the CPU port UNLESS the hardware + switch itself performs SA learning from traffic injected from the CPU. + Nonetheless, a substantial number of switches don't. +- the hardware fdb of the DSA switch on AP 2 may autonomously learn that + Client A and B are reachable through swp0. Therefore, the software br0 + of AP 2 also may or may not learn this. In the example we're + illustrating, some Ethernet traffic has been going on, and br0 from AP + 2 has indeed learnt that it can reach Client B through swp0. + +One of the wireless clients, say Client B, disconnects from AP 1 and +roams to AP 2. The topology now looks like this: + + AP 1: + +------------------------------------------------------------------------+ + | br0 | + +------------------------------------------------------------------------+ + +------------+ +------------+ +------------+ +------------+ +------------+ + | swp0 | | swp1 | | swp2 | | swp3 | | wlan0 | + +------------+ +------------+ +------------+ +------------+ +------------+ + | ^ + | | + | Client A + | + | + | Client B + | | + | v + +------------+ +------------+ +------------+ +------------+ +------------+ + | swp0 | | swp1 | | swp2 | | swp3 | | wlan0 | + +------------+ +------------+ +------------+ +------------+ +------------+ + +------------------------------------------------------------------------+ + | br0 | + +------------------------------------------------------------------------+ + AP 2 + +- br0 of AP 1 still knows that Client A is reachable via wlan0 (no change) +- br0 of AP 1 will (possibly) know that Client B has left wlan0. There + are cases where it might never find out though. Either way, DSA today + does not process that notification in any way. +- the hardware FDB of the DSA switch on AP 1 may learn autonomously that + Client B can be reached via swp0, if it receives any packet with + Client 1's source MAC address over Ethernet. +- the hardware FDB of the DSA switch on AP 2 still thinks that Client B + can be reached via swp0. It does not know that it has roamed to wlan0, + because it doesn't perform SA learning from the CPU port. + +Now Client A contacts Client B. +AP 1 routes the packet fine towards swp0 and delivers it on the Ethernet +segment. +AP 2 sees a frame on swp0 and its fdb says that the destination is swp0. +Hairpinning is disabled => drop. + +This problem comes from the fact that these switches have a 'blind spot' +for addresses coming from software bridging. The generic solution is not +to assume that hardware learning can be enabled somehow, but to listen +to more bridge learning events. It turns out that the bridge driver does +learn in software from all inbound frames, in __br_handle_local_finish. +A proper SWITCHDEV_FDB_ADD_TO_DEVICE notification is emitted for the +addresses serviced by the bridge on 'foreign' interfaces. The software +bridge also does the right thing on migration, by notifying that the old +entry is deleted, so that does not need to be special-cased in DSA. When +it is deleted, we just need to delete our static FDB entry towards the +CPU too, and wait. + +The problem is that DSA currently only cares about SWITCHDEV_FDB_ADD_TO_DEVICE +events received on its own interfaces, such as static FDB entries. + +Luckily we can change that, and DSA can listen to all switchdev FDB +add/del events in the system and figure out if those events were emitted +by a bridge that spans at least one of DSA's own ports. In case that is +true, DSA will also offload that address towards its own CPU port, in +the eventuality that there might be bridge clients attached to the DSA +switch who want to talk to the station connected to the foreign +interface. + +In terms of implementation, we need to keep the fdb_info->added_by_user +check for the case where the switchdev event was targeted directly at a +DSA switch port. But we don't need to look at that flag for snooped +events. So the check is currently too late, we need to move it earlier. +This also simplifies the code a bit, since we avoid uselessly allocating +and freeing switchdev_work. + +We could probably do some improvements in the future. For example, +multi-bridge support is rudimentary at the moment. If there are two +bridges spanning a DSA switch's ports, and both of them need to service +the same MAC address, then what will happen is that the migration of one +of those stations will trigger the deletion of the FDB entry from the +CPU port while it is still used by other bridge. That could be improved +with reference counting but is left for another time. + +This behavior needs to be enabled at driver level by setting +ds->assisted_learning_on_cpu_port = true. This is because we don't want +to inflict a potential performance penalty (accesses through +MDIO/I2C/SPI are expensive) to hardware that really doesn't need it +because address learning on the CPU port works there. + +Reported-by: DENG Qingfang +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +[Backported to linux-5.4.y] +Signed-off-by: DENG Qingfang +--- + include/net/dsa.h | 5 ++++ + net/dsa/slave.c | 63 ++++++++++++++++++++++++++++++++++++++--------- + 2 files changed, 57 insertions(+), 11 deletions(-) + +--- a/include/net/dsa.h ++++ b/include/net/dsa.h +@@ -279,6 +279,11 @@ struct dsa_switch { + */ + bool configure_vlan_while_not_filtering; + ++ /* Let DSA manage the FDB entries towards the CPU, based on the ++ * software bridge database. ++ */ ++ bool assisted_learning_on_cpu_port; ++ + /* In case vlan_filtering_is_global is set, the VLAN awareness state + * should be retrieved from here and not from the per-port settings. + */ +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -1627,6 +1627,25 @@ static void dsa_slave_switchdev_event_wo + dev_put(dp->slave); + } + ++static int dsa_lower_dev_walk(struct net_device *lower_dev, void *data) ++{ ++ if (dsa_slave_dev_check(lower_dev)) { ++ *((void **)data) = (void *)netdev_priv(lower_dev); ++ return 1; ++ } ++ ++ return 0; ++} ++ ++static struct dsa_slave_priv *dsa_slave_dev_lower_find(struct net_device *dev) ++{ ++ struct dsa_slave_priv *data = NULL; ++ ++ netdev_walk_all_lower_dev_rcu(dev, dsa_lower_dev_walk, (void **) &data); ++ ++ return data; ++} ++ + /* Called under rcu_read_lock() */ + static int dsa_slave_switchdev_event(struct notifier_block *unused, + unsigned long event, void *ptr) +@@ -1645,10 +1664,37 @@ static int dsa_slave_switchdev_event(str + return notifier_from_errno(err); + case SWITCHDEV_FDB_ADD_TO_DEVICE: + case SWITCHDEV_FDB_DEL_TO_DEVICE: +- if (!dsa_slave_dev_check(dev)) +- return NOTIFY_DONE; ++ fdb_info = ptr; ++ ++ if (dsa_slave_dev_check(dev)) { ++ if (!fdb_info->added_by_user) ++ return NOTIFY_OK; ++ ++ dp = dsa_slave_to_port(dev); ++ } else { ++ /* Snoop addresses learnt on foreign interfaces ++ * bridged with us, for switches that don't ++ * automatically learn SA from CPU-injected traffic ++ */ ++ struct net_device *br_dev; ++ struct dsa_slave_priv *p; ++ ++ br_dev = netdev_master_upper_dev_get_rcu(dev); ++ if (!br_dev) ++ return NOTIFY_DONE; ++ ++ if (!netif_is_bridge_master(br_dev)) ++ return NOTIFY_DONE; ++ ++ p = dsa_slave_dev_lower_find(br_dev); ++ if (!p) ++ return NOTIFY_DONE; + +- dp = dsa_slave_to_port(dev); ++ dp = p->dp->cpu_dp; ++ ++ if (!dp->ds->assisted_learning_on_cpu_port) ++ return NOTIFY_DONE; ++ } + + if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del) + return NOTIFY_DONE; +@@ -1663,18 +1709,13 @@ static int dsa_slave_switchdev_event(str + switchdev_work->port = dp->index; + switchdev_work->event = event; + +- fdb_info = ptr; +- +- if (!fdb_info->added_by_user) { +- kfree(switchdev_work); +- return NOTIFY_OK; +- } +- + ether_addr_copy(switchdev_work->addr, + fdb_info->addr); + switchdev_work->vid = fdb_info->vid; + +- dev_hold(dev); ++ /* Hold a reference on the slave for dsa_fdb_offload_notify */ ++ if (dsa_is_user_port(dp->ds, dp->index)) ++ dev_hold(dev); + dsa_schedule_work(&switchdev_work->work); + break; + default: diff --git a/target/linux/generic/hack-5.10/710-net-dsa-mv88e6xxx-default-VID-1.patch b/target/linux/generic/hack-5.10/710-net-dsa-mv88e6xxx-default-VID-1.patch new file mode 100644 index 0000000000..f301cc1e2d --- /dev/null +++ b/target/linux/generic/hack-5.10/710-net-dsa-mv88e6xxx-default-VID-1.patch @@ -0,0 +1,18 @@ +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -2088,6 +2088,7 @@ static int mv88e6xxx_port_fdb_add(struct + struct mv88e6xxx_chip *chip = ds->priv; + int err; + ++ vid = vid ? : 1; + mv88e6xxx_reg_lock(chip); + err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid, + MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC); +@@ -2102,6 +2103,7 @@ static int mv88e6xxx_port_fdb_del(struct + struct mv88e6xxx_chip *chip = ds->priv; + int err; + ++ vid = vid ? : 1; + mv88e6xxx_reg_lock(chip); + err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid, 0); + mv88e6xxx_reg_unlock(chip); diff --git a/target/linux/generic/hack-5.10/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-5.10/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch new file mode 100644 index 0000000000..46a1ba1d96 --- /dev/null +++ b/target/linux/generic/hack-5.10/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -0,0 +1,12 @@ +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -2650,6 +2650,9 @@ static int mv88e6xxx_setup_port(struct m + if (dsa_is_cpu_port(ds, port)) + reg = 0; + ++ /* Disable ATU member violation interrupt */ ++ reg |= MV88E6XXX_PORT_ASSOC_VECTOR_IGNORE_WRONG; ++ + err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_ASSOC_VECTOR, + reg); + if (err) diff --git a/target/linux/generic/hack-5.4/710-net-dsa-mv88e6xxx-default-VID-1.patch b/target/linux/generic/hack-5.4/710-net-dsa-mv88e6xxx-default-VID-1.patch new file mode 100644 index 0000000000..5dc5ac6825 --- /dev/null +++ b/target/linux/generic/hack-5.4/710-net-dsa-mv88e6xxx-default-VID-1.patch @@ -0,0 +1,18 @@ +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -1930,6 +1930,7 @@ static int mv88e6xxx_port_fdb_add(struct + struct mv88e6xxx_chip *chip = ds->priv; + int err; + ++ vid = vid ? : 1; + mv88e6xxx_reg_lock(chip); + err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid, + MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC); +@@ -1944,6 +1945,7 @@ static int mv88e6xxx_port_fdb_del(struct + struct mv88e6xxx_chip *chip = ds->priv; + int err; + ++ vid = vid ? : 1; + mv88e6xxx_reg_lock(chip); + err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid, 0); + mv88e6xxx_reg_unlock(chip); diff --git a/target/linux/generic/hack-5.4/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-5.4/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch new file mode 100644 index 0000000000..1da388c862 --- /dev/null +++ b/target/linux/generic/hack-5.4/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -0,0 +1,12 @@ +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -2492,6 +2492,9 @@ static int mv88e6xxx_setup_port(struct m + if (dsa_is_cpu_port(ds, port)) + reg = 0; + ++ /* Disable ATU member violation interrupt */ ++ reg |= MV88E6XXX_PORT_ASSOC_VECTOR_IGNORE_WRONG; ++ + err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_ASSOC_VECTOR, + reg); + if (err) diff --git a/target/linux/generic/pending-5.10/762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch b/target/linux/generic/pending-5.10/762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch new file mode 100644 index 0000000000..081d002c7e --- /dev/null +++ b/target/linux/generic/pending-5.10/762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch @@ -0,0 +1,75 @@ +From 46fe6cecb296d850c1ee2b333e57093ac4b733f3 Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:09 +0100 +Subject: [PATCH] net: bridge: switchdev: Refactor br_switchdev_fdb_notify + +Instead of having to add more and more arguments to +br_switchdev_fdb_call_notifiers, get rid of it and build the info +struct directly in br_switchdev_fdb_notify. + +Signed-off-by: Tobias Waldekranz +Reviewed-by: Vladimir Oltean +--- + net/bridge/br_switchdev.c | 41 +++++++++++---------------------------- + 1 file changed, 11 insertions(+), 30 deletions(-) + +--- a/net/bridge/br_switchdev.c ++++ b/net/bridge/br_switchdev.c +@@ -102,46 +102,27 @@ int br_switchdev_set_port_flag(struct ne + return 0; + } + +-static void +-br_switchdev_fdb_call_notifiers(bool adding, const unsigned char *mac, +- u16 vid, struct net_device *dev, +- bool added_by_user, bool offloaded) +-{ +- struct switchdev_notifier_fdb_info info; +- unsigned long notifier_type; +- +- info.addr = mac; +- info.vid = vid; +- info.added_by_user = added_by_user; +- info.offloaded = offloaded; +- notifier_type = adding ? SWITCHDEV_FDB_ADD_TO_DEVICE : SWITCHDEV_FDB_DEL_TO_DEVICE; +- call_switchdev_notifiers(notifier_type, dev, &info.info, NULL); +-} +- + void + br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type) + { ++ struct switchdev_notifier_fdb_info info = { ++ .addr = fdb->key.addr.addr, ++ .vid = fdb->key.vlan_id, ++ .added_by_user = test_bit(BR_FDB_ADDED_BY_USER, &fdb->flags), ++ .offloaded = test_bit(BR_FDB_OFFLOADED, &fdb->flags), ++ }; ++ + if (!fdb->dst) + return; + + switch (type) { + case RTM_DELNEIGH: +- br_switchdev_fdb_call_notifiers(false, fdb->key.addr.addr, +- fdb->key.vlan_id, +- fdb->dst->dev, +- test_bit(BR_FDB_ADDED_BY_USER, +- &fdb->flags), +- test_bit(BR_FDB_OFFLOADED, +- &fdb->flags)); ++ call_switchdev_notifiers(SWITCHDEV_FDB_DEL_TO_DEVICE, ++ fdb->dst->dev, &info.info, NULL); + break; + case RTM_NEWNEIGH: +- br_switchdev_fdb_call_notifiers(true, fdb->key.addr.addr, +- fdb->key.vlan_id, +- fdb->dst->dev, +- test_bit(BR_FDB_ADDED_BY_USER, +- &fdb->flags), +- test_bit(BR_FDB_OFFLOADED, +- &fdb->flags)); ++ call_switchdev_notifiers(SWITCHDEV_FDB_ADD_TO_DEVICE, ++ fdb->dst->dev, &info.info, NULL); + break; + } + } diff --git a/target/linux/generic/pending-5.10/763-net-bridge-switchdev-Include-local-flag-in-FDB-notif.patch b/target/linux/generic/pending-5.10/763-net-bridge-switchdev-Include-local-flag-in-FDB-notif.patch new file mode 100644 index 0000000000..41374c88df --- /dev/null +++ b/target/linux/generic/pending-5.10/763-net-bridge-switchdev-Include-local-flag-in-FDB-notif.patch @@ -0,0 +1,42 @@ +From ec5be4f79026282925ae383caa431a8d41e3456a Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:10 +0100 +Subject: [PATCH] net: bridge: switchdev: Include local flag in FDB + notifications + +Some switchdev drivers, notably DSA, ignore all dynamically learned +address notifications (!added_by_user) as these are autonomously added +by the switch. Previously, such a notification was indistinguishable +from a local address notification. Include a local bit in the +notification so that the two classes can be discriminated. + +This allows DSA-like devices to add local addresses to the hardware +FDB (with the CPU as the destination), thereby avoiding flows towards +the CPU being flooded by the switch as unknown unicast. + +Signed-off-by: Tobias Waldekranz +--- + include/net/switchdev.h | 1 + + net/bridge/br_switchdev.c | 1 + + 2 files changed, 2 insertions(+) + +--- a/include/net/switchdev.h ++++ b/include/net/switchdev.h +@@ -224,6 +224,7 @@ struct switchdev_notifier_fdb_info { + const unsigned char *addr; + u16 vid; + u8 added_by_user:1, ++ local:1, + offloaded:1; + }; + +--- a/net/bridge/br_switchdev.c ++++ b/net/bridge/br_switchdev.c +@@ -109,6 +109,7 @@ br_switchdev_fdb_notify(const struct net + .addr = fdb->key.addr.addr, + .vid = fdb->key.vlan_id, + .added_by_user = test_bit(BR_FDB_ADDED_BY_USER, &fdb->flags), ++ .local = test_bit(BR_FDB_LOCAL, &fdb->flags), + .offloaded = test_bit(BR_FDB_OFFLOADED, &fdb->flags), + }; + diff --git a/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch b/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch new file mode 100644 index 0000000000..2317989fa5 --- /dev/null +++ b/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch @@ -0,0 +1,94 @@ +From 2e50fd9322047253c327550b4485cf8761035a8c Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:11 +0100 +Subject: [PATCH] net: bridge: switchdev: Send FDB notifications for host + addresses + +Treat addresses added to the bridge itself in the same way as regular +ports and send out a notification so that drivers may sync it down to +the hardware FDB. + +Signed-off-by: Tobias Waldekranz +--- + net/bridge/br_fdb.c | 4 ++-- + net/bridge/br_private.h | 7 ++++--- + net/bridge/br_switchdev.c | 11 +++++------ + 3 files changed, 11 insertions(+), 11 deletions(-) + +--- a/net/bridge/br_fdb.c ++++ b/net/bridge/br_fdb.c +@@ -602,7 +602,7 @@ void br_fdb_update(struct net_bridge *br + /* fastpath: update of existing entry */ + if (unlikely(source != fdb->dst && + !test_bit(BR_FDB_STICKY, &fdb->flags))) { +- br_switchdev_fdb_notify(fdb, RTM_DELNEIGH); ++ br_switchdev_fdb_notify(br, fdb, RTM_DELNEIGH); + fdb->dst = source; + fdb_modified = true; + /* Take over HW learned entry */ +@@ -735,7 +735,7 @@ static void fdb_notify(struct net_bridge + int err = -ENOBUFS; + + if (swdev_notify) +- br_switchdev_fdb_notify(fdb, type); ++ br_switchdev_fdb_notify(br, fdb, type); + + skb = nlmsg_new(fdb_nlmsg_size(), GFP_ATOMIC); + if (skb == NULL) +--- a/net/bridge/br_private.h ++++ b/net/bridge/br_private.h +@@ -1527,8 +1527,8 @@ bool nbp_switchdev_allowed_egress(const + int br_switchdev_set_port_flag(struct net_bridge_port *p, + unsigned long flags, + unsigned long mask); +-void br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, +- int type); ++void br_switchdev_fdb_notify(struct net_bridge *br, ++ const struct net_bridge_fdb_entry *fdb, int type); + int br_switchdev_port_vlan_add(struct net_device *dev, u16 vid, u16 flags, + struct netlink_ext_ack *extack); + int br_switchdev_port_vlan_del(struct net_device *dev, u16 vid); +@@ -1574,7 +1574,8 @@ static inline int br_switchdev_port_vlan + } + + static inline void +-br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type) ++br_switchdev_fdb_notify(struct net_bridge *br, ++ const struct net_bridge_fdb_entry *fdb, int type) + { + } + +--- a/net/bridge/br_switchdev.c ++++ b/net/bridge/br_switchdev.c +@@ -103,7 +103,8 @@ int br_switchdev_set_port_flag(struct ne + } + + void +-br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type) ++br_switchdev_fdb_notify(struct net_bridge *br, ++ const struct net_bridge_fdb_entry *fdb, int type) + { + struct switchdev_notifier_fdb_info info = { + .addr = fdb->key.addr.addr, +@@ -112,18 +113,16 @@ br_switchdev_fdb_notify(const struct net + .local = test_bit(BR_FDB_LOCAL, &fdb->flags), + .offloaded = test_bit(BR_FDB_OFFLOADED, &fdb->flags), + }; +- +- if (!fdb->dst) +- return; ++ struct net_device *dev = fdb->dst ? fdb->dst->dev : br->dev; + + switch (type) { + case RTM_DELNEIGH: + call_switchdev_notifiers(SWITCHDEV_FDB_DEL_TO_DEVICE, +- fdb->dst->dev, &info.info, NULL); ++ dev, &info.info, NULL); + break; + case RTM_NEWNEIGH: + call_switchdev_notifiers(SWITCHDEV_FDB_ADD_TO_DEVICE, +- fdb->dst->dev, &info.info, NULL); ++ dev, &info.info, NULL); + break; + } + } diff --git a/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch new file mode 100644 index 0000000000..9246d1fa40 --- /dev/null +++ b/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch @@ -0,0 +1,36 @@ +From dd082716b43a3684b2f473ae5d1e76d1c076d86d Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:12 +0100 +Subject: [PATCH] net: dsa: Include local addresses in assisted CPU port + learning + +Add local addresses (i.e. the ports' MAC addresses) to the hardware +FDB when assisted CPU port learning is enabled. + +NOTE: The bridge's own MAC address is also "local". If that address is +not shared with any port, the bridge's MAC is not be added by this +functionality - but the following commit takes care of that case. + +Signed-off-by: Tobias Waldekranz +--- + net/dsa/slave.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -2144,10 +2144,12 @@ static int dsa_slave_switchdev_event(str + fdb_info = ptr; + + if (dsa_slave_dev_check(dev)) { +- if (!fdb_info->added_by_user) +- return NOTIFY_OK; +- + dp = dsa_slave_to_port(dev); ++ ++ if (fdb_info->local && dp->ds->assisted_learning_on_cpu_port) ++ dp = dp->cpu_dp; ++ else if (!fdb_info->added_by_user) ++ return NOTIFY_OK; + } else { + /* Snoop addresses learnt on foreign interfaces + * bridged with us, for switches that don't diff --git a/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch new file mode 100644 index 0000000000..77f0dca252 --- /dev/null +++ b/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch @@ -0,0 +1,30 @@ +From 0663ebde114a6fb2c28c622ba5212b302d4d2581 Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:13 +0100 +Subject: [PATCH] net: dsa: Include bridge addresses in assisted CPU port + learning + +Now that notifications are sent out for addresses added to the bridge +itself, extend DSA to include those addresses in the hardware FDB when +assisted CPU port learning is enabled. + +Signed-off-by: Tobias Waldekranz +--- + net/dsa/slave.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -2158,7 +2158,11 @@ static int dsa_slave_switchdev_event(str + struct net_device *br_dev; + struct dsa_slave_priv *p; + +- br_dev = netdev_master_upper_dev_get_rcu(dev); ++ if (netif_is_bridge_master(dev)) ++ br_dev = dev; ++ else ++ br_dev = netdev_master_upper_dev_get_rcu(dev); ++ + if (!br_dev) + return NOTIFY_DONE; + diff --git a/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch new file mode 100644 index 0000000000..39271108ec --- /dev/null +++ b/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch @@ -0,0 +1,56 @@ +From 81e39fd78db82fb51b05fff309b9c521f1a0bc5a Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:14 +0100 +Subject: [PATCH] net: dsa: Sync static FDB entries on foreign interfaces to + hardware + +Reuse the "assisted_learning_on_cpu_port" functionality to always add +entries for user-configured entries on foreign interfaces, even if +assisted_learning_on_cpu_port is not enabled. E.g. in this situation: + + br0 + / \ +swp0 dummy0 + +$ bridge fdb add 02:00:de:ad:00:01 dev dummy0 vlan 1 master + +Results in DSA adding an entry in the hardware FDB, pointing this +address towards the CPU port. + +The same is true for entries added to the bridge itself, e.g: + +$ bridge fdb add 02:00:de:ad:00:01 dev br0 vlan 1 self + +Signed-off-by: Tobias Waldekranz +--- + net/dsa/slave.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -2151,9 +2151,12 @@ static int dsa_slave_switchdev_event(str + else if (!fdb_info->added_by_user) + return NOTIFY_OK; + } else { +- /* Snoop addresses learnt on foreign interfaces +- * bridged with us, for switches that don't +- * automatically learn SA from CPU-injected traffic ++ /* Snoop addresses added to foreign interfaces ++ * bridged with us, or the bridge ++ * itself. Dynamically learned addresses can ++ * also be added for switches that don't ++ * automatically learn SA from CPU-injected ++ * traffic. + */ + struct net_device *br_dev; + struct dsa_slave_priv *p; +@@ -2175,7 +2178,8 @@ static int dsa_slave_switchdev_event(str + + dp = p->dp->cpu_dp; + +- if (!dp->ds->assisted_learning_on_cpu_port) ++ if (!fdb_info->added_by_user && ++ !dp->ds->assisted_learning_on_cpu_port) + return NOTIFY_DONE; + } + diff --git a/target/linux/generic/pending-5.10/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.10/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch new file mode 100644 index 0000000000..5b8d058247 --- /dev/null +++ b/target/linux/generic/pending-5.10/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -0,0 +1,27 @@ +From: Tobias Waldekranz +Subject: [RFC net-next 7/7] net: dsa: mv88e6xxx: Request assisted learning on CPU port +Date: Sat, 16 Jan 2021 02:25:15 +0100 +Archived-At: + +While the hardware is capable of performing learning on the CPU port, +it requires alot of additions to the bridge's forwarding path in order +to handle multi-destination traffic correctly. + +Until that is in place, opt for the next best thing and let DSA sync +the relevant addresses down to the hardware FDB. + +Signed-off-by: Tobias Waldekranz +--- + drivers/net/dsa/mv88e6xxx/chip.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -5405,6 +5405,7 @@ static int mv88e6xxx_register_switch(str + ds->ops = &mv88e6xxx_switch_ops; + ds->ageing_time_min = chip->info->age_time_coeff; + ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; ++ ds->assisted_learning_on_cpu_port = true; + + dev_set_drvdata(dev, ds); + diff --git a/target/linux/generic/pending-5.4/762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch b/target/linux/generic/pending-5.4/762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch new file mode 100644 index 0000000000..bfa2d375e1 --- /dev/null +++ b/target/linux/generic/pending-5.4/762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch @@ -0,0 +1,71 @@ +From 46fe6cecb296d850c1ee2b333e57093ac4b733f3 Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:09 +0100 +Subject: [PATCH] net: bridge: switchdev: Refactor br_switchdev_fdb_notify + +Instead of having to add more and more arguments to +br_switchdev_fdb_call_notifiers, get rid of it and build the info +struct directly in br_switchdev_fdb_notify. + +Signed-off-by: Tobias Waldekranz +Reviewed-by: Vladimir Oltean +--- + net/bridge/br_switchdev.c | 37 +++++++++++-------------------------- + 1 file changed, 11 insertions(+), 26 deletions(-) + +--- a/net/bridge/br_switchdev.c ++++ b/net/bridge/br_switchdev.c +@@ -102,42 +102,27 @@ int br_switchdev_set_port_flag(struct ne + return 0; + } + +-static void +-br_switchdev_fdb_call_notifiers(bool adding, const unsigned char *mac, +- u16 vid, struct net_device *dev, +- bool added_by_user, bool offloaded) +-{ +- struct switchdev_notifier_fdb_info info; +- unsigned long notifier_type; +- +- info.addr = mac; +- info.vid = vid; +- info.added_by_user = added_by_user; +- info.offloaded = offloaded; +- notifier_type = adding ? SWITCHDEV_FDB_ADD_TO_DEVICE : SWITCHDEV_FDB_DEL_TO_DEVICE; +- call_switchdev_notifiers(notifier_type, dev, &info.info, NULL); +-} +- + void + br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type) + { ++ struct switchdev_notifier_fdb_info info = { ++ .addr = fdb->key.addr.addr, ++ .vid = fdb->key.vlan_id, ++ .added_by_user = fdb->added_by_user, ++ .offloaded = fdb->offloaded, ++ }; ++ + if (!fdb->dst) + return; + + switch (type) { + case RTM_DELNEIGH: +- br_switchdev_fdb_call_notifiers(false, fdb->key.addr.addr, +- fdb->key.vlan_id, +- fdb->dst->dev, +- fdb->added_by_user, +- fdb->offloaded); ++ call_switchdev_notifiers(SWITCHDEV_FDB_DEL_TO_DEVICE, ++ fdb->dst->dev, &info.info, NULL); + break; + case RTM_NEWNEIGH: +- br_switchdev_fdb_call_notifiers(true, fdb->key.addr.addr, +- fdb->key.vlan_id, +- fdb->dst->dev, +- fdb->added_by_user, +- fdb->offloaded); ++ call_switchdev_notifiers(SWITCHDEV_FDB_ADD_TO_DEVICE, ++ fdb->dst->dev, &info.info, NULL); + break; + } + } diff --git a/target/linux/generic/pending-5.4/763-net-bridge-switchdev-Include-local-flag-in-FDB-notif.patch b/target/linux/generic/pending-5.4/763-net-bridge-switchdev-Include-local-flag-in-FDB-notif.patch new file mode 100644 index 0000000000..49d6f079ba --- /dev/null +++ b/target/linux/generic/pending-5.4/763-net-bridge-switchdev-Include-local-flag-in-FDB-notif.patch @@ -0,0 +1,42 @@ +From ec5be4f79026282925ae383caa431a8d41e3456a Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:10 +0100 +Subject: [PATCH] net: bridge: switchdev: Include local flag in FDB + notifications + +Some switchdev drivers, notably DSA, ignore all dynamically learned +address notifications (!added_by_user) as these are autonomously added +by the switch. Previously, such a notification was indistinguishable +from a local address notification. Include a local bit in the +notification so that the two classes can be discriminated. + +This allows DSA-like devices to add local addresses to the hardware +FDB (with the CPU as the destination), thereby avoiding flows towards +the CPU being flooded by the switch as unknown unicast. + +Signed-off-by: Tobias Waldekranz +--- + include/net/switchdev.h | 1 + + net/bridge/br_switchdev.c | 1 + + 2 files changed, 2 insertions(+) + +--- a/include/net/switchdev.h ++++ b/include/net/switchdev.h +@@ -124,6 +124,7 @@ struct switchdev_notifier_fdb_info { + const unsigned char *addr; + u16 vid; + u8 added_by_user:1, ++ local:1, + offloaded:1; + }; + +--- a/net/bridge/br_switchdev.c ++++ b/net/bridge/br_switchdev.c +@@ -109,6 +109,7 @@ br_switchdev_fdb_notify(const struct net + .addr = fdb->key.addr.addr, + .vid = fdb->key.vlan_id, + .added_by_user = fdb->added_by_user, ++ .local = fdb->is_local, + .offloaded = fdb->offloaded, + }; + diff --git a/target/linux/generic/pending-5.4/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch b/target/linux/generic/pending-5.4/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch new file mode 100644 index 0000000000..8b869dd8f3 --- /dev/null +++ b/target/linux/generic/pending-5.4/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch @@ -0,0 +1,94 @@ +From 2e50fd9322047253c327550b4485cf8761035a8c Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:11 +0100 +Subject: [PATCH] net: bridge: switchdev: Send FDB notifications for host + addresses + +Treat addresses added to the bridge itself in the same way as regular +ports and send out a notification so that drivers may sync it down to +the hardware FDB. + +Signed-off-by: Tobias Waldekranz +--- + net/bridge/br_fdb.c | 4 ++-- + net/bridge/br_private.h | 7 ++++--- + net/bridge/br_switchdev.c | 11 +++++------ + 3 files changed, 11 insertions(+), 11 deletions(-) + +--- a/net/bridge/br_fdb.c ++++ b/net/bridge/br_fdb.c +@@ -581,7 +581,7 @@ void br_fdb_update(struct net_bridge *br + + /* fastpath: update of existing entry */ + if (unlikely(source != fdb->dst && !fdb->is_sticky)) { +- br_switchdev_fdb_notify(fdb, RTM_DELNEIGH); ++ br_switchdev_fdb_notify(br, fdb, RTM_DELNEIGH); + fdb->dst = source; + fdb_modified = true; + /* Take over HW learned entry */ +@@ -697,7 +697,7 @@ static void fdb_notify(struct net_bridge + int err = -ENOBUFS; + + if (swdev_notify) +- br_switchdev_fdb_notify(fdb, type); ++ br_switchdev_fdb_notify(br, fdb, type); + + skb = nlmsg_new(fdb_nlmsg_size(), GFP_ATOMIC); + if (skb == NULL) +--- a/net/bridge/br_private.h ++++ b/net/bridge/br_private.h +@@ -1203,8 +1203,8 @@ bool nbp_switchdev_allowed_egress(const + int br_switchdev_set_port_flag(struct net_bridge_port *p, + unsigned long flags, + unsigned long mask); +-void br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, +- int type); ++void br_switchdev_fdb_notify(struct net_bridge *br, ++ const struct net_bridge_fdb_entry *fdb, int type); + int br_switchdev_port_vlan_add(struct net_device *dev, u16 vid, u16 flags, + struct netlink_ext_ack *extack); + int br_switchdev_port_vlan_del(struct net_device *dev, u16 vid); +@@ -1250,7 +1250,8 @@ static inline int br_switchdev_port_vlan + } + + static inline void +-br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type) ++br_switchdev_fdb_notify(struct net_bridge *br, ++ const struct net_bridge_fdb_entry *fdb, int type) + { + } + +--- a/net/bridge/br_switchdev.c ++++ b/net/bridge/br_switchdev.c +@@ -103,7 +103,8 @@ int br_switchdev_set_port_flag(struct ne + } + + void +-br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type) ++br_switchdev_fdb_notify(struct net_bridge *br, ++ const struct net_bridge_fdb_entry *fdb, int type) + { + struct switchdev_notifier_fdb_info info = { + .addr = fdb->key.addr.addr, +@@ -112,18 +113,16 @@ br_switchdev_fdb_notify(const struct net + .local = fdb->is_local, + .offloaded = fdb->offloaded, + }; +- +- if (!fdb->dst) +- return; ++ struct net_device *dev = fdb->dst ? fdb->dst->dev : br->dev; + + switch (type) { + case RTM_DELNEIGH: + call_switchdev_notifiers(SWITCHDEV_FDB_DEL_TO_DEVICE, +- fdb->dst->dev, &info.info, NULL); ++ dev, &info.info, NULL); + break; + case RTM_NEWNEIGH: + call_switchdev_notifiers(SWITCHDEV_FDB_ADD_TO_DEVICE, +- fdb->dst->dev, &info.info, NULL); ++ dev, &info.info, NULL); + break; + } + } diff --git a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch new file mode 100644 index 0000000000..618ccf0982 --- /dev/null +++ b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch @@ -0,0 +1,36 @@ +From dd082716b43a3684b2f473ae5d1e76d1c076d86d Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:12 +0100 +Subject: [PATCH] net: dsa: Include local addresses in assisted CPU port + learning + +Add local addresses (i.e. the ports' MAC addresses) to the hardware +FDB when assisted CPU port learning is enabled. + +NOTE: The bridge's own MAC address is also "local". If that address is +not shared with any port, the bridge's MAC is not be added by this +functionality - but the following commit takes care of that case. + +Signed-off-by: Tobias Waldekranz +--- + net/dsa/slave.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -1695,10 +1695,12 @@ static int dsa_slave_switchdev_event(str + fdb_info = ptr; + + if (dsa_slave_dev_check(dev)) { +- if (!fdb_info->added_by_user) +- return NOTIFY_OK; +- + dp = dsa_slave_to_port(dev); ++ ++ if (fdb_info->local && dp->ds->assisted_learning_on_cpu_port) ++ dp = dp->cpu_dp; ++ else if (!fdb_info->added_by_user) ++ return NOTIFY_OK; + } else { + /* Snoop addresses learnt on foreign interfaces + * bridged with us, for switches that don't diff --git a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch new file mode 100644 index 0000000000..ed34c7ad24 --- /dev/null +++ b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch @@ -0,0 +1,30 @@ +From 0663ebde114a6fb2c28c622ba5212b302d4d2581 Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:13 +0100 +Subject: [PATCH] net: dsa: Include bridge addresses in assisted CPU port + learning + +Now that notifications are sent out for addresses added to the bridge +itself, extend DSA to include those addresses in the hardware FDB when +assisted CPU port learning is enabled. + +Signed-off-by: Tobias Waldekranz +--- + net/dsa/slave.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -1709,7 +1709,11 @@ static int dsa_slave_switchdev_event(str + struct net_device *br_dev; + struct dsa_slave_priv *p; + +- br_dev = netdev_master_upper_dev_get_rcu(dev); ++ if (netif_is_bridge_master(dev)) ++ br_dev = dev; ++ else ++ br_dev = netdev_master_upper_dev_get_rcu(dev); ++ + if (!br_dev) + return NOTIFY_DONE; + diff --git a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch new file mode 100644 index 0000000000..94f45c6be4 --- /dev/null +++ b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch @@ -0,0 +1,56 @@ +From 81e39fd78db82fb51b05fff309b9c521f1a0bc5a Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Sat, 16 Jan 2021 02:25:14 +0100 +Subject: [PATCH] net: dsa: Sync static FDB entries on foreign interfaces to + hardware + +Reuse the "assisted_learning_on_cpu_port" functionality to always add +entries for user-configured entries on foreign interfaces, even if +assisted_learning_on_cpu_port is not enabled. E.g. in this situation: + + br0 + / \ +swp0 dummy0 + +$ bridge fdb add 02:00:de:ad:00:01 dev dummy0 vlan 1 master + +Results in DSA adding an entry in the hardware FDB, pointing this +address towards the CPU port. + +The same is true for entries added to the bridge itself, e.g: + +$ bridge fdb add 02:00:de:ad:00:01 dev br0 vlan 1 self + +Signed-off-by: Tobias Waldekranz +--- + net/dsa/slave.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -1702,9 +1702,12 @@ static int dsa_slave_switchdev_event(str + else if (!fdb_info->added_by_user) + return NOTIFY_OK; + } else { +- /* Snoop addresses learnt on foreign interfaces +- * bridged with us, for switches that don't +- * automatically learn SA from CPU-injected traffic ++ /* Snoop addresses added to foreign interfaces ++ * bridged with us, or the bridge ++ * itself. Dynamically learned addresses can ++ * also be added for switches that don't ++ * automatically learn SA from CPU-injected ++ * traffic. + */ + struct net_device *br_dev; + struct dsa_slave_priv *p; +@@ -1726,7 +1729,8 @@ static int dsa_slave_switchdev_event(str + + dp = p->dp->cpu_dp; + +- if (!dp->ds->assisted_learning_on_cpu_port) ++ if (!fdb_info->added_by_user && ++ !dp->ds->assisted_learning_on_cpu_port) + return NOTIFY_DONE; + } + diff --git a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch new file mode 100644 index 0000000000..cb421f164b --- /dev/null +++ b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -0,0 +1,27 @@ +From: Tobias Waldekranz +Subject: [RFC net-next 7/7] net: dsa: mv88e6xxx: Request assisted learning on CPU port +Date: Sat, 16 Jan 2021 02:25:15 +0100 +Archived-At: + +While the hardware is capable of performing learning on the CPU port, +it requires alot of additions to the bridge's forwarding path in order +to handle multi-destination traffic correctly. + +Until that is in place, opt for the next best thing and let DSA sync +the relevant addresses down to the hardware FDB. + +Signed-off-by: Tobias Waldekranz +--- + drivers/net/dsa/mv88e6xxx/chip.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -5080,6 +5080,7 @@ static int mv88e6xxx_register_switch(str + ds->ops = &mv88e6xxx_switch_ops; + ds->ageing_time_min = chip->info->age_time_coeff; + ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; ++ ds->assisted_learning_on_cpu_port = true; + + dev_set_drvdata(dev, ds); + From d1dfb577f1c0d5b1f1fa35000c9ad7abdb7d10ed Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Sun, 21 Feb 2021 18:33:30 -0300 Subject: [PATCH 27/45] wolfssl: bump to v4.7.0-stable Biggest fix for this version is CVE-2021-3336, which has already been applied here. There are a couple of low severity security bug fixes as well. Three patches are no longer needed, and were removed; the one remaining was refreshed. This tool shows no ABI changes: https://abi-laboratory.pro/index.php?view=objects_report&l=wolfssl&v1=4.6.0&v2=4.7.0 Signed-off-by: Eneas U de Queiroz --- package/libs/wolfssl/Makefile | 6 +-- .../wolfssl/patches/010-CVE-2021-3336.patch | 53 ------------------- .../patches/100-disable-hardening-check.patch | 2 +- ...Fix-linking-against-hostapd-with-LTO.patch | 25 --------- .../patches/120-enable-secret-callback.patch | 10 ---- 5 files changed, 4 insertions(+), 92 deletions(-) delete mode 100644 package/libs/wolfssl/patches/010-CVE-2021-3336.patch delete mode 100644 package/libs/wolfssl/patches/110-Fix-linking-against-hostapd-with-LTO.patch delete mode 100644 package/libs/wolfssl/patches/120-enable-secret-callback.patch diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 846351f06d..53cd932d1f 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=4.6.0-stable -PKG_RELEASE:=2 +PKG_VERSION:=4.7.0-stable +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=053aefbb02d0b06b27c5e2df6875b4b587318755b7db9d6aa8d72206b310a848 +PKG_HASH:=b0e740b31d4d877d540ad50cc539a8873fc41af02bd3091c4357b403f7106e31 PKG_FIXUP:=libtool libtool-abiver PKG_INSTALL:=1 diff --git a/package/libs/wolfssl/patches/010-CVE-2021-3336.patch b/package/libs/wolfssl/patches/010-CVE-2021-3336.patch deleted file mode 100644 index abb9bfdd9b..0000000000 --- a/package/libs/wolfssl/patches/010-CVE-2021-3336.patch +++ /dev/null @@ -1,53 +0,0 @@ -From fad1e67677bf7797b6bd6e1f21a513c289d963a7 Mon Sep 17 00:00:00 2001 -From: Sean Parkinson -Date: Thu, 21 Jan 2021 08:24:38 +1000 -Subject: [PATCH] TLS 1.3: ensure key for signature in CertificateVerify - ---- - src/tls13.c | 18 +++++++++++++----- - 1 file changed, 13 insertions(+), 5 deletions(-) - ---- a/src/tls13.c -+++ b/src/tls13.c -@@ -5624,28 +5624,36 @@ static int DoTls13CertificateVerify(WOLF - #ifdef HAVE_ED25519 - if (args->sigAlgo == ed25519_sa_algo && - !ssl->peerEd25519KeyPresent) { -- WOLFSSL_MSG("Oops, peer sent ED25519 key but not in verify"); -+ WOLFSSL_MSG("Peer sent ED22519 sig but not ED22519 cert"); -+ ret = SIG_VERIFY_E; -+ goto exit_dcv; - } - #endif - #ifdef HAVE_ED448 - if (args->sigAlgo == ed448_sa_algo && !ssl->peerEd448KeyPresent) { -- WOLFSSL_MSG("Oops, peer sent ED448 key but not in verify"); -+ WOLFSSL_MSG("Peer sent ED448 sig but not ED448 cert"); -+ ret = SIG_VERIFY_E; -+ goto exit_dcv; - } - #endif - #ifdef HAVE_ECC - if (args->sigAlgo == ecc_dsa_sa_algo && - !ssl->peerEccDsaKeyPresent) { -- WOLFSSL_MSG("Oops, peer sent ECC key but not in verify"); -+ WOLFSSL_MSG("Peer sent ECC sig but not ECC cert"); -+ ret = SIG_VERIFY_E; -+ goto exit_dcv; - } - #endif - #ifndef NO_RSA - if (args->sigAlgo == rsa_sa_algo) { -- WOLFSSL_MSG("Oops, peer sent PKCS#1.5 signature"); -+ WOLFSSL_MSG("Peer sent PKCS#1.5 algo but not in certificate"); - ERROR_OUT(INVALID_PARAMETER, exit_dcv); - } - if (args->sigAlgo == rsa_pss_sa_algo && - (ssl->peerRsaKey == NULL || !ssl->peerRsaKeyPresent)) { -- WOLFSSL_MSG("Oops, peer sent RSA key but not in verify"); -+ WOLFSSL_MSG("Peer sent RSA sig but not RSA cert"); -+ ret = SIG_VERIFY_E; -+ goto exit_dcv; - } - #endif - diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch index c2793285e7..c89ff1be9d 100644 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -1,6 +1,6 @@ --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h -@@ -2248,7 +2248,7 @@ extern void uITRON4_free(void *p) ; +@@ -2255,7 +2255,7 @@ extern void uITRON4_free(void *p) ; #endif /* warning for not using harden build options (default with ./configure) */ diff --git a/package/libs/wolfssl/patches/110-Fix-linking-against-hostapd-with-LTO.patch b/package/libs/wolfssl/patches/110-Fix-linking-against-hostapd-with-LTO.patch deleted file mode 100644 index c24a15116f..0000000000 --- a/package/libs/wolfssl/patches/110-Fix-linking-against-hostapd-with-LTO.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 391ecbd647c121300dc7dcf209e412ccb7b8d432 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Fri, 1 Jan 2021 21:57:56 +0100 -Subject: [PATCH] Fix linking against hostapd with LTO - -When running LTO on wolfssl the ecc_map() function is removed from the -binary by GCC 8.4.0. This function is used by multiple functions from -the crypto_wolfssl.c implementation of hostapd master. - -Fixes: 780e8a4619b6 ("Fixes for building `--enable-wpas=small` with WPA Supplicant v2.7.") -Signed-off-by: Hauke Mehrtens ---- - configure.ac | 1 + - 1 file changed, 1 insertion(+) - ---- a/configure.ac -+++ b/configure.ac -@@ -947,6 +947,7 @@ then - AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL" - - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP" -+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_ECC_ADD_DBL" - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DER_LOAD" - AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER" - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN" diff --git a/package/libs/wolfssl/patches/120-enable-secret-callback.patch b/package/libs/wolfssl/patches/120-enable-secret-callback.patch deleted file mode 100644 index 9c9b361d01..0000000000 --- a/package/libs/wolfssl/patches/120-enable-secret-callback.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -943,6 +943,7 @@ then - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI" - AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA" - AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE" -+ AM_CFLAGS="$AM_CFLAGS -DHAVE_SECRET_CALLBACK" - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EITHER_SIDE" - AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL" - From 773949c152f7378a303919e790210113012fea04 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Sat, 20 Feb 2021 14:45:26 +0100 Subject: [PATCH 28/45] ramips: mt7621: enable SX150x driver The Netgear R6800 and R6700v2 devices have a Semtech SX1503 GPIO expander controlling the device LEDs. This expander was initially supported on 4.14, but support was lost in the transition to 5.4. Since this driver cannot be built as a kernel module, enable it in the kernel config for all mt7621 devices. Run-tested on a Netgear R6800. Cc: Stijn Segers Cc: Hauke Mehrtens Signed-off-by: Sander Vanheule Tested-by: Stijn Segers --- target/linux/ramips/mt7621/config-5.4 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4 index fba22a39cf..057c782760 100644 --- a/target/linux/ramips/mt7621/config-5.4 +++ b/target/linux/ramips/mt7621/config-5.4 @@ -210,6 +210,7 @@ CONFIG_PHYLINK=y CONFIG_PINCTRL=y CONFIG_PINCTRL_RT2880=y # CONFIG_PINCTRL_SINGLE is not set +CONFIG_PINCTRL_SX150X=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_GPIO=y CONFIG_POWER_SUPPLY=y From b5bc53813d28cb4229f9800a36c1e600a239e6a9 Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Fri, 19 Feb 2021 00:22:26 +0100 Subject: [PATCH 29/45] uboot-envtools: add support for ZyXEL GS-1900-8HP v1 and v2 This adds the necessary nuts and bolts for the uboot settings for both the ZyXEL GS1900-8HP v1 and v2. Signed-off-by: Stijn Segers --- package/boot/uboot-envtools/files/realtek | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/boot/uboot-envtools/files/realtek b/package/boot/uboot-envtools/files/realtek index cce0628ffc..9573e8944f 100644 --- a/package/boot/uboot-envtools/files/realtek +++ b/package/boot/uboot-envtools/files/realtek @@ -11,6 +11,8 @@ case "$board" in d-link,dgs-1210-16|\ d-link,dgs-1210-28|\ d-link,dgs-1210-10p|\ +zyxel,gs1900-8hp-v1|\ +zyxel,gs1900-8hp-v2|\ zyxel,gs1900-10hp) idx="$(find_mtd_index u-boot-env)" [ -n "$idx" ] && \ From 06356f00200639c48d95330e633965957b0347ab Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Thu, 18 Feb 2021 14:10:57 +0100 Subject: [PATCH 30/45] ramips: overwrite reset gpio properties in DIR-860L DTS As suggested by Sergio, this adds GPIOs 19 and 8 explicitly into the DIR-860L DTS, so the PCI-E ports get reset and the N radio (radio1) on PCI-E port 1 comes up reliably. Fixes the following error that popped up in dmesg: [ 1.638942] mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK) Suggested-by: Sergio Paracuellos Signed-off-by: Stijn Segers Reviewed-by: Sergio Paracuellos --- target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts index 5d1c336736..f843f62801 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts @@ -143,6 +143,9 @@ &pcie { status = "okay"; + + reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>, + <&gpio 8 GPIO_ACTIVE_LOW>; }; &pcie0 { From 12a80e44b914a00fa39daae5474b3964f246ddc3 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Wed, 17 Feb 2021 21:50:08 -0300 Subject: [PATCH 31/45] openssl: always build with GOST engine support The packages feed has a proposed package for a GOST engine, which needs support from the main openssl library. It is a default option in OpenSSL. All that needs to be done here is to not disable it. Package increases by a net 1-byte, so it is not really really worth keeping this optional. This commit also includes a commented-out example engine configuration in openssl.cnf, as it is done for other available engines. Signed-off-by: Eneas U de Queiroz --- package/libs/openssl/Config.in | 11 ----------- package/libs/openssl/Makefile | 7 +------ .../150-openssl.cnf-add-engines-conf.patch | 19 ++++++++++++++++++- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in index d1281ec6fa..bc2f0584b6 100644 --- a/package/libs/openssl/Config.in +++ b/package/libs/openssl/Config.in @@ -293,15 +293,4 @@ config OPENSSL_WITH_ASYNC initiate crypto operations asynchronously. In order to work this will require the presence of an async capable engine. -config OPENSSL_WITH_GOST - bool - prompt "Prepare library for GOST engine" - depends on OPENSSL_ENGINE - help - This option prepares the library to accept engine support - for Russian GOST crypto algorithms. - The gost engine is not included in standard openwrt feeds. - To build such engine yourself, see: - https://github.com/gost-engine/engine - endif diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 7dbbd65026..436abfd94c 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=openssl PKG_BASE:=1.1.1 PKG_BUGFIX:=j PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_USE_MIPS16:=0 ENGINES_DIR=engines-1.1 @@ -52,7 +52,6 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_WITH_DTLS \ CONFIG_OPENSSL_WITH_EC2M \ CONFIG_OPENSSL_WITH_ERROR_MESSAGES \ - CONFIG_OPENSSL_WITH_GOST \ CONFIG_OPENSSL_WITH_IDEA \ CONFIG_OPENSSL_WITH_MDC2 \ CONFIG_OPENSSL_WITH_NPN \ @@ -289,10 +288,6 @@ else OPENSSL_OPTIONS += no-engine endif -ifndef CONFIG_OPENSSL_WITH_GOST - OPENSSL_OPTIONS += no-gost -endif - ifndef CONFIG_OPENSSL_WITH_DTLS OPENSSL_OPTIONS += no-dtls endif diff --git a/package/libs/openssl/patches/150-openssl.cnf-add-engines-conf.patch b/package/libs/openssl/patches/150-openssl.cnf-add-engines-conf.patch index 81d41963c6..c90fce2442 100644 --- a/package/libs/openssl/patches/150-openssl.cnf-add-engines-conf.patch +++ b/package/libs/openssl/patches/150-openssl.cnf-add-engines-conf.patch @@ -1,6 +1,6 @@ --- a/apps/openssl.cnf +++ b/apps/openssl.cnf -@@ -22,6 +22,82 @@ oid_section = new_oids +@@ -22,6 +22,99 @@ oid_section = new_oids # (Alternatively, use a configuration file that has only # X.509v3 extensions in its main [= default] section.) @@ -14,6 +14,7 @@ +#devcrypto=devcrypto +#afalg=afalg +#padlock=padlock ++##gost=gost + +[afalg] +# Leave this alone and configure algorithms with CIPERS/DIGESTS below @@ -79,6 +80,22 @@ + +[padlock] +default_algorithms = ALL ++ ++[gost] ++default_algorithms = ALL ++# CRYPT_PARAMS: OID of default GOST 28147-89 parameters It allows the ++# user to choose between different parameter sets of symmetric cipher ++# algorithm. RFC 4357 specifies several parameters for the ++# GOST 28147-89 algorithm, but OpenSSL doesn't provide user interface ++# to choose one when encrypting. So use engine configuration parameter ++# instead. ++# Value of this parameter can be either short name, defined in OpenSSL ++# obj_dat.h header file or numeric representation of OID, defined in ++# RFC 4357. Defaults to id-tc26-gost-28147-param-Z ++#CRYPT_PARAMS = id-tc26-gost-28147-param-Z ++ ++# PBE_PARAMS: Shortname of default digest alg for PBE ++#PBE_PARAMS = + [ new_oids ] From 030bc39c350d301d3cbca4725e845a752c359c5f Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 3 Jan 2021 03:29:02 +0100 Subject: [PATCH 32/45] ppp: Update to version 2.4.9 Upstream integrated multiple patches from Distributions and did other changes: * rp-pppoe.so was renamed to pppoe.so * Converted to ANSI C The following patches were applied upstream: * 100-debian_ip-ip_option.patch * 101-debian_close_dev_ppp.patch * 103-debian_fix_link_pidfile.patch * 106-debian_stripMSdomain.patch * 107-debian_pppoatm_wildcard.patch * 110-debian_defaultroute.patch * 202-no_strip.patch Compilation with musl libc was fixed upstream so 140-pppoe_compile_fix.patch is not needed any more Parts of the 203-opt_flags.patch patch were applied in a different way upstream. Signed-off-by: Hauke Mehrtens --- package/network/services/ppp/Makefile | 10 +- package/network/services/ppp/files/ppp.sh | 4 +- .../010-use_target_for_configure.patch | 22 +- .../ppp/patches/100-debian_ip-ip_option.patch | 96 ------ .../patches/101-debian_close_dev_ppp.patch | 28 -- .../patches/103-debian_fix_link_pidfile.patch | 23 -- .../ppp/patches/105-debian_demand.patch | 30 +- .../patches/106-debian_stripMSdomain.patch | 47 --- .../patches/107-debian_pppoatm_wildcard.patch | 25 -- .../ppp/patches/110-debian_defaultroute.patch | 314 ------------------ .../120-debian_ipv6_updown_option.patch | 18 +- .../ppp/patches/140-pppoe_compile_fix.patch | 36 -- .../services/ppp/patches/200-makefile.patch | 23 +- .../ppp/patches/201-mppe_mppc_1.1.patch | 133 +++++--- .../services/ppp/patches/202-no_strip.patch | 88 ----- .../services/ppp/patches/203-opt_flags.patch | 36 +- .../patches/205-no_exponential_timeout.patch | 4 +- .../ppp/patches/207-lcp_mtu_max.patch | 2 +- .../ppp/patches/208-fix_status_code.patch | 2 +- .../300-filter-pcap-includes-lib.patch | 6 +- .../ppp/patches/310-precompile_filter.patch | 30 +- ...multilink_support_custom_iface_names.patch | 33 +- .../330-retain_foreign_default_routes.patch | 2 +- .../340-populate_default_gateway.patch | 6 +- .../patches/400-simplify_kernel_checks.patch | 32 +- .../ppp/patches/401-no_record_file.patch | 6 +- .../services/ppp/patches/403-no_wtmp.patch | 4 +- .../404-remove_obsolete_protocol_names.patch | 16 +- .../ppp/patches/405-no_multilink_option.patch | 2 +- .../ppp/patches/500-add-pptp-plugin.patch | 14 +- ...openssl-for-the-DES-instead-of-the-l.patch | 25 +- 31 files changed, 226 insertions(+), 891 deletions(-) delete mode 100644 package/network/services/ppp/patches/100-debian_ip-ip_option.patch delete mode 100644 package/network/services/ppp/patches/101-debian_close_dev_ppp.patch delete mode 100644 package/network/services/ppp/patches/103-debian_fix_link_pidfile.patch delete mode 100644 package/network/services/ppp/patches/106-debian_stripMSdomain.patch delete mode 100644 package/network/services/ppp/patches/107-debian_pppoatm_wildcard.patch delete mode 100644 package/network/services/ppp/patches/110-debian_defaultroute.patch delete mode 100644 package/network/services/ppp/patches/140-pppoe_compile_fix.patch delete mode 100644 package/network/services/ppp/patches/202-no_strip.patch diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 48d7120a72..10e9bdfdfe 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -13,14 +13,14 @@ PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/paulusmack/ppp -PKG_SOURCE_DATE:=2020-10-03 -PKG_SOURCE_VERSION:=ad3937a0a38a696eb1a37dbf8f92e8e6072cdccb -PKG_MIRROR_HASH:=c5b39615eb62728431b19f3ae5428eb1e2fc705b4b7b960228fe5b5d7b5a4bca +PKG_SOURCE_DATE:=2021-01-04 +PKG_SOURCE_VERSION:=4fb319056f168bb8379865b91b4fd3e1ada73f1e +PKG_MIRROR_HASH:=429cb5fcff36e1d8698766130711d4764347f08b83233dfb4831bea21616efef PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-4-Clause PKG_CPE_ID:=cpe:/a:samba:ppp -PKG_RELEASE_VERSION:=2.4.8 +PKG_RELEASE_VERSION:=2.4.9 PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE) PKG_BUILD_DEPENDS:=libpcap @@ -242,7 +242,7 @@ endef define Package/ppp-mod-pppoe/install $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/rp-pppoe.so \ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppoe.so \ $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ endef diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index b553effd88..7bbc497c43 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -234,7 +234,7 @@ proto_pppoe_setup() { json_get_var padi_timeout padi_timeout ppp_generic_setup "$config" \ - plugin rp-pppoe.so \ + plugin pppoe.so \ ${ac:+rp_pppoe_ac "$ac"} \ ${service:+rp_pppoe_service "$service"} \ ${host_uniq:+host-uniq "$host_uniq"} \ @@ -331,7 +331,7 @@ proto_pptp_teardown() { [ -n "$INCLUDE_ONLY" ] || { add_protocol ppp - [ -f /usr/lib/pppd/*/rp-pppoe.so ] && add_protocol pppoe + [ -f /usr/lib/pppd/*/pppoe.so ] && add_protocol pppoe [ -f /usr/lib/pppd/*/pppoatm.so ] && add_protocol pppoa [ -f /usr/lib/pppd/*/pptp.so ] && add_protocol pptp } diff --git a/package/network/services/ppp/patches/010-use_target_for_configure.patch b/package/network/services/ppp/patches/010-use_target_for_configure.patch index 7deac0e446..9e8618f83c 100644 --- a/package/network/services/ppp/patches/010-use_target_for_configure.patch +++ b/package/network/services/ppp/patches/010-use_target_for_configure.patch @@ -9,16 +9,16 @@ Signed-off-by: Jo-Philipp Wich --- a/configure +++ b/configure -@@ -8,9 +8,9 @@ SYSCONF=/etc - # if [ -d /NextApps ]; then - # system="NeXTStep" - # else -- system=`uname -s` -- release=`uname -r` -- arch=`uname -m` -+ system=${UNAME_S:-`uname -s`} -+ release=${UNAME_R:-`uname -r`} -+ arch=${UNAME_M:-`uname -m`} - # fi +@@ -10,9 +10,9 @@ CROSS_COMPILE= + CC=cc + CFLAGS= + +-system=`uname -s` +-release=`uname -r` +-arch=`uname -m` ++system=${UNAME_S:-`uname -s`} ++release=${UNAME_R:-`uname -r`} ++arch=${UNAME_M:-`uname -m`} state="unknown" + case $system in diff --git a/package/network/services/ppp/patches/100-debian_ip-ip_option.patch b/package/network/services/ppp/patches/100-debian_ip-ip_option.patch deleted file mode 100644 index a996622922..0000000000 --- a/package/network/services/ppp/patches/100-debian_ip-ip_option.patch +++ /dev/null @@ -1,96 +0,0 @@ -pppd: Allow specifying ip-up and ip-down scripts - -This patch implements the "ip-up-script" and "ip-down-script" options which -allow to specify the path of the ip-up and ip-down scripts to call. - -These options default to _PATH_IPUP and _PATH_IPDOWN to retain the -existing behaviour. - -The patch originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/ipcp.c -+++ b/pppd/ipcp.c -@@ -1957,7 +1957,7 @@ ipcp_up(f) - */ - if (ipcp_script_state == s_down && ipcp_script_pid == 0) { - ipcp_script_state = s_up; -- ipcp_script(_PATH_IPUP, 0); -+ ipcp_script(path_ipup, 0); - } - } - -@@ -2007,7 +2007,7 @@ ipcp_down(f) - /* Execute the ip-down script */ - if (ipcp_script_state == s_up && ipcp_script_pid == 0) { - ipcp_script_state = s_down; -- ipcp_script(_PATH_IPDOWN, 0); -+ ipcp_script(path_ipdown, 0); - } - } - -@@ -2061,13 +2061,13 @@ ipcp_script_done(arg) - case s_up: - if (ipcp_fsm[0].state != OPENED) { - ipcp_script_state = s_down; -- ipcp_script(_PATH_IPDOWN, 0); -+ ipcp_script(path_ipdown, 0); - } - break; - case s_down: - if (ipcp_fsm[0].state == OPENED) { - ipcp_script_state = s_up; -- ipcp_script(_PATH_IPUP, 0); -+ ipcp_script(path_ipup, 0); - } - break; - } ---- a/pppd/main.c -+++ b/pppd/main.c -@@ -306,6 +306,9 @@ main(argc, argv) - struct protent *protp; - char numbuf[16]; - -+ strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup)); -+ strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown)); -+ - link_stats_valid = 0; - new_phase(PHASE_INITIALIZE); - ---- a/pppd/options.c -+++ b/pppd/options.c -@@ -117,6 +117,8 @@ bool tune_kernel; /* may alter kernel s - int connect_delay = 1000; /* wait this many ms after connect script */ - int req_unit = -1; /* requested interface unit */ - char req_ifname[MAXIFNAMELEN]; /* requested interface name */ -+char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ -+char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ - bool multilink = 0; /* Enable multilink operation */ - char *bundle_name = NULL; /* bundle name for multilink */ - bool dump_options; /* print out option values */ -@@ -316,6 +318,13 @@ option_t general_options[] = { - "Metric to use for the default route (Linux only; -1 for default behavior)", - OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 }, - -+ { "ip-up-script", o_string, path_ipup, -+ "Set pathname of ip-up script", -+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, -+ { "ip-down-script", o_string, path_ipdown, -+ "Set pathname of ip-down script", -+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, -+ - #ifdef HAVE_MULTILINK - { "multilink", o_bool, &multilink, - "Enable multilink operation", OPT_PRIO | 1 }, ---- a/pppd/pppd.h -+++ b/pppd/pppd.h -@@ -335,6 +335,8 @@ extern int connect_delay; /* Time to del - extern int max_data_rate; /* max bytes/sec through charshunt */ - extern int req_unit; /* interface unit number to use */ - extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ -+extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ -+extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ - extern bool multilink; /* enable multilink operation */ - extern bool noendpoint; /* don't send or accept endpt. discrim. */ - extern char *bundle_name; /* bundle name for multilink */ diff --git a/package/network/services/ppp/patches/101-debian_close_dev_ppp.patch b/package/network/services/ppp/patches/101-debian_close_dev_ppp.patch deleted file mode 100644 index 62830179b6..0000000000 --- a/package/network/services/ppp/patches/101-debian_close_dev_ppp.patch +++ /dev/null @@ -1,28 +0,0 @@ -pppd: Close already open ppp descriptors - -When using the kernel PPPoE driver in conjunction with the "persist" option, -the already open descriptor to /dev/ppp is not closed when the link is -reestablished. This eventually leads to high CPU load because the stray -descriptors are always reported as ready by select(). - -This patch closes the descriptor if it is already open when establishing a -new connection. It originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -467,6 +467,13 @@ int generic_establish_ppp (int fd) - if (new_style_driver) { - int flags; - -+ /* if a ppp_fd is already open, close it first */ -+ if(ppp_fd > 0) { -+ close(ppp_fd); -+ remove_fd(ppp_fd); -+ ppp_fd = -1; -+ } -+ - /* Open an instance of /dev/ppp and connect the channel to it */ - if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) { - error("Couldn't get channel number: %m"); diff --git a/package/network/services/ppp/patches/103-debian_fix_link_pidfile.patch b/package/network/services/ppp/patches/103-debian_fix_link_pidfile.patch deleted file mode 100644 index 5a764ab9b2..0000000000 --- a/package/network/services/ppp/patches/103-debian_fix_link_pidfile.patch +++ /dev/null @@ -1,23 +0,0 @@ -pppd: Fix creation of linkpidfile - -When pppd is run without "nodetach" or with "updetach", the linkpidfile is -never created. The call to create_linkpidfile() is protected by a check for -linkpidfile[0] but this is only filled in when create_linkpidfile() is called. - -This patch changes to code to allways uncondiationally call -create_linkpidfile(), it originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/main.c -+++ b/pppd/main.c -@@ -780,8 +780,7 @@ detach() - /* update pid files if they have been written already */ - if (pidfilename[0]) - create_pidfile(pid); -- if (linkpidfile[0]) -- create_linkpidfile(pid); -+ create_linkpidfile(pid); - exit(0); /* parent dies */ - } - setsid(); diff --git a/package/network/services/ppp/patches/105-debian_demand.patch b/package/network/services/ppp/patches/105-debian_demand.patch index c442f4c8af..ff66aa8ea5 100644 --- a/package/network/services/ppp/patches/105-debian_demand.patch +++ b/package/network/services/ppp/patches/105-debian_demand.patch @@ -18,7 +18,7 @@ #ifdef PPP_FILTER #include #endif -@@ -220,6 +224,14 @@ loop_chars(p, n) +@@ -218,6 +222,14 @@ loop_chars(unsigned char *p, int n) int c, rv; rv = 0; @@ -33,14 +33,12 @@ for (; n > 0; --n) { c = *p++; if (c == PPP_FLAG) { -@@ -298,17 +310,102 @@ loop_frame(frame, len) +@@ -294,16 +306,100 @@ loop_frame(unsigned char *frame, int len * loopback, now that the real serial link is up. */ void --demand_rexmit(proto) -+demand_rexmit(proto, newip) - int proto; -+ u_int32_t newip; +-demand_rexmit(int proto) ++demand_rexmit(int proto, u_int32_t newip) { struct packet *pkt, *prev, *nextpkt; + unsigned short checksum; @@ -139,7 +137,7 @@ } else { --- a/pppd/ipcp.c +++ b/pppd/ipcp.c -@@ -1882,7 +1882,7 @@ ipcp_up(f) +@@ -1850,7 +1850,7 @@ ipcp_up(fsm *f) proxy_arp_set[f->unit] = 1; } @@ -150,7 +148,7 @@ } else { --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c -@@ -1258,7 +1258,7 @@ ipv6cp_up(f) +@@ -1253,7 +1253,7 @@ ipv6cp_up(fsm *f) if (sif6defaultroute(f->unit, go->ourid, ho->hisid)) default_route_set[f->unit] = 1; } @@ -161,12 +159,12 @@ } else { --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -602,7 +602,7 @@ void demand_conf __P((void)); /* config - void demand_block __P((void)); /* set all NPs to queue up packets */ - void demand_unblock __P((void)); /* set all NPs to pass packets */ - void demand_discard __P((void)); /* set all NPs to discard packets */ --void demand_rexmit __P((int)); /* retransmit saved frames for an NP */ -+void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/ - int loop_chars __P((unsigned char *, int)); /* process chars from loopback */ - int loop_frame __P((unsigned char *, int)); /* should we bring link up? */ +@@ -598,7 +598,7 @@ void demand_conf(void); /* config interf + void demand_block(void); /* set all NPs to queue up packets */ + void demand_unblock(void); /* set all NPs to pass packets */ + void demand_discard(void); /* set all NPs to discard packets */ +-void demand_rexmit(int); /* retransmit saved frames for an NP */ ++void demand_rexmit(int, u_int32_t); /* retransmit saved frames for an NP*/ + int loop_chars(unsigned char *, int); /* process chars from loopback */ + int loop_frame(unsigned char *, int); /* should we bring link up? */ diff --git a/package/network/services/ppp/patches/106-debian_stripMSdomain.patch b/package/network/services/ppp/patches/106-debian_stripMSdomain.patch deleted file mode 100644 index 376de64c43..0000000000 --- a/package/network/services/ppp/patches/106-debian_stripMSdomain.patch +++ /dev/null @@ -1,47 +0,0 @@ -pppd: Implement option to strip domain part from MS CHAP response - -This patch implements a new boolean option "chapms-strip-domain" which -strips the leading domain part of the username in a received MS Chap -response. - -When the option is set, all leading chars up to and including the last -backslash in the username are stripped. The option defaults to false. - -The patch originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/chap-new.c -+++ b/pppd/chap-new.c -@@ -58,6 +58,7 @@ int (*chap_verify_hook)(char *name, char - int chap_timeout_time = 3; - int chap_max_transmits = 10; - int chap_rechallenge_time = 0; -+int chapms_strip_domain = 0; - - /* - * Command-line options. -@@ -69,6 +70,8 @@ static option_t chap_option_list[] = { - "Set max #xmits for challenge", OPT_PRIO }, - { "chap-interval", o_int, &chap_rechallenge_time, - "Set interval for rechallenge", OPT_PRIO }, -+ { "chapms-strip-domain", o_bool, &chapms_strip_domain, -+ "Strip the domain prefix before the Username", 1 }, - { NULL } - }; - -@@ -336,6 +339,14 @@ chap_handle_response(struct chap_server_ - /* Null terminate and clean remote name. */ - slprintf(rname, sizeof(rname), "%.*v", len, name); - name = rname; -+ -+ /* strip the MS domain name */ -+ if (chapms_strip_domain && strrchr(rname, '\\')) { -+ char tmp[MAXNAMELEN+1]; -+ -+ strcpy(tmp, strrchr(rname, '\\') + 1); -+ strcpy(rname, tmp); -+ } - } - - if (chap_verify_hook) diff --git a/package/network/services/ppp/patches/107-debian_pppoatm_wildcard.patch b/package/network/services/ppp/patches/107-debian_pppoatm_wildcard.patch deleted file mode 100644 index 6f559a1231..0000000000 --- a/package/network/services/ppp/patches/107-debian_pppoatm_wildcard.patch +++ /dev/null @@ -1,25 +0,0 @@ -pppoatm: Allow wildcard ATM devices - -When operating pppd's pppoatm plugin with an USB ADSL modem, e.g. an -Alcatel Speedtouch, the ATM device number might change when the modem is -reconnected to the USB port or when the host controller resets the USB -device. - -This patch allows to specify the ATM device as wildcard which gives -enough flexibility to cope with changing device names. - -The patch originated from the Debain project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/plugins/pppoatm/pppoatm.c -+++ b/pppd/plugins/pppoatm/pppoatm.c -@@ -75,7 +75,7 @@ static int setdevname_pppoatm(const char - //info("PPPoATM setdevname_pppoatm: '%s'", cp); - memset(&addr, 0, sizeof addr); - if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr), -- T2A_PVC | T2A_NAME) < 0) { -+ T2A_PVC | T2A_NAME | T2A_WILDCARD) < 0) { - if(doit) - info("atm does not recognize: %s", cp); - return 0; diff --git a/package/network/services/ppp/patches/110-debian_defaultroute.patch b/package/network/services/ppp/patches/110-debian_defaultroute.patch deleted file mode 100644 index 21b329e5d5..0000000000 --- a/package/network/services/ppp/patches/110-debian_defaultroute.patch +++ /dev/null @@ -1,314 +0,0 @@ -pppd: Add "replacedefaultroute" and "noreplacedefaultroute" options - -This patch implements two new options, "replacedefaultroute" to replace any -existing system default route when specified and "noreplacedefaultroute" to -disable the "replacedefaultroute" option, which is useful in multi user -environments where the administrator wants to allow users to dial pppd -connections but not allow them to change the system default route. - -The patch originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/ipcp.c -+++ b/pppd/ipcp.c -@@ -197,6 +197,14 @@ static option_t ipcp_option_list[] = { - "disable defaultroute option", OPT_ALIAS | OPT_A2CLR, - &ipcp_wantoptions[0].default_route }, - -+ { "replacedefaultroute", o_bool, -+ &ipcp_wantoptions[0].replace_default_route, -+ "Replace default route", 1 -+ }, -+ { "noreplacedefaultroute", o_bool, -+ &ipcp_allowoptions[0].replace_default_route, -+ "Never replace default route", OPT_A2COPY, -+ &ipcp_wantoptions[0].replace_default_route }, - { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp, - "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp }, - { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, -@@ -270,7 +278,7 @@ struct protent ipcp_protent = { - ip_active_pkt - }; - --static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t)); -+static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool)); - static void ipcp_script __P((char *, int)); /* Run an up/down script */ - static void ipcp_script_done __P((void *)); - -@@ -1760,7 +1768,8 @@ ip_demand_conf(u) - if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE)) - return 0; - if (wo->default_route) -- if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr)) -+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr, -+ wo->replace_default_route)) - default_route_set[u] = 1; - if (wo->proxy_arp) - if (sifproxyarp(u, wo->hisaddr)) -@@ -1848,7 +1857,8 @@ ipcp_up(f) - */ - if (demand) { - if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { -- ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr); -+ ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, -+ wo->replace_default_route); - if (go->ouraddr != wo->ouraddr) { - warn("Local IP address changed to %I", go->ouraddr); - script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); -@@ -1873,7 +1883,8 @@ ipcp_up(f) - - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) -- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr)) -+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr, -+ wo->replace_default_route)) - default_route_set[f->unit] = 1; - - /* Make a proxy ARP entry if requested. */ -@@ -1923,7 +1934,8 @@ ipcp_up(f) - - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) -- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr)) -+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr, -+ wo->replace_default_route)) - default_route_set[f->unit] = 1; - - /* Make a proxy ARP entry if requested. */ -@@ -2001,7 +2013,7 @@ ipcp_down(f) - sifnpmode(f->unit, PPP_IP, NPMODE_DROP); - sifdown(f->unit); - ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr, -- ipcp_hisoptions[f->unit].hisaddr); -+ ipcp_hisoptions[f->unit].hisaddr, 0); - } - - /* Execute the ip-down script */ -@@ -2017,16 +2029,25 @@ ipcp_down(f) - * proxy arp entries, etc. - */ - static void --ipcp_clear_addrs(unit, ouraddr, hisaddr) -+ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute) - int unit; - u_int32_t ouraddr; /* local address */ - u_int32_t hisaddr; /* remote address */ -+ bool replacedefaultroute; - { - if (proxy_arp_set[unit]) { - cifproxyarp(unit, hisaddr); - proxy_arp_set[unit] = 0; - } -- if (default_route_set[unit]) { -+ /* If replacedefaultroute, sifdefaultroute will be called soon -+ * with replacedefaultroute set and that will overwrite the current -+ * default route. This is the case only when doing demand, otherwise -+ * during demand, this cifdefaultroute would restore the old default -+ * route which is not what we want in this case. In the non-demand -+ * case, we'll delete the default route and restore the old if there -+ * is one saved by an sifdefaultroute with replacedefaultroute. -+ */ -+ if (!replacedefaultroute && default_route_set[unit]) { - cifdefaultroute(unit, ouraddr, hisaddr); - default_route_set[unit] = 0; - } ---- a/pppd/ipcp.h -+++ b/pppd/ipcp.h -@@ -70,6 +70,7 @@ typedef struct ipcp_options { - bool old_addrs; /* Use old (IP-Addresses) option? */ - bool req_addr; /* Ask peer to send IP address? */ - bool default_route; /* Assign default route through interface? */ -+ bool replace_default_route; /* Replace default route through interface? */ - bool proxy_arp; /* Make proxy ARP entry for peer? */ - bool neg_vj; /* Van Jacobson Compression? */ - bool old_vj; /* use old (short) form of VJ option? */ ---- a/pppd/pppd.8 -+++ b/pppd/pppd.8 -@@ -133,6 +133,11 @@ the gateway, when IPv6CP negotiation is - This entry is removed when the PPP connection is broken. This option - is privileged if the \fInodefaultroute6\fR option has been specified. - .TP -+.B replacedefaultroute -+This option is a flag to the defaultroute option. If defaultroute is -+set and this flag is also set, pppd replaces an existing default route -+with the new default route. -+.TP - .B disconnect \fIscript - Execute the command specified by \fIscript\fR, by passing it to a - shell, after -@@ -756,7 +761,12 @@ disable both forms of hardware flow cont - .TP - .B nodefaultroute - Disable the \fIdefaultroute\fR option. The system administrator who --wishes to prevent users from creating default routes with pppd -+wishes to prevent users from adding a default route with pppd -+can do so by placing this option in the /etc/ppp/options file. -+.TP -+.B noreplacedefaultroute -+Disable the \fIreplacedefaultroute\fR option. The system administrator who -+wishes to prevent users from replacing a default route with pppd - can do so by placing this option in the /etc/ppp/options file. - .TP - .B nodefaultroute6 ---- a/pppd/pppd.h -+++ b/pppd/pppd.h -@@ -684,7 +684,7 @@ int sif6addr __P((int, eui64_t, eui64_t - int cif6addr __P((int, eui64_t, eui64_t)); - /* Remove an IPv6 address from i/f */ - #endif --int sifdefaultroute __P((int, u_int32_t, u_int32_t)); -+int sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt)); - /* Create default route through i/f */ - int cifdefaultroute __P((int, u_int32_t, u_int32_t)); - /* Delete default route through i/f */ ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -209,6 +209,8 @@ static int if_is_up; /* Interface has be - static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */ - static int have_default_route; /* Gateway for default route added */ - static int have_default_route6; /* Gateway for default IPv6 route added */ -+static struct rtentry old_def_rt; /* Old default route */ -+static int default_rt_repl_rest; /* replace and restore old default rt */ - static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */ - static char proxy_arp_dev[16]; /* Device for proxy arp entry */ - static u_int32_t our_old_addr; /* for detecting address changes */ -@@ -1577,6 +1579,9 @@ static int read_route_table(struct rtent - p = NULL; - } - -+ SET_SA_FAMILY (rt->rt_dst, AF_INET); -+ SET_SA_FAMILY (rt->rt_gateway, AF_INET); -+ - SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16); - SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16); - SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16); -@@ -1649,20 +1654,52 @@ int have_route_to(u_int32_t addr) - /******************************************************************** - * - * sifdefaultroute - assign a default route through the address given. -- */ -- --int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway) --{ -- struct rtentry rt; -- -- if (defaultroute_exists(&rt, dfl_route_metric) && strcmp(rt.rt_dev, ifname) != 0) { -- if (rt.rt_flags & RTF_GATEWAY) -- error("not replacing existing default route via %I with metric %d", -- SIN_ADDR(rt.rt_gateway), dfl_route_metric); -- else -+ * -+ * If the global default_rt_repl_rest flag is set, then this function -+ * already replaced the original system defaultroute with some other -+ * route and it should just replace the current defaultroute with -+ * another one, without saving the current route. Use: demand mode, -+ * when pppd sets first a defaultroute it it's temporary ppp0 addresses -+ * and then changes the temporary addresses to the addresses for the real -+ * ppp connection when it has come up. -+ */ -+ -+int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace) -+{ -+ struct rtentry rt, tmp_rt; -+ struct rtentry *del_rt = NULL; -+ -+ if (default_rt_repl_rest) { -+ /* We have already reclaced the original defaultroute, if we -+ are called again, we will delete the current default route -+ and set the new default route in this function. -+ - this is normally only the case the doing demand: */ -+ if (defaultroute_exists(&tmp_rt, dfl_route_metric)) -+ del_rt = &tmp_rt; -+ } else if (defaultroute_exists(&old_def_rt, dfl_route_metric) && -+ strcmp(old_def_rt.rt_dev, ifname) != 0) { -+ /* We did not yet replace an existing default route, let's -+ check if we should save and replace a default route: */ -+ if (old_def_rt.rt_flags & RTF_GATEWAY) { -+ if (!replace) { -+ error("not replacing existing default route via %I with metric %d", -+ SIN_ADDR(old_def_rt.rt_gateway), dfl_route_metric); -+ return 0; -+ } else { -+ /* we need to copy rt_dev because we need it permanent too: */ -+ char *tmp_dev = malloc(strlen(old_def_rt.rt_dev) + 1); -+ strcpy(tmp_dev, old_def_rt.rt_dev); -+ old_def_rt.rt_dev = tmp_dev; -+ -+ notice("replacing old default route to %s [%I] with metric %d", -+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway), -+ dfl_route_metric); -+ default_rt_repl_rest = 1; -+ del_rt = &old_def_rt; -+ } -+ } else - error("not replacing existing default route through %s with metric %d", -- rt.rt_dev, dfl_route_metric); -- return 0; -+ old_def_rt.rt_dev, dfl_route_metric); - } - - memset (&rt, 0, sizeof (rt)); -@@ -1678,10 +1715,16 @@ int sifdefaultroute (int unit, u_int32_t - - rt.rt_flags = RTF_UP; - if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) { -- if ( ! ok_error ( errno )) -+ if (!ok_error(errno)) - error("default route ioctl(SIOCADDRT): %m"); - return 0; - } -+ if (default_rt_repl_rest && del_rt) -+ if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) { -+ if (!ok_error(errno)) -+ error("del old default route ioctl(SIOCDELRT): %m"); -+ return 0; -+ } - - have_default_route = 1; - return 1; -@@ -1715,11 +1758,21 @@ int cifdefaultroute (int unit, u_int32_t - rt.rt_flags = RTF_UP; - if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) { - if (still_ppp()) { -- if ( ! ok_error ( errno )) -+ if (!ok_error(errno)) - error("default route ioctl(SIOCDELRT): %m"); - return 0; - } - } -+ if (default_rt_repl_rest) { -+ notice("restoring old default route to %s [%I]", -+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway)); -+ if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) { -+ if (!ok_error(errno)) -+ error("restore default route ioctl(SIOCADDRT): %m"); -+ return 0; -+ } -+ default_rt_repl_rest = 0; -+ } - - return 1; - } ---- a/pppd/sys-solaris.c -+++ b/pppd/sys-solaris.c -@@ -2120,12 +2120,18 @@ cifaddr(u, o, h) - * sifdefaultroute - assign a default route through the address given. - */ - int --sifdefaultroute(u, l, g) -+sifdefaultroute(u, l, g, replace) - int u; - u_int32_t l, g; -+ bool replace; - { - struct rtentry rt; - -+ if (replace) { -+ error("replacedefaultroute not supported on this platform"); -+ return 0; -+ } -+ - #if defined(__USLC__) - g = l; /* use the local address as gateway */ - #endif diff --git a/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch b/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch index a1110caecb..11e8d81f43 100644 --- a/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch +++ b/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -308,6 +308,8 @@ main(argc, argv) +@@ -295,6 +295,8 @@ main(int argc, char *argv[]) strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup)); strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown)); @@ -23,16 +23,16 @@ Signed-off-by: Jo-Philipp Wich new_phase(PHASE_INITIALIZE); --- a/pppd/options.c +++ b/pppd/options.c -@@ -119,6 +119,8 @@ int req_unit = -1; /* requested interfa - char req_ifname[MAXIFNAMELEN]; /* requested interface name */ +@@ -118,6 +118,8 @@ int req_unit = -1; /* requested interfa char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ + char req_ifname[MAXIFNAMELEN]; /* requested interface name */ +char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ +char path_ipv6down[MAXPATHLEN];/* pathname of ipv6-down script */ bool multilink = 0; /* Enable multilink operation */ char *bundle_name = NULL; /* bundle name for multilink */ bool dump_options; /* print out option values */ -@@ -325,6 +327,13 @@ option_t general_options[] = { +@@ -324,6 +326,13 @@ option_t general_options[] = { "Set pathname of ip-down script", OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, @@ -48,7 +48,7 @@ Signed-off-by: Jo-Philipp Wich "Enable multilink operation", OPT_PRIO | 1 }, --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c -@@ -1300,7 +1300,7 @@ ipv6cp_up(f) +@@ -1295,7 +1295,7 @@ ipv6cp_up(fsm *f) */ if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { ipv6cp_script_state = s_up; @@ -57,7 +57,7 @@ Signed-off-by: Jo-Philipp Wich } } -@@ -1352,7 +1352,7 @@ ipv6cp_down(f) +@@ -1346,7 +1346,7 @@ ipv6cp_down(fsm *f) /* Execute the ipv6-down script */ if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { ipv6cp_script_state = s_down; @@ -66,7 +66,7 @@ Signed-off-by: Jo-Philipp Wich } } -@@ -1395,13 +1395,13 @@ ipv6cp_script_done(arg) +@@ -1384,13 +1384,13 @@ ipv6cp_script_done(void *arg) case s_up: if (ipv6cp_fsm[0].state != OPENED) { ipv6cp_script_state = s_down; @@ -84,10 +84,10 @@ Signed-off-by: Jo-Philipp Wich } --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -337,6 +337,8 @@ extern int req_unit; /* interface unit n - extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ +@@ -328,6 +328,8 @@ extern int req_unit; /* interface unit n extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ + extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ +extern char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ +extern char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */ extern bool multilink; /* enable multilink operation */ diff --git a/package/network/services/ppp/patches/140-pppoe_compile_fix.patch b/package/network/services/ppp/patches/140-pppoe_compile_fix.patch deleted file mode 100644 index 2253d4f3c1..0000000000 --- a/package/network/services/ppp/patches/140-pppoe_compile_fix.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/pppd/plugins/rp-pppoe/pppoe.h -+++ b/pppd/plugins/rp-pppoe/pppoe.h -@@ -48,11 +48,7 @@ - #include - - /* Ugly header files on some Linux boxes... */ --#if defined(HAVE_LINUX_IF_H) --#include --#elif defined(HAVE_NET_IF_H) - #include --#endif - - #ifdef HAVE_NET_IF_TYPES_H - #include -@@ -80,20 +76,7 @@ typedef unsigned long UINT32_t; - #error Could not find a 32-bit integer type - #endif - --#ifdef HAVE_LINUX_IF_ETHER_H --#include --#endif -- --#ifdef HAVE_NETINET_IF_ETHER_H --#include -- --#ifdef HAVE_SYS_SOCKET_H --#include --#endif --#ifndef HAVE_SYS_DLPI_H --#include --#endif --#endif -+#include - - - /* Ethernet frame types according to RFC 2516 */ diff --git a/package/network/services/ppp/patches/200-makefile.patch b/package/network/services/ppp/patches/200-makefile.patch index 42351392dc..d0b9a9a99b 100644 --- a/package/network/services/ppp/patches/200-makefile.patch +++ b/package/network/services/ppp/patches/200-makefile.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -48,7 +48,7 @@ MPPE=y +@@ -49,7 +49,7 @@ MPPE=y # Uncomment the next line to include support for PPP packet filtering. # This requires that the libpcap library and headers be installed # and that the kernel driver support PPP packet filtering. @@ -16,7 +16,7 @@ Signed-off-by: Jo-Philipp Wich # Uncomment the next line to enable multilink PPP (enabled by default) # Linux distributions: Please leave multilink ENABLED in your builds -@@ -58,7 +58,7 @@ HAVE_MULTILINK=y +@@ -59,7 +59,7 @@ HAVE_MULTILINK=y # Uncomment the next line to enable the TDB database (enabled by default.) # If you enable multilink, then TDB is automatically enabled also. # Linux distributions: Please leave TDB ENABLED in your builds. @@ -25,21 +25,28 @@ Signed-off-by: Jo-Philipp Wich # Uncomment the next line to enable Type=notify services in systemd # If enabled, and the user sets the up_sdnotify option, then -@@ -85,7 +85,7 @@ MAXOCTETS=y +@@ -85,13 +85,13 @@ USE_LIBUTIL=y + endif + + # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto) +-USE_EAPTLS=y ++#USE_EAPTLS=y + + MAXOCTETS=y INCLUDE_DIRS= -I../include --COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -+COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP +-COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe ++COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP -pipe CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' -@@ -126,10 +126,10 @@ CFLAGS += -DHAS_SHADOW +@@ -143,10 +143,10 @@ CFLAGS += -DHAS_SHADOW #LIBS += -lshadow $(LIBS) endif --ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),) -+#ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),) +-ifeq ($(shell echo '\#include ' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes) ++#ifeq ($(shell echo '\#include ' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes) CFLAGS += -DHAVE_CRYPT_H=1 LIBS += -lcrypt -endif diff --git a/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch b/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch index 9345c10400..3c30517e42 100644 --- a/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch +++ b/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch @@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich */ --- a/pppd/ccp.c +++ b/pppd/ccp.c -@@ -61,12 +61,10 @@ static int setdeflate __P((char **)); +@@ -61,12 +61,10 @@ static int setdeflate (char **); static char bsd_value[8]; static char deflate_value[8]; @@ -197,7 +197,7 @@ Signed-off-by: Jo-Philipp Wich /* * Local state (mainly for handling reset-reqs and reset-acks). -@@ -343,6 +323,100 @@ setdeflate(argv) +@@ -341,6 +321,100 @@ setdeflate(char **argv) return 1; } @@ -298,7 +298,7 @@ Signed-off-by: Jo-Philipp Wich /* * ccp_init - initialize CCP. */ -@@ -377,6 +451,30 @@ ccp_init(unit) +@@ -374,6 +448,30 @@ ccp_init(int unit) ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS; ccp_allowoptions[0].predictor_1 = 1; @@ -329,7 +329,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -454,11 +552,11 @@ ccp_input(unit, p, len) +@@ -443,11 +541,11 @@ ccp_input(int unit, u_char *p, int len) if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) { notice("Compression disabled by peer."); #ifdef MPPE @@ -343,7 +343,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -486,6 +584,15 @@ ccp_extcode(f, code, id, p, len) +@@ -471,6 +569,15 @@ ccp_extcode(fsm *f, int code, int id, u_ break; /* send a reset-ack, which the transmitter will see and reset its compression state. */ @@ -359,7 +359,7 @@ Signed-off-by: Jo-Philipp Wich fsm_sdata(f, CCP_RESETACK, id, NULL, 0); break; -@@ -514,12 +621,11 @@ ccp_protrej(unit) +@@ -498,12 +605,11 @@ ccp_protrej(int unit) fsm_lowerdown(&ccp_fsm[unit]); #ifdef MPPE @@ -374,7 +374,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -536,7 +642,7 @@ ccp_resetci(f) +@@ -519,7 +625,7 @@ ccp_resetci(fsm *f) all_rejected[f->unit] = 0; #ifdef MPPE @@ -382,11 +382,27 @@ Signed-off-by: Jo-Philipp Wich + if (go->mppe || go->mppc) { ccp_options *ao = &ccp_allowoptions[f->unit]; int auth_mschap_bits = auth_done[f->unit]; - int numbits; -@@ -550,80 +656,109 @@ ccp_resetci(f) + #ifdef USE_EAPTLS +@@ -536,95 +642,124 @@ ccp_resetci(fsm *f) * NB: If MPPE is required, all other compression opts are invalid. * So, we return right away if we can't do it. */ +- +- /* Leave only the mschap auth bits set */ +- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | +- CHAP_MS2_WITHPEER | CHAP_MS2_PEER); +- /* Count the mschap auths */ +- auth_mschap_bits >>= CHAP_MS_SHIFT; +- numbits = 0; +- do { +- numbits += auth_mschap_bits & 1; +- auth_mschap_bits >>= 1; +- } while (auth_mschap_bits); +- if (numbits > 1) { +- error("MPPE required, but auth done in both directions."); +- lcp_close(f->unit, "MPPE required but not available"); +- return; +- } + if (ccp_wantoptions[f->unit].mppe) { + /* Leave only the mschap auth bits set */ + auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | @@ -403,33 +419,42 @@ Signed-off-by: Jo-Philipp Wich + lcp_close(f->unit, "MPPE required but not available"); + return; + } + + #ifdef USE_EAPTLS +- /* +- * MPPE is also possible in combination with EAP-TLS. +- * It is not possible to detect if we're doing EAP or EAP-TLS +- * at this stage, hence we accept all forms of EAP. If TLS is +- * not used then the MPPE keys will not be derived anyway. +- */ +- /* Leave only the eap auth bits set */ +- auth_eap_bits &= (EAP_WITHPEER | EAP_PEER ); ++ /* ++ * MPPE is also possible in combination with EAP-TLS. ++ * It is not possible to detect if we're doing EAP or EAP-TLS ++ * at this stage, hence we accept all forms of EAP. If TLS is ++ * not used then the MPPE keys will not be derived anyway. ++ */ ++ /* Leave only the eap auth bits set */ ++ auth_eap_bits &= (EAP_WITHPEER | EAP_PEER ); + +- if ((numbits == 0) && (auth_eap_bits == 0)) { +- error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed."); ++ if ((numbits == 0) && (auth_eap_bits == 0)) { ++ error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed."); + #else +- if (!numbits) { +- error("MPPE required, but MS-CHAP[v2] auth not performed."); + if (!numbits) { + error("MPPE required, but MS-CHAP[v2] auth not performed."); + #endif +- lcp_close(f->unit, "MPPE required but not available"); +- return; +- } + lcp_close(f->unit, "MPPE required but not available"); + return; + } -- /* Leave only the mschap auth bits set */ -- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | -- CHAP_MS2_WITHPEER | CHAP_MS2_PEER); -- /* Count the mschap auths */ -- auth_mschap_bits >>= CHAP_MS_SHIFT; -- numbits = 0; -- do { -- numbits += auth_mschap_bits & 1; -- auth_mschap_bits >>= 1; -- } while (auth_mschap_bits); -- if (numbits > 1) { -- error("MPPE required, but auth done in both directions."); -- lcp_close(f->unit, "MPPE required but not available"); -- return; -- } -- if (!numbits) { -- error("MPPE required, but MS-CHAP[v2] auth not performed."); -- lcp_close(f->unit, "MPPE required but not available"); -- return; -- } -- - /* A plugin (eg radius) may not have obtained key material. */ - if (!mppe_keys_set) { - error("MPPE required, but keys are not available. " @@ -559,7 +584,7 @@ Signed-off-by: Jo-Philipp Wich if (go->bsd_compress) { opt_buf[0] = CI_BSD_COMPRESS; opt_buf[1] = CILEN_BSD_COMPRESS; -@@ -679,7 +814,8 @@ ccp_cilen(f) +@@ -679,7 +814,8 @@ static int + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) + (go->predictor_1? CILEN_PREDICTOR_1: 0) + (go->predictor_2? CILEN_PREDICTOR_2: 0) @@ -569,7 +594,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -693,6 +829,8 @@ ccp_addci(f, p, lenp) +@@ -690,6 +826,8 @@ static void { int res; ccp_options *go = &ccp_gotoptions[f->unit]; @@ -578,7 +603,7 @@ Signed-off-by: Jo-Philipp Wich u_char *p0 = p; /* -@@ -701,22 +839,43 @@ ccp_addci(f, p, lenp) +@@ -698,22 +836,43 @@ static void * in case it gets Acked. */ #ifdef MPPE @@ -631,7 +656,7 @@ Signed-off-by: Jo-Philipp Wich if (go->deflate) { p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT; p[1] = CILEN_DEFLATE; -@@ -802,7 +961,7 @@ ccp_addci(f, p, lenp) +@@ -799,30 +958,50 @@ static void /* * ccp_ackci - process a received configure-ack, and return @@ -639,9 +664,7 @@ Signed-off-by: Jo-Philipp Wich + * 1 if the packet was OK. */ static int - ccp_ackci(f, p, len) -@@ -811,24 +970,44 @@ ccp_ackci(f, p, len) - int len; + ccp_ackci(fsm *f, u_char *p, int len) { ccp_options *go = &ccp_gotoptions[f->unit]; + ccp_options *ao = &ccp_allowoptions[f->unit]; @@ -694,8 +717,8 @@ Signed-off-by: Jo-Philipp Wich if (go->deflate) { if (len < CILEN_DEFLATE || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) -@@ -901,6 +1080,8 @@ ccp_nakci(f, p, len, treat_as_reject) - int treat_as_reject; +@@ -891,6 +1070,8 @@ static int + ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ccp_options *go = &ccp_gotoptions[f->unit]; + ccp_options *ao = &ccp_allowoptions[f->unit]; @@ -703,7 +726,7 @@ Signed-off-by: Jo-Philipp Wich ccp_options no; /* options we've seen already */ ccp_options try; /* options to ask for next time */ -@@ -908,28 +1089,100 @@ ccp_nakci(f, p, len, treat_as_reject) +@@ -898,28 +1079,100 @@ static int try = *go; #ifdef MPPE @@ -822,7 +845,7 @@ Signed-off-by: Jo-Philipp Wich if (go->deflate && len >= CILEN_DEFLATE && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) && p[1] == CILEN_DEFLATE) { -@@ -1002,14 +1255,50 @@ ccp_rejci(f, p, len) +@@ -989,14 +1242,50 @@ ccp_rejci(fsm *f, u_char *p, int len) return -1; #ifdef MPPE @@ -877,8 +900,8 @@ Signed-off-by: Jo-Philipp Wich if (go->deflate_correct && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) -@@ -1073,14 +1362,15 @@ ccp_reqci(f, p, lenp, dont_nak) - int dont_nak; +@@ -1056,14 +1345,15 @@ static int + ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { int ret, newret, res; - u_char *p0, *retp; @@ -897,7 +920,7 @@ Signed-off-by: Jo-Philipp Wich ret = CONFACK; retp = p0 = p; -@@ -1103,106 +1393,302 @@ ccp_reqci(f, p, lenp, dont_nak) +@@ -1086,106 +1376,302 @@ ccp_reqci(fsm *f, u_char *p, int *lenp, switch (type) { #ifdef MPPE case CI_MPPE: @@ -910,10 +933,6 @@ Signed-off-by: Jo-Philipp Wich - - /* Nak if anything unsupported or unknown are set. */ - if (ho->mppe & MPPE_OPT_UNSUPPORTED) { -- newret = CONFNAK; -- ho->mppe &= ~MPPE_OPT_UNSUPPORTED; -- } -- if (ho->mppe & MPPE_OPT_UNKNOWN) { + p2 = p[2]; + p5 = p[5]; + /* not sure what they want, tell 'em what we got */ @@ -922,6 +941,10 @@ Signed-off-by: Jo-Philipp Wich + MPPE_MPPC)) != 0 || p[5] == 0) || + (p[2] == 0 && p[3] == 0 && p[4] == 0 && p[5] == 0)) { newret = CONFNAK; +- ho->mppe &= ~MPPE_OPT_UNSUPPORTED; +- } +- if (ho->mppe & MPPE_OPT_UNKNOWN) { +- newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNKNOWN; - } - @@ -1293,7 +1316,7 @@ Signed-off-by: Jo-Philipp Wich case CI_DEFLATE: case CI_DEFLATE_DRAFT: if (!ao->deflate || clen != CILEN_DEFLATE -@@ -1344,12 +1830,6 @@ ccp_reqci(f, p, lenp, dont_nak) +@@ -1327,12 +1813,6 @@ ccp_reqci(fsm *f, u_char *p, int *lenp, else *lenp = retp - p0; } @@ -1306,7 +1329,7 @@ Signed-off-by: Jo-Philipp Wich return ret; } -@@ -1371,24 +1851,35 @@ method_name(opt, opt2) +@@ -1353,24 +1833,35 @@ method_name(ccp_options *opt, ccp_option char *p = result; char *q = result + sizeof(result); /* 1 past result */ @@ -1358,7 +1381,7 @@ Signed-off-by: Jo-Philipp Wich case CI_DEFLATE: case CI_DEFLATE_DRAFT: if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) -@@ -1444,12 +1935,12 @@ ccp_up(f) +@@ -1425,12 +1916,12 @@ ccp_up(fsm *f) } else if (ANY_COMPRESS(*ho)) notice("%s transmit compression enabled", method_name(ho, NULL)); #ifdef MPPE @@ -1373,7 +1396,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -1472,7 +1963,7 @@ ccp_down(f) +@@ -1452,7 +1943,7 @@ ccp_down(fsm *f) lcp_close(f->unit, "MPPE disabled"); } } @@ -1382,7 +1405,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -1532,24 +2023,28 @@ ccp_printpkt(p, plen, printer, arg) +@@ -1509,24 +2000,28 @@ ccp_printpkt(u_char *p, int plen, #ifdef MPPE case CI_MPPE: if (optlen >= CILEN_MPPE) { @@ -1423,7 +1446,7 @@ Signed-off-by: Jo-Philipp Wich case CI_DEFLATE: case CI_DEFLATE_DRAFT: if (optlen >= CILEN_DEFLATE) { -@@ -1635,6 +2130,7 @@ ccp_datainput(unit, pkt, len) +@@ -1609,6 +2104,7 @@ ccp_datainput(int unit, u_char *pkt, int error("Lost compression sync: disabling compression"); ccp_close(unit, "Lost compression sync"); #ifdef MPPE @@ -1431,7 +1454,7 @@ Signed-off-by: Jo-Philipp Wich /* * If we were doing MPPE, we must also take the link down. */ -@@ -1642,9 +2138,18 @@ ccp_datainput(unit, pkt, len) +@@ -1616,9 +2112,18 @@ ccp_datainput(int unit, u_char *pkt, int error("Too many MPPE errors, closing LCP"); lcp_close(unit, "Too many MPPE errors"); } diff --git a/package/network/services/ppp/patches/202-no_strip.patch b/package/network/services/ppp/patches/202-no_strip.patch deleted file mode 100644 index 0af7b2b2ab..0000000000 --- a/package/network/services/ppp/patches/202-no_strip.patch +++ /dev/null @@ -1,88 +0,0 @@ -build: Do not strip binaries on install - -Strippign executables should be handled by the distro packaging, not by ppp -itself. This patch removes the "-s" (strip) switch from all "install" commands -in order to install unstripped binaries into the destination prefix. - -Signed-off-by: Jo-Philipp Wich - ---- a/chat/Makefile.linux -+++ b/chat/Makefile.linux -@@ -25,7 +25,7 @@ chat.o: chat.c - - install: chat - mkdir -p $(BINDIR) $(MANDIR) -- $(INSTALL) -s -c chat $(BINDIR) -+ $(INSTALL) -c chat $(BINDIR) - $(INSTALL) -c -m 644 chat.8 $(MANDIR) - - clean: ---- a/pppd/Makefile.linux -+++ b/pppd/Makefile.linux -@@ -108,7 +108,7 @@ ifdef USE_SRP - CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include - LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto - TARGETS += srp-entry --EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry -+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry - MANPAGES += srp-entry.8 - EXTRACLEAN += srp-entry.o - NEEDDES=y -@@ -220,7 +220,7 @@ all: $(TARGETS) - install: pppd - mkdir -p $(BINDIR) $(MANDIR) - $(EXTRAINSTALL) -- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd -+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd - if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \ - chmod o-rx,u+s $(BINDIR)/pppd; fi - $(INSTALL) -c -m 444 pppd.8 $(MANDIR) ---- a/pppd/plugins/radius/Makefile.linux -+++ b/pppd/plugins/radius/Makefile.linux -@@ -36,9 +36,9 @@ all: $(PLUGIN) - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR) -- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR) -- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radius.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR) - $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR) - $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR) - ---- a/pppd/plugins/rp-pppoe/Makefile.linux -+++ b/pppd/plugins/rp-pppoe/Makefile.linux -@@ -43,9 +43,9 @@ rp-pppoe.so: plugin.o discovery.o if.o c - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR) -+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR) - $(INSTALL) -d -m 755 $(BINDIR) -- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR) -+ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR) - - clean: - rm -f *.o *.so pppoe-discovery ---- a/pppdump/Makefile.linux -+++ b/pppdump/Makefile.linux -@@ -17,5 +17,5 @@ clean: - - install: - mkdir -p $(BINDIR) $(MANDIR) -- $(INSTALL) -s -c pppdump $(BINDIR) -+ $(INSTALL) -c pppdump $(BINDIR) - $(INSTALL) -c -m 444 pppdump.8 $(MANDIR) ---- a/pppstats/Makefile.linux -+++ b/pppstats/Makefile.linux -@@ -22,7 +22,7 @@ all: pppstats - - install: pppstats - -mkdir -p $(MANDIR) -- $(INSTALL) -s -c pppstats $(BINDIR) -+ $(INSTALL) -c pppstats $(BINDIR) - $(INSTALL) -c -m 444 pppstats.8 $(MANDIR) - - pppstats: $(PPPSTATSRCS) diff --git a/package/network/services/ppp/patches/203-opt_flags.patch b/package/network/services/ppp/patches/203-opt_flags.patch index 8dfacf3834..705959e7ba 100644 --- a/package/network/services/ppp/patches/203-opt_flags.patch +++ b/package/network/services/ppp/patches/203-opt_flags.patch @@ -8,17 +8,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/plugins/radius/Makefile.linux +++ b/pppd/plugins/radius/Makefile.linux -@@ -12,7 +12,8 @@ VERSION = $(shell awk -F '"' '/VERSION/ - INSTALL = install - - PLUGIN=radius.so radattr.so radrealms.so --CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON -+COPTS = -O2 -+CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON - - # Uncomment the next line to include support for Microsoft's - # MS-CHAP authentication protocol. -@@ -43,13 +44,13 @@ install: all +@@ -47,13 +47,13 @@ install: all $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR) radius.so: radius.o libradiusclient.a @@ -35,26 +25,14 @@ Signed-off-by: Jo-Philipp Wich CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \ clientid.o sendserver.o lock.o util.o md5.o ---- a/pppdump/Makefile.linux -+++ b/pppdump/Makefile.linux -@@ -2,7 +2,8 @@ DESTDIR = $(INSTROOT)@DESTDIR@ - BINDIR = $(DESTDIR)/sbin - MANDIR = $(DESTDIR)/share/man/man8 - --CFLAGS= -O -I../include/net -+COPTS = -O -+CFLAGS= $(COPTS) -I../include/net - OBJS = pppdump.o bsd-comp.o deflate.o zlib.o - - INSTALL= install ---- a/pppd/plugins/rp-pppoe/Makefile.linux -+++ b/pppd/plugins/rp-pppoe/Makefile.linux -@@ -39,7 +39,7 @@ debug.o: debug.c +--- a/pppd/plugins/pppoe/Makefile.linux ++++ b/pppd/plugins/pppoe/Makefile.linux +@@ -38,7 +38,7 @@ debug.o: debug.c $(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c - rp-pppoe.so: plugin.o discovery.o if.o common.o -- $(CC) $(LDFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o -+ $(CC) $(LDFLAGS) -fPIC -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o + pppoe.so: plugin.o discovery.o if.o common.o +- $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o ++ $(CC) $(LDFLAGS) -fPIC -o pppoe.so -shared plugin.o discovery.o if.o common.o install: all $(INSTALL) -d -m 755 $(LIBDIR) diff --git a/package/network/services/ppp/patches/205-no_exponential_timeout.patch b/package/network/services/ppp/patches/205-no_exponential_timeout.patch index 7f752e3137..b08c2eff89 100644 --- a/package/network/services/ppp/patches/205-no_exponential_timeout.patch +++ b/package/network/services/ppp/patches/205-no_exponential_timeout.patch @@ -5,8 +5,8 @@ discovery attempts. Signed-off-by: Jo-Philipp Wich ---- a/pppd/plugins/rp-pppoe/discovery.c -+++ b/pppd/plugins/rp-pppoe/discovery.c +--- a/pppd/plugins/pppoe/discovery.c ++++ b/pppd/plugins/pppoe/discovery.c @@ -632,7 +632,9 @@ discovery(PPPoEConnection *conn) conn->discoveryState = STATE_SENT_PADI; waitForPADO(conn, timeout); diff --git a/package/network/services/ppp/patches/207-lcp_mtu_max.patch b/package/network/services/ppp/patches/207-lcp_mtu_max.patch index 7aa8d4e129..522576c627 100644 --- a/package/network/services/ppp/patches/207-lcp_mtu_max.patch +++ b/package/network/services/ppp/patches/207-lcp_mtu_max.patch @@ -8,7 +8,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/lcp.c +++ b/pppd/lcp.c -@@ -1916,12 +1916,12 @@ lcp_up(f) +@@ -1862,12 +1862,12 @@ lcp_up(fsm *f) * the interface MTU is set to the lowest of that, the * MTU we want to use, and our link MRU. */ diff --git a/package/network/services/ppp/patches/208-fix_status_code.patch b/package/network/services/ppp/patches/208-fix_status_code.patch index f1a12006a5..54e6c45e14 100644 --- a/package/network/services/ppp/patches/208-fix_status_code.patch +++ b/package/network/services/ppp/patches/208-fix_status_code.patch @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -1052,7 +1052,8 @@ get_input() +@@ -1034,7 +1034,8 @@ get_input(void) } notice("Modem hangup"); hungup = 1; diff --git a/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch b/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch index 40866132e8..87e340b3f1 100644 --- a/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch +++ b/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch @@ -7,14 +7,14 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -190,8 +190,8 @@ endif +@@ -210,8 +210,8 @@ LIBS += -ldl + endif ifdef FILTER - ifneq ($(wildcard /usr/include/pcap-bpf.h),) -LIBS += -lpcap -CFLAGS += -DPPP_FILTER +LIBS += -lpcap -L$(STAGING_DIR)/usr/lib +CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include endif - endif + ifdef HAVE_INET6 diff --git a/package/network/services/ppp/patches/310-precompile_filter.patch b/package/network/services/ppp/patches/310-precompile_filter.patch index ec61104423..ca91d153e9 100644 --- a/package/network/services/ppp/patches/310-precompile_filter.patch +++ b/package/network/services/ppp/patches/310-precompile_filter.patch @@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -50,6 +50,9 @@ MPPE=y +@@ -51,6 +51,9 @@ MPPE=y # and that the kernel driver support PPP packet filtering. #FILTER=y @@ -23,8 +23,8 @@ Signed-off-by: Jo-Philipp Wich # Uncomment the next line to enable multilink PPP (enabled by default) # Linux distributions: Please leave multilink ENABLED in your builds # of pppd! -@@ -195,6 +198,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR) - endif +@@ -214,6 +217,14 @@ LIBS += -lpcap -L$(STAGING_DIR)/usr/l + CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include endif +ifdef PRECOMPILED_FILTER @@ -40,7 +40,7 @@ Signed-off-by: Jo-Philipp Wich HEADERS += ipv6cp.h eui64.h --- a/pppd/options.c +++ b/pppd/options.c -@@ -57,6 +57,7 @@ +@@ -56,6 +56,7 @@ #ifdef PPP_FILTER #include @@ -48,21 +48,21 @@ Signed-off-by: Jo-Philipp Wich /* * There have been 3 or 4 different names for this in libpcap CVS, but * this seems to be what they have settled on... -@@ -169,6 +170,13 @@ static int setlogfile __P((char **)); - static int loadplugin __P((char **)); +@@ -168,6 +169,13 @@ static int setlogfile(char **); + static int loadplugin(char **); #endif +#ifdef PPP_PRECOMPILED_FILTER +#include "pcap_pcc.h" -+static int setprecompiledpassfilter __P((char **)); -+static int setprecompiledactivefilter __P((char **)); ++static int setprecompiledpassfilter(char **); ++static int setprecompiledactivefilter(char **); +#undef PPP_FILTER +#endif + #ifdef PPP_FILTER - static int setpassfilter __P((char **)); - static int setactivefilter __P((char **)); -@@ -361,6 +369,14 @@ option_t general_options[] = { + static int setpassfilter(char **); + static int setactivefilter(char **); +@@ -360,6 +368,14 @@ option_t general_options[] = { "set filter for active pkts", OPT_PRIO }, #endif @@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich #ifdef MAXOCTETS { "maxoctets", o_int, &maxoctets, "Set connection traffic limit", -@@ -1516,6 +1532,29 @@ callfile(argv) +@@ -1468,6 +1484,27 @@ callfile(char **argv) return ok; } @@ -87,8 +87,7 @@ Signed-off-by: Jo-Philipp Wich + * precompiled expression + */ +static int -+setprecompiledpassfilter(argv) -+ char **argv; ++setprecompiledpassfilter(char **argv) +{ + return pcap_pre_compiled (*argv, &pass_filter); +} @@ -97,8 +96,7 @@ Signed-off-by: Jo-Philipp Wich + * setactivefilter - Set the active filter for packets + */ +static int -+setprecompiledactivefilter(argv) -+ char **argv; ++setprecompiledactivefilter(char **argv) +{ + return pcap_pre_compiled (*argv, &active_filter); +} diff --git a/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch b/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch index 75c803650f..0c4d7ea9d6 100644 --- a/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch +++ b/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch @@ -16,17 +16,17 @@ Signed-off-by: George Kashperko #include "pppd.h" #include "fsm.h" -@@ -56,7 +57,8 @@ static void iterate_bundle_links __P((vo +@@ -56,7 +57,8 @@ static void iterate_bundle_links(void (* - static int get_default_epdisc __P((struct epdisc *)); - static int parse_num __P((char *str, const char *key, int *valp)); --static int owns_unit __P((TDB_DATA pid, int unit)); -+static int parse_str __P((char *str, const char *key, char *buf, int buflen)); -+static int owns_link __P((TDB_DATA pid, char *ifname)); + static int get_default_epdisc(struct epdisc *); + static int parse_num(char *str, const char *key, int *valp); +-static int owns_unit(TDB_DATA pid, int unit); ++static int parse_str(char *str, const char *key, char *buf, int buflen); ++static int owns_link(TDB_DATA pid, char *ifname); #define set_ip_epdisc(ep, addr) do { \ ep->length = 4; \ -@@ -197,35 +199,38 @@ mp_join_bundle() +@@ -197,35 +199,38 @@ mp_join_bundle(void) key.dptr = bundle_id; key.dsize = p - bundle_id; pid = tdb_fetch(pppdb, key); @@ -73,16 +73,12 @@ Signed-off-by: George Kashperko } /* we have to make a new bundle */ -@@ -408,22 +413,45 @@ parse_num(str, key, valp) +@@ -405,20 +410,39 @@ parse_num(char *str, const char *key, in return 0; } +static int -+parse_str(str, key, buf, buflen) -+ char *str; -+ const char *key; -+ char *buf; -+ int buflen; ++parse_str(char *str, const char *key, char *buf, int buflen) +{ + char *p, *endp; + int i; @@ -103,11 +99,8 @@ Signed-off-by: George Kashperko + * Check whether the pppd identified by `key' still owns ppp link `ifname'. */ static int --owns_unit(key, unit) -+owns_link(key, ifname) - TDB_DATA key; -- int unit; -+ char *ifname; +-owns_unit(TDB_DATA key, int unit) ++owns_link(TDB_DATA key, char *ifname) { - char ifkey[32]; + char ifkey[7 + IFNAMSIZ]; @@ -126,7 +119,7 @@ Signed-off-by: George Kashperko && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -700,6 +700,16 @@ void cfg_bundle(int mrru, int mtru, int +@@ -706,6 +706,16 @@ void cfg_bundle(int mrru, int mtru, int add_fd(ppp_dev_fd); } @@ -143,7 +136,7 @@ Signed-off-by: George Kashperko /* * make_new_bundle - create a new PPP unit (i.e. a bundle) * and connect our channel to it. This should only get called -@@ -718,6 +728,8 @@ void make_new_bundle(int mrru, int mtru, +@@ -724,6 +734,8 @@ void make_new_bundle(int mrru, int mtru, /* set the mrru and flags */ cfg_bundle(mrru, mtru, rssn, tssn); diff --git a/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch b/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch index 6c0849cc6c..6ccc4507b2 100644 --- a/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch +++ b/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -1767,6 +1767,7 @@ int cifdefaultroute (int unit, u_int32_t +@@ -1770,6 +1770,7 @@ int cifdefaultroute (int unit, u_int32_t SIN_ADDR(rt.rt_genmask) = 0L; } diff --git a/package/network/services/ppp/patches/340-populate_default_gateway.patch b/package/network/services/ppp/patches/340-populate_default_gateway.patch index ae385dfc9b..0f965c705d 100644 --- a/package/network/services/ppp/patches/340-populate_default_gateway.patch +++ b/package/network/services/ppp/patches/340-populate_default_gateway.patch @@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -1717,6 +1717,9 @@ int sifdefaultroute (int unit, u_int32_t +@@ -1720,6 +1720,9 @@ int sifdefaultroute (int unit, u_int32_t memset (&rt, 0, sizeof (rt)); SET_SA_FAMILY (rt.rt_dst, AF_INET); @@ -23,12 +23,12 @@ Signed-off-by: Jo-Philipp Wich rt.rt_dev = ifname; rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */ -@@ -1725,7 +1728,7 @@ int sifdefaultroute (int unit, u_int32_t +@@ -1728,7 +1731,7 @@ int sifdefaultroute (int unit, u_int32_t SIN_ADDR(rt.rt_genmask) = 0L; } - rt.rt_flags = RTF_UP; + rt.rt_flags = RTF_UP | RTF_GATEWAY; if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) { - if (!ok_error(errno)) + if ( ! ok_error ( errno )) error("default route ioctl(SIOCADDRT): %m"); diff --git a/package/network/services/ppp/patches/400-simplify_kernel_checks.patch b/package/network/services/ppp/patches/400-simplify_kernel_checks.patch index 0754f8f4d6..3c72048362 100644 --- a/package/network/services/ppp/patches/400-simplify_kernel_checks.patch +++ b/package/network/services/ppp/patches/400-simplify_kernel_checks.patch @@ -10,7 +10,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -200,7 +200,7 @@ static int driver_is_old = 0; +@@ -206,7 +206,7 @@ static int driver_is_old = 0; static int restore_term = 0; /* 1 => we've munged the terminal */ static struct termios inittermios; /* Initial TTY termios */ @@ -19,7 +19,7 @@ Signed-off-by: Jo-Philipp Wich static char loop_name[20]; static unsigned char inbuf[512]; /* buffer for chars read from loopback */ -@@ -219,8 +219,8 @@ static int looped; /* 1 if using loop +@@ -225,8 +225,8 @@ static int looped; /* 1 if using loop static int link_mtu; /* mtu for the link (not bundle) */ static struct utsname utsname; /* for the kernel version */ @@ -29,7 +29,7 @@ Signed-off-by: Jo-Philipp Wich #define MAX_IFS 100 -@@ -1453,11 +1453,12 @@ int ccp_fatal_error (int unit) +@@ -1455,11 +1455,12 @@ int ccp_fatal_error (int unit) * * path_to_procfs - find the path to the proc file system mount point */ @@ -44,7 +44,7 @@ Signed-off-by: Jo-Philipp Wich struct mntent *mntent; FILE *fp; -@@ -1479,6 +1480,7 @@ static char *path_to_procfs(const char * +@@ -1481,6 +1482,7 @@ static char *path_to_procfs(const char * fclose (fp); } } @@ -52,7 +52,7 @@ Signed-off-by: Jo-Philipp Wich strlcpy(proc_path + proc_path_len, tail, sizeof(proc_path) - proc_path_len); -@@ -2332,15 +2334,19 @@ int ppp_available(void) +@@ -2365,15 +2367,19 @@ int ppp_available(void) int my_version, my_modification, my_patch; int osmaj, osmin, ospatch; @@ -72,7 +72,7 @@ Signed-off-by: Jo-Philipp Wich /* XXX should get from driver */ driver_version = 2; -@@ -2400,6 +2406,7 @@ int ppp_available(void) +@@ -2433,6 +2439,7 @@ int ppp_available(void) if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP)) ok = 0; @@ -80,7 +80,7 @@ Signed-off-by: Jo-Philipp Wich /* * This is the PPP device. Validate the version of the driver at this -@@ -2936,6 +2943,7 @@ get_pty(master_fdp, slave_fdp, slave_nam +@@ -3106,6 +3113,7 @@ get_pty(int *master_fdp, int *slave_fdp, } #endif /* TIOCGPTN */ @@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich if (sfd < 0) { /* the old way - scan through the pty name space */ for (i = 0; i < 64; ++i) { -@@ -2954,6 +2962,7 @@ get_pty(master_fdp, slave_fdp, slave_nam +@@ -3124,6 +3132,7 @@ get_pty(int *master_fdp, int *slave_fdp, } } } @@ -98,11 +98,11 @@ Signed-off-by: Jo-Philipp Wich return 0; --- a/pppd/plugins/pppoatm/pppoatm.c +++ b/pppd/plugins/pppoatm/pppoatm.c -@@ -168,14 +168,6 @@ static void disconnect_pppoatm(void) +@@ -171,14 +171,6 @@ static void disconnect_pppoatm(void) void plugin_init(void) { --#if defined(__linux__) +-#ifdef linux - extern int new_style_driver; /* From sys-linux.c */ - if (!ppp_available() && !new_style_driver) - fatal("Kernel doesn't support ppp_generic - " @@ -110,12 +110,12 @@ Signed-off-by: Jo-Philipp Wich -#else - fatal("No PPPoATM support on this OS"); -#endif - info("PPPoATM plugin_init"); add_options(pppoa_options); } ---- a/pppd/plugins/rp-pppoe/plugin.c -+++ b/pppd/plugins/rp-pppoe/plugin.c -@@ -59,9 +59,6 @@ static char const RCSID[] = + +--- a/pppd/plugins/pppoe/plugin.c ++++ b/pppd/plugins/pppoe/plugin.c +@@ -58,9 +58,6 @@ static char const RCSID[] = char pppd_version[] = VERSION; @@ -125,7 +125,7 @@ Signed-off-by: Jo-Philipp Wich char *pppd_pppoe_service = NULL; static char *acName = NULL; static char *existingSession = NULL; -@@ -394,10 +391,6 @@ PPPoEDevnameHook(char *cmd, char **argv, +@@ -407,10 +404,6 @@ PPPoEDevnameHook(char *cmd, char **argv, void plugin_init(void) { @@ -135,7 +135,7 @@ Signed-off-by: Jo-Philipp Wich - add_options(Options); - info("RP-PPPoE plugin version %s compiled against pppd %s", + info("PPPoE plugin from pppd %s", VERSION); --- a/pppd/plugins/pppol2tp/pppol2tp.c +++ b/pppd/plugins/pppol2tp/pppol2tp.c @@ -490,12 +490,7 @@ static void pppol2tp_cleanup(void) diff --git a/package/network/services/ppp/patches/401-no_record_file.patch b/package/network/services/ppp/patches/401-no_record_file.patch index f707fda8ab..7844260685 100644 --- a/package/network/services/ppp/patches/401-no_record_file.patch +++ b/package/network/services/ppp/patches/401-no_record_file.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -326,7 +326,6 @@ extern int holdoff; /* Dead time before +@@ -317,7 +317,6 @@ extern int holdoff; /* Dead time before extern bool holdoff_specified; /* true if user gave a holdoff value */ extern bool notty; /* Stdin/out is not a tty */ extern char *pty_socket; /* Socket to connect to pty */ @@ -17,7 +17,7 @@ Signed-off-by: Jo-Philipp Wich extern char linkname[MAXPATHLEN]; /* logical name for link */ --- a/pppd/tty.c +++ b/pppd/tty.c -@@ -145,7 +145,7 @@ char *disconnect_script = NULL; /* Scrip +@@ -143,7 +143,7 @@ char *disconnect_script = NULL; /* Scrip char *welcomer = NULL; /* Script to run after phys link estab. */ char *ptycommand = NULL; /* Command to run on other side of pty */ bool notty = 0; /* Stdin/out is not a tty */ @@ -26,7 +26,7 @@ Signed-off-by: Jo-Philipp Wich int max_data_rate; /* max bytes/sec through charshunt */ bool sync_serial = 0; /* Device is synchronous serial device */ char *pty_socket = NULL; /* Socket to connect to pty */ -@@ -201,8 +201,10 @@ option_t tty_options[] = { +@@ -199,8 +199,10 @@ option_t tty_options[] = { "Send and receive over socket, arg is host:port", OPT_PRIO | OPT_DEVNAM }, diff --git a/package/network/services/ppp/patches/403-no_wtmp.patch b/package/network/services/ppp/patches/403-no_wtmp.patch index 537a1b0c7f..772620ed72 100644 --- a/package/network/services/ppp/patches/403-no_wtmp.patch +++ b/package/network/services/ppp/patches/403-no_wtmp.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -2470,6 +2470,7 @@ int ppp_available(void) +@@ -2503,6 +2503,7 @@ int ppp_available(void) void logwtmp (const char *line, const char *name, const char *host) { @@ -15,7 +15,7 @@ Signed-off-by: Jo-Philipp Wich struct utmp ut, *utp; pid_t mypid = getpid(); #if __GLIBC__ < 2 -@@ -2535,6 +2536,7 @@ void logwtmp (const char *line, const ch +@@ -2568,6 +2569,7 @@ void logwtmp (const char *line, const ch close (wtmp); } #endif diff --git a/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch b/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch index d37fc03539..b9b6f0e593 100644 --- a/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch +++ b/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -883,14 +883,17 @@ struct protocol_list { +@@ -866,14 +866,17 @@ struct protocol_list { const char *name; } protocol_list[] = { { 0x21, "IP" }, @@ -25,7 +25,7 @@ Signed-off-by: Jo-Philipp Wich { 0x33, "Stream Protocol ST-II" }, { 0x35, "Banyan Vines" }, { 0x39, "AppleTalk EDDP" }, -@@ -904,8 +907,11 @@ struct protocol_list { +@@ -887,8 +890,11 @@ struct protocol_list { { 0x49, "Serial Data Transport Protocol (PPP-SDTP)" }, { 0x4b, "SNA over 802.2" }, { 0x4d, "SNA" }, @@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich { 0x53, "Encryption" }, { 0x55, "Individual Link Encryption" }, { 0x57, "IPv6" }, -@@ -916,12 +922,15 @@ struct protocol_list { +@@ -899,12 +905,15 @@ struct protocol_list { { 0x65, "RTP IPHC Compressed non-TCP" }, { 0x67, "RTP IPHC Compressed UDP 8" }, { 0x69, "RTP IPHC Compressed RTP 8" }, @@ -53,7 +53,7 @@ Signed-off-by: Jo-Philipp Wich { 0x0203, "IBM Source Routing BPDU" }, { 0x0205, "DEC LANBridge100 Spanning Tree" }, { 0x0207, "Cisco Discovery Protocol" }, -@@ -933,15 +942,19 @@ struct protocol_list { +@@ -916,15 +925,19 @@ struct protocol_list { { 0x0231, "Luxcom" }, { 0x0233, "Sigma Network Systems" }, { 0x0235, "Apple Client Server Protocol" }, @@ -73,7 +73,7 @@ Signed-off-by: Jo-Philipp Wich { 0x4001, "Cray Communications Control Protocol" }, { 0x4003, "CDPD Mobile Network Registration Protocol" }, { 0x4005, "Expand accelerator protocol" }, -@@ -952,8 +965,10 @@ struct protocol_list { +@@ -935,8 +948,10 @@ struct protocol_list { { 0x4023, "RefTek Protocol" }, { 0x4025, "Fibre Channel" }, { 0x4027, "EMIT Protocols" }, @@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich { 0x8023, "OSI Network Layer Control Protocol" }, { 0x8025, "Xerox NS IDP Control Protocol" }, { 0x8027, "DECnet Phase IV Control Protocol" }, -@@ -962,7 +977,9 @@ struct protocol_list { +@@ -945,7 +960,9 @@ struct protocol_list { { 0x8031, "Bridging NCP" }, { 0x8033, "Stream Protocol Control Protocol" }, { 0x8035, "Banyan Vines Control Protocol" }, @@ -94,7 +94,7 @@ Signed-off-by: Jo-Philipp Wich { 0x803f, "NETBIOS Framing Control Protocol" }, { 0x8041, "Cisco Systems Control Protocol" }, { 0x8043, "Ascom Timeplex" }, -@@ -971,18 +988,24 @@ struct protocol_list { +@@ -954,18 +971,24 @@ struct protocol_list { { 0x8049, "Serial Data Control Protocol (PPP-SDCP)" }, { 0x804b, "SNA over 802.2 Control Protocol" }, { 0x804d, "SNA Control Protocol" }, @@ -119,7 +119,7 @@ Signed-off-by: Jo-Philipp Wich { 0x8207, "Cisco Discovery Protocol Control" }, { 0x8209, "Netcs Twin Routing" }, { 0x820b, "STP - Control Protocol" }, -@@ -991,24 +1014,29 @@ struct protocol_list { +@@ -974,24 +997,29 @@ struct protocol_list { { 0x8281, "MPLSCP" }, { 0x8285, "IEEE p1284.4 standard - Protocol Control" }, { 0x8287, "ETSI TETRA TNP1 Control Protocol" }, diff --git a/package/network/services/ppp/patches/405-no_multilink_option.patch b/package/network/services/ppp/patches/405-no_multilink_option.patch index ce87d039a3..a34ec57b0a 100644 --- a/package/network/services/ppp/patches/405-no_multilink_option.patch +++ b/package/network/services/ppp/patches/405-no_multilink_option.patch @@ -9,7 +9,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/options.c +++ b/pppd/options.c -@@ -349,13 +349,14 @@ option_t general_options[] = { +@@ -348,13 +348,14 @@ option_t general_options[] = { "Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 }, { "nomultilink", o_bool, &multilink, "Disable multilink operation", OPT_PRIOSUB | 0 }, diff --git a/package/network/services/ppp/patches/500-add-pptp-plugin.patch b/package/network/services/ppp/patches/500-add-pptp-plugin.patch index 5ed861d545..96f4bcaf70 100644 --- a/package/network/services/ppp/patches/500-add-pptp-plugin.patch +++ b/package/network/services/ppp/patches/500-add-pptp-plugin.patch @@ -1,8 +1,8 @@ --- a/configure +++ b/configure -@@ -195,7 +195,7 @@ if [ -d "$ksrc" ]; then +@@ -133,7 +133,7 @@ if [ -d "$ksrc" ]; then mkmkf $ksrc/Makedefs$compiletype Makedefs.com - for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/rp-pppoe \ + for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/pppoe \ pppd/plugins/radius pppd/plugins/pppoatm \ - pppd/plugins/pppol2tp; do + pppd/plugins/pppol2tp pppd/plugins/pptp ; do @@ -11,12 +11,12 @@ if [ -f $ksrc/Makefile.$makext$archvariant ]; then --- a/pppd/plugins/Makefile.linux +++ b/pppd/plugins/Makefile.linux -@@ -9,7 +9,7 @@ BINDIR = $(DESTDIR)/sbin - MANDIR = $(DESTDIR)/share/man/man8 - LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) +@@ -14,7 +14,7 @@ INSTALL = install + # EAP-TLS + CFLAGS += -DUSE_EAPTLS=1 --SUBDIRS := rp-pppoe pppoatm pppol2tp -+SUBDIRS := rp-pppoe pppoatm pppol2tp pptp +-SUBDIRS := pppoe pppoatm pppol2tp ++SUBDIRS := pppoe pppoatm pppol2tp pptp # Uncomment the next line to include the radius authentication plugin SUBDIRS += radius PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so diff --git a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch index 5802d6158c..dc18156a04 100644 --- a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch +++ b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch @@ -15,8 +15,8 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -35,10 +35,10 @@ endif - COPTS = -O2 -pipe -Wall -g +@@ -36,10 +36,10 @@ endif + LIBS = -lrt -# Uncomment the next line to include support for Microsoft's @@ -28,19 +28,19 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. # Don't use MSLANMAN unless you really know what you're doing. #MSLANMAN=y # Uncomment the next line to include support for MPPE. CHAPMS (above) must -@@ -141,8 +141,7 @@ endif +@@ -158,8 +158,7 @@ endif ifdef NEEDDES ifndef USE_CRYPT -CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl --LIBS += -lcrypto +-NEEDCRYPTOLIB = y +LIBS += -ldes $(LIBS) else CFLAGS += -DUSE_CRYPT=1 endif --- a/pppd/pppcrypt.c +++ b/pppd/pppcrypt.c -@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w +@@ -62,7 +62,7 @@ MakeKey(u_char *key, u_char *des_key) des_key[7] = Get7Bits(key, 49); #ifndef USE_CRYPT @@ -49,7 +49,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. #endif } -@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */ +@@ -147,30 +147,30 @@ DesDecrypt(u_char *cipher, u_char *clear } #else /* USE_CRYPT */ @@ -57,8 +57,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. +static des_key_schedule key_schedule; bool - DesSetkey(key) - u_char *key; + DesSetkey(u_char *key) { - DES_cblock des_key; + des_cblock des_key; @@ -69,10 +68,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. } bool --DesEncrypt(clear, cipher) -+DesEncrypt(clear, key, cipher) - u_char *clear; /* IN 8 octets */ - u_char *cipher; /* OUT 8 octets */ + DesEncrypt(u_char *clear, u_char *cipher) { - DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, - &key_schedule, 1); @@ -81,9 +77,8 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. return (1); } -@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear) - u_char *cipher; /* IN 8 octets */ - u_char *clear; /* OUT 8 octets */ + bool + DesDecrypt(u_char *cipher, u_char *clear) { - DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear, - &key_schedule, 0); From 06af45ec0502d5cb0529ac46fcb34c4c63394723 Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Tue, 2 Feb 2021 16:10:32 +0800 Subject: [PATCH 33/45] ramips: remove obsolete mx25l25635f compatible hack The kernel bump to 5.4 has removed the mx25l25635f hack, and the mx25l25635f compatible is no longer required. Signed-off-by: DENG Qingfang --- target/linux/ramips/dts/mt7620a_youku_yk1.dts | 2 +- target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts | 2 +- target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts | 2 +- target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_youku_yk1.dts b/target/linux/ramips/dts/mt7620a_youku_yk1.dts index 86e2031aa6..8727b011d4 100644 --- a/target/linux/ramips/dts/mt7620a_youku_yk1.dts +++ b/target/linux/ramips/dts/mt7620a_youku_yk1.dts @@ -67,7 +67,7 @@ status = "okay"; flash@0 { - compatible = "mx25l25635f", "jedec,spi-nor"; + compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <25000000>; m25p,fast-read; diff --git a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts index 49eeb46d5f..20f63902af 100644 --- a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts +++ b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts @@ -65,7 +65,7 @@ status = "okay"; flash@0 { - compatible = "mx25l25635f", "jedec,spi-nor"; + compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <80000000>; m25p,fast-read; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts index f5425ccfee..d374fd3dde 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -15,7 +15,7 @@ status = "okay"; flash@0 { - compatible = "mx25l25635f", "jedec,spi-nor"; + compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <50000000>; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts index 401868362e..7a36ecfa7b 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts @@ -11,7 +11,7 @@ status = "okay"; flash@0 { - compatible = "mx25l25635f", "jedec,spi-nor"; + compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <50000000>; From fb83efb626491e4e0de79429041ea7792db337d4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 20 Jan 2021 21:38:03 -0800 Subject: [PATCH 34/45] pcre: disable C++ bindings Nothing uses them. Allows to simplify the Makefile. Signed-off-by: Rosen Penev --- package/libs/pcre/Makefile | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/package/libs/pcre/Makefile b/package/libs/pcre/Makefile index 37d939da7f..8644746b4b 100644 --- a/package/libs/pcre/Makefile +++ b/package/libs/pcre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pcre PKG_VERSION:=8.44 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/$(PKG_NAME) @@ -24,10 +24,8 @@ PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_CONFIG_DEPENDS:=\ - CONFIG_PACKAGE_libpcrecpp \ CONFIG_PCRE_JIT_ENABLED -include $(INCLUDE_DIR)/uclibc++.mk include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk @@ -56,19 +54,12 @@ define Package/libpcre32 TITLE:=A Perl Compatible Regular Expression library (32bit support) endef -define Package/libpcrecpp - $(call Package/libpcre/default) - TITLE:=C++ wrapper for Perl Compatible Regular Expression library - DEPENDS:=+libpcre $(CXX_DEPENDS) -endef - - HOST_CONFIGURE_ARGS += \ --enable-utf8 \ --enable-unicode-properties \ --enable-pcre16 \ --with-match-limit-recursion=16000 \ - --enable-cpp + --disable-cpp TARGET_CFLAGS += $(FPIC) @@ -79,7 +70,7 @@ CONFIGURE_ARGS += \ --enable-pcre32 \ $(if $(CONFIG_PCRE_JIT_ENABLED),--enable-jit,--disable-jit) \ --with-match-limit-recursion=16000 \ - $(if $(CONFIG_PACKAGE_libpcrecpp),--enable,--disable)-cpp + -disable-cpp MAKE_FLAGS += \ CFLAGS="$(TARGET_CFLAGS)" @@ -118,13 +109,7 @@ define Package/libpcre32/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre32.so* $(1)/usr/lib/ endef -define Package/libpcrecpp/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/ -endef - $(eval $(call BuildPackage,libpcre)) $(eval $(call BuildPackage,libpcre16)) $(eval $(call BuildPackage,libpcre32)) -$(eval $(call BuildPackage,libpcrecpp)) $(eval $(call HostBuild)) From e6aac8d98f5663be99163f9e61dad23ad657b7ed Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 15 Feb 2021 14:37:17 +0000 Subject: [PATCH 35/45] image: add support for building FIT image with filesystem Allow for single (external-data) FIT image to hold kernel, dtb and squashfs. In that way, the bootloader verifies the system integrity including the rootfs, because what's the point of checking that the hash of the kernel is correct if it won't boot in case of squashfs being corrupted? Better allow bootloader to check everything needed to make it at least up to failsafe mode. As a positive side effect this change also makes the sysupgrade process on nand potentially much easier as it is now. In short: mkimage has a parameter '-E' which allows generating FIT images with 'external' data rather than embedding the data into the device-tree blob itself. In this way, the FIT structure itself remains small and can be parsed easily (rather than having to page around megabytes of image content). This patch makes use of that and adds support for adding sub-images of type 'filesystem' which are used to store the squashfs. Now U-Boot can verify the whole OS and the new partition parsers added in the Linux kernel can detect the filesystem sub-images, create partitions for them, and select the active rootfs volume based on the configuration in FIT (passing configuration via device tree could be implemented easily at a later stage). This new FIT partition parser works for NOR flash (on top of mtdblock), NAND flash (on top of ubiblock) as well as classic block devices (ie. eMMC, SDcard, SATA, NVME, ...). It could even be used to mount such FIT images via `losetup -P` on a user PC if this patch gets included in Linux upstream one day ;) Signed-off-by: John Crispin Signed-off-by: Daniel Golle --- include/image-commands.mk | 4 +- package/base-files/files/lib/upgrade/nand.sh | 100 +++++--- scripts/mkits.sh | 46 +++- target/linux/generic/config-5.10 | 1 + target/linux/generic/config-5.4 | 1 + .../generic/files/block/partitions/fit.c | 233 ++++++++++++++++++ .../400-block-fit-partition-parser.patch | 96 ++++++++ .../400-block-fit-partition-parser.patch | 99 ++++++++ ...to-create-ubiblock-device-for-rootfs.patch | 5 +- ...to-create-ubiblock-device-for-rootfs.patch | 5 +- 10 files changed, 546 insertions(+), 44 deletions(-) create mode 100644 target/linux/generic/files/block/partitions/fit.c create mode 100644 target/linux/generic/hack-5.10/400-block-fit-partition-parser.patch create mode 100644 target/linux/generic/hack-5.4/400-block-fit-partition-parser.patch diff --git a/include/image-commands.mk b/include/image-commands.mk index 51e745958e..3377680a07 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -200,11 +200,13 @@ define Build/fit $(TOPDIR)/scripts/mkits.sh \ -D $(DEVICE_NAME) -o $@.its -k $@ \ $(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \ + $(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \ -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ $(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \ -A $(LINUX_KARCH) -v $(LINUX_VERSION) - PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\ + -E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new @mv $@.new $@ endef diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index e6f58df4f5..7cf95c0139 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -3,13 +3,13 @@ . /lib/functions.sh -# 'kernel' partition on NAND contains the kernel +# 'kernel' partition or UBI volume on NAND contains the kernel CI_KERNPART="${CI_KERNPART:-kernel}" # 'ubi' partition on NAND contains UBI CI_UBIPART="${CI_UBIPART:-ubi}" -# 'rootfs' partition on NAND contains the rootfs +# 'rootfs' UBI volume on NAND contains the rootfs CI_ROOTPART="${CI_ROOTPART:-rootfs}" ubi_mknod() { @@ -117,9 +117,11 @@ nand_restore_config() { nand_upgrade_prepare_ubi() { local rootfs_length="$1" local rootfs_type="$2" - local has_kernel="${3:-0}" + local kernel_length="$3" local has_env="${4:-0}" + [ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1 + local mtdnum="$( find_mtd_index "$CI_UBIPART" )" if [ ! "$mtdnum" ]; then echo "cannot find ubi mtd partition $CI_UBIPART" @@ -148,23 +150,24 @@ nand_upgrade_prepare_ubi() { local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" local data_ubivol="$( nand_find_volume $ubidev rootfs_data )" - # remove ubiblock device of rootfs - local root_ubiblk="ubiblock${root_ubivol:3}" - if [ "$root_ubivol" -a -e "/dev/$root_ubiblk" ]; then - echo "removing $root_ubiblk" - if ! ubiblock -r /dev/$root_ubivol; then - echo "cannot remove $root_ubiblk" - return 1; + local ubiblk ubiblkvol + for ubiblk in /dev/ubiblock*_? ; do + [ -e "$ubiblk" ] || continue + echo "removing ubiblock${ubiblk:13}" + ubiblkvol=ubi${ubiblk:13} + if ! ubiblock -r /dev/$ubiblkvol; then + echo "cannot remove $ubiblk" + return 1 fi - fi + done # kill volumes [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true - [ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true + [ "$root_ubivol" -a "$root_ubivol" != "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true # update kernel - if [ "$has_kernel" = "1" ]; then + if [ -n "$kernel_length" ]; then if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then echo "cannot create kernel volume" return 1; @@ -172,15 +175,17 @@ nand_upgrade_prepare_ubi() { fi # update rootfs - local root_size_param - if [ "$rootfs_type" = "ubifs" ]; then - root_size_param="-m" - else - root_size_param="-s $rootfs_length" - fi - if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $root_size_param; then - echo "cannot create rootfs volume" - return 1; + if [ -n "$rootfs_length" ]; then + local root_size_param + if [ "$rootfs_type" = "ubifs" ]; then + root_size_param="-m" + else + root_size_param="-s $rootfs_length" + fi + if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $rootfs_size_param; then + echo "cannot create rootfs volume" + return 1; + fi fi # create rootfs_data for non-ubifs rootfs @@ -232,7 +237,7 @@ nand_upgrade_ubinized() { nand_upgrade_ubifs() { local rootfs_length=$( (cat $1 | wc -c) 2> /dev/null) - nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0" + nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "" "" local ubidev="$( nand_find_ubi "$CI_UBIPART" )" local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)" @@ -241,39 +246,59 @@ nand_upgrade_ubifs() { nand_do_upgrade_success } +nand_upgrade_fit() { + local fit_file="$1" + local fit_length="$(wc -c < "$fit_file")" + + nand_upgrade_prepare_ubi "" "" "$fit_length" "1" + + local fit_ubidev="$(nand_find_ubi "$CI_UBIPART")" + local fit_ubivol="$(nand_find_volume $fit_ubidev "$CI_KERNPART")" + ubiupdatevol /dev/$fit_ubivol -s $fit_length $fit_file + + nand_do_upgrade_success +} + nand_upgrade_tar() { local tar_file="$1" local kernel_mtd="$(find_mtd_index $CI_KERNPART)" - local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + local board_dir=$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$') board_dir=${board_dir%/} - local kernel_length=$( (tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null) - local rootfs_length=$( (tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null) + kernel_length=$( (tar xf "$tar_file" ${board_dir}/kernel -O | wc -c) 2> /dev/null) + local has_rootfs=0 + local rootfs_length + local rootfs_type - local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" + tar tf "$tar_file" ${board_dir}/root 1>/dev/null 2>/dev/null && has_rootfs=1 + [ "$has_rootfs" = "1" ] && { + rootfs_length=$( (tar xf "$tar_file" ${board_dir}/root -O | wc -c) 2> /dev/null) + rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" + } local has_kernel=1 local has_env=0 [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART + tar xf "$tar_file" ${board_dir}/kernel -O | mtd write - $CI_KERNPART } - [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0 + [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel= - nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$has_kernel" "$has_env" + nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "${has_kernel:+$kernel_length}" "$has_env" local ubidev="$( nand_find_ubi "$CI_UBIPART" )" [ "$has_kernel" = "1" ] && { - local kern_ubivol="$(nand_find_volume $ubidev $CI_KERNPART)" - tar xf $tar_file ${board_dir}/kernel -O | \ + local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" + tar xf "$tar_file" ${board_dir}/kernel -O | \ ubiupdatevol /dev/$kern_ubivol -s $kernel_length - } - local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)" - tar xf $tar_file ${board_dir}/root -O | \ - ubiupdatevol /dev/$root_ubivol -s $rootfs_length - - + [ "$has_rootfs" = "1" ] && { + local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" + tar xf "$tar_file" ${board_dir}/root -O | \ + ubiupdatevol /dev/$root_ubivol -s $rootfs_length - + } nand_do_upgrade_success } @@ -284,6 +309,7 @@ nand_do_upgrade() { [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs" case "$file_type" in + "fit") nand_upgrade_fit $1;; "ubi") nand_upgrade_ubinized $1;; "ubifs") nand_upgrade_ubifs $1;; *) nand_upgrade_tar $1;; @@ -309,7 +335,7 @@ nand_do_platform_check() { local control_length=$( (tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null) local file_type="$(identify $2)" - [ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" ] && { + [ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" -a "$file_type" != "fit" ] && { echo "Invalid sysupgrade file." return 1 } diff --git a/scripts/mkits.sh b/scripts/mkits.sh index bb629d6fca..59ff3a2d15 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -23,18 +23,24 @@ usage() { printf "\n\t-c ==> set config name 'config'" printf "\n\t-a ==> set load address to 'addr' (hex)" printf "\n\t-e ==> set entry point to 'entry' (hex)" + printf "\n\t-f ==> set device tree compatible string" printf "\n\t-v ==> set kernel version to 'version'" printf "\n\t-k ==> include kernel image 'kernel'" printf "\n\t-D ==> human friendly Device Tree Blob 'name'" printf "\n\t-n ==> fdt unit-address 'address'" printf "\n\t-d ==> include Device Tree Blob 'dtb'" + printf "\n\t-r ==> include RootFS blob 'rootfs'" + printf "\n\t-H ==> specify hash algo instead of SHA1" printf "\n\t-o ==> create output file 'its_file'\n" exit 1 } FDTNUM=1 +ROOTFSNUM=1 +HASH=sha1 +LOADABLES= -while getopts ":A:a:c:C:D:d:e:k:n:o:v:" OPTION +while getopts ":A:a:c:C:D:d:e:f:k:n:o:v:r:S" OPTION do case $OPTION in A ) ARCH=$OPTARG;; @@ -44,9 +50,12 @@ do D ) DEVICE=$OPTARG;; d ) DTB=$OPTARG;; e ) ENTRY_ADDR=$OPTARG;; + f ) COMPATIBLE=$OPTARG;; k ) KERNEL=$OPTARG;; n ) FDTNUM=$OPTARG;; o ) OUTPUT=$OPTARG;; + r ) ROOTFS=$OPTARG;; + S ) HASH=$OPTARG;; v ) VERSION=$OPTARG;; * ) echo "Invalid option passed to '$0' (options:$*)" usage;; @@ -62,11 +71,16 @@ fi ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]') +if [ -n "${COMPATIBLE}" ]; then + COMPATIBLE_PROP="compatible = \"${COMPATIBLE}\";" +fi + # Conditionally create fdt information if [ -n "${DTB}" ]; then FDT_NODE=" fdt@$FDTNUM { description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\"; + ${COMPATIBLE_PROP} data = /incbin/(\"${DTB}\"); type = \"flat_dt\"; arch = \"${ARCH}\"; @@ -75,13 +89,34 @@ if [ -n "${DTB}" ]; then algo = \"crc32\"; }; hash@2 { - algo = \"sha1\"; + algo = \"${HASH}\"; }; }; " FDT_PROP="fdt = \"fdt@$FDTNUM\";" fi +if [ -n "${ROOTFS}" ]; then + dd if="${ROOTFS}" of="${ROOTFS}.pagesync" bs=4096 conv=sync + ROOTFS_NODE=" + rootfs@$ROOTFSNUM { + description = \"${ARCH_UPPER} OpenWrt ${DEVICE} rootfs\"; + ${COMPATIBLE_PROP} + data = /incbin/(\"${ROOTFS}.pagesync\"); + type = \"filesystem\"; + arch = \"${ARCH}\"; + compression = \"none\"; + hash@1 { + algo = \"crc32\"; + }; + hash@2 { + algo = \"${HASH}\"; + }; + }; +" + LOADABLES="${LOADABLES:+$LOADABLES, }\"rootfs@${ROOTFSNUM}\"" +fi + # Create a default, fully populated DTS file DATA="/dts-v1/; @@ -103,18 +138,21 @@ DATA="/dts-v1/; algo = \"crc32\"; }; hash@2 { - algo = \"sha1\"; + algo = \"$HASH\"; }; }; ${FDT_NODE} +${ROOTFS_NODE} }; configurations { default = \"${CONFIG}\"; ${CONFIG} { - description = \"OpenWrt\"; + description = \"OpenWrt ${DEVICE}\"; kernel = \"kernel@1\"; ${FDT_PROP} + ${LOADABLES:+loadables = ${LOADABLES};} + ${COMPATIBLE_PROP} }; }; };" diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index d8c5017083..d88c0de17f 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -1871,6 +1871,7 @@ CONFIG_FIB_RULES=y # CONFIG_FIELDBUS_DEV is not set CONFIG_FILE_LOCKING=y # CONFIG_FIND_BIT_BENCHMARK is not set +# CONFIG_FIT_PARTITION is not set # CONFIG_FIREWIRE is not set # CONFIG_FIREWIRE_NOSY is not set # CONFIG_FIREWIRE_SERIAL is not set diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 4ace100b01..9755c9658a 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -1665,6 +1665,7 @@ CONFIG_FILE_LOCKING=y # CONFIG_FIRMWARE_EDID is not set # CONFIG_FIRMWARE_IN_KERNEL is not set # CONFIG_FIRMWARE_MEMMAP is not set +# CONFIG_FIT_PARTITION is not set # CONFIG_FIXED_PHY is not set CONFIG_FLATMEM=y CONFIG_FLATMEM_MANUAL=y diff --git a/target/linux/generic/files/block/partitions/fit.c b/target/linux/generic/files/block/partitions/fit.c new file mode 100644 index 0000000000..8ccbcf2fc2 --- /dev/null +++ b/target/linux/generic/files/block/partitions/fit.c @@ -0,0 +1,233 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * fs/partitions/fit.c + * Copyright (C) 2021 Daniel Golle + * + * headers extracted from U-Boot mkimage sources + * (C) Copyright 2008 Semihalf + * (C) Copyright 2000-2005 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * based on existing partition parsers + * Copyright (C) 1991-1998 Linus Torvalds + * Re-organised Feb 1998 Russell King + */ + +#define pr_fmt(fmt) fmt + +#include +#include +#include +#include +#include + +#include "check.h" + +#define FIT_IMAGES_PATH "/images" +#define FIT_CONFS_PATH "/configurations" + +/* hash/signature/key node */ +#define FIT_HASH_NODENAME "hash" +#define FIT_ALGO_PROP "algo" +#define FIT_VALUE_PROP "value" +#define FIT_IGNORE_PROP "uboot-ignore" +#define FIT_SIG_NODENAME "signature" +#define FIT_KEY_REQUIRED "required" +#define FIT_KEY_HINT "key-name-hint" + +/* cipher node */ +#define FIT_CIPHER_NODENAME "cipher" +#define FIT_ALGO_PROP "algo" + +/* image node */ +#define FIT_DATA_PROP "data" +#define FIT_DATA_POSITION_PROP "data-position" +#define FIT_DATA_OFFSET_PROP "data-offset" +#define FIT_DATA_SIZE_PROP "data-size" +#define FIT_TIMESTAMP_PROP "timestamp" +#define FIT_DESC_PROP "description" +#define FIT_ARCH_PROP "arch" +#define FIT_TYPE_PROP "type" +#define FIT_OS_PROP "os" +#define FIT_COMP_PROP "compression" +#define FIT_ENTRY_PROP "entry" +#define FIT_LOAD_PROP "load" + +/* configuration node */ +#define FIT_KERNEL_PROP "kernel" +#define FIT_FILESYSTEM_PROP "filesystem" +#define FIT_RAMDISK_PROP "ramdisk" +#define FIT_FDT_PROP "fdt" +#define FIT_LOADABLE_PROP "loadables" +#define FIT_DEFAULT_PROP "default" +#define FIT_SETUP_PROP "setup" +#define FIT_FPGA_PROP "fpga" +#define FIT_FIRMWARE_PROP "firmware" +#define FIT_STANDALONE_PROP "standalone" + +#define FIT_MAX_HASH_LEN HASH_MAX_DIGEST_SIZE + +int fit_partition(struct parsed_partitions *state) +{ + struct address_space *mapping = state->bdev->bd_inode->i_mapping; + struct page *page = read_mapping_page(mapping, 0, NULL); + void *fit, *init_fit; + struct partition_meta_info *info; + char tmp[sizeof(info->volname)]; + u64 dsize, dsectors; + u32 size, image_pos, image_len; + const u32 *image_offset_be, *image_len_be, *image_pos_be; + int ret = 1, node, images, config, slot; + const char *image_name, *image_type, *image_description, *config_default, + *config_description, *config_loadables; + int image_name_len, image_type_len, image_description_len, config_default_len, + config_description_len, config_loadables_len; + sector_t start_sect, nr_sects; + size_t label_min; + + if (!page) + return -ENOMEM; + + init_fit = page_address(page); + + if (!init_fit) { + put_page(page); + return -EFAULT; + } + + if (fdt_check_header(init_fit)) { + put_page(page); + return 0; + } + + dsectors = get_capacity(state->bdev->bd_disk); + dsize = dsectors << SECTOR_SHIFT; + printk(KERN_DEBUG "FIT: volume size: %llu sectors (%llu bytes)\n", dsectors, dsize); + + size = fdt_totalsize(init_fit); + printk(KERN_DEBUG "FIT: FDT structure size: %u bytes\n", size); + if (size > PAGE_SIZE) { + printk(KERN_ERR "FIT: FDT structure beyond page boundaries, use 'mkimage -E ...'!\n"); + put_page(page); + return -ENOTSUPP; + } + + if (size >= dsize) { + put_page(page); + state->access_beyond_eod = (size >= dsize); + return 0; + } + + fit = kmemdup(init_fit, size, GFP_KERNEL); + put_page(page); + if (!fit) + return -ENOMEM; + + config = fdt_path_offset(fit, FIT_CONFS_PATH); + if (config < 0) { + printk(KERN_ERR "FIT: Cannot find %s node: %d\n", FIT_CONFS_PATH, images); + ret = -ENOENT; + goto ret_out; + } + + config_default = fdt_getprop(fit, config, FIT_DEFAULT_PROP, &config_default_len); + + if (!config_default) { + printk(KERN_ERR "FIT: Cannot find default configuration\n"); + ret = -ENOENT; + goto ret_out; + } + + node = fdt_subnode_offset(fit, config, config_default); + if (node < 0) { + printk(KERN_ERR "FIT: Cannot find %s node: %d\n", config_default, node); + ret = -ENOENT; + goto ret_out; + } + + config_description = fdt_getprop(fit, node, FIT_DESC_PROP, &config_description_len); + config_loadables = fdt_getprop(fit, node, FIT_LOADABLE_PROP, &config_loadables_len); + + printk(KERN_DEBUG "FIT: Default configuration: %s%s%s%s\n", config_default, + config_description?" (":"", config_description?:"", config_description?")":""); + + images = fdt_path_offset(fit, FIT_IMAGES_PATH); + if (images < 0) { + printk(KERN_ERR "FIT: Cannot find %s node: %d\n", FIT_IMAGES_PATH, images); + ret = -EINVAL; + goto ret_out; + } + + slot = 1; + fdt_for_each_subnode(node, fit, images) { + image_name = fdt_get_name(fit, node, &image_name_len); + image_type = fdt_getprop(fit, node, FIT_TYPE_PROP, &image_type_len); + image_offset_be = fdt_getprop(fit, node, FIT_DATA_OFFSET_PROP, NULL); + image_pos_be = fdt_getprop(fit, node, FIT_DATA_POSITION_PROP, NULL); + image_len_be = fdt_getprop(fit, node, FIT_DATA_SIZE_PROP, NULL); + if (!image_name || !image_type || !image_len_be) + continue; + + image_len = be32_to_cpu(*image_len_be); + if (!image_len) + continue; + + if (image_offset_be) + image_pos = be32_to_cpu(*image_offset_be) + size; + else if (image_pos_be) + image_pos = be32_to_cpu(*image_pos_be); + else + continue; + + image_description = fdt_getprop(fit, node, FIT_DESC_PROP, &image_description_len); + + printk(KERN_DEBUG "FIT: %16s sub-image 0x%08x - 0x%08x '%s' %s%s%s\n", + image_type, image_pos, image_pos + image_len, image_name, + image_description?"(":"", image_description?:"", image_description?") ":""); + + if (strcmp(image_type, FIT_FILESYSTEM_PROP)) + continue; + + if (image_pos & ((1 << PAGE_SHIFT)-1)) { + printk(KERN_ERR "FIT: image %s start not aligned to page boundaries, skipping\n", image_name); + continue; + } + + if (image_len & ((1 << PAGE_SHIFT)-1)) { + printk(KERN_ERR "FIT: sub-image %s end not aligned to page boundaries, skipping\n", image_name); + continue; + } + + start_sect = image_pos >> SECTOR_SHIFT; + nr_sects = image_len >> SECTOR_SHIFT; + + if (start_sect + nr_sects > dsectors) { + state->access_beyond_eod = 1; + continue; + } + + put_partition(state, slot, start_sect, nr_sects); + state->parts[slot].flags = 0; + info = &state->parts[slot].info; + + label_min = min_t(int, sizeof(info->volname) - 1, image_name_len); + strncpy(info->volname, image_name, label_min); + info->volname[label_min] = '\0'; + + snprintf(tmp, sizeof(tmp), "(%s)", info->volname); + strlcat(state->pp_buf, tmp, PAGE_SIZE); + + state->parts[slot].has_info = true; + + if (config_loadables && !strcmp(image_name, config_loadables)) { + printk(KERN_DEBUG "FIT: selecting configured loadable %s to be root filesystem\n", image_name); + state->parts[slot].flags |= ADDPART_FLAG_ROOTDEV; + } + + ++slot; + } + +ret_out: + kfree(fit); + return ret; +} diff --git a/target/linux/generic/hack-5.10/400-block-fit-partition-parser.patch b/target/linux/generic/hack-5.10/400-block-fit-partition-parser.patch new file mode 100644 index 0000000000..9eaf8637d0 --- /dev/null +++ b/target/linux/generic/hack-5.10/400-block-fit-partition-parser.patch @@ -0,0 +1,96 @@ +--- a/block/blk.h ++++ b/block/blk.h +@@ -357,6 +357,7 @@ char *disk_name(struct gendisk *hd, int + #define ADDPART_FLAG_NONE 0 + #define ADDPART_FLAG_RAID 1 + #define ADDPART_FLAG_WHOLEDISK 2 ++#define ADDPART_FLAG_ROOTDEV 4 + void delete_partition(struct hd_struct *part); + int bdev_add_partition(struct block_device *bdev, int partno, + sector_t start, sector_t length); +--- a/block/partitions/Kconfig ++++ b/block/partitions/Kconfig +@@ -101,6 +101,13 @@ config ATARI_PARTITION + Say Y here if you would like to use hard disks under Linux which + were partitioned under the Atari OS. + ++config FIT_PARTITION ++ bool "Flattened-Image-Tree (FIT) partition support" if PARTITION_ADVANCED ++ default n ++ help ++ Say Y here if your system needs to mount the filesystem part of ++ a Flattened-Image-Tree (FIT) image commonly used with Das U-Boot. ++ + config IBM_PARTITION + bool "IBM disk label and partition support" + depends on PARTITION_ADVANCED && S390 +--- a/block/partitions/Makefile ++++ b/block/partitions/Makefile +@@ -8,6 +8,7 @@ obj-$(CONFIG_ACORN_PARTITION) += acorn.o + obj-$(CONFIG_AMIGA_PARTITION) += amiga.o + obj-$(CONFIG_ATARI_PARTITION) += atari.o + obj-$(CONFIG_AIX_PARTITION) += aix.o ++obj-$(CONFIG_FIT_PARTITION) += fit.o + obj-$(CONFIG_CMDLINE_PARTITION) += cmdline.o + obj-$(CONFIG_MAC_PARTITION) += mac.o + obj-$(CONFIG_LDM_PARTITION) += ldm.o +--- a/block/partitions/check.h ++++ b/block/partitions/check.h +@@ -58,6 +58,7 @@ int amiga_partition(struct parsed_partit + int atari_partition(struct parsed_partitions *state); + int cmdline_partition(struct parsed_partitions *state); + int efi_partition(struct parsed_partitions *state); ++int fit_partition(struct parsed_partitions *state); + int ibm_partition(struct parsed_partitions *); + int karma_partition(struct parsed_partitions *state); + int ldm_partition(struct parsed_partitions *state); +--- a/block/partitions/core.c ++++ b/block/partitions/core.c +@@ -10,6 +10,8 @@ + #include + #include + #include ++#include ++ + #include "check.h" + + static int (*check_part[])(struct parsed_partitions *) = { +@@ -46,6 +48,9 @@ static int (*check_part[])(struct parsed + #ifdef CONFIG_EFI_PARTITION + efi_partition, /* this must come before msdos */ + #endif ++#ifdef CONFIG_FIT_PARTITION ++ fit_partition, ++#endif + #ifdef CONFIG_SGI_PARTITION + sgi_partition, + #endif +@@ -694,6 +699,9 @@ static bool blk_add_partition(struct gen + (state->parts[p].flags & ADDPART_FLAG_RAID)) + md_autodetect_dev(part_to_dev(part)->devt); + ++ if ((state->parts[p].flags & ADDPART_FLAG_ROOTDEV) && ROOT_DEV == 0) ++ ROOT_DEV = part_to_dev(part)->devt; ++ + return true; + } + +--- a/drivers/mtd/ubi/block.c ++++ b/drivers/mtd/ubi/block.c +@@ -396,7 +396,7 @@ int ubiblock_create(struct ubi_volume_in + dev->leb_size = vi->usable_leb_size; + + /* Initialize the gendisk of this ubiblock device */ +- gd = alloc_disk(1); ++ gd = alloc_disk(0); + if (!gd) { + pr_err("UBI: block: alloc_disk failed\n"); + ret = -ENODEV; +@@ -413,6 +413,7 @@ int ubiblock_create(struct ubi_volume_in + goto out_put_disk; + } + gd->private_data = dev; ++ gd->flags |= GENHD_FL_EXT_DEVT; + sprintf(gd->disk_name, "ubiblock%d_%d", dev->ubi_num, dev->vol_id); + set_capacity(gd, disk_capacity); + dev->gd = gd; diff --git a/target/linux/generic/hack-5.4/400-block-fit-partition-parser.patch b/target/linux/generic/hack-5.4/400-block-fit-partition-parser.patch new file mode 100644 index 0000000000..13cf5e8ca0 --- /dev/null +++ b/target/linux/generic/hack-5.4/400-block-fit-partition-parser.patch @@ -0,0 +1,99 @@ +--- a/block/partitions/Kconfig ++++ b/block/partitions/Kconfig +@@ -101,6 +101,13 @@ config ATARI_PARTITION + Say Y here if you would like to use hard disks under Linux which + were partitioned under the Atari OS. + ++config FIT_PARTITION ++ bool "Flattened-Image-Tree (FIT) partition support" if PARTITION_ADVANCED ++ default n ++ help ++ Say Y here if your system needs to mount the filesystem part of ++ a Flattened-Image-Tree (FIT) image commonly used with Das U-Boot. ++ + config IBM_PARTITION + bool "IBM disk label and partition support" + depends on PARTITION_ADVANCED && S390 +--- a/block/partitions/Makefile ++++ b/block/partitions/Makefile +@@ -9,6 +9,7 @@ obj-$(CONFIG_ACORN_PARTITION) += acorn.o + obj-$(CONFIG_AMIGA_PARTITION) += amiga.o + obj-$(CONFIG_ATARI_PARTITION) += atari.o + obj-$(CONFIG_AIX_PARTITION) += aix.o ++obj-$(CONFIG_FIT_PARTITION) += fit.o + obj-$(CONFIG_CMDLINE_PARTITION) += cmdline.o + obj-$(CONFIG_MAC_PARTITION) += mac.o + obj-$(CONFIG_LDM_PARTITION) += ldm.o +--- a/drivers/mtd/ubi/block.c ++++ b/drivers/mtd/ubi/block.c +@@ -396,7 +396,7 @@ int ubiblock_create(struct ubi_volume_in + dev->leb_size = vi->usable_leb_size; + + /* Initialize the gendisk of this ubiblock device */ +- gd = alloc_disk(1); ++ gd = alloc_disk(0); + if (!gd) { + pr_err("UBI: block: alloc_disk failed\n"); + ret = -ENODEV; +@@ -413,6 +413,7 @@ int ubiblock_create(struct ubi_volume_in + goto out_put_disk; + } + gd->private_data = dev; ++ gd->flags |= GENHD_FL_EXT_DEVT; + sprintf(gd->disk_name, "ubiblock%d_%d", dev->ubi_num, dev->vol_id); + set_capacity(gd, disk_capacity); + dev->gd = gd; +--- a/block/partition-generic.c ++++ b/block/partition-generic.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "partitions/check.h" + +@@ -634,6 +635,8 @@ rescan: + if (state->parts[p].flags & ADDPART_FLAG_RAID) + md_autodetect_dev(part_to_dev(part)->devt); + #endif ++ if ((state->parts[p].flags & ADDPART_FLAG_ROOTDEV) && ROOT_DEV == 0) ++ ROOT_DEV = part_to_dev(part)->devt; + } + free_partitions(state); + return 0; +--- a/block/partitions/check.c ++++ b/block/partitions/check.c +@@ -33,6 +33,7 @@ + #include "ibm.h" + #include "ultrix.h" + #include "efi.h" ++#include "fit.h" + #include "karma.h" + #include "sysv68.h" + #include "cmdline.h" +@@ -73,6 +74,9 @@ static int (*check_part[])(struct parsed + #ifdef CONFIG_EFI_PARTITION + efi_partition, /* this must come before msdos */ + #endif ++#ifdef CONFIG_FIT_PARTITION ++ fit_partition, ++#endif + #ifdef CONFIG_SGI_PARTITION + sgi_partition, + #endif +--- a/include/linux/genhd.h ++++ b/include/linux/genhd.h +@@ -614,6 +614,7 @@ struct unixware_disklabel { + #define ADDPART_FLAG_NONE 0 + #define ADDPART_FLAG_RAID 1 + #define ADDPART_FLAG_WHOLEDISK 2 ++#define ADDPART_FLAG_ROOTDEV 4 + + extern int blk_alloc_devt(struct hd_struct *part, dev_t *devt); + extern void blk_free_devt(dev_t devt); +--- /dev/null ++++ b/block/partitions/fit.h +@@ -0,0 +1,2 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++int fit_partition(struct parsed_partitions *); diff --git a/target/linux/generic/pending-5.10/491-ubi-auto-create-ubiblock-device-for-rootfs.patch b/target/linux/generic/pending-5.10/491-ubi-auto-create-ubiblock-device-for-rootfs.patch index e5ee2c8656..a2b48fd4fc 100644 --- a/target/linux/generic/pending-5.10/491-ubi-auto-create-ubiblock-device-for-rootfs.patch +++ b/target/linux/generic/pending-5.10/491-ubi-auto-create-ubiblock-device-for-rootfs.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/block.c +++ b/drivers/mtd/ubi/block.c -@@ -652,6 +652,44 @@ static void __init ubiblock_create_from_ +@@ -652,6 +652,47 @@ static void __init ubiblock_create_from_ } } @@ -33,6 +33,9 @@ Signed-off-by: Daniel Golle + for (ubi_num = 0; ubi_num < UBI_MAX_DEVICES; ubi_num++) { + desc = ubi_open_volume_nm(ubi_num, "rootfs", UBI_READONLY); + if (IS_ERR(desc)) ++ desc = ubi_open_volume_nm(ubi_num, "fit", UBI_READONLY);; ++ ++ if (IS_ERR(desc)) + continue; + + ubi_get_volume_info(desc, &vi); diff --git a/target/linux/generic/pending-5.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch b/target/linux/generic/pending-5.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch index 61fcbac92e..88d609d996 100644 --- a/target/linux/generic/pending-5.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch +++ b/target/linux/generic/pending-5.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/block.c +++ b/drivers/mtd/ubi/block.c -@@ -652,6 +652,44 @@ static void __init ubiblock_create_from_ +@@ -652,6 +652,47 @@ static void __init ubiblock_create_from_ } } @@ -33,6 +33,9 @@ Signed-off-by: Daniel Golle + for (ubi_num = 0; ubi_num < UBI_MAX_DEVICES; ubi_num++) { + desc = ubi_open_volume_nm(ubi_num, "rootfs", UBI_READONLY); + if (IS_ERR(desc)) ++ desc = ubi_open_volume_nm(ubi_num, "fit", UBI_READONLY);; ++ ++ if (IS_ERR(desc)) + continue; + + ubi_get_volume_info(desc, &vi); From 330bd380e8b691833c8dcc9b579b51851cbd4b0f Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 21 Feb 2021 14:19:26 +0000 Subject: [PATCH 36/45] image: allow building FIT and uImage with ramdisk Instead of embedding the initrd cpio archive into the kernel, allow for having an external ramdisk added to the FIT or uImage. This is useful to overcome kernel size limitations present in many stock bootloaders, as the ramdisk is then loaded seperately and doesn't add to the kernel size. Hence we can have larger ramdisks to host ie. installers with all binaries to flash included (or a web-based firmware selector). In terms of performance and total size the differences are neglectible. Signed-off-by: Daniel Golle --- config/Config-images.in | 21 ++++++++++++++++----- include/image-commands.mk | 27 +++++++++++++++++++++++++++ include/kernel-defaults.mk | 26 ++++++++++++++++++++++++++ scripts/mkits.sh | 28 +++++++++++++++++++++++++++- scripts/target-metadata.pl | 1 + target/Config.in | 3 +++ 6 files changed, 100 insertions(+), 6 deletions(-) diff --git a/config/Config-images.in b/config/Config-images.in index 957d3af18f..080fee2cce 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -35,9 +35,11 @@ menu "Target Images" bool "lzma" config TARGET_INITRAMFS_COMPRESSION_LZO + depends on !TARGET_ROOTFS_INITRAMFS_SEPERATE bool "lzo" config TARGET_INITRAMFS_COMPRESSION_LZ4 + depends on !TARGET_ROOTFS_INITRAMFS_SEPERATE bool "lz4" config TARGET_INITRAMFS_COMPRESSION_XZ @@ -56,11 +58,20 @@ menu "Target Images" Kernel uses specified external cpio as INITRAMFS_SOURCE. config TARGET_INITRAMFS_FORCE - bool "Force" - depends on TARGET_ROOTFS_INITRAMFS - default n - help - Ignore the initramfs passed by the bootloader. + bool "Force" + depends on TARGET_ROOTFS_INITRAMFS + default n + help + Ignore the initramfs passed by the bootloader. + + config TARGET_ROOTFS_INITRAMFS_SEPERATE + bool "seperate ramdisk" + depends on TARGET_ROOTFS_INITRAMFS && !TARGET_INITRAMFS_FORCE + default y if USES_SEPERATE_INITRAMFS + help + Generate seperate initrd.cpio instead of embedding it. + This is useful for generating images with a dedicated + ramdisk e.g. in U-Boot's uImage and uImage.FIT formats. comment "Root filesystem archives" diff --git a/include/image-commands.mk b/include/image-commands.mk index 3377680a07..d4ec51ca7c 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -196,11 +196,22 @@ define Build/eva-image mv $@.new $@ endef +define Build/initrd_compression + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),.bzip2) \ + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),.gzip) \ + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),.lzma) \ + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),.xz) \ + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),.zstd) +endef + define Build/fit $(TOPDIR)/scripts/mkits.sh \ -D $(DEVICE_NAME) -o $@.its -k $@ \ $(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \ $(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \ + $(if $(findstring with-initrd,$(word 3,$(1))), \ + $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE), \ + -i $(KERNEL_BUILD_DIR)/initrd.cpio$(strip $(call Build/initrd_compression)))) \ -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ $(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \ @@ -450,6 +461,22 @@ define Build/uImage mv $@.new $@ endef +define Build/uImage-with-ramdisk + mkimage \ + -A $(LINUX_KARCH) \ + -O linux \ + -T kernel \ + -C $(word 1,$(1)) \ + -a $(KERNEL_LOADADDR) \ + -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -i $(KERNEL_BUILD_DIR)/initrd.cpio.$(strip $(call Build/initrd_compression)) \ + -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' \ + $(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC)) \ + $(wordlist 2,$(words $(1)),$(1)) \ + -d $@ $@.new + mv $@.new $@ +endef + define Build/xor-image $(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1) mv $@.xor $@ diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 8293956f6b..4b39296f8c 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -48,6 +48,13 @@ else endif ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) + ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y) + define Kernel/SetInitramfs/PreConfigure + grep -v -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config + echo 'CONFIG_BLK_DEV_INITRD=y' >> $(LINUX_DIR)/.config + echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config + endef + else ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"") define Kernel/SetInitramfs/PreConfigure grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config @@ -60,14 +67,19 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) echo 'CONFIG_INITRAMFS_SOURCE="$(call qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(LINUX_DIR)/.config endef endif +endif define Kernel/SetInitramfs rm -f $(LINUX_DIR)/.config.prev mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old $(call Kernel/SetInitramfs/PreConfigure) + ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y) echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config + else + echo "# CONFIG_INITRAMFS_FORCE is not set" >> $(LINUX_DIR)/.config + endif echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config @@ -147,6 +159,20 @@ define Kernel/CompileImage/Initramfs $(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init $(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init) rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio* +ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y) +ifeq ($(CONFIG_EXTERNAL_CPIO),y) + $(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio +else + ( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root > $(KERNEL_BUILD_DIR)/initrd.cpio ) +endif + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2) + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio) + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd.cpio $(KERNEL_BUILD_DIR)/initrd.cpio.lzma) +# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),) + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio) +# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),) + $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio) +endif +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) $(call Kernel/CopyImage,-initramfs) endef diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 59ff3a2d15..ecaba8e965 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -24,6 +24,7 @@ usage() { printf "\n\t-a ==> set load address to 'addr' (hex)" printf "\n\t-e ==> set entry point to 'entry' (hex)" printf "\n\t-f ==> set device tree compatible string" + printf "\n\t-i ==> include initrd Blob 'initrd'" printf "\n\t-v ==> set kernel version to 'version'" printf "\n\t-k ==> include kernel image 'kernel'" printf "\n\t-D ==> human friendly Device Tree Blob 'name'" @@ -37,10 +38,11 @@ usage() { FDTNUM=1 ROOTFSNUM=1 +INITRDNUM=1 HASH=sha1 LOADABLES= -while getopts ":A:a:c:C:D:d:e:f:k:n:o:v:r:S" OPTION +while getopts ":A:a:c:C:D:d:e:f:i:k:n:o:v:r:S" OPTION do case $OPTION in A ) ARCH=$OPTARG;; @@ -51,6 +53,7 @@ do d ) DTB=$OPTARG;; e ) ENTRY_ADDR=$OPTARG;; f ) COMPATIBLE=$OPTARG;; + i ) INITRD=$OPTARG;; k ) KERNEL=$OPTARG;; n ) FDTNUM=$OPTARG;; o ) OUTPUT=$OPTARG;; @@ -96,6 +99,27 @@ if [ -n "${DTB}" ]; then FDT_PROP="fdt = \"fdt@$FDTNUM\";" fi +if [ -n "${INITRD}" ]; then + INITRD_NODE=" + initrd@$INITRDNUM { + description = \"${ARCH_UPPER} OpenWrt ${DEVICE} initrd\"; + ${COMPATIBLE_PROP} + data = /incbin/(\"${INITRD}\"); + type = \"ramdisk\"; + arch = \"${ARCH}\"; + os = \"linux\"; + hash@1 { + algo = \"crc32\"; + }; + hash@2 { + algo = \"${HASH}\"; + }; + }; +" + INITRD_PROP="ramdisk=\"initrd@${INITRDNUM}\";" +fi + + if [ -n "${ROOTFS}" ]; then dd if="${ROOTFS}" of="${ROOTFS}.pagesync" bs=4096 conv=sync ROOTFS_NODE=" @@ -141,6 +165,7 @@ DATA="/dts-v1/; algo = \"$HASH\"; }; }; +${INITRD_NODE} ${FDT_NODE} ${ROOTFS_NODE} }; @@ -153,6 +178,7 @@ ${ROOTFS_NODE} ${FDT_PROP} ${LOADABLES:+loadables = ${LOADABLES};} ${COMPATIBLE_PROP} + ${INITRD_PROP} }; }; };" diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index 78f77b16d5..4128d54461 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -33,6 +33,7 @@ sub target_config_features(@) { /^fpu$/ and $ret .= "\tselect HAS_FPU\n"; /^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n"; /^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n"; + /^seperate_ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n\tselect USES_SEPERATE_INITRAMFS\n"; /^powerpc64$/ and $ret .= "\tselect powerpc64\n"; /^nommu$/ and $ret .= "\tselect NOMMU\n"; /^mips16$/ and $ret .= "\tselect HAS_MIPS16\n"; diff --git a/target/Config.in b/target/Config.in index 43de4710df..9dbc5ffe46 100644 --- a/target/Config.in +++ b/target/Config.in @@ -51,6 +51,9 @@ config USES_DEVICETREE config USES_INITRAMFS bool +config USES_SEPERATE_INITRAMFS + bool + config USES_SQUASHFS bool From 5c10f26c28031c0d7e72b672623727adb5df7b2d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 17 Feb 2021 15:17:49 +0000 Subject: [PATCH 37/45] sysupgrade-nand: allow limiting rootfs_data by setting env variable Check if firmware environment variable 'rootfs_data_max' exists and is set to a numerical value greater than 0. If so, limit rootfs_data volume to that size instead of using the maximum available size. This is useful on devices with lots of flash where users may want to have eg. a volume for persistent logs and statistics or for external applications/containers. Persistence on rootfs overlay is limited by the size of memory available during the sysugprade process as that data needs to be copied to RAM while the volume is being recreated during sysupgrade. Hence it is unsuitable for keeping larger amounts of data accross upgrade which makes additional volume(s) for application data desirable. Signed-off-by: Daniel Golle --- package/base-files/files/lib/upgrade/nand.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index 7cf95c0139..2b766480d7 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -117,6 +117,9 @@ nand_restore_config() { nand_upgrade_prepare_ubi() { local rootfs_length="$1" local rootfs_type="$2" + local rootfs_data_max="$(fw_printenv -n rootfs_data_max 2>/dev/null)" + [ -n "$rootfs_data_max" ] && rootfs_data_max=$(($rootfs_data_max)) + local kernel_length="$3" local has_env="${4:-0}" @@ -176,11 +179,11 @@ nand_upgrade_prepare_ubi() { # update rootfs if [ -n "$rootfs_length" ]; then - local root_size_param + local rootfs_size_param if [ "$rootfs_type" = "ubifs" ]; then - root_size_param="-m" + rootfs_size_param="-m" else - root_size_param="-s $rootfs_length" + rootfs_size_param="-s $rootfs_length" fi if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $rootfs_size_param; then echo "cannot create rootfs volume" @@ -190,7 +193,16 @@ nand_upgrade_prepare_ubi() { # create rootfs_data for non-ubifs rootfs if [ "$rootfs_type" != "ubifs" ]; then - if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then + local availeb=$(cat /sys/devices/virtual/ubi/$ubidev/avail_eraseblocks) + local ebsize=$(cat /sys/devices/virtual/ubi/$ubidev/eraseblock_size) + local avail_size=$(( $availeb * $ebsize )) + local rootfs_data_size_param="-m" + if [ -n "$rootfs_data_max" ] && + [ "$rootfs_data_max" != "0" ] && + [ "$rootfs_data_max" -le "$avail_size" ]; then + rootfs_data_size_param="-s $rootfs_data_max" + fi + if ! ubimkvol /dev/$ubidev -N rootfs_data $rootfs_data_size_param; then echo "cannot initialize rootfs_data volume" return 1 fi From 8d766aa669702f8291a95f985a0b4dd16b1cca2d Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 23 Feb 2021 22:41:13 +0100 Subject: [PATCH 38/45] kernel: add further missing symbols CONFIG_NET_DSA_MV88E6XXX_PTP was simply missing in generic config. CONFIG_I2C_PXA_SLAVE was previously enabled via i2c-pxa package, but got removed there without moving the symbol to generic config. Fixes: dd13add3ceed ("kernel: i2c-pxa: remove slave") Signed-off-by: Adrian Schmutzler --- target/linux/generic/config-5.10 | 2 ++ target/linux/generic/config-5.4 | 2 ++ target/linux/imx6/config-5.4 | 1 - target/linux/kirkwood/config-5.4 | 1 - target/linux/mvebu/config-5.4 | 1 - 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index d88c0de17f..02d1cd40b7 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -2322,6 +2322,7 @@ CONFIG_HW_RANDOM_TPM=y # CONFIG_I2C_PCA_PLATFORM is not set # CONFIG_I2C_PIIX4 is not set # CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_PXA_SLAVE is not set # CONFIG_I2C_RCAR is not set # CONFIG_I2C_RK3X is not set # CONFIG_I2C_ROBOTFUZZ_OSIF is not set @@ -3731,6 +3732,7 @@ CONFIG_NET_CORE=y # CONFIG_NET_DSA_MV88E6352 is not set # CONFIG_NET_DSA_MV88E6XXX is not set # CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +# CONFIG_NET_DSA_MV88E6XXX_PTP is not set # CONFIG_NET_DSA_QCA8K is not set # CONFIG_NET_DSA_REALTEK_SMI is not set # CONFIG_NET_DSA_SJA1105 is not set diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 9755c9658a..5e5ca89920 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -2109,6 +2109,7 @@ CONFIG_HW_RANDOM_TPM=y # CONFIG_I2C_PCA_PLATFORM is not set # CONFIG_I2C_PIIX4 is not set # CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_PXA_SLAVE is not set # CONFIG_I2C_RCAR is not set # CONFIG_I2C_RK3X is not set # CONFIG_I2C_ROBOTFUZZ_OSIF is not set @@ -3445,6 +3446,7 @@ CONFIG_NET_CORE=y # CONFIG_NET_DSA_MV88E6352 is not set # CONFIG_NET_DSA_MV88E6XXX is not set # CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +# CONFIG_NET_DSA_MV88E6XXX_PTP is not set # CONFIG_NET_DSA_QCA8K is not set # CONFIG_NET_DSA_REALTEK_SMI is not set # CONFIG_NET_DSA_SJA1105 is not set diff --git a/target/linux/imx6/config-5.4 b/target/linux/imx6/config-5.4 index 8d3cd56d5d..8469376758 100644 --- a/target/linux/imx6/config-5.4 +++ b/target/linux/imx6/config-5.4 @@ -293,7 +293,6 @@ CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y CONFIG_NET_DSA_MV88E6XXX=y CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y -# CONFIG_NET_DSA_MV88E6XXX_PTP is not set CONFIG_NET_DSA_TAG_DSA=y CONFIG_NET_DSA_TAG_EDSA=y CONFIG_NET_FLOW_LIMIT=y diff --git a/target/linux/kirkwood/config-5.4 b/target/linux/kirkwood/config-5.4 index 2ef4c05074..f7eac5e811 100644 --- a/target/linux/kirkwood/config-5.4 +++ b/target/linux/kirkwood/config-5.4 @@ -180,7 +180,6 @@ CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y CONFIG_NET_DSA_MV88E6XXX=y CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y -# CONFIG_NET_DSA_MV88E6XXX_PTP is not set CONFIG_NET_DSA_TAG_DSA=y CONFIG_NET_DSA_TAG_EDSA=y CONFIG_NET_SWITCHDEV=y diff --git a/target/linux/mvebu/config-5.4 b/target/linux/mvebu/config-5.4 index beeecd138e..382c150cb3 100644 --- a/target/linux/mvebu/config-5.4 +++ b/target/linux/mvebu/config-5.4 @@ -286,7 +286,6 @@ CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y CONFIG_NET_DSA_MV88E6XXX=y CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y -# CONFIG_NET_DSA_MV88E6XXX_PTP is not set CONFIG_NET_DSA_TAG_DSA=y CONFIG_NET_DSA_TAG_EDSA=y CONFIG_NET_FLOW_LIMIT=y From e464d365fe66bd6b5b238a18b32650a8b1d1ef63 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Wed, 17 Feb 2021 21:17:03 +0900 Subject: [PATCH 39/45] kirkwood: copy files to kernel 5.10 Copy config and patches to kernel 5.10. Signed-off-by: Sungbo Eo --- target/linux/kirkwood/config-5.10 | 287 +++++++++++ ...-kirkwood-Add-Check-Point-L-50-board.patch | 485 ++++++++++++++++++ .../kirkwood/patches-5.10/100-ib62x0.patch | 53 ++ .../kirkwood/patches-5.10/101-iconnect.patch | 80 +++ .../kirkwood/patches-5.10/102-dockstar.patch | 62 +++ .../patches-5.10/103-iomega-ix2-200.patch | 67 +++ .../patches-5.10/105-linksys-viper-dts.patch | 52 ++ .../kirkwood/patches-5.10/106-goflexnet.patch | 53 ++ ...-zyxel-nsa3x0-common-nand-partitions.patch | 48 ++ .../kirkwood/patches-5.10/107-03-nsa325.patch | 54 ++ .../patches-5.10/109-pogoplug_v4.patch | 87 ++++ .../kirkwood/patches-5.10/110-pogo_e02.patch | 68 +++ .../kirkwood/patches-5.10/111-l-50.patch | 47 ++ ...able-sata-port-specific-led-triggers.patch | 10 + .../202-linksys-find-active-root.patch | 62 +++ .../patches-5.10/203-blackarmor-nas220.patch | 99 ++++ 16 files changed, 1614 insertions(+) create mode 100644 target/linux/kirkwood/config-5.10 create mode 100644 target/linux/kirkwood/patches-5.10/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch create mode 100644 target/linux/kirkwood/patches-5.10/100-ib62x0.patch create mode 100644 target/linux/kirkwood/patches-5.10/101-iconnect.patch create mode 100644 target/linux/kirkwood/patches-5.10/102-dockstar.patch create mode 100644 target/linux/kirkwood/patches-5.10/103-iomega-ix2-200.patch create mode 100644 target/linux/kirkwood/patches-5.10/105-linksys-viper-dts.patch create mode 100644 target/linux/kirkwood/patches-5.10/106-goflexnet.patch create mode 100644 target/linux/kirkwood/patches-5.10/107-01-zyxel-nsa3x0-common-nand-partitions.patch create mode 100644 target/linux/kirkwood/patches-5.10/107-03-nsa325.patch create mode 100644 target/linux/kirkwood/patches-5.10/109-pogoplug_v4.patch create mode 100644 target/linux/kirkwood/patches-5.10/110-pogo_e02.patch create mode 100644 target/linux/kirkwood/patches-5.10/111-l-50.patch create mode 100644 target/linux/kirkwood/patches-5.10/201-enable-sata-port-specific-led-triggers.patch create mode 100644 target/linux/kirkwood/patches-5.10/202-linksys-find-active-root.patch create mode 100644 target/linux/kirkwood/patches-5.10/203-blackarmor-nas220.patch diff --git a/target/linux/kirkwood/config-5.10 b/target/linux/kirkwood/config-5.10 new file mode 100644 index 0000000000..2ef4c05074 --- /dev/null +++ b/target/linux/kirkwood/config-5.10 @@ -0,0 +1,287 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_CPU_AUTO=y +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +CONFIG_ARCH_MULTI_V4_V5=y +CONFIG_ARCH_MULTI_V5=y +CONFIG_ARCH_MVEBU=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM=y +# CONFIG_ARMADA_37XX_WATCHDOG is not set +# CONFIG_ARMADA_THERMAL is not set +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y +CONFIG_ARM_HAS_SG_CHAIN=y +# CONFIG_ARM_KIRKWOOD_CPUIDLE is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +# CONFIG_ARM_MVEBU_V7_CPUIDLE is not set +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_THUMB is not set +CONFIG_ARM_UNWIND=y +CONFIG_ATA=y +CONFIG_ATAGS=y +CONFIG_ATA_LEDS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_CACHE_FEROCEON_L2=y +# CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_FEROCEON=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FEROCEON=y +# CONFIG_CPU_FEROCEON_OLD_ID is not set +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_PM=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_FEROCEON=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_MARVELL_CESA=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_RNG2=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_MVEBU_UART0_ALTERNATE=y +# CONFIG_DEBUG_MVEBU_UART1_ALTERNATE is not set +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0xf1012000 +CONFIG_DEBUG_UART_VIRT=0xfed12000 +CONFIG_DEBUG_UNCOMPRESS=y +# CONFIG_DLCI is not set +CONFIG_DMA_REMAP=y +CONFIG_DNOTIFY=y +CONFIG_DTC=y +# CONFIG_EARLY_PRINTK is not set +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FORCE_PCI=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GLOB=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_MVEBU=y +CONFIG_GRO_CELLS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_OMAP=y +CONFIG_HZ=100 +CONFIG_HZ_100=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MV64XXX=y +# CONFIG_I2C_PXA is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_KIRKWOOD_CLK=y +CONFIG_KIRKWOOD_THERMAL=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_NETXBIG=y +CONFIG_LEDS_NS2=y +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MACH_KIRKWOOD=y +CONFIG_MACH_MVEBU_ANY=y +CONFIG_MANGLE_BOOTARGS=y +CONFIG_MARVELL_PHY=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MEMFD_CREATE=y +CONFIG_MIGRATION=y +CONFIG_MODULES_USE_ELF_REL=y +# CONFIG_MTD_CFI is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_ECC_SW_HAMMING=y +# CONFIG_MTD_NAND_MARVELL is not set +CONFIG_MTD_NAND_ORION=y +CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MV643XX_ETH=y +CONFIG_MVEBU_CLK_COMMON=y +CONFIG_MVEBU_MBUS=y +CONFIG_MVMDIO=y +# CONFIG_MVNETA is not set +# CONFIG_MVPP2 is not set +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_MV88E6XXX=y +CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y +# CONFIG_NET_DSA_MV88E6XXX_PTP is not set +CONFIG_NET_DSA_TAG_DSA=y +CONFIG_NET_DSA_TAG_EDSA=y +CONFIG_NET_SWITCHDEV=y +CONFIG_NLS=y +CONFIG_NVMEM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_ORION_IRQCHIP=y +CONFIG_ORION_TIMER=y +CONFIG_ORION_WATCHDOG=y +CONFIG_OUTER_CACHE=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +CONFIG_PCI_BRIDGE_EMUL=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_MVEBU=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLINK=y +# CONFIG_PHY_MVEBU_A3700_UTMI is not set +# CONFIG_PHY_MVEBU_A38X_COMPHY is not set +CONFIG_PHY_MVEBU_SATA=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_KIRKWOOD=y +CONFIG_PINCTRL_MVEBU=y +# CONFIG_PINCTRL_SINGLE is not set +CONFIG_PINCTRL_SX150X=y +CONFIG_PLAT_ORION=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO=y +# CONFIG_POWER_RESET_QNAP is not set +CONFIG_POWER_SUPPLY=y +CONFIG_RATIONAL=y +CONFIG_REFCOUNT_FULL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_MV=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_SATA_PMP=y +CONFIG_SCSI=y +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_MCTRL_GPIO=y +# CONFIG_SERIAL_MVEBU_UART is not set +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SGL_ALLOC=y +CONFIG_SG_POOL=y +CONFIG_SOC_BUS=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +# CONFIG_SPI_ARMADA_3700 is not set +CONFIG_SPI_MASTER=y +CONFIG_SPI_ORION=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRAM=y +CONFIG_SRAM_EXEC=y +CONFIG_SRCU=y +CONFIG_SWPHY=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_OF=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TINY_SRCU=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNWINDER_ARM=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_LED_TRIG=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +# CONFIG_VFP is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WAN=y +CONFIG_WATCHDOG_CORE=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/kirkwood/patches-5.10/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch b/target/linux/kirkwood/patches-5.10/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch new file mode 100644 index 0000000000..52caee7b40 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch @@ -0,0 +1,485 @@ +From efa968c18abab78c5e0c40a853caf286c3629a59 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Tue, 17 Mar 2020 21:28:01 +0100 +Subject: [PATCH v3] ARM: dts: kirkwood: Add Check Point L-50 board + +This patch adds dts for the Check Point L-50 from 600/1100 series +routers. + +Specification: +-CPU: Marvell Kirkwood 88F6821 1200MHz +-RAM: 512MB +-Flash: NAND 512MB +-WiFi: mPCIe card based on Atheros AR9287 b/g/n +-WAN: 1 Gigabit Port (Marvell 88E1116R PHY) +-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+3)) +-USB: 2x USB2.0 +-Express card slot +-SD card slot +-Serial console: RJ-45 115200 8n1 +-Unsupported DSL + +Reviewed-by: Andrew Lunn +Signed-off-by: Pawel Dembicki +--- +Changes in v3: +- fix typo and code style issues pointed by OpenWrt guys +Changes in v2: +- none + + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/kirkwood-l-50.dts | 438 ++++++++++++++++++++++++++++ + 2 files changed, 439 insertions(+) + create mode 100644 arch/arm/boot/dts/kirkwood-l-50.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -270,6 +270,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-iomega_ix2_200.dtb \ + kirkwood-is2.dtb \ + kirkwood-km_kirkwood.dtb \ ++ kirkwood-l-50.dtb \ + kirkwood-laplug.dtb \ + kirkwood-linkstation-lsqvl.dtb \ + kirkwood-linkstation-lsvl.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-l-50.dts +@@ -0,0 +1,438 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Check Point L-50 Board Description ++ * Copyright 2020 Pawel Dembicki ++ */ ++ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "Check Point L-50"; ++ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>; ++ pinctrl-names = "default"; ++ ++ pmx_sysrst: pmx-sysrst { ++ marvell,pins = "mpp6"; ++ marvell,function = "sysrst"; ++ }; ++ ++ pmx_button29: pmx_button29 { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led38: pmx_led38 { ++ marvell,pins = "mpp38"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_sdio_cd: pmx-sdio-cd { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ ++ serial@12000 { ++ status = "okay"; ++ }; ++ ++ mvsdio@90000 { ++ status = "okay"; ++ cd-gpios = <&gpio1 14 9>; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ gpio2: gpio-expander@20{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x20>; ++ ++ gpio-controller; ++ }; ++ ++ /* Three GPIOs from 0x21 exp. are undescribed in dts: ++ * 1: DSL module reset (active low) ++ * 5: mPCIE reset (active low) ++ * 6: Express card reset (active low) ++ */ ++ gpio3: gpio-expander@21{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x21>; ++ ++ gpio-controller; ++ }; ++ ++ rtc@30 { ++ compatible = "s35390a"; ++ reg = <0x30>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ status_green { ++ label = "l-50:green:status"; ++ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; ++ }; ++ ++ status_red { ++ label = "l-50:red:status"; ++ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "l-50:green:wifi"; ++ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ internet_green { ++ label = "l-50:green:internet"; ++ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet_red { ++ label = "l-50:red:internet"; ++ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb1_green { ++ label = "l-50:green:usb1"; ++ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port3>; ++ }; ++ ++ usb1_red { ++ label = "l-50:red:usb1"; ++ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2_green { ++ label = "l-50:green:usb2"; ++ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port1>; ++ }; ++ ++ usb2_red { ++ label = "l-50:red:usb2"; ++ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ usb2_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb2_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ usb1_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ mpcie_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "mpcie_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ express_card_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "express_card_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ factory_defaults { ++ label = "factory_defaults"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy8: ethernet-phy@8 { ++ reg = <0x08>; ++ }; ++ ++ switch0: switch@10 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x10>; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan7"; ++ }; ++ ++ switch0port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch1port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ phy-mode = "rgmii-id"; ++ ethernet = <ð1port>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ switch@11 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x11>; ++ dsa,member = <0 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan3"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "dmz"; ++ }; ++ ++ switch1port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch0port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "dsl"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ phy-handle = <ðphy8>; ++ }; ++}; ++ ++ð1 { ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ pinctrl-0 = <&pmx_nand>; ++ pinctrl-names = "default"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; ++ }; ++ ++ partition@a0000 { ++ label = "bootldr-env"; ++ reg = <0x000c0000 0x00040000>; ++ }; ++ ++ partition@100000 { ++ label = "kernel-1"; ++ reg = <0x00100000 0x00800000>; ++ }; ++ ++ partition@900000 { ++ label = "rootfs-1"; ++ reg = <0x00900000 0x07100000>; ++ }; ++ ++ partition@7a00000 { ++ label = "kernel-2"; ++ reg = <0x07a00000 0x00800000>; ++ }; ++ ++ partition@8200000 { ++ label = "rootfs-2"; ++ reg = <0x08200000 0x07100000>; ++ }; ++ ++ partition@f300000 { ++ label = "default_sw"; ++ reg = <0x0f300000 0x07900000>; ++ }; ++ ++ partition@16c00000 { ++ label = "logs"; ++ reg = <0x16c00000 0x01800000>; ++ }; ++ ++ partition@18400000 { ++ label = "preset_cfg"; ++ reg = <0x18400000 0x00100000>; ++ }; ++ ++ partition@18500000 { ++ label = "adsl"; ++ reg = <0x18500000 0x00100000>; ++ }; ++ ++ partition@18600000 { ++ label = "storage"; ++ reg = <0x18600000 0x07a00000>; ++ }; ++}; ++ ++&rtc { ++ status = "disabled"; ++}; ++ ++&pciec { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&sata_phy0 { ++ status = "disabled"; ++}; ++ ++&sata_phy1 { ++ status = "disabled"; ++}; ++ ++&usb0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ port@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ ++ hub_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ hub_port3: port@3 { ++ reg = <3>; ++ #trigger-source-cells = <0>; ++ }; ++ }; ++}; diff --git a/target/linux/kirkwood/patches-5.10/100-ib62x0.patch b/target/linux/kirkwood/patches-5.10/100-ib62x0.patch new file mode 100644 index 0000000000..0637c24b63 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/100-ib62x0.patch @@ -0,0 +1,53 @@ +--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts ++++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts +@@ -6,7 +6,14 @@ + + / { + model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)"; +- compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ compatible = "raidsonic,ib-nas62x0", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ aliases { ++ led-boot = &led_green_os; ++ led-failsafe = &led_red_os; ++ led-running = &led_green_os; ++ led-upgrade = &led_red_os; ++ }; + + memory { + device_type = "memory"; +@@ -81,12 +88,12 @@ + &pmx_led_usb_transfer>; + pinctrl-names = "default"; + +- green-os { ++ led_green_os: green-os { + label = "ib62x0:green:os"; + gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; +- default-state = "keep"; ++ default-state = "on"; + }; +- red-os { ++ led_red_os: red-os { + label = "ib62x0:red:os"; + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + }; +@@ -118,13 +125,13 @@ + }; + + partition@100000 { +- label = "uImage"; +- reg = <0x0100000 0x600000>; ++ label = "second stage u-boot"; ++ reg = <0x100000 0x200000>; + }; + +- partition@700000 { +- label = "root"; +- reg = <0x0700000 0xf900000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x200000 0xfe00000>; + }; + + }; diff --git a/target/linux/kirkwood/patches-5.10/101-iconnect.patch b/target/linux/kirkwood/patches-5.10/101-iconnect.patch new file mode 100644 index 0000000000..935e2dfcf5 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/101-iconnect.patch @@ -0,0 +1,80 @@ +--- a/arch/arm/boot/dts/kirkwood-iconnect.dts ++++ b/arch/arm/boot/dts/kirkwood-iconnect.dts +@@ -8,6 +8,13 @@ + model = "Iomega Iconnect"; + compatible = "iom,iconnect-1.1", "iom,iconnect", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_power_blue; ++ led-failsafe = &led_power_red; ++ led-running = &led_power_blue; ++ led-upgrade = &led_power_red; ++ }; ++ + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; +@@ -16,8 +23,6 @@ + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; +- linux,initrd-start = <0x4500040>; +- linux,initrd-end = <0x4800000>; + }; + + ocp@f1000000 { +@@ -89,12 +94,12 @@ + gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; +- power-blue { ++ led_power_blue: power-blue { + label = "power:blue"; + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; +- default-state = "keep"; ++ default-state = "on"; + }; +- power-red { ++ led_power_red: power-red { + label = "power:red"; + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + }; +@@ -146,28 +151,23 @@ + status = "okay"; + + partition@0 { +- label = "uboot"; +- reg = <0x0000000 0xc0000>; ++ label = "u-boot"; ++ reg = <0x0000000 0xe0000>; + }; + +- partition@a0000 { +- label = "env"; +- reg = <0xa0000 0x20000>; ++ partition@e0000 { ++ label = "u-boot environment"; ++ reg = <0xe0000 0x100000>; + }; + + partition@100000 { +- label = "zImage"; +- reg = <0x100000 0x300000>; +- }; +- +- partition@540000 { +- label = "initrd"; +- reg = <0x540000 0x300000>; ++ label = "second stage u-boot"; ++ reg = <0x100000 0x200000>; + }; + +- partition@980000 { +- label = "boot"; +- reg = <0x980000 0x1f400000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x200000 0x1fe00000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-5.10/102-dockstar.patch b/target/linux/kirkwood/patches-5.10/102-dockstar.patch new file mode 100644 index 0000000000..127f84962c --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/102-dockstar.patch @@ -0,0 +1,62 @@ +--- a/arch/arm/boot/dts/kirkwood-dockstar.dts ++++ b/arch/arm/boot/dts/kirkwood-dockstar.dts +@@ -8,6 +8,13 @@ + model = "Seagate FreeAgent Dockstar"; + compatible = "seagate,dockstar", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_health; ++ led-failsafe = &led_fault; ++ led-running = &led_health; ++ led-upgrade = &led_fault; ++ }; ++ + memory { + device_type = "memory"; + reg = <0x00000000 0x8000000>; +@@ -42,12 +49,12 @@ + pinctrl-0 = <&pmx_led_green &pmx_led_orange>; + pinctrl-names = "default"; + +- health { ++ led_health: health { + label = "status:green:health"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; +- default-state = "keep"; ++ default-state = "on"; + }; +- fault { ++ led_fault: fault { + label = "status:orange:fault"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; +@@ -78,18 +85,22 @@ + + partition@0 { + label = "u-boot"; +- reg = <0x0000000 0x100000>; +- read-only; ++ reg = <0x0000000 0xe0000>; ++ }; ++ ++ partition@e0000 { ++ label = "u-boot environment"; ++ reg = <0xe0000 0x100000>; + }; + + partition@100000 { +- label = "uImage"; +- reg = <0x0100000 0x400000>; ++ label = "second stage u-boot"; ++ reg = <0x100000 0x200000>; + }; + +- partition@500000 { +- label = "data"; +- reg = <0x0500000 0xfb00000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x200000 0xfe00000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-5.10/103-iomega-ix2-200.patch b/target/linux/kirkwood/patches-5.10/103-iomega-ix2-200.patch new file mode 100644 index 0000000000..9313b4bc3e --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/103-iomega-ix2-200.patch @@ -0,0 +1,67 @@ +--- a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts ++++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +@@ -8,6 +8,13 @@ + model = "Iomega StorCenter ix2-200"; + compatible = "iom,ix2-200", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_power; ++ led-failsafe = &led_health; ++ led-running = &led_power; ++ led-upgrade = &led_health; ++ }; ++ + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; +@@ -127,16 +134,16 @@ + &pmx_led_rebuild &pmx_led_health >; + pinctrl-names = "default"; + +- power_led { ++ led_power: power_led { + label = "status:white:power_led"; + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; +- default-state = "keep"; ++ default-state = "on"; + }; + rebuild_led { + label = "status:white:rebuild_led"; + gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + }; +- health_led { ++ led_health: health_led { + label = "status:red:health_led"; + gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + }; +@@ -186,18 +193,18 @@ + }; + + partition@a0000 { +- label = "env"; ++ label = "u-boot environment"; + reg = <0xa0000 0x20000>; + read-only; + }; + + partition@100000 { +- label = "uImage"; ++ label = "kernel"; + reg = <0x100000 0x300000>; + }; + + partition@400000 { +- label = "rootfs"; ++ label = "ubi"; + reg = <0x400000 0x1C00000>; + }; + }; +@@ -211,7 +218,7 @@ + }; + + ð0 { +- status = "okay"; ++ status = "disabled"; + ethernet0-port@0 { + speed = <1000>; + duplex = <1>; diff --git a/target/linux/kirkwood/patches-5.10/105-linksys-viper-dts.patch b/target/linux/kirkwood/patches-5.10/105-linksys-viper-dts.patch new file mode 100644 index 0000000000..0d97ad14a2 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/105-linksys-viper-dts.patch @@ -0,0 +1,52 @@ +--- a/arch/arm/boot/dts/kirkwood-linksys-viper.dts ++++ b/arch/arm/boot/dts/kirkwood-linksys-viper.dts +@@ -24,6 +24,10 @@ + }; + + aliases { ++ led-boot = &led_white_health; ++ led-failsafe = &led_white_health; ++ led-running = &led_white_health; ++ led-upgrade = &led_white_health; + serial0 = &uart0; + }; + +@@ -56,9 +60,10 @@ + pinctrl-0 = < &pmx_led_white_health &pmx_led_white_pulse >; + pinctrl-names = "default"; + +- white-health { ++ led_white_health: white-health { + label = "viper:white:health"; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; + }; + + white-pulse { +@@ -114,22 +119,22 @@ + }; + + partition@200000 { +- label = "kernel"; ++ label = "kernel1"; + reg = <0x200000 0x2A0000>; + }; + + partition@4a0000 { +- label = "rootfs"; ++ label = "rootfs1"; + reg = <0x4A0000 0x1760000>; + }; + + partition@1c00000 { +- label = "alt_kernel"; ++ label = "kernel2"; + reg = <0x1C00000 0x2A0000>; + }; + + partition@1ea0000 { +- label = "alt_rootfs"; ++ label = "rootfs2"; + reg = <0x1EA0000 0x1760000>; + }; + diff --git a/target/linux/kirkwood/patches-5.10/106-goflexnet.patch b/target/linux/kirkwood/patches-5.10/106-goflexnet.patch new file mode 100644 index 0000000000..82cf90841e --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/106-goflexnet.patch @@ -0,0 +1,53 @@ +--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts ++++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts +@@ -8,6 +8,13 @@ + model = "Seagate GoFlex Net"; + compatible = "seagate,goflexnet", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_health; ++ led-failsafe = &led_fault; ++ led-running = &led_health; ++ led-upgrade = &led_fault; ++ }; ++ + memory { + device_type = "memory"; + reg = <0x00000000 0x8000000>; +@@ -85,12 +92,12 @@ + >; + pinctrl-names = "default"; + +- health { ++ led_health: health { + label = "status:green:health"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; +- default-state = "keep"; ++ default-state = "on"; + }; +- fault { ++ led_fault: fault { + label = "status:orange:fault"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; +@@ -159,18 +166,8 @@ + }; + + partition@100000 { +- label = "uImage"; +- reg = <0x0100000 0x400000>; +- }; +- +- partition@500000 { +- label = "pogoplug"; +- reg = <0x0500000 0x2000000>; +- }; +- +- partition@2500000 { +- label = "root"; +- reg = <0x02500000 0xd800000>; ++ label = "ubi"; ++ reg = <0x0100000 0x0ff00000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-5.10/107-01-zyxel-nsa3x0-common-nand-partitions.patch b/target/linux/kirkwood/patches-5.10/107-01-zyxel-nsa3x0-common-nand-partitions.patch new file mode 100644 index 0000000000..df654033fd --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/107-01-zyxel-nsa3x0-common-nand-partitions.patch @@ -0,0 +1,48 @@ +--- a/arch/arm/boot/dts/kirkwood-nsa3x0-common.dtsi ++++ b/arch/arm/boot/dts/kirkwood-nsa3x0-common.dtsi +@@ -112,40 +112,16 @@ + + partition@0 { + label = "uboot"; +- reg = <0x0000000 0x0100000>; ++ reg = <0x0000000 0x00c0000>; + read-only; + }; + partition@100000 { + label = "uboot_env"; +- reg = <0x0100000 0x0080000>; ++ reg = <0x00c0000 0x0080000>; + }; +- partition@180000 { +- label = "key_store"; +- reg = <0x0180000 0x0080000>; +- }; +- partition@200000 { +- label = "info"; +- reg = <0x0200000 0x0080000>; +- }; +- partition@280000 { +- label = "etc"; +- reg = <0x0280000 0x0a00000>; +- }; +- partition@c80000 { +- label = "kernel_1"; +- reg = <0x0c80000 0x0a00000>; +- }; +- partition@1680000 { +- label = "rootfs1"; +- reg = <0x1680000 0x2fc0000>; +- }; +- partition@4640000 { +- label = "kernel_2"; +- reg = <0x4640000 0x0a00000>; +- }; +- partition@5040000 { +- label = "rootfs2"; +- reg = <0x5040000 0x2fc0000>; ++ partition@140000 { ++ label = "ubi"; ++ reg = <0x0140000 0x7ec0000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-5.10/107-03-nsa325.patch b/target/linux/kirkwood/patches-5.10/107-03-nsa325.patch new file mode 100644 index 0000000000..374c0895a9 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/107-03-nsa325.patch @@ -0,0 +1,54 @@ +--- a/arch/arm/boot/dts/kirkwood-nsa325.dts ++++ b/arch/arm/boot/dts/kirkwood-nsa325.dts +@@ -15,6 +15,13 @@ + model = "ZyXEL NSA325"; + compatible = "zyxel,nsa325", "marvell,kirkwood-88f6282", "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_green_sys; ++ led-failsafe = &led_orange_sys; ++ led-running = &led_green_sys; ++ led-upgrade = &led_orange_sys; ++ }; ++ + memory { + device_type = "memory"; + reg = <0x00000000 0x20000000>; +@@ -162,17 +169,19 @@ + &pmx_led_hdd1_green &pmx_led_hdd1_red>; + pinctrl-names = "default"; + +- green-sys { ++ led_green_sys: green-sys { + label = "nsa325:green:sys"; + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; + }; +- orange-sys { ++ led_orange_sys: orange-sys { + label = "nsa325:orange:sys"; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + green-hdd1 { + label = "nsa325:green:hdd1"; + gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "ata1"; + }; + red-hdd1 { + label = "nsa325:red:hdd1"; +@@ -181,6 +190,7 @@ + green-hdd2 { + label = "nsa325:green:hdd2"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "ata2"; + }; + red-hdd2 { + label = "nsa325:red:hdd2"; +@@ -189,6 +199,7 @@ + green-usb { + label = "nsa325:green:usb"; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "usb-host"; + }; + green-copy { + label = "nsa325:green:copy"; diff --git a/target/linux/kirkwood/patches-5.10/109-pogoplug_v4.patch b/target/linux/kirkwood/patches-5.10/109-pogoplug_v4.patch new file mode 100644 index 0000000000..4273eb9af1 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/109-pogoplug_v4.patch @@ -0,0 +1,87 @@ +--- a/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts ++++ b/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts +@@ -18,12 +18,20 @@ + compatible = "cloudengines,pogoplugv4", "marvell,kirkwood-88f6192", + "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_health; ++ led-failsafe = &led_fault; ++ led-running = &led_health; ++ led-upgrade = &led_fault; ++ }; ++ + memory { + device_type = "memory"; + reg = <0x00000000 0x08000000>; + }; + + chosen { ++ bootargs = "console=ttyS0,115200"; + stdout-path = "uart0:115200n8"; + }; + +@@ -37,8 +45,8 @@ + eject { + debounce-interval = <50>; + wakeup-source; +- linux,code = ; +- label = "Eject Button"; ++ linux,code = ; ++ label = "Reset"; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + }; +@@ -48,12 +56,12 @@ + pinctrl-0 = <&pmx_led_green &pmx_led_red>; + pinctrl-names = "default"; + +- health { ++ led_health: health { + label = "pogoplugv4:green:health"; + gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; +- fault { ++ led_fault: fault { + label = "pogoplugv4:red:fault"; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + }; +@@ -137,29 +145,19 @@ + #size-cells = <1>; + + partition@0 { +- label = "u-boot"; +- reg = <0x00000000 0x200000>; ++ label = "uboot"; ++ reg = <0x00000000 0x1c0000>; + read-only; + }; + +- partition@200000 { +- label = "uImage"; +- reg = <0x00200000 0x300000>; +- }; +- +- partition@500000 { +- label = "uImage2"; +- reg = <0x00500000 0x300000>; +- }; +- +- partition@800000 { +- label = "failsafe"; +- reg = <0x00800000 0x800000>; ++ partition@1c0000 { ++ label = "uboot_env"; ++ reg = <0x001c0000 0x40000>; + }; + +- partition@1000000 { +- label = "root"; +- reg = <0x01000000 0x7000000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x00200000 0x7e00000>; + }; + }; + }; diff --git a/target/linux/kirkwood/patches-5.10/110-pogo_e02.patch b/target/linux/kirkwood/patches-5.10/110-pogo_e02.patch new file mode 100644 index 0000000000..fc384d3521 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/110-pogo_e02.patch @@ -0,0 +1,68 @@ +--- a/arch/arm/boot/dts/kirkwood-pogo_e02.dts ++++ b/arch/arm/boot/dts/kirkwood-pogo_e02.dts +@@ -20,6 +20,13 @@ + compatible = "cloudengines,pogoe02", "marvell,kirkwood-88f6281", + "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_health; ++ led-failsafe = &led_fault; ++ led-running = &led_health; ++ led-upgrade = &led_fault; ++ }; ++ + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; +@@ -33,12 +40,12 @@ + gpio-leds { + compatible = "gpio-leds"; + +- health { ++ led_health: health { + label = "pogo_e02:green:health"; + gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; +- default-state = "keep"; ++ default-state = "on"; + }; +- fault { ++ led_fault: fault { + label = "pogo_e02:orange:fault"; + gpios = <&gpio1 17 GPIO_ACTIVE_LOW>; + }; +@@ -95,24 +102,24 @@ + status = "okay"; + + partition@0 { +- label = "u-boot"; +- reg = <0x0000000 0x100000>; ++ label = "uboot"; ++ reg = <0x0 0xe0000>; + read-only; + }; + +- partition@100000 { +- label = "uImage"; +- reg = <0x0100000 0x400000>; ++ partition@e0000 { ++ label = "uboot_env"; ++ reg = <0xe0000 0x20000>; + }; + +- partition@500000 { +- label = "pogoplug"; +- reg = <0x0500000 0x2000000>; ++ partition@100000 { ++ label = "second_stage_uboot"; ++ reg = <0x100000 0x100000>; + }; + +- partition@2500000 { +- label = "root"; +- reg = <0x02500000 0x5b00000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x200000 0x7e00000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-5.10/111-l-50.patch b/target/linux/kirkwood/patches-5.10/111-l-50.patch new file mode 100644 index 0000000000..bc933cb610 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/111-l-50.patch @@ -0,0 +1,47 @@ +--- a/arch/arm/boot/dts/kirkwood-l-50.dts ++++ b/arch/arm/boot/dts/kirkwood-l-50.dts +@@ -18,6 +18,13 @@ + reg = <0x00000000 0x20000000>; + }; + ++ aliases { ++ led-boot = &led_status_green; ++ led-failsafe = &led_status_red; ++ led-running = &led_status_green; ++ led-upgrade = &led_status_red; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200n8"; + stdout-path = &uart0; +@@ -95,12 +102,12 @@ + leds { + compatible = "gpio-leds"; + +- status_green { ++ led_status_green: status_green { + label = "l-50:green:status"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + }; + +- status_red { ++ led_status_red: status_red { + label = "l-50:red:status"; + gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; + }; +@@ -349,13 +356,8 @@ + }; + + partition@100000 { +- label = "kernel-1"; +- reg = <0x00100000 0x00800000>; +- }; +- +- partition@900000 { +- label = "rootfs-1"; +- reg = <0x00900000 0x07100000>; ++ label = "ubi"; ++ reg = <0x00100000 0x07900000>; + }; + + partition@7a00000 { diff --git a/target/linux/kirkwood/patches-5.10/201-enable-sata-port-specific-led-triggers.patch b/target/linux/kirkwood/patches-5.10/201-enable-sata-port-specific-led-triggers.patch new file mode 100644 index 0000000000..c1645367a4 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/201-enable-sata-port-specific-led-triggers.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/mach-mvebu/Kconfig ++++ b/arch/arm/mach-mvebu/Kconfig +@@ -119,6 +119,7 @@ config MACH_DOVE + config MACH_KIRKWOOD + bool "Marvell Kirkwood boards" + depends on ARCH_MULTI_V5 ++ select ARCH_WANT_LIBATA_LEDS + select CPU_FEROCEON + select GPIOLIB + select KIRKWOOD_CLK diff --git a/target/linux/kirkwood/patches-5.10/202-linksys-find-active-root.patch b/target/linux/kirkwood/patches-5.10/202-linksys-find-active-root.patch new file mode 100644 index 0000000000..b7e7f50271 --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/202-linksys-find-active-root.patch @@ -0,0 +1,62 @@ +The WRT1900AC among other Linksys routers uses a dual-firmware layout. +Dynamically rename the active partition to "ubi". + +Signed-off-by: Imre Kaloz +--- +--- a/drivers/mtd/parsers/ofpart.c ++++ b/drivers/mtd/parsers/ofpart.c +@@ -21,6 +21,8 @@ static bool node_has_compatible(struct d + return of_get_property(pp, "compatible", NULL); + } + ++static int mangled_rootblock; ++ + static int parse_fixed_partitions(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) +@@ -28,6 +30,7 @@ static int parse_fixed_partitions(struct + struct mtd_partition *parts; + struct device_node *mtd_node; + struct device_node *ofpart_node; ++ const char *owrtpart = "ubi"; + const char *partname; + struct device_node *pp; + int nr_parts, i, ret = 0; +@@ -106,9 +109,15 @@ static int parse_fixed_partitions(struct + parts[i].size = of_read_number(reg + a_cells, s_cells); + parts[i].of_node = pp; + +- partname = of_get_property(pp, "label", &len); +- if (!partname) +- partname = of_get_property(pp, "name", &len); ++ if (mangled_rootblock && (i == mangled_rootblock)) { ++ partname = owrtpart; ++ } else { ++ partname = of_get_property(pp, "label", &len); ++ ++ if (!partname) ++ partname = of_get_property(pp, "name", &len); ++ } ++ + parts[i].name = partname; + + if (of_get_property(pp, "read-only", &len)) +@@ -215,6 +224,18 @@ static int __init ofpart_parser_init(voi + return 0; + } + ++static int __init active_root(char *str) ++{ ++ get_option(&str, &mangled_rootblock); ++ ++ if (!mangled_rootblock) ++ return 1; ++ ++ return 1; ++} ++ ++__setup("mangled_rootblock=", active_root); ++ + static void __exit ofpart_parser_exit(void) + { + deregister_mtd_parser(&ofpart_parser); diff --git a/target/linux/kirkwood/patches-5.10/203-blackarmor-nas220.patch b/target/linux/kirkwood/patches-5.10/203-blackarmor-nas220.patch new file mode 100644 index 0000000000..e04a28206a --- /dev/null +++ b/target/linux/kirkwood/patches-5.10/203-blackarmor-nas220.patch @@ -0,0 +1,99 @@ +--- a/arch/arm/boot/dts/kirkwood-blackarmor-nas220.dts ++++ b/arch/arm/boot/dts/kirkwood-blackarmor-nas220.dts +@@ -17,6 +17,13 @@ + compatible = "seagate,blackarmor-nas220","marvell,kirkwood-88f6192", + "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_status_amber; ++ led-failsafe = &led_status_amber; ++ led-running = &led_status_blue; ++ led-upgrade = &led_status_amber; ++ }; ++ + memory { /* 128 MB */ + device_type = "memory"; + reg = <0x00000000 0x8000000>; +@@ -36,14 +43,14 @@ + compatible = "gpio-keys"; + + reset { +- label = "Reset"; +- linux,code = ; ++ label = "Reset Button"; ++ linux,code = ; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + +- button { +- label = "Power"; +- linux,code = ; ++ power { ++ label = "Power Button"; ++ linux,code = ; + gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; + }; + }; +@@ -51,11 +58,27 @@ + gpio-leds { + compatible = "gpio-leds"; + +- blue-power { ++ led_power_blue: power_blue { + label = "nas220:blue:power"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-on"; + }; ++ ++ disk_blue { ++ label = "nas220:blue:disk"; ++ gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "disk-activity"; ++ }; ++ ++ led_status_blue: status_blue { ++ label = "nas220:blue:status"; ++ gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led_status_amber: status_amber { ++ label = "nas220:amber:status"; ++ gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; ++ }; + }; + + regulators { +@@ -153,6 +176,33 @@ + + &nand { + status = "okay"; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ ++ partition@0 { ++ label = "uboot"; ++ reg = <0x0 0xa0000>; ++ read-only; ++ }; ++ ++ partition@a0000 { ++ label = "uboot-env"; ++ reg = <0xa0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@b0000 { ++ label = "reserved"; ++ reg = <0xb0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@c0000 { ++ label = "ubi"; ++ reg = <0xc0000 0x1e80000>; ++ }; ++ }; + }; + + &mdio { From 58ebc507241d4f1b9c4505c4b47acbf51f12d3ec Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Wed, 17 Feb 2021 21:36:25 +0900 Subject: [PATCH 40/45] kirkwood: refresh patches for kernel 5.10 Refresh patches to make them apply to kernel 5.10. The removed patch has been merged upstream. Signed-off-by: Sungbo Eo --- ...-kirkwood-Add-Check-Point-L-50-board.patch | 485 ------------------ ...able-sata-port-specific-led-triggers.patch | 2 +- .../202-linksys-find-active-root.patch | 2 +- 3 files changed, 2 insertions(+), 487 deletions(-) delete mode 100644 target/linux/kirkwood/patches-5.10/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch diff --git a/target/linux/kirkwood/patches-5.10/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch b/target/linux/kirkwood/patches-5.10/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch deleted file mode 100644 index 52caee7b40..0000000000 --- a/target/linux/kirkwood/patches-5.10/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch +++ /dev/null @@ -1,485 +0,0 @@ -From efa968c18abab78c5e0c40a853caf286c3629a59 Mon Sep 17 00:00:00 2001 -From: Pawel Dembicki -Date: Tue, 17 Mar 2020 21:28:01 +0100 -Subject: [PATCH v3] ARM: dts: kirkwood: Add Check Point L-50 board - -This patch adds dts for the Check Point L-50 from 600/1100 series -routers. - -Specification: --CPU: Marvell Kirkwood 88F6821 1200MHz --RAM: 512MB --Flash: NAND 512MB --WiFi: mPCIe card based on Atheros AR9287 b/g/n --WAN: 1 Gigabit Port (Marvell 88E1116R PHY) --LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+3)) --USB: 2x USB2.0 --Express card slot --SD card slot --Serial console: RJ-45 115200 8n1 --Unsupported DSL - -Reviewed-by: Andrew Lunn -Signed-off-by: Pawel Dembicki ---- -Changes in v3: -- fix typo and code style issues pointed by OpenWrt guys -Changes in v2: -- none - - arch/arm/boot/dts/Makefile | 1 + - arch/arm/boot/dts/kirkwood-l-50.dts | 438 ++++++++++++++++++++++++++++ - 2 files changed, 439 insertions(+) - create mode 100644 arch/arm/boot/dts/kirkwood-l-50.dts - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -270,6 +270,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-iomega_ix2_200.dtb \ - kirkwood-is2.dtb \ - kirkwood-km_kirkwood.dtb \ -+ kirkwood-l-50.dtb \ - kirkwood-laplug.dtb \ - kirkwood-linkstation-lsqvl.dtb \ - kirkwood-linkstation-lsvl.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-l-50.dts -@@ -0,0 +1,438 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Check Point L-50 Board Description -+ * Copyright 2020 Pawel Dembicki -+ */ -+ -+/dts-v1/; -+ -+#include "kirkwood.dtsi" -+#include "kirkwood-6281.dtsi" -+ -+/ { -+ model = "Check Point L-50"; -+ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood"; -+ -+ memory { -+ device_type = "memory"; -+ reg = <0x00000000 0x20000000>; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200n8"; -+ stdout-path = &uart0; -+ }; -+ -+ ocp@f1000000 { -+ pinctrl: pin-controller@10000 { -+ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>; -+ pinctrl-names = "default"; -+ -+ pmx_sysrst: pmx-sysrst { -+ marvell,pins = "mpp6"; -+ marvell,function = "sysrst"; -+ }; -+ -+ pmx_button29: pmx_button29 { -+ marvell,pins = "mpp29"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led38: pmx_led38 { -+ marvell,pins = "mpp38"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_sdio_cd: pmx-sdio-cd { -+ marvell,pins = "mpp46"; -+ marvell,function = "gpio"; -+ }; -+ }; -+ -+ serial@12000 { -+ status = "okay"; -+ }; -+ -+ mvsdio@90000 { -+ status = "okay"; -+ cd-gpios = <&gpio1 14 9>; -+ }; -+ -+ i2c@11000 { -+ status = "okay"; -+ clock-frequency = <400000>; -+ -+ gpio2: gpio-expander@20{ -+ #gpio-cells = <2>; -+ #interrupt-cells = <2>; -+ compatible = "semtech,sx1505q"; -+ reg = <0x20>; -+ -+ gpio-controller; -+ }; -+ -+ /* Three GPIOs from 0x21 exp. are undescribed in dts: -+ * 1: DSL module reset (active low) -+ * 5: mPCIE reset (active low) -+ * 6: Express card reset (active low) -+ */ -+ gpio3: gpio-expander@21{ -+ #gpio-cells = <2>; -+ #interrupt-cells = <2>; -+ compatible = "semtech,sx1505q"; -+ reg = <0x21>; -+ -+ gpio-controller; -+ }; -+ -+ rtc@30 { -+ compatible = "s35390a"; -+ reg = <0x30>; -+ }; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ status_green { -+ label = "l-50:green:status"; -+ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; -+ }; -+ -+ status_red { -+ label = "l-50:red:status"; -+ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; -+ }; -+ -+ wifi { -+ label = "l-50:green:wifi"; -+ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "phy0tpt"; -+ }; -+ -+ internet_green { -+ label = "l-50:green:internet"; -+ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; -+ }; -+ -+ internet_red { -+ label = "l-50:red:internet"; -+ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; -+ }; -+ -+ usb1_green { -+ label = "l-50:green:usb1"; -+ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "usbport"; -+ trigger-sources = <&hub_port3>; -+ }; -+ -+ usb1_red { -+ label = "l-50:red:usb1"; -+ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; -+ }; -+ -+ usb2_green { -+ label = "l-50:green:usb2"; -+ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "usbport"; -+ trigger-sources = <&hub_port1>; -+ }; -+ -+ usb2_red { -+ label = "l-50:red:usb2"; -+ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ usb2_pwr { -+ compatible = "regulator-fixed"; -+ regulator-name = "usb2_pwr"; -+ -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>; -+ regulator-always-on; -+ }; -+ -+ usb1_pwr { -+ compatible = "regulator-fixed"; -+ regulator-name = "usb1_pwr"; -+ -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>; -+ regulator-always-on; -+ }; -+ -+ mpcie_pwr { -+ compatible = "regulator-fixed"; -+ regulator-name = "mpcie_pwr"; -+ -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ regulator-always-on; -+ }; -+ -+ express_card_pwr { -+ compatible = "regulator-fixed"; -+ regulator-name = "express_card_pwr"; -+ -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ regulator-always-on; -+ }; -+ -+ keys { -+ compatible = "gpio-keys"; -+ -+ factory_defaults { -+ label = "factory_defaults"; -+ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; -+ linux,code = ; -+ }; -+ }; -+}; -+ -+&mdio { -+ status = "okay"; -+ -+ ethphy8: ethernet-phy@8 { -+ reg = <0x08>; -+ }; -+ -+ switch0: switch@10 { -+ compatible = "marvell,mv88e6085"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0x10>; -+ dsa,member = <0 0>; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ port@0 { -+ reg = <0>; -+ label = "lan5"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "lan1"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "lan6"; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "lan2"; -+ }; -+ -+ port@4 { -+ reg = <4>; -+ label = "lan7"; -+ }; -+ -+ switch0port5: port@5 { -+ reg = <5>; -+ phy-mode = "rgmii-txid"; -+ link = <&switch1port5>; -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; -+ }; -+ -+ port@6 { -+ reg = <6>; -+ label = "cpu"; -+ phy-mode = "rgmii-id"; -+ ethernet = <ð1port>; -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; -+ }; -+ }; -+ }; -+ -+ switch@11 { -+ compatible = "marvell,mv88e6085"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0x11>; -+ dsa,member = <0 1>; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ port@0 { -+ reg = <0>; -+ label = "lan3"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "lan8"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "lan4"; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "dmz"; -+ }; -+ -+ switch1port5: port@5 { -+ reg = <5>; -+ phy-mode = "rgmii-txid"; -+ link = <&switch0port5>; -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; -+ }; -+ -+ port@6 { -+ reg = <6>; -+ label = "dsl"; -+ fixed-link { -+ speed = <100>; -+ full-duplex; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+ð0 { -+ status = "okay"; -+ ethernet0-port@0 { -+ phy-handle = <ðphy8>; -+ }; -+}; -+ -+ð1 { -+ status = "okay"; -+ ethernet1-port@0 { -+ speed = <1000>; -+ duplex = <1>; -+ }; -+}; -+ -+&nand { -+ status = "okay"; -+ pinctrl-0 = <&pmx_nand>; -+ pinctrl-names = "default"; -+ -+ partition@0 { -+ label = "u-boot"; -+ reg = <0x00000000 0x000c0000>; -+ }; -+ -+ partition@a0000 { -+ label = "bootldr-env"; -+ reg = <0x000c0000 0x00040000>; -+ }; -+ -+ partition@100000 { -+ label = "kernel-1"; -+ reg = <0x00100000 0x00800000>; -+ }; -+ -+ partition@900000 { -+ label = "rootfs-1"; -+ reg = <0x00900000 0x07100000>; -+ }; -+ -+ partition@7a00000 { -+ label = "kernel-2"; -+ reg = <0x07a00000 0x00800000>; -+ }; -+ -+ partition@8200000 { -+ label = "rootfs-2"; -+ reg = <0x08200000 0x07100000>; -+ }; -+ -+ partition@f300000 { -+ label = "default_sw"; -+ reg = <0x0f300000 0x07900000>; -+ }; -+ -+ partition@16c00000 { -+ label = "logs"; -+ reg = <0x16c00000 0x01800000>; -+ }; -+ -+ partition@18400000 { -+ label = "preset_cfg"; -+ reg = <0x18400000 0x00100000>; -+ }; -+ -+ partition@18500000 { -+ label = "adsl"; -+ reg = <0x18500000 0x00100000>; -+ }; -+ -+ partition@18600000 { -+ label = "storage"; -+ reg = <0x18600000 0x07a00000>; -+ }; -+}; -+ -+&rtc { -+ status = "disabled"; -+}; -+ -+&pciec { -+ status = "okay"; -+}; -+ -+&pcie0 { -+ status = "okay"; -+}; -+ -+&sata_phy0 { -+ status = "disabled"; -+}; -+ -+&sata_phy1 { -+ status = "disabled"; -+}; -+ -+&usb0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ port@1 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <1>; -+ #trigger-source-cells = <0>; -+ -+ hub_port1: port@1 { -+ reg = <1>; -+ #trigger-source-cells = <0>; -+ }; -+ -+ hub_port3: port@3 { -+ reg = <3>; -+ #trigger-source-cells = <0>; -+ }; -+ }; -+}; diff --git a/target/linux/kirkwood/patches-5.10/201-enable-sata-port-specific-led-triggers.patch b/target/linux/kirkwood/patches-5.10/201-enable-sata-port-specific-led-triggers.patch index c1645367a4..35db065727 100644 --- a/target/linux/kirkwood/patches-5.10/201-enable-sata-port-specific-led-triggers.patch +++ b/target/linux/kirkwood/patches-5.10/201-enable-sata-port-specific-led-triggers.patch @@ -1,6 +1,6 @@ --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig -@@ -119,6 +119,7 @@ config MACH_DOVE +@@ -116,6 +116,7 @@ config MACH_DOVE config MACH_KIRKWOOD bool "Marvell Kirkwood boards" depends on ARCH_MULTI_V5 diff --git a/target/linux/kirkwood/patches-5.10/202-linksys-find-active-root.patch b/target/linux/kirkwood/patches-5.10/202-linksys-find-active-root.patch index b7e7f50271..18c03efa8f 100644 --- a/target/linux/kirkwood/patches-5.10/202-linksys-find-active-root.patch +++ b/target/linux/kirkwood/patches-5.10/202-linksys-find-active-root.patch @@ -41,7 +41,7 @@ Signed-off-by: Imre Kaloz parts[i].name = partname; if (of_get_property(pp, "read-only", &len)) -@@ -215,6 +224,18 @@ static int __init ofpart_parser_init(voi +@@ -218,6 +227,18 @@ static int __init ofpart_parser_init(voi return 0; } From 1bb3f593ee73288dcc0471ae038638a50b750ee4 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Wed, 17 Feb 2021 22:27:47 +0900 Subject: [PATCH 41/45] kirkwood: update config for kernel 5.10 Update config with make kernel_oldconfig. CONFIG_SATA_PMP=y is added manually as done for 5.4. This should be resolved properly in a separate issue. Signed-off-by: Sungbo Eo [add back CONFIG_SATA_PMP, rebase/refresh] Signed-off-by: Adrian Schmutzler --- target/linux/kirkwood/config-5.10 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/target/linux/kirkwood/config-5.10 b/target/linux/kirkwood/config-5.10 index 2ef4c05074..ad8cf89182 100644 --- a/target/linux/kirkwood/config-5.10 +++ b/target/linux/kirkwood/config-5.10 @@ -1,6 +1,5 @@ CONFIG_ALIGNMENT_TRAP=y CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y @@ -13,6 +12,8 @@ CONFIG_ARCH_MULTI_V5=y CONFIG_ARCH_MVEBU=y CONFIG_ARCH_NR_GPIO=0 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARM=y # CONFIG_ARMADA_37XX_WATCHDOG is not set @@ -54,6 +55,7 @@ CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_LADDER=y CONFIG_CPU_PABRT_LEGACY=y CONFIG_CPU_PM=y +CONFIG_CPU_THERMAL=y CONFIG_CPU_THUMB_CAPABLE=y CONFIG_CPU_TLB_FEROCEON=y CONFIG_CPU_USE_DOMAINS=y @@ -64,6 +66,7 @@ CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_CRC32C=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_MARVELL=y CONFIG_CRYPTO_DEV_MARVELL_CESA=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y @@ -77,13 +80,12 @@ CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" CONFIG_DEBUG_MVEBU_UART0_ALTERNATE=y # CONFIG_DEBUG_MVEBU_UART1_ALTERNATE is not set CONFIG_DEBUG_UART_8250=y -# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set CONFIG_DEBUG_UART_8250_SHIFT=2 -# CONFIG_DEBUG_UART_8250_WORD is not set CONFIG_DEBUG_UART_PHYS=0xf1012000 CONFIG_DEBUG_UART_VIRT=0xfed12000 CONFIG_DEBUG_UNCOMPRESS=y # CONFIG_DLCI is not set +CONFIG_DMA_OPS=y CONFIG_DMA_REMAP=y CONFIG_DNOTIFY=y CONFIG_DTC=y @@ -144,6 +146,7 @@ CONFIG_LEDS_GPIO=y CONFIG_LEDS_NETXBIG=y CONFIG_LEDS_NS2=y CONFIG_LIBFDT=y +CONFIG_LLD_VERSION=0 CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y @@ -159,6 +162,7 @@ CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MTD_CFI is not set CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_ECC_SW_HAMMING=y # CONFIG_MTD_NAND_MARVELL is not set CONFIG_MTD_NAND_ORION=y @@ -180,7 +184,6 @@ CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y CONFIG_NET_DSA_MV88E6XXX=y CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y -# CONFIG_NET_DSA_MV88E6XXX_PTP is not set CONFIG_NET_DSA_TAG_DSA=y CONFIG_NET_DSA_TAG_EDSA=y CONFIG_NET_SWITCHDEV=y @@ -225,7 +228,6 @@ CONFIG_POWER_RESET_GPIO=y # CONFIG_POWER_RESET_QNAP is not set CONFIG_POWER_SUPPLY=y CONFIG_RATIONAL=y -CONFIG_REFCOUNT_FULL=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y From 1322150b0cc8acdb7fbcf7115a5201803fc4986d Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Wed, 17 Feb 2021 23:33:04 +0900 Subject: [PATCH 42/45] kirkwood: set testing kernel version to 5.10 Tested on Pogoplug V4. Linksys EA3500 will not build with buildbot settings and should be disabled when the target is switched, unless the image size is reduced again. Signed-off-by: Sungbo Eo [add EA3500 comment] Signed-off-by: Adrian Schmutzler --- target/linux/kirkwood/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/kirkwood/Makefile b/target/linux/kirkwood/Makefile index 94bee8ba2d..1f5159e444 100644 --- a/target/linux/kirkwood/Makefile +++ b/target/linux/kirkwood/Makefile @@ -11,6 +11,7 @@ FEATURES:=usb nand squashfs ramdisk CPU_TYPE:=xscale KERNEL_PATCHVER:=5.4 +KERNEL_TESTING_PATCHVER:=5.10 include $(INCLUDE_DIR)/target.mk From 3a4b751110b32380cf827f14a203190cfbc2e40f Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 24 Feb 2021 01:52:34 +0100 Subject: [PATCH 43/45] ath79: enable UART in SoC DTSI files The uart node is enabled on all devices except one (GL-USB150 *). Thus, let's not have a few hundred nodes to enable it, but do not disable it in the first place. Where the majority of devices is using it, also move the serial0 alias to the DTSI. *) Since GL-USB150 even defines serial0 alias, the missing uart is probably just a mistake. Anyway, disable it for now so this patch stays cosmetic. Signed-off-by: Adrian Schmutzler --- target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts | 4 ---- target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts | 4 ---- target/linux/ath79/dts/ar7100.dtsi | 2 -- .../ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi | 4 ---- target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi | 4 ---- target/linux/ath79/dts/ar7161_aruba_ap-105.dts | 4 ---- .../ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi | 4 ---- target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts | 4 ---- target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts | 4 ---- target/linux/ath79/dts/ar7161_meraki_mr16.dts | 4 ---- target/linux/ath79/dts/ar7161_netgear_wndr.dtsi | 4 ---- target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts | 4 ---- .../linux/ath79/dts/ar7161_ubnt_routerstation.dtsi | 4 ---- target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts | 4 ---- target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts | 4 ---- target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts | 4 ---- target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts | 4 ---- target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi | 4 ---- target/linux/ath79/dts/ar7240_tplink.dtsi | 4 ---- target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts | 4 ---- target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi | 4 ---- target/linux/ath79/dts/ar7241_tplink.dtsi | 4 ---- .../linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts | 4 ---- target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi | 4 ---- target/linux/ath79/dts/ar7242_avm_fritz300e.dts | 4 ---- target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi | 4 ---- .../ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts | 4 ---- target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts | 4 ---- target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts | 4 ---- target/linux/ath79/dts/ar7242_meraki_mr12.dts | 4 ---- .../linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts | 4 ---- target/linux/ath79/dts/ar7242_ubnt_sw.dtsi | 4 ---- target/linux/ath79/dts/ar724x.dtsi | 2 -- target/linux/ath79/dts/ar724x_ubnt_xm.dtsi | 4 ---- target/linux/ath79/dts/ar9132.dtsi | 2 -- .../linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts | 4 ---- .../linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts | 4 ---- target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts | 4 ---- target/linux/ath79/dts/ar9330.dtsi | 6 ++++-- target/linux/ath79/dts/ar9330_dlink_dir-505.dts | 5 ----- target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts | 5 ----- target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi | 5 ----- target/linux/ath79/dts/ar9330_pqi_air-pen.dts | 5 ----- target/linux/ath79/dts/ar9331_8dev_carambola2.dts | 5 ----- .../linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi | 5 ----- target/linux/ath79/dts/ar9331_arduino_yun.dts | 12 ------------ .../ath79/dts/ar9331_embeddedwireless_dorin.dts | 5 ----- target/linux/ath79/dts/ar9331_etactica_eg200.dts | 5 ----- target/linux/ath79/dts/ar9331_glinet_64xx.dtsi | 5 ----- target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts | 5 ----- target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts | 5 ++++- target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi | 8 -------- .../ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts | 5 ----- target/linux/ath79/dts/ar9331_pisen_ts-d084.dts | 5 ----- target/linux/ath79/dts/ar9331_pisen_wmm003n.dts | 5 ----- .../linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts | 5 ----- .../linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts | 5 ----- .../ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi | 5 ----- target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi | 5 ----- .../linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi | 5 ----- target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts | 5 ----- .../linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts | 5 ----- target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi | 5 ----- target/linux/ath79/dts/ar9341_pcs_cr3000.dts | 5 ----- target/linux/ath79/dts/ar9341_pisen_wmb001n.dts | 5 ----- target/linux/ath79/dts/ar9341_tplink.dtsi | 5 ----- target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi | 5 ----- target/linux/ath79/dts/ar9342_iodata_etg3-r.dts | 4 ---- target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts | 4 ---- target/linux/ath79/dts/ar9342_ubnt_wa.dtsi | 4 ---- target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 4 ---- .../linux/ath79/dts/ar9344_aerohive_hiveap-121.dts | 4 ---- target/linux/ath79/dts/ar9344_alfa-network_n5q.dts | 4 ---- .../linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts | 5 ----- target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts | 4 ---- .../linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts | 4 ---- target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts | 1 - target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts | 1 - target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi | 4 ---- target/linux/ath79/dts/ar9344_engenius_exx600.dtsi | 5 ----- .../linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts | 4 ---- .../dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi | 5 ----- target/linux/ath79/dts/ar9344_netgear_wndr.dtsi | 4 ---- target/linux/ath79/dts/ar9344_ocedo_raccoon.dts | 4 ---- target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi | 5 ----- target/linux/ath79/dts/ar9344_openmesh_om5p.dts | 5 ----- target/linux/ath79/dts/ar9344_pcs_cap324.dts | 5 ----- target/linux/ath79/dts/ar9344_pcs_cr5000.dts | 5 ----- target/linux/ath79/dts/ar9344_qihoo_c301.dts | 4 ---- target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi | 4 ---- target/linux/ath79/dts/ar9344_samsung_wam250.dts | 5 ----- target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi | 5 ----- target/linux/ath79/dts/ar9344_tplink_cpe.dtsi | 4 ---- target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi | 4 ---- target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts | 4 ---- target/linux/ath79/dts/ar9344_wd_mynet-n750.dts | 4 ---- .../ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts | 4 ---- target/linux/ath79/dts/ar9344_winchannel_wb2000.dts | 4 ---- target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts | 4 ---- target/linux/ath79/dts/ar934x.dtsi | 6 ++++-- target/linux/ath79/dts/qca9531_8dev_lima.dts | 4 ---- .../linux/ath79/dts/qca9531_alfa-network_r36a.dtsi | 4 ---- .../linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts | 4 ---- target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts | 4 ---- .../linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts | 4 ---- target/linux/ath79/dts/qca9531_comfast_cf-e5.dts | 4 ---- target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts | 4 ---- target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts | 4 ---- .../ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts | 4 ---- target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts | 4 ---- target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts | 4 ---- target/linux/ath79/dts/qca9531_engenius_ews511ap.dts | 4 ---- target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 4 ---- target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 4 ---- target/linux/ath79/dts/qca9531_glinet_gl-e750.dts | 4 ---- target/linux/ath79/dts/qca9531_glinet_gl-x750.dts | 4 ---- target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi | 4 ---- target/linux/ath79/dts/qca9531_telco_t1.dts | 4 ---- .../linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts | 4 ---- .../linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts | 4 ---- .../linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts | 4 ---- .../linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts | 4 ---- target/linux/ath79/dts/qca9531_wallys_dr531.dts | 4 ---- target/linux/ath79/dts/qca9531_yuncore_a770.dts | 4 ---- .../linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts | 4 ---- target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi | 4 ---- .../ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi | 8 ++++---- .../dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi | 1 - .../dts/qca9533_mikrotik_routerboard-wapr-2nd.dts | 1 - target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi | 4 ---- .../linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi | 4 ---- target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi | 4 ---- .../linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi | 4 ---- .../linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts | 4 ---- target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi | 4 ---- target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi | 4 ---- .../linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts | 4 ---- target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts | 4 ---- target/linux/ath79/dts/qca953x.dtsi | 2 -- target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi | 4 ---- target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi | 4 ---- target/linux/ath79/dts/qca9550_airtight_c-75.dts | 4 ---- .../linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi | 4 ---- .../qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts | 4 ---- target/linux/ath79/dts/qca9557_8dev_rambutan.dts | 4 ---- target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts | 4 ---- target/linux/ath79/dts/qca9557_engenius_eap1200h.dts | 4 ---- .../ath79/dts/qca9557_engenius_enstationac-v1.dts | 4 ---- target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi | 4 ---- .../ath79/dts/qca9558_allnet_all-wap02860ac.dts | 4 ---- target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi | 4 ---- .../linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi | 4 ---- target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi | 4 ---- target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts | 4 ---- target/linux/ath79/dts/qca9558_domywifi_dw33d.dts | 4 ---- target/linux/ath79/dts/qca9558_engenius_epg5000.dts | 4 ---- .../ath79/dts/qca9558_librerouter_librerouter-v1.dts | 4 ---- .../ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi | 4 ---- target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi | 4 ---- target/linux/ath79/dts/qca9558_ocedo_koala.dts | 4 ---- target/linux/ath79/dts/qca9558_ocedo_ursus.dts | 4 ---- target/linux/ath79/dts/qca9558_openmesh_mr.dtsi | 4 ---- .../linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts | 4 ---- target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi | 4 ---- target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts | 4 ---- target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi | 4 ---- target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi | 4 ---- target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts | 4 ---- target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi | 4 ---- .../linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts | 4 ---- .../linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi | 4 ---- .../ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts | 4 ---- .../linux/ath79/dts/qca9558_trendnet_tew-823dru.dts | 4 ---- target/linux/ath79/dts/qca955x.dtsi | 2 -- target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi | 4 ---- target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi | 4 ---- target/linux/ath79/dts/qca955x_ubnt_xc.dtsi | 4 ---- target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi | 4 ---- target/linux/ath79/dts/qca9561_avm_fritz4020.dts | 4 ---- .../linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts | 4 ---- .../linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi | 4 ---- .../linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi | 4 ---- .../ath79/dts/qca9561_tplink_eap225-wall-v2.dts | 4 ---- .../linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts | 4 ---- target/linux/ath79/dts/qca9563_compex_wpj563.dts | 4 ---- target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi | 4 ---- target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts | 4 ---- .../linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi | 4 ---- target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi | 4 ---- target/linux/ath79/dts/qca9563_nec_wg1200cr.dts | 4 ---- target/linux/ath79/dts/qca9563_nec_wg800hp.dts | 4 ---- target/linux/ath79/dts/qca9563_netgear_wndr.dtsi | 4 ---- target/linux/ath79/dts/qca9563_phicomm_k2t.dts | 4 ---- target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi | 4 ---- target/linux/ath79/dts/qca9563_rosinson_wr818.dts | 4 ---- .../linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts | 4 ---- .../linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts | 4 ---- .../linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi | 4 ---- .../linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi | 4 ---- target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts | 4 ---- .../linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi | 4 ---- target/linux/ath79/dts/qca9563_tplink_re450.dtsi | 4 ---- .../linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi | 4 ---- .../linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi | 4 ---- target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi | 4 ---- target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi | 4 ---- target/linux/ath79/dts/qca956x.dtsi | 2 -- target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi | 4 ---- 208 files changed, 16 insertions(+), 847 deletions(-) diff --git a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts index 2186d13667..e1d5f2dac1 100644 --- a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts +++ b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts @@ -196,10 +196,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts index e2481ad70c..d008dd5ec8 100644 --- a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts +++ b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts @@ -150,10 +150,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index 64702f2df2..ec6ff30ab6 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -41,8 +41,6 @@ reg-io-width = <4>; reg-shift = <2>; no-loopback-test; - - status = "disabled"; }; usb_phy: usb-phy@18030000 { diff --git a/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi b/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi index e34c304b47..c6cbe2fda1 100644 --- a/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi +++ b/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi @@ -48,10 +48,6 @@ }; }; -&uart { - status = "okay"; -}; - &gpio { ngpios = <31>; gpio-line-names = diff --git a/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi b/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi index ab868846ff..5b4b6e3dda 100644 --- a/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi +++ b/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi @@ -91,7 +91,3 @@ }; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts index 3ad2486873..e24236324c 100644 --- a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts +++ b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts @@ -120,10 +120,6 @@ }; }; -&uart { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi index 3b6eaf5cc8..109ed0caf3 100644 --- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi @@ -212,10 +212,6 @@ }; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts index a7115ff7e6..f2809f0549 100644 --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts @@ -159,10 +159,6 @@ }; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts index 145aba7d8e..826b45ff51 100644 --- a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts +++ b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts @@ -117,7 +117,3 @@ }; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7161_meraki_mr16.dts b/target/linux/ath79/dts/ar7161_meraki_mr16.dts index f541a00841..afbf1e31f2 100644 --- a/target/linux/ath79/dts/ar7161_meraki_mr16.dts +++ b/target/linux/ath79/dts/ar7161_meraki_mr16.dts @@ -102,10 +102,6 @@ clocks = <&extosc>; }; -&uart { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi index 217128546f..c7e83631cc 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi @@ -188,10 +188,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts b/target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts index 39bc318b17..9eaf5aaa1d 100644 --- a/target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts +++ b/target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts @@ -75,10 +75,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi index 7768bf4c44..116bc9cfc2 100644 --- a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi +++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi @@ -67,10 +67,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts index 4f284ed900..e5d7ea57f1 100644 --- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts +++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts @@ -181,7 +181,3 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts index 9e44420048..abd298449b 100644 --- a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts +++ b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts @@ -157,7 +157,3 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts index 7c819e88e7..51d4a0601d 100644 --- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts +++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts @@ -90,10 +90,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts index 0c94c90284..7e1c87adde 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts @@ -196,7 +196,3 @@ gpio-controller; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index 0360412598..7202e1d684 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -129,7 +129,3 @@ gpio-controller; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7240_tplink.dtsi b/target/linux/ath79/dts/ar7240_tplink.dtsi index 48849ccbcb..4799fd79ec 100644 --- a/target/linux/ath79/dts/ar7240_tplink.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink.dtsi @@ -115,7 +115,3 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts index 831f3e9c25..de2b536227 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts @@ -201,7 +201,3 @@ gpio-controller; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi index 625f4b0684..e704ddd9fc 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi @@ -185,10 +185,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar7241_tplink.dtsi b/target/linux/ath79/dts/ar7241_tplink.dtsi index 49908066d6..6d7f7515ef 100644 --- a/target/linux/ath79/dts/ar7241_tplink.dtsi +++ b/target/linux/ath79/dts/ar7241_tplink.dtsi @@ -104,7 +104,3 @@ mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address-increment = <1>; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts index d83f4cd2a8..ca1ad270ce 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts @@ -150,7 +150,3 @@ mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address-increment = <1>; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi index 7bf79f7465..73ded0f5bd 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi @@ -27,10 +27,6 @@ }; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts index 3cc7198ca1..310a2b1ee2 100644 --- a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts +++ b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts @@ -133,10 +133,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi index d1a251441e..98f6759eac 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi @@ -144,10 +144,6 @@ clocks = <&extosc>; }; -&uart { - status = "okay"; -}; - &usb_phy { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts index bf570b6ea5..7cb051a475 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts @@ -217,10 +217,6 @@ clocks = <&extosc>; }; -&uart { - status = "okay"; -}; - &usb_phy { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts index 39a8a7f25f..07d7e4914e 100644 --- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -69,10 +69,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts index 0e06ee0128..ca488223af 100644 --- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -69,10 +69,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar7242_meraki_mr12.dts b/target/linux/ath79/dts/ar7242_meraki_mr12.dts index 125919d4f1..ea64b947ef 100644 --- a/target/linux/ath79/dts/ar7242_meraki_mr12.dts +++ b/target/linux/ath79/dts/ar7242_meraki_mr12.dts @@ -90,10 +90,6 @@ clocks = <&extosc>; }; -&uart { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts index a07f80f55f..01f4cb7fde 100644 --- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts +++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts @@ -134,10 +134,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi index c5122dbd9f..caae72c91f 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi +++ b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi @@ -128,10 +128,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - ð1 { status = "okay"; diff --git a/target/linux/ath79/dts/ar724x.dtsi b/target/linux/ath79/dts/ar724x.dtsi index a078712e01..25d72a786c 100644 --- a/target/linux/ath79/dts/ar724x.dtsi +++ b/target/linux/ath79/dts/ar724x.dtsi @@ -45,8 +45,6 @@ reg-io-width = <4>; reg-shift = <2>; no-loopback-test; - - status = "disabled"; }; gpio: gpio@18040000 { diff --git a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi index 81a1aba47d..77dbfc4ac3 100644 --- a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi +++ b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi @@ -15,10 +15,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9132.dtsi b/target/linux/ath79/dts/ar9132.dtsi index ac87884a4d..37fc32e6d6 100644 --- a/target/linux/ath79/dts/ar9132.dtsi +++ b/target/linux/ath79/dts/ar9132.dtsi @@ -72,8 +72,6 @@ reg-io-width = <4>; reg-shift = <2>; no-loopback-test; - - status = "disabled"; }; gpio: gpio@18040000 { diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts index 772c874cdd..606572aaba 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts @@ -62,10 +62,6 @@ }; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts index f575990894..3b406e4d80 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts @@ -79,10 +79,6 @@ }; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts index ad517d8baf..821c2aec66 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts @@ -106,10 +106,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 78f80b9f7e..7607fede49 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -8,6 +8,10 @@ #address-cells = <1>; #size-cells = <1>; + aliases { + serial0 = &uart; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -41,8 +45,6 @@ clocks = <&pll ATH79_CLK_REF>; clock-names = "uart"; - - status = "disabled"; }; gpio: gpio@18040000 { diff --git a/target/linux/ath79/dts/ar9330_dlink_dir-505.dts b/target/linux/ath79/dts/ar9330_dlink_dir-505.dts index 574165b748..ad48e07701 100644 --- a/target/linux/ath79/dts/ar9330_dlink_dir-505.dts +++ b/target/linux/ath79/dts/ar9330_dlink_dir-505.dts @@ -10,7 +10,6 @@ compatible = "dlink,dir-505", "qca,ar9330"; aliases { - serial0 = &uart; led-boot = &led_power_green; led-failsafe = &led_status_red; led-running = &led_power_green; @@ -50,10 +49,6 @@ }; }; -&uart { - status = "okay"; -}; - &gpio { led_enable { gpio-hog; diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index 20c9a8fdd4..6a13c1bafe 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -10,7 +10,6 @@ compatible = "glinet,gl-ar150", "qca,ar9330"; aliases { - serial0 = &uart; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -62,10 +61,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi index d9ca2c0f72..4f428cbb17 100644 --- a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi +++ b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi @@ -11,7 +11,6 @@ }; aliases { - serial0 = &uart; led-boot = &led_power_blue; led-failsafe = &led_power_blue; led-running = &led_power_blue; @@ -78,10 +77,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 5f2aa3b03c..607ee5f6c9 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -10,7 +10,6 @@ compatible = "pqi,air-pen", "qca,ar9330"; aliases { - serial0 = &uart; led-boot = &led_wlan; led-failsafe = &led_wlan; led-upgrade = &led_wlan; @@ -50,10 +49,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts index 42193f857c..ba01d25d58 100644 --- a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts +++ b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts @@ -10,7 +10,6 @@ compatible = "8dev,carambola2", "qca,ar9331"; aliases { - serial0 = &uart; label-mac-device = &wmac; }; @@ -49,10 +48,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi index 47133cdf5d..7734f20e04 100644 --- a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi @@ -11,7 +11,6 @@ led-boot = &led_vpn; led-failsafe = &led_vpn; led-upgrade = &led_vpn; - serial0 = &uart; }; keys { @@ -111,10 +110,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9331_arduino_yun.dts b/target/linux/ath79/dts/ar9331_arduino_yun.dts index 6a5aca0541..389a83dd22 100644 --- a/target/linux/ath79/dts/ar9331_arduino_yun.dts +++ b/target/linux/ath79/dts/ar9331_arduino_yun.dts @@ -9,10 +9,6 @@ model = "Arduino Yun"; compatible = "arduino,yun", "qca,ar9331"; - aliases { - serial0 = &uart; - }; - chosen { bootargs = "console=ttyATH0,250000"; }; @@ -107,14 +103,6 @@ }; }; -&uart { - status = "okay"; -}; - -&gpio { - status = "okay"; -}; - &pinmux { pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins>; diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts index 12f1e93d44..48bf4d159f 100644 --- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts +++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts @@ -14,7 +14,6 @@ led-failsafe = &led_status; led-running = &led_status; led-upgrade = &led_status; - serial0 = &uart; }; leds { @@ -43,10 +42,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_etactica_eg200.dts b/target/linux/ath79/dts/ar9331_etactica_eg200.dts index e6feb54fcd..95c8a10e0d 100644 --- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts +++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts @@ -13,7 +13,6 @@ led-boot = &led_etactica; led-failsafe = &led_etactica; led-upgrade = &led_etactica; - serial0 = &uart; }; keys { @@ -53,10 +52,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi index 8cdc9ac4ca..2f92123c34 100644 --- a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi +++ b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi @@ -7,7 +7,6 @@ / { aliases { - serial0 = &uart; label-mac-device = &wmac; }; @@ -65,10 +64,6 @@ mtd-mac-address = <&uboot 0x1fc00>; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; vbus-supply = <®_usb_vbus>; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts index 67b587ab6e..7d6e7bd4af 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts @@ -10,7 +10,6 @@ model = "GL.iNet GL-MiFi"; aliases { - serial0 = &uart; label-mac-device = ð0; }; @@ -69,10 +68,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts index c75684be04..80e1f228ff 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts @@ -10,7 +10,6 @@ model = "GL.iNet GL-USB150"; aliases { - serial0 = &uart; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -113,6 +112,10 @@ }; }; +&uart { + status = "disabled"; +}; + &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi b/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi index e7ca002038..3f20843b08 100644 --- a/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi +++ b/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi @@ -6,10 +6,6 @@ #include / { - aliases { - serial0 = &uart; - }; - keys: keys { compatible = "gpio-keys"; @@ -87,10 +83,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts index bbc0f1c711..62d5caeb9d 100644 --- a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts +++ b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts @@ -14,7 +14,6 @@ led-boot = &led_system; led-failsafe = &led_system; led-upgrade = &led_system; - serial0 = &uart; }; gpio-export { @@ -107,10 +106,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts index 8632011de3..873762088a 100644 --- a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts +++ b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts @@ -10,7 +10,6 @@ compatible = "pisen,ts-d084", "qca,ar9331"; aliases { - serial0 = &uart; led-boot = &led_system; led-failsafe = &led_system; led-running = &led_system; @@ -91,10 +90,6 @@ compatible = "syscon", "simple-mfd"; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts index 16f88c3273..3a18249aa6 100644 --- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts +++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts @@ -10,7 +10,6 @@ compatible = "pisen,wmm003n", "qca,ar9331"; aliases { - serial0 = &uart; led-boot = &led_system; led-failsafe = &led_system; led-running = &led_system; @@ -99,10 +98,6 @@ compatible = "syscon", "simple-mfd"; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; vbus-supply = <®_usb_vbus>; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts index e9533553a1..7df4ed9a98 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts @@ -10,7 +10,6 @@ compatible = "tplink,tl-mr3020-v1", "qca,ar9331"; aliases { - serial0 = &uart; led-boot = &led_wps; led-failsafe = &led_wps; led-running = &led_wps; @@ -86,10 +85,6 @@ clock-frequency = <25000000>; }; -&uart { - status = "okay"; -}; - &usb { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts index c5f7a4fe76..6c353379b7 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts @@ -10,7 +10,6 @@ compatible = "tplink,tl-mr3040-v2", "qca,ar9331"; aliases { - serial0 = &uart; led-boot = &led_lan; led-failsafe = &led_lan; label-mac-device = ð0; @@ -82,10 +81,6 @@ clock-frequency = <25000000>; }; -&uart { - status = "okay"; -}; - &usb { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi index ecd795580f..e31640b87f 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi @@ -7,7 +7,6 @@ / { aliases { - serial0 = &uart; led-boot = &led_system; led-failsafe = &led_system; led-running = &led_system; @@ -97,10 +96,6 @@ compatible = "syscon", "simple-mfd"; }; -&uart { - status = "okay"; -}; - &usb { dr_mode = "host"; vbus-supply = <®_usb_vbus>; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi index db43484112..7d2cbeb95c 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi @@ -7,7 +7,6 @@ / { aliases { - serial0 = &uart; led-boot = &led_system; led-failsafe = &led_system; led-running = &led_system; @@ -65,10 +64,6 @@ mtd-mac-address-increment = <(-1)>; }; -&uart { - status = "okay"; -}; - &usb { status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi index a542fae739..e460e4cd23 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi @@ -10,7 +10,6 @@ model = "TP-Link TL-WR741N/ND v4"; aliases { - serial0 = &uart; led-boot = &led_system; led-failsafe = &led_system; led-running = &led_system; @@ -140,10 +139,6 @@ mtd-mac-address-increment = <(-1)>; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts index 7900557775..b830821977 100644 --- a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts +++ b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts @@ -11,7 +11,6 @@ compatible = "engenius,eap300-v2", "qca,ar9341"; aliases { - serial0 = &uart; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -69,10 +68,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts index 38e9b381c0..8204578c17 100644 --- a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts +++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts @@ -11,7 +11,6 @@ compatible = "engenius,ens202ext-v1", "qca,ar9341"; aliases { - serial0 = &uart; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -84,10 +83,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi index 403ee940c1..727064def3 100644 --- a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi +++ b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi @@ -11,7 +11,6 @@ }; aliases { - serial0 = &uart; led-boot = &led_power_blue; led-failsafe = &led_power_blue; led-running = &led_power_blue; @@ -82,10 +81,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &pinmux { led_lan_wan_blue_pin: pinmux_lan_wan_blue_pin { pinctrl-single,bits = <0x10 0x0 0x0000ffff>; diff --git a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts index 28076716b7..1d742a785d 100644 --- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts +++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts @@ -10,7 +10,6 @@ compatible = "pcs,cr3000", "qca,ar9341"; aliases { - serial0 = &uart; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -84,10 +83,6 @@ clock-frequency = <25000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts index 98236d44a6..ffa52b437c 100644 --- a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts +++ b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts @@ -11,7 +11,6 @@ compatible = "pisen,wmb001n", "qca,ar9341"; aliases { - serial0 = &uart; led-boot = &led_wifi; led-failsafe = &led_wifi; led-running = &led_wifi; @@ -131,10 +130,6 @@ clock-frequency = <25000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9341_tplink.dtsi b/target/linux/ath79/dts/ar9341_tplink.dtsi index f229a1917e..26410bcc11 100644 --- a/target/linux/ath79/dts/ar9341_tplink.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink.dtsi @@ -7,7 +7,6 @@ / { aliases { - serial0 = &uart; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -66,10 +65,6 @@ clock-frequency = <25000000>; }; -&uart { - status = "okay"; -}; - &gpio { pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins &pmx_usb_power>; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi index 8f40675d91..499ef98201 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi @@ -7,7 +7,6 @@ / { aliases { - serial0 = &uart; label-mac-device = &wmac; }; }; @@ -50,10 +49,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts index f11d3952a3..8b354d6015 100644 --- a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts +++ b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts @@ -132,7 +132,3 @@ rxdv-delay = <3>; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts index 8e0955e182..01bc487626 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts @@ -71,10 +71,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index d141d48dae..ac036ccd85 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -25,10 +25,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index c5fbdb94c4..3089e6b341 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -57,10 +57,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts index 0ef5f1b7b9..fae3eec786 100644 --- a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts +++ b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts @@ -65,10 +65,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &gpio { pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; diff --git a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts index dd50d2bc20..486e109c8f 100644 --- a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts +++ b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts @@ -144,10 +144,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts index 11cc2dadfd..73e06370f8 100644 --- a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts +++ b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts @@ -10,7 +10,6 @@ model = "COMFAST CF-E120A v3"; aliases { - serial0 = &uart; led-boot = &led_rssihigh; led-failsafe = &led_rssihigh; led-upgrade = &led_rssihigh; @@ -118,10 +117,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; phy-handle = <&swphy0>; diff --git a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts index de8a4d5fd7..96549ec2ca 100644 --- a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts +++ b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts @@ -61,10 +61,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts b/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts index d2f385c571..627265bf70 100644 --- a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts +++ b/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts @@ -128,10 +128,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts b/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts index bd4c58f3c9..e6f18cea69 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts +++ b/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts @@ -11,7 +11,6 @@ led-failsafe = &led_power_orange; led-running = &led_power_blue; led-upgrade = &led_power_orange; - serial0 = &uart; }; leds { diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts b/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts index 189945848d..b2fcf71bd8 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts +++ b/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts @@ -11,7 +11,6 @@ led-failsafe = &led_power_orange; led-running = &led_power_green; led-upgrade = &led_power_orange; - serial0 = &uart; }; leds { diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi index 4c2177bfad..e591ecd1b8 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi +++ b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi @@ -119,10 +119,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb { status = "okay"; #address-cells = <1>; diff --git a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi index 340357b8de..d7036ff675 100644 --- a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi +++ b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi @@ -13,7 +13,6 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - serial0 = &uart; }; keys { @@ -61,10 +60,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts index a387cebefc..52becec18b 100644 --- a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts +++ b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts @@ -96,10 +96,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &pinmux { enable_gpio_16: pinmux_enable_gpio_16 { pinctrl-single,bits = <0x10 0x0 0x000000ff>; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi index 013a998a02..3ed50abefa 100644 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi @@ -14,7 +14,6 @@ led-failsafe = &led_user; led-running = &led_user; led-upgrade = &led_user; - serial0 = &uart; }; leds { @@ -163,10 +162,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi index ac012eafb4..52425a071c 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -260,7 +260,3 @@ gpio-controller; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts index 3260d6b32d..e7ef02054e 100644 --- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts +++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts @@ -66,10 +66,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi index 8517576787..ff532733b6 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi +++ b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi @@ -11,7 +11,6 @@ }; aliases { - serial0 = &uart; label-mac-device = ð0; }; @@ -30,10 +29,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts index a733a922e4..636595c9ee 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts +++ b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts @@ -14,7 +14,6 @@ }; aliases { - serial0 = &uart; led-boot = &led_power_blue; led-failsafe = &led_power_blue; led-running = &led_power_blue; @@ -85,10 +84,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &pinmux { led_lan_wan_blue_pin: pinmux_lan_wan_blue_pin { pinctrl-single,bits = <0xc 0x0 0xffff0000>; diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index de75b8e0b4..3ce8bb58fc 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -10,7 +10,6 @@ compatible = "pcs,cap324", "qca,ar9344"; aliases { - serial0 = &uart; led-boot = &led_power_amber; led-failsafe = &led_power_amber; led-running = &led_power_green; @@ -73,10 +72,6 @@ clock-frequency = <25000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts index 7f74ba6351..9aaabd0c24 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts @@ -10,7 +10,6 @@ compatible = "pcs,cr5000", "qca,ar9344"; aliases { - serial0 = &uart; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -65,10 +64,6 @@ clock-frequency = <25000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_qihoo_c301.dts b/target/linux/ath79/dts/ar9344_qihoo_c301.dts index b05d673137..616036fcfc 100644 --- a/target/linux/ath79/dts/ar9344_qihoo_c301.dts +++ b/target/linux/ath79/dts/ar9344_qihoo_c301.dts @@ -75,10 +75,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &gpio { gpio_ext_lna0 { gpio-hog; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi b/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi index 16e20b7498..a41e626ea4 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi @@ -100,10 +100,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_samsung_wam250.dts b/target/linux/ath79/dts/ar9344_samsung_wam250.dts index a7cea7c2b6..0f38ff82ee 100644 --- a/target/linux/ath79/dts/ar9344_samsung_wam250.dts +++ b/target/linux/ath79/dts/ar9344_samsung_wam250.dts @@ -140,11 +140,6 @@ }; }; -&uart { - status = "okay"; -}; - - &usb { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi index 116d797eb2..88b9170fc0 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi +++ b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi @@ -9,7 +9,6 @@ compatible = "teltonika,rut9xx", "qca,ar9344"; aliases { - serial0 = &uart; serial1 = &hs_uart; label-mac-device = ð1; }; @@ -43,10 +42,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &hs_uart { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi index 39d4bd6ea9..d4b7de440a 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @@ -25,10 +25,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi index ea7dfeac93..a3f4dc036d 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi @@ -66,10 +66,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts index 8c62272897..4612ae1a66 100644 --- a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts +++ b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts @@ -46,10 +46,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts index 992bbf6bc1..e3faa392a8 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts @@ -63,10 +63,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &gpio { gpio_ext_lna0 { gpio-hog; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts index d04d517b19..575c72ee7c 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts @@ -81,10 +81,6 @@ clock-frequency = <25000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts index 68d3d6a881..72cd5aab49 100644 --- a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts +++ b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts @@ -82,10 +82,6 @@ clock-frequency = <40000000>; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts index 5f24bf23d6..a3b4534cb5 100644 --- a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts +++ b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts @@ -68,10 +68,6 @@ pinctrl-0 = <&enable_gpio21>; }; -&uart { - status = "okay"; -}; - &gpio { pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index aa1003cdb5..42fbab4b60 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -8,6 +8,10 @@ #address-cells = <1>; #size-cells = <1>; + aliases { + serial0 = &uart; + }; + chosen { bootargs = "console=ttyS0,115200"; }; @@ -70,8 +74,6 @@ reg-io-width = <4>; reg-shift = <2>; no-loopback-test; - - status = "disabled"; }; gpio: gpio@18040000 { diff --git a/target/linux/ath79/dts/qca9531_8dev_lima.dts b/target/linux/ath79/dts/qca9531_8dev_lima.dts index 1adfe15b5f..7fc84a6787 100644 --- a/target/linux/ath79/dts/qca9531_8dev_lima.dts +++ b/target/linux/ath79/dts/qca9531_8dev_lima.dts @@ -24,10 +24,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi index f0d3e0b617..4c9346db1e 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi @@ -97,10 +97,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts index c3097bf93b..e14cf772af 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts @@ -117,10 +117,6 @@ }; }; -&uart { - status = "okay"; -}; - ð1 { mtd-mac-address = <&art 0x0>; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts index ac387040bf..757a2eaeee 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts @@ -116,10 +116,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts index 842ed970a6..4738ba56af 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts @@ -131,10 +131,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts index 45416089b7..57727754bb 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts @@ -61,10 +61,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb0 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts index 5065069863..a7ea34eeb0 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts @@ -130,10 +130,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb_phy { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts index 7114df5cbc..edb6bbe5f3 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts @@ -104,10 +104,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts index d57c943810..6ae2e4eb54 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts @@ -104,10 +104,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts index 2cc9d46fac..89822586ff 100644 --- a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts +++ b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts @@ -60,10 +60,6 @@ }; }; -&uart { - status = "okay"; -}; - &pinmux { pinmux_led_eth_pins: pinmux_led_eth_pins { pinctrl-single,bits = <0x8 0x2b000000 0xff000000>, <0xc 0x00002d00 0x0000ff00>; diff --git a/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts index 9f9dd44812..d2fbc09c60 100644 --- a/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts +++ b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts @@ -145,10 +145,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts index 736ebf2dd3..6fd28d5b36 100644 --- a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts +++ b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts @@ -84,10 +84,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index 6422dc60f5..d0b0d88c48 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -131,10 +131,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb0 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts index f3d62b36a8..24dc8aaf6a 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts @@ -76,10 +76,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts index de7d5f577a..98022d7cc5 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -47,10 +47,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts index f32cb6e39a..c755e00033 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts @@ -59,10 +59,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb0 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi index 6ba4ae8fdf..7c6ed9f4fe 100644 --- a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi +++ b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi @@ -103,10 +103,6 @@ mtd-mac-address = <&pridata 0x400>; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_telco_t1.dts b/target/linux/ath79/dts/qca9531_telco_t1.dts index 252d9073c8..eaaf4f154c 100644 --- a/target/linux/ath79/dts/qca9531_telco_t1.dts +++ b/target/linux/ath79/dts/qca9531_telco_t1.dts @@ -65,10 +65,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts index f6bd7ad58f..9a39001935 100644 --- a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts @@ -89,10 +89,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts index d163a73228..0e2c158260 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts @@ -132,10 +132,6 @@ }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts index 751a69154f..82a73d301d 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts @@ -89,10 +89,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts index a162d9030f..69445df741 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts @@ -96,10 +96,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_wallys_dr531.dts b/target/linux/ath79/dts/qca9531_wallys_dr531.dts index 2375a054ce..abf821b11b 100644 --- a/target/linux/ath79/dts/qca9531_wallys_dr531.dts +++ b/target/linux/ath79/dts/qca9531_wallys_dr531.dts @@ -137,10 +137,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts b/target/linux/ath79/dts/qca9531_yuncore_a770.dts index a6738c7d9a..c58b0c4e38 100644 --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts @@ -93,10 +93,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts index c4918205fd..8deeea4245 100644 --- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts +++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts @@ -129,10 +129,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi index cd095c1559..f1eef86a9b 100644 --- a/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi +++ b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi @@ -110,10 +110,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi index effa2d3619..f0473c7497 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi @@ -6,6 +6,10 @@ #include / { + aliases { + serial0 = &uart; + }; + keys { compatible = "gpio-keys"; @@ -74,10 +78,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi index 5448b7beb0..a45365073b 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_user; led-upgrade = &led_user; led-running = &led_user; - serial0 = &uart; }; leds { diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts index ba674c13d8..459fc04e6c 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts @@ -11,7 +11,6 @@ led-failsafe = &led_rssilow; led-upgrade = &led_rssilow; led-running = &led_rssilow; - serial0 = &uart; }; leds { diff --git a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi index 74daba3f93..53eb08b253 100644 --- a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi +++ b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi @@ -77,10 +77,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi index 0bc6d4fa28..c506c849f9 100644 --- a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi @@ -59,10 +59,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi index f663a1fcd7..d5eeec13b7 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi @@ -49,10 +49,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi index 28e74d5ced..6033acddf3 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi @@ -63,10 +63,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts index e723587a0b..45fe9e86b3 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts @@ -91,10 +91,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi index 26edbb2cd0..fb034195ec 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi @@ -34,10 +34,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi index 842815d683..4166686795 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi @@ -69,10 +69,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts index f0b42a6e4c..db99f70b36 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts @@ -94,10 +94,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb0 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts b/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts index 8b9469ebc0..f7910b3d6f 100644 --- a/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts +++ b/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts @@ -71,10 +71,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index 1a64b01300..d73163c3fe 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -53,8 +53,6 @@ reg-io-width = <4>; reg-shift = <2>; no-loopback-test; - - status = "disabled"; }; usb_phy: usb-phy@18030000 { diff --git a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi index aff6eb2871..71d9fffbe3 100644 --- a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi +++ b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi @@ -45,10 +45,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi index 53e5fe9bcc..ab8ac92426 100644 --- a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi +++ b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi @@ -51,10 +51,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9550_airtight_c-75.dts b/target/linux/ath79/dts/qca9550_airtight_c-75.dts index a766398971..a984b38ad2 100644 --- a/target/linux/ath79/dts/qca9550_airtight_c-75.dts +++ b/target/linux/ath79/dts/qca9550_airtight_c-75.dts @@ -166,10 +166,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi b/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi index befb933483..d0c796fadb 100644 --- a/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi +++ b/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi @@ -17,10 +17,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts b/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts index a3f9ec28a4..f5c6731bb7 100644 --- a/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts +++ b/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts @@ -113,10 +113,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts index ce46555148..638d78a7a5 100644 --- a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts +++ b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts @@ -123,7 +123,3 @@ #address-cells = <1>; #size-cells = <0>; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts index 8d437a6792..dce1a2144f 100644 --- a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts +++ b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts @@ -134,7 +134,3 @@ full-duplex; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts index 72a50c922e..a7a77141e5 100644 --- a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts +++ b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts @@ -76,10 +76,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts index 2cf800cddc..af397dfd3a 100644 --- a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts +++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts @@ -80,10 +80,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi index 2f6bf4dbee..204a63cda8 100644 --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi @@ -174,10 +174,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts index aee8bbff56..ba6be49fce 100644 --- a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts +++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts @@ -139,10 +139,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi index 624e20096f..e4bb6c25e5 100644 --- a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi +++ b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi @@ -99,10 +99,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi index 5d32551274..d8a311614f 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi @@ -56,10 +56,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi index a1b019a7ad..7ae33c3e04 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi @@ -40,10 +40,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts index 86f889a5dc..15a32a1f3f 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts @@ -157,10 +157,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts index fae0853922..0c42208c20 100644 --- a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts +++ b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts @@ -71,10 +71,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts index 5e4d224d3e..35716152ad 100644 --- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts +++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts @@ -153,10 +153,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy1 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts index 5be931bcd0..ddb91d0791 100644 --- a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts +++ b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts @@ -75,10 +75,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi index 70b3ee68c3..5e919856a5 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi @@ -126,7 +126,3 @@ }; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi b/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi index 40a4ead19d..2f7cdcf8c3 100644 --- a/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi +++ b/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi @@ -120,10 +120,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/qca9558_ocedo_koala.dts b/target/linux/ath79/dts/qca9558_ocedo_koala.dts index a3a3cc3e31..aa3876acb1 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_koala.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_koala.dts @@ -59,10 +59,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts index 79ed751d66..dc8329f976 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts @@ -30,10 +30,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi index d51c587683..f4eed22460 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi +++ b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi @@ -74,10 +74,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts index 8cea2ff401..b4d452dda1 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts @@ -81,10 +81,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &pll { clocks = <&extosc>; }; diff --git a/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi b/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi index aa4bd75f2f..21946c42b2 100644 --- a/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi +++ b/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi @@ -144,10 +144,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts index 96269c4418..eee3e39bc3 100644 --- a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts +++ b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts @@ -131,10 +131,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi index 87dbdd0a5f..52cbb5d016 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi @@ -81,10 +81,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi index 598c5570aa..f9e8adcc9e 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi @@ -136,10 +136,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts index b0a3293d4f..c0fbeb5a43 100644 --- a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts @@ -168,10 +168,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi index 225af82c93..6c487f15be 100644 --- a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi @@ -100,10 +100,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts index 8f525d57bc..0099592dc1 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts @@ -104,10 +104,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi index 66059b890b..959d5c35fb 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi @@ -72,10 +72,6 @@ }; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts index bb1993516e..058acda746 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts @@ -57,10 +57,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts index e3f3643b37..22569bfc1d 100644 --- a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts +++ b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts @@ -67,10 +67,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca955x.dtsi b/target/linux/ath79/dts/qca955x.dtsi index 9817843edf..8138f4afee 100644 --- a/target/linux/ath79/dts/qca955x.dtsi +++ b/target/linux/ath79/dts/qca955x.dtsi @@ -53,8 +53,6 @@ reg-io-width = <4>; reg-shift = <2>; no-loopback-test; - - status = "disabled"; }; usb_phy0: usb-phy0@18030000 { diff --git a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi index ac7a0c85f0..1047dfddeb 100644 --- a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi +++ b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi @@ -45,10 +45,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi b/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi index 0051eb2508..e448cd3012 100644 --- a/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi +++ b/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi @@ -47,10 +47,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi index 7e022e46a1..0f803945db 100644 --- a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi +++ b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi @@ -5,10 +5,6 @@ #include #include -&uart { - status = "okay"; -}; - &pcie0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi index 849063b6d1..9e1ce89c46 100644 --- a/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi +++ b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi @@ -41,10 +41,6 @@ }; }; -&uart { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts index 13e6eb1673..7c220baddd 100644 --- a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts +++ b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts @@ -95,10 +95,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts index 8776299080..bf744f1087 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts @@ -163,10 +163,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi index 9ba6ccfafd..664032936c 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi @@ -117,10 +117,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi index 7ba94aa42e..75d3816b72 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi @@ -63,10 +63,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts index 4dea09f429..a39fde01e5 100644 --- a/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts @@ -56,10 +56,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts index 22bd8c941d..821f125c20 100644 --- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts +++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts @@ -52,10 +52,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_compex_wpj563.dts b/target/linux/ath79/dts/qca9563_compex_wpj563.dts index 74b6da9468..aa829413dc 100644 --- a/target/linux/ath79/dts/qca9563_compex_wpj563.dts +++ b/target/linux/ath79/dts/qca9563_compex_wpj563.dts @@ -131,10 +131,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi index 3b45681bc0..1366e68a8f 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi @@ -50,10 +50,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts index 49805ec319..a65ccc0863 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts @@ -69,10 +69,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi b/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi index 90d91a6d8e..78eb0fe219 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi @@ -111,10 +111,6 @@ phy-handle = <&phy0>; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi index 75103afdd7..9226d37a43 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi @@ -154,10 +154,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts b/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts index a224ddbd5f..26c1932154 100644 --- a/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts +++ b/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts @@ -160,10 +160,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_nec_wg800hp.dts b/target/linux/ath79/dts/qca9563_nec_wg800hp.dts index 8a4226f35c..1069a63a5e 100644 --- a/target/linux/ath79/dts/qca9563_nec_wg800hp.dts +++ b/target/linux/ath79/dts/qca9563_nec_wg800hp.dts @@ -172,10 +172,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; qca,no-eeprom; diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi index e77298bbd9..8c6a374131 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi @@ -243,7 +243,3 @@ #trigger-source-cells = <0>; }; }; - -&uart { - status = "okay"; -}; diff --git a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts index b86289a3ab..63e2e53aa5 100644 --- a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts +++ b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts @@ -46,10 +46,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi index 33d0095da4..9cf146c918 100644 --- a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi +++ b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi @@ -144,10 +144,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts index 512d36bbe0..a88eeb3de0 100644 --- a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts +++ b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts @@ -43,10 +43,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts index 6e7bd9986a..6c4b04b81c 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts @@ -92,10 +92,6 @@ }; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts index e0d03e1640..63040acf4a 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts @@ -147,10 +147,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi index 8e46cd87fc..1a074e63a6 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi @@ -15,10 +15,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi index c13bafce0b..3644cf863e 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi @@ -104,10 +104,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts index fdb3d8cdc1..6b438ce126 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts @@ -48,10 +48,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi index 0be46301f0..cc9e0b7ff6 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi @@ -26,10 +26,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi index e09c1ba63f..3354baee08 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi @@ -108,10 +108,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi index 1503bf4c8e..5fd314b856 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi @@ -102,10 +102,6 @@ status = "okay"; }; -&uart { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi index b8f48047e2..c8c69e8a65 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi @@ -84,10 +84,6 @@ }; }; -&uart { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 85f13c1473..42fe25c781 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -39,10 +39,6 @@ }; }; -&uart { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index f8fdf5e27d..4eed20bea4 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -100,10 +100,6 @@ }; }; -&uart { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index 30ede3e55b..8627f7ee40 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -53,8 +53,6 @@ reg-io-width = <4>; reg-shift = <2>; no-loopback-test; - - status = "disabled"; }; gpio: gpio@18040000 { diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi index 3e591ec908..31079123c5 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi @@ -45,10 +45,6 @@ }; }; -&uart { - status = "okay"; -}; - ð0 { status = "okay"; From 4204d70d7a1123fdf11d3f5b1f46143639fa58a6 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 15 Feb 2021 17:41:36 +0100 Subject: [PATCH 44/45] ath79: create common DTSI for Senao ar724x APs This creates a shared DTSI for ar724x Senao/Engenius APs: - ENH202 v1 - EAP350 v1 - ECB350 v1 Since ar7240/ar7242 have different configuration, this new file mostly contains the partitioning. Suggested-by: Michael Pratt Signed-off-by: Adrian Schmutzler --- .../ath79/dts/ar7240_engenius_enh202-v1.dts | 88 +----------------- .../ath79/dts/ar7242_engenius_eap350-v1.dts | 88 +----------------- .../ath79/dts/ar7242_engenius_ecb350-v1.dts | 88 +----------------- .../linux/ath79/dts/ar724x_senao_loader.dtsi | 91 +++++++++++++++++++ 4 files changed, 94 insertions(+), 261 deletions(-) create mode 100644 target/linux/ath79/dts/ar724x_senao_loader.dtsi diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts index 51d4a0601d..89b6746c61 100644 --- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts +++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "ar7240.dtsi" +#include "ar724x_senao_loader.dtsi" #include #include -#include / { compatible = "engenius,enh202-v1", "qca,ar7240"; @@ -69,92 +69,6 @@ linux,default-trigger = "phy0tpt"; }; }; - - virtual_flash { - compatible = "mtd-concat"; - - devices = <&fwconcat0 &fwconcat1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = ; - label = "firmware"; - reg = <0x0 0x0>; - }; - }; - }; -}; - -&spi { - 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 0x40000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x40000 0x10000>; - }; - - partition@50000 { - label = "custom"; - reg = <0x50000 0x50000>; - read-only; - }; - - partition@a0000 { - label = "loader"; - reg = <0xa0000 0x10000>; - read-only; - }; - - fwconcat1: partition@b0000 { - label = "fwconcat1"; - reg = <0xb0000 0xf0000>; - }; - - partition@1a0000 { - label = "fakeroot"; - reg = <0x1a0000 0x10000>; - read-only; - }; - - fwconcat0: partition@1b0000 { - label = "fwconcat0"; - reg = <0x1b0000 0x4c0000>; - }; - - partition@670000 { - label = "failsafe"; - reg = <0x670000 0x180000>; - read-only; - }; - - art: partition@7f0000 { - label = "art"; - reg = <0x7f0000 0x10000>; - read-only; - }; - }; - }; }; ð0 { diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts index 07d7e4914e..be0f7cbc43 100644 --- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "ar7242.dtsi" +#include "ar724x_senao_loader.dtsi" #include #include -#include / { compatible = "engenius,eap350-v1", "qca,ar7242"; @@ -48,92 +48,6 @@ linux,default-trigger = "phy0tpt"; }; }; - - virtual_flash { - compatible = "mtd-concat"; - - devices = <&fwconcat0 &fwconcat1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = ; - label = "firmware"; - reg = <0x0 0x0>; - }; - }; - }; -}; - -&spi { - 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 0x40000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x40000 0x10000>; - }; - - partition@50000 { - label = "custom"; - reg = <0x50000 0x50000>; - read-only; - }; - - partition@a0000 { - label = "loader"; - reg = <0xa0000 0x10000>; - read-only; - }; - - fwconcat1: partition@b0000 { - label = "fwconcat1"; - reg = <0xb0000 0xf0000>; - }; - - partition@1a0000 { - label = "fakeroot"; - reg = <0x1a0000 0x10000>; - read-only; - }; - - fwconcat0: partition@1b0000 { - label = "fwconcat0"; - reg = <0x1b0000 0x4c0000>; - }; - - partition@670000 { - label = "failsafe"; - reg = <0x670000 0x180000>; - read-only; - }; - - art: partition@7f0000 { - label = "art"; - reg = <0x7f0000 0x10000>; - read-only; - }; - }; - }; }; &mdio0 { diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts index ca488223af..55343e786a 100644 --- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "ar7242.dtsi" +#include "ar724x_senao_loader.dtsi" #include #include -#include / { compatible = "engenius,ecb350-v1", "qca,ar7242"; @@ -48,92 +48,6 @@ linux,default-trigger = "phy0tpt"; }; }; - - virtual_flash { - compatible = "mtd-concat"; - - devices = <&fwconcat0 &fwconcat1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = ; - label = "firmware"; - reg = <0x0 0x0>; - }; - }; - }; -}; - -&spi { - 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 0x40000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x40000 0x10000>; - }; - - partition@50000 { - label = "custom"; - reg = <0x50000 0x50000>; - read-only; - }; - - partition@a0000 { - label = "loader"; - reg = <0xa0000 0x10000>; - read-only; - }; - - fwconcat1: partition@b0000 { - label = "fwconcat1"; - reg = <0xb0000 0xf0000>; - }; - - partition@1a0000 { - label = "fakeroot"; - reg = <0x1a0000 0x10000>; - read-only; - }; - - fwconcat0: partition@1b0000 { - label = "fwconcat0"; - reg = <0x1b0000 0x4c0000>; - }; - - partition@670000 { - label = "failsafe"; - reg = <0x670000 0x180000>; - read-only; - }; - - art: partition@7f0000 { - label = "art"; - reg = <0x7f0000 0x10000>; - read-only; - }; - }; - }; }; &mdio0 { diff --git a/target/linux/ath79/dts/ar724x_senao_loader.dtsi b/target/linux/ath79/dts/ar724x_senao_loader.dtsi new file mode 100644 index 0000000000..fdc2726e6f --- /dev/null +++ b/target/linux/ath79/dts/ar724x_senao_loader.dtsi @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include + +/ { + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&spi { + 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 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x50000 0x50000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0xa0000 0x10000>; + read-only; + }; + + fwconcat1: partition@b0000 { + label = "fwconcat1"; + reg = <0xb0000 0xf0000>; + }; + + partition@1a0000 { + label = "fakeroot"; + reg = <0x1a0000 0x10000>; + read-only; + }; + + fwconcat0: partition@1b0000 { + label = "fwconcat0"; + reg = <0x1b0000 0x4c0000>; + }; + + partition@670000 { + label = "failsafe"; + reg = <0x670000 0x180000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; From ce8b535ed3aea743f58d8445dfaa1c2ced375f94 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 15 Feb 2021 17:30:59 +0100 Subject: [PATCH 45/45] ath79: create common DTSI for Senao ar934x APs This creates a shared DTSI for ar934x Senao/Engenius APs: - EAP300 v2 - ENS202EXT v1 - EAP600 - ECB600 Since ar9341/ar9344 have different configuration, this new file mostly contains the partitioning. Suggested-by: Michael Pratt Signed-off-by: Adrian Schmutzler --- .../ath79/dts/ar9341_engenius_eap300-v2.dts | 92 +----------------- .../dts/ar9341_engenius_ens202ext-v1.dts | 92 +----------------- .../ath79/dts/ar9344_engenius_exx600.dtsi | 92 +----------------- .../linux/ath79/dts/ar934x_senao_loader.dtsi | 95 +++++++++++++++++++ 4 files changed, 98 insertions(+), 273 deletions(-) create mode 100644 target/linux/ath79/dts/ar934x_senao_loader.dtsi diff --git a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts index b830821977..8c87a73508 100644 --- a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts +++ b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "ar9341.dtsi" +#include "ar934x_senao_loader.dtsi" #include #include -#include / { model = "Engenius EAP300 v2"; @@ -43,96 +43,6 @@ linux,default-trigger = "phy0tpt"; }; }; - - virtual_flash { - compatible = "mtd-concat"; - - devices = <&fwconcat0 &fwconcat1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = ; - label = "firmware"; - reg = <0x0 0x0>; - }; - }; - }; -}; - -&ref { - clock-frequency = <40000000>; -}; - -&spi { - 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 = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x040000 0x010000>; - }; - - partition@50000 { - label = "custom"; - reg = <0x050000 0x050000>; - read-only; - }; - - partition@a0000 { - label = "loader"; - reg = <0x0a0000 0x010000>; - read-only; - }; - - fwconcat1: partition@b0000 { - label = "fwconcat1"; - reg = <0x0b0000 0x170000>; - }; - - partition@220000 { - label = "fakeroot"; - reg = <0x220000 0x010000>; - read-only; - }; - - fwconcat0: partition@230000 { - label = "fwconcat0"; - reg = <0x230000 0xbc0000>; - }; - - partition@df0000 { - label = "failsafe"; - reg = <0xdf0000 0x200000>; - read-only; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; - }; }; ð1 { diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts index 8204578c17..5c81020ccd 100644 --- a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts +++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "ar9341.dtsi" +#include "ar934x_senao_loader.dtsi" #include #include -#include / { model = "Engenius ENS202EXT v1"; @@ -58,96 +58,6 @@ gpios = <&gpio 0 GPIO_ACTIVE_LOW>; }; }; - - virtual_flash { - compatible = "mtd-concat"; - - devices = <&fwconcat0 &fwconcat1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = ; - label = "firmware"; - reg = <0x0 0x0>; - }; - }; - }; -}; - -&ref { - clock-frequency = <40000000>; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x040000 0x010000>; - }; - - partition@50000 { - label = "custom"; - reg = <0x050000 0x050000>; - read-only; - }; - - partition@a0000 { - label = "loader"; - reg = <0x0a0000 0x010000>; - read-only; - }; - - fwconcat1: partition@b0000 { - label = "fwconcat1"; - reg = <0x0b0000 0x170000>; - }; - - partition@220000 { - label = "fakeroot"; - reg = <0x220000 0x010000>; - read-only; - }; - - fwconcat0: partition@230000 { - label = "fwconcat0"; - reg = <0x230000 0xbc0000>; - }; - - partition@df0000 { - label = "failsafe"; - reg = <0xdf0000 0x200000>; - read-only; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; - }; }; ð0 { diff --git a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi index d7036ff675..1c318f2083 100644 --- a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi +++ b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "ar9344.dtsi" +#include "ar934x_senao_loader.dtsi" #include #include -#include / { aliases { @@ -35,96 +35,6 @@ linux,default-trigger = "phy1tpt"; }; }; - - virtual_flash { - compatible = "mtd-concat"; - - devices = <&fwconcat0 &fwconcat1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = ; - label = "firmware"; - reg = <0x0 0x0>; - }; - }; - }; -}; - -&ref { - clock-frequency = <40000000>; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x040000 0x010000>; - }; - - partition@50000 { - label = "custom"; - reg = <0x050000 0x050000>; - read-only; - }; - - partition@a0000 { - label = "loader"; - reg = <0x0a0000 0x010000>; - read-only; - }; - - fwconcat1: partition@b0000 { - label = "fwconcat1"; - reg = <0x0b0000 0x170000>; - }; - - partition@220000 { - label = "fakeroot"; - reg = <0x220000 0x010000>; - read-only; - }; - - fwconcat0: partition@230000 { - label = "fwconcat0"; - reg = <0x230000 0xbc0000>; - }; - - partition@df0000 { - label = "failsafe"; - reg = <0xdf0000 0x200000>; - read-only; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; - }; }; &mdio0 { diff --git a/target/linux/ath79/dts/ar934x_senao_loader.dtsi b/target/linux/ath79/dts/ar934x_senao_loader.dtsi new file mode 100644 index 0000000000..aa8a36d242 --- /dev/null +++ b/target/linux/ath79/dts/ar934x_senao_loader.dtsi @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include + +/ { + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + fwconcat1: partition@b0000 { + label = "fwconcat1"; + reg = <0x0b0000 0x170000>; + }; + + partition@220000 { + label = "fakeroot"; + reg = <0x220000 0x010000>; + read-only; + }; + + fwconcat0: partition@230000 { + label = "fwconcat0"; + reg = <0x230000 0xbc0000>; + }; + + partition@df0000 { + label = "failsafe"; + reg = <0xdf0000 0x200000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +};