From 364550f9d922c142af11ef3eeff11e309e3beef5 Mon Sep 17 00:00:00 2001 From: Arne Zachlod Date: Sun, 13 Nov 2022 13:08:37 +0100 Subject: [PATCH 01/42] ramips: fix MAC address assignment for rt1800, e7350 previous commit ffa4b5283b introduced a bug which broke the MAC address assignment for belkin,rt1800 and linksys,e7350. Fixes: ffa4b5283b39 ("ramips: add support for Mikrotik LtAP-2HnD") Signed-off-by: Arne Zachlod --- target/linux/ramips/mt7621/base-files/etc/board.d/02_network | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index cef5d55925..c4fe2153ac 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -219,6 +219,7 @@ ramips_setup_macs() lan_mac=$(mtd_get_mac_ascii Config lan_hwaddr) wan_mac=$(mtd_get_mac_ascii Config wan_hwaddr) label_mac=$lan_mac + ;; mikrotik,ltap-2hnd) label_mac=$(cat "/sys/firmware/mikrotik/hard_config/mac_base") lan_mac=$label_mac From b8bda645fcbd1b8c3aafdf2ebd4d54893fdddd65 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Tue, 25 Oct 2022 09:12:16 +0200 Subject: [PATCH 02/42] ipq40xx: utilize nvmem-cells for plasmacloud,pa1200 The calibration data and mac addresses on this device are stored in the 0:ART partition. It is therefore possible to move the code to handle them directly to the devicetree instead of the various scripts. But the actual relevant information about the partition layout is provided by the bootloader via bootargs (mtdparts) and not via the devicetree itself. Instead of using a fixed-partition template, the mtd dynamic partitions support from the upstream kernel is used. Reported-by: Robert Marko Signed-off-by: Sven Eckelmann --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 -- .../arch/arm/boot/dts/qcom-ipq4018-pa1200.dts | 31 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 9cdbaa3d4e..246bc6ca21 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -76,7 +76,6 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; cellc,rtl30vw |\ - plasmacloud,pa1200 |\ plasmacloud,pa2200) caldata_extract "0:ART" 0x1000 0x2f20 ;; @@ -171,7 +170,6 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; cellc,rtl30vw |\ - plasmacloud,pa1200 |\ plasmacloud,pa2200) caldata_extract "0:ART" 0x5000 0x2f20 ;; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts index 4e08dd39d0..dac4adbd5f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts @@ -140,7 +140,32 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <24000000>; + /* partitions are passed via bootloader */ + partitions { + partition-art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + label = "0:ART"; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + }; + }; }; }; @@ -161,9 +186,15 @@ &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; + + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; + + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; }; From 539a5fd62490c22fdd29ddbc2ccfb2fd25cba610 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 24 Oct 2022 18:55:44 +0200 Subject: [PATCH 03/42] ipq40xx: Convert plasmacloud,pa1200 to DSA * ethernet1: - physical port label "Ethernet 1" - its mac address is printed on the device label * ethernet2: - physical port label "Ethernet 2" - can be used to power the device Both ports are not marked by there role (because the vendor firmware automatically detects roles) but the "Ethernet 2" port was used in the past for "WAN" functionality in OpenWrt. Signed-off-by: Sven Eckelmann --- .../ipq40xx/base-files/etc/board.d/02_network | 3 ++ .../arch/arm/boot/dts/qcom-ipq4018-pa1200.dts | 33 ++++++++++++++++--- target/linux/ipq40xx/image/generic.mk | 3 +- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index e682a0fb15..dc111044e8 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -77,6 +77,9 @@ ipq40xx_setup_interfaces() openmesh,a62) ucidef_set_interfaces_lan_wan "ethernet2" "ethernet1" ;; + plasmacloud,pa1200) + ucidef_set_interfaces_lan_wan "ethernet1" "ethernet2" + ;; zte,mf286d) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "wan" ;; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts index dac4adbd5f..af4a7b196b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts @@ -17,10 +17,6 @@ status = "okay"; }; - mdio@90000 { - status = "okay"; - }; - tcsr@194b000 { /* select hostmode */ compatible = "qcom,tcsr"; @@ -75,6 +71,7 @@ led-failsafe = &led_status_yellow; led-running = &led_status_cyan; led-upgrade = &led_status_yellow; + label-mac-device = &swport5; }; leds { @@ -183,6 +180,34 @@ status = "okay"; }; +&mdio { + status = "okay"; +}; + +&gmac { + status = "okay"; +}; + +&switch { + status = "okay"; +}; + +&swport4 { + status = "okay"; + label = "ethernet2"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_gmac1>; +}; + +&swport5 { + status = "okay"; + label = "ethernet1"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_gmac0>; +}; + &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 9553931676..8b2851f83e 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -958,8 +958,7 @@ define Device/plasmacloud_pa1200 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata endef -# Missing DSA Setup -#TARGET_DEVICES += plasmacloud_pa1200 +TARGET_DEVICES += plasmacloud_pa1200 define Device/plasmacloud_pa2200 $(call Device/FitImageLzma) From ce6c9e0328a563082d12397068fbf2eb2a227d24 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Tue, 25 Oct 2022 09:12:16 +0200 Subject: [PATCH 04/42] ipq40xx: utilize nvmem-cells for plasmacloud,pa2200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The calibration data and mac addresses on this device are stored in the 0:ART partition. It is therefore possible to move the code to handle them directly to the devicetree instead of the various scripts. But the actual relevant information about the partition layout is provided by the bootloader via bootargs (mtdparts) and not via the devicetree itself. Instead of using a fixed-partition template, the mtd dynamic partitions support from the upstream kernel is used. Reported-by: Robert Marko Tested-by: Michaël BILCOT Signed-off-by: Sven Eckelmann --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 9 +---- .../arch/arm/boot/dts/qcom-ipq4019-pa2200.dts | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 246bc6ca21..7498e1c710 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -34,9 +34,6 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \ /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; - plasmacloud,pa2200) - caldata_extract "0:ART" 0x9000 0x2f20 - ;; linksys,ea8300 |\ linksys,mr8300) caldata_extract "ART" 0x9000 0x2f20 @@ -75,8 +72,7 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \ /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; - cellc,rtl30vw |\ - plasmacloud,pa2200) + cellc,rtl30vw) caldata_extract "0:ART" 0x1000 0x2f20 ;; devolo,magic-2-wifi-next) @@ -169,8 +165,7 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \ /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; - cellc,rtl30vw |\ - plasmacloud,pa2200) + cellc,rtl30vw) caldata_extract "0:ART" 0x5000 0x2f20 ;; devolo,magic-2-wifi-next) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts index 461f05bc73..d7dcf053be 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts @@ -140,7 +140,36 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <24000000>; + /* partitions are passed via bootloader */ + partitions { + partition-art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + label = "0:ART"; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; + + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + }; + }; }; }; @@ -171,6 +200,9 @@ reg = <0x00010000 0 0 0 0>; qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; ieee80211-freq-limit = <5170000 5350000>; + + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_9000>; }; }; }; @@ -178,10 +210,16 @@ &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; + + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; ieee80211-freq-limit = <5470000 5875000>; + + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; }; From fc69532eb96a17079f973c0a8735e26234a1f5a1 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 24 Oct 2022 18:55:44 +0200 Subject: [PATCH 05/42] ipq40xx: Convert plasmacloud,pa2200 to DSA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ethernet1: - physical port label "Ethernet 1" - its mac address is printed on the device label * ethernet2: - physical port label "Ethernet 2" - can be used to power the device Both ports are not marked by there role (because the vendor firmware automatically detects roles) but the "Ethernet 2" port was used in the past for "WAN" functionality in OpenWrt. Tested-by: Michaël BILCOT Signed-off-by: Sven Eckelmann --- .../ipq40xx/base-files/etc/board.d/02_network | 3 +- .../arch/arm/boot/dts/qcom-ipq4019-pa2200.dts | 33 ++++++++++++++++--- target/linux/ipq40xx/image/generic.mk | 3 +- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index dc111044e8..24b59d6630 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -77,7 +77,8 @@ ipq40xx_setup_interfaces() openmesh,a62) ucidef_set_interfaces_lan_wan "ethernet2" "ethernet1" ;; - plasmacloud,pa1200) + plasmacloud,pa1200|\ + plasmacloud,pa2200) ucidef_set_interfaces_lan_wan "ethernet1" "ethernet2" ;; zte,mf286d) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts index d7dcf053be..259ea7bb47 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts @@ -17,10 +17,6 @@ status = "okay"; }; - mdio@90000 { - status = "okay"; - }; - tcsr@1949000 { compatible = "qcom,tcsr"; reg = <0x1949000 0x100>; @@ -63,6 +59,7 @@ led-failsafe = &led_status_blue; led-running = &led_power_orange; led-upgrade = &led_status_blue; + label-mac-device = &swport4; }; leds { @@ -207,6 +204,34 @@ }; }; +&mdio { + status = "okay"; +}; + +&gmac { + status = "okay"; +}; + +&switch { + status = "okay"; +}; + +&swport4 { + status = "okay"; + label = "ethernet1"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_gmac0>; +}; + +&swport5 { + status = "okay"; + label = "ethernet2"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_gmac1>; +}; + &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 8b2851f83e..d05e2c72ec 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -974,8 +974,7 @@ define Device/plasmacloud_pa2200 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata DEVICE_PACKAGES := ath10k-firmware-qca9888-ct endef -# Missing DSA Setup -#TARGET_DEVICES += plasmacloud_pa2200 +TARGET_DEVICES += plasmacloud_pa2200 define Device/qcom_ap-dk01.1-c1 DEVICE_VENDOR := Qualcomm Atheros From 1a49b499f12e7589db601dfd695cca7483740eee Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Fri, 7 Oct 2022 00:56:00 +0200 Subject: [PATCH 06/42] ipq40xx: dts: remove leftover nodes after DSA conversion Remove ess-psgmii@98000, edma@c080000 and ess-switch@c000000 nodes. These nodes are not used after the DSA conversion, but were left over in a few devices added recently. ZTE MF289F is omitted on purpose, as for it, these nodes will be removed together with DSA conversion. Build tested only, as I only have MF286D from those devices. Reviewed-by: Robert Marko Signed-off-by: Lech Perczak --- .../arch/arm/boot/dts/qcom-ipq4018-whw01-v1.dts | 12 ------------ .../arch/arm/boot/dts/qcom-ipq4019-mf286d.dts | 4 ---- .../patches-5.15/900-dts-ipq4019-ap-dk01.1.patch | 14 +------------- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01-v1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01-v1.dts index 6f244132ea..8ca57a0e85 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01-v1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01-v1.dts @@ -31,21 +31,9 @@ }; }; - ess-psgmii@98000 { - status = "okay"; - }; - ess_tcsr@1953000 { status = "okay"; }; - - ess-switch@c000000 { - status = "okay"; - }; - - edma@c080000 { - status = "okay"; - }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts index a832e2392a..ff04279a60 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts @@ -85,10 +85,6 @@ reset-delay-us = <2000>; }; - ess-psgmii@98000 { - status = "okay"; - }; - tcsr@1949000 { compatible = "qcom,tcsr"; reg = <0x1949000 0x100>; diff --git a/target/linux/ipq40xx/patches-5.15/900-dts-ipq4019-ap-dk01.1.patch b/target/linux/ipq40xx/patches-5.15/900-dts-ipq4019-ap-dk01.1.patch index 650bdafe0e..145d3f49ed 100644 --- a/target/linux/ipq40xx/patches-5.15/900-dts-ipq4019-ap-dk01.1.patch +++ b/target/linux/ipq40xx/patches-5.15/900-dts-ipq4019-ap-dk01.1.patch @@ -56,7 +56,7 @@ }; serial@78af000 { -@@ -109,5 +128,41 @@ +@@ -109,5 +128,29 @@ wifi@a800000 { status = "okay"; }; @@ -65,18 +65,6 @@ + status = "okay"; + }; + -+ ess-switch@c000000 { -+ status = "okay"; -+ }; -+ -+ ess-psgmii@98000 { -+ status = "okay"; -+ }; -+ -+ edma@c080000 { -+ status = "okay"; -+ }; -+ + usb3_ss_phy: ssphy@9a000 { + status = "okay"; + }; From fdcd383919e9ba6a8f6558a1eff9abf7175e872e Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 11 Nov 2022 13:37:07 +0100 Subject: [PATCH 07/42] kconfig: abort configuration on unset symbol This fixes the initial patch to cover all cases where unset symbols are handled in the code. Fixes commit eaa9c94c7574 ("generic: Kconfig: exit on unset symbol") Signed-off-by: David Bauer --- ...-abort-configuration-on-unset-symbol.patch | 41 +++++++++++++++++++ .../generic/hack-5.10/205-kconfig-exit.patch | 28 ------------- ...-abort-configuration-on-unset-symbol.patch | 41 +++++++++++++++++++ .../generic/hack-5.15/205-kconfig-exit.patch | 20 --------- 4 files changed, 82 insertions(+), 48 deletions(-) create mode 100644 target/linux/generic/hack-5.10/205-kconfig-abort-configuration-on-unset-symbol.patch delete mode 100644 target/linux/generic/hack-5.10/205-kconfig-exit.patch create mode 100644 target/linux/generic/hack-5.15/205-kconfig-abort-configuration-on-unset-symbol.patch delete mode 100644 target/linux/generic/hack-5.15/205-kconfig-exit.patch diff --git a/target/linux/generic/hack-5.10/205-kconfig-abort-configuration-on-unset-symbol.patch b/target/linux/generic/hack-5.10/205-kconfig-abort-configuration-on-unset-symbol.patch new file mode 100644 index 0000000000..bd5c54d4b8 --- /dev/null +++ b/target/linux/generic/hack-5.10/205-kconfig-abort-configuration-on-unset-symbol.patch @@ -0,0 +1,41 @@ +From 310e8e04a05d9eb43fa9dd7f00143300afcaa37a Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Fri, 11 Nov 2022 13:33:44 +0100 +Subject: [PATCH] kconfig: abort configuration on unset symbol + +When a target configuration has unset Kconfig symbols, the build will +fail when OpenWrt is compiled with V=s and stdin is connected to a tty. + +In case OpenWrt is compiled without either of these preconditions, the +build will succeed with the symbols in question being unset. + +Modify the kernel configuration in a way it fails on unset symbols +regardless of the aforementioned preconditions. + +Signed-off-by: David Bauer +--- + scripts/kconfig/conf.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/scripts/kconfig/conf.c ++++ b/scripts/kconfig/conf.c +@@ -109,6 +109,9 @@ static int conf_askvalue(struct symbol * + } + /* fall through */ + case oldaskconfig: ++ if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) { ++ exit(1); ++ } + fflush(stdout); + xfgets(line, sizeof(line), stdin); + return 1; +@@ -303,6 +306,9 @@ static int conf_choice(struct menu *menu + } + /* fall through */ + case oldaskconfig: ++ if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) { ++ exit(1); ++ } + fflush(stdout); + xfgets(line, sizeof(line), stdin); + strip(line); diff --git a/target/linux/generic/hack-5.10/205-kconfig-exit.patch b/target/linux/generic/hack-5.10/205-kconfig-exit.patch deleted file mode 100644 index 591daf624a..0000000000 --- a/target/linux/generic/hack-5.10/205-kconfig-exit.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: David Bauer -Subject: Kconfig: exit on unset symbol - -When a target configuration has unset Kconfig symbols, the build will -fail when OpenWrt is compiled with V=s and stdin is connected to a tty. - -In case OpenWrt is compiled without either of these preconditions, the -build will succeed with the symbols in question being unset. - -Modify the kernel configuration in a way it fails on unset symbols -regardless of the aforementioned preconditions. - -Submitted-by: David Bauer ---- - scripts/kconfig/conf.c | 2 + - 1 files changed, 2 insertions(+) - ---- a/scripts/kconfig/conf.c -+++ b/scripts/kconfig/conf.c -@@ -215,6 +215,8 @@ static int conf_sym(struct menu *menu) - break; - continue; - case 0: -+ if (!sym_has_value(sym) && !tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) -+ exit(1); - newval = oldval; - break; - case '?': diff --git a/target/linux/generic/hack-5.15/205-kconfig-abort-configuration-on-unset-symbol.patch b/target/linux/generic/hack-5.15/205-kconfig-abort-configuration-on-unset-symbol.patch new file mode 100644 index 0000000000..a87c7a5116 --- /dev/null +++ b/target/linux/generic/hack-5.15/205-kconfig-abort-configuration-on-unset-symbol.patch @@ -0,0 +1,41 @@ +From 310e8e04a05d9eb43fa9dd7f00143300afcaa37a Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Fri, 11 Nov 2022 13:33:44 +0100 +Subject: [PATCH] kconfig: abort configuration on unset symbol + +When a target configuration has unset Kconfig symbols, the build will +fail when OpenWrt is compiled with V=s and stdin is connected to a tty. + +In case OpenWrt is compiled without either of these preconditions, the +build will succeed with the symbols in question being unset. + +Modify the kernel configuration in a way it fails on unset symbols +regardless of the aforementioned preconditions. + +Signed-off-by: David Bauer +--- + scripts/kconfig/conf.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/scripts/kconfig/conf.c ++++ b/scripts/kconfig/conf.c +@@ -341,6 +341,9 @@ static int conf_askvalue(struct symbol * + } + /* fall through */ + default: ++ if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) { ++ exit(1); ++ } + fflush(stdout); + xfgets(line, sizeof(line), stdin); + break; +@@ -523,6 +526,9 @@ static int conf_choice(struct menu *menu + } + /* fall through */ + case oldaskconfig: ++ if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) { ++ exit(1); ++ } + fflush(stdout); + xfgets(line, sizeof(line), stdin); + strip(line); diff --git a/target/linux/generic/hack-5.15/205-kconfig-exit.patch b/target/linux/generic/hack-5.15/205-kconfig-exit.patch deleted file mode 100644 index 9f3bb8f311..0000000000 --- a/target/linux/generic/hack-5.15/205-kconfig-exit.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 300d26562ce4dc427154cb247beb75db4b1f0774 Mon Sep 17 00:00:00 2001 -From: OpenWrt community -Date: Wed, 13 Jul 2022 13:29:57 +0200 -Subject: [PATCH] scripts/Kconfig: Kconfig exit - ---- - scripts/kconfig/conf.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/scripts/kconfig/conf.c -+++ b/scripts/kconfig/conf.c -@@ -435,6 +435,8 @@ static int conf_sym(struct menu *menu) - break; - continue; - case 0: -+ if (!sym_has_value(sym) && !tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) -+ exit(1); - newval = oldval; - break; - case '?': From cec9cbef449daea6529fbda64777ff1b7ae4e499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Sat, 12 Nov 2022 16:06:52 +0100 Subject: [PATCH 08/42] kernel: add kmod-hwmon-sht3x support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver supports the temperature and humidity sensors chips SHT3x and STS3x by Sensirion. Signed-off-by: Uwe Kleine-König --- package/kernel/linux/modules/hwmon.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk index e0810c97bd..c8d79b622e 100644 --- a/package/kernel/linux/modules/hwmon.mk +++ b/package/kernel/linux/modules/hwmon.mk @@ -474,6 +474,21 @@ endef $(eval $(call KernelPackage,hwmon-sht21)) +define KernelPackage/hwmon-sht3x + TITLE:=Sensiron SHT3x and compat. monitoring support + KCONFIG:=CONFIG_SENSORS_SHT3x + FILES:=$(LINUX_DIR)/drivers/hwmon/sht3x.ko + AUTOLOAD:=$(call AutoProbe,sht3x) + $(call AddDepends/hwmon,+kmod-i2c-core +kmod-lib-crc8) +endef + +define KernelPackage/hwmon-sht3x/description + Kernel module for Sensirion SHT3x temperature and humidity sensors chip +endef + +$(eval $(call KernelPackage,hwmon-sht3x)) + + define KernelPackage/hwmon-tmp102 TITLE:=Texas Instruments TMP102 monitoring support KCONFIG:=CONFIG_SENSORS_TMP102 From de79a0a9e0679b03d35c92e3abbce6e9fbb19a9d Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 21 Oct 2022 14:36:47 +0200 Subject: [PATCH 09/42] zlib: update to 1.2.13 Remove "001-neon-implementation-of-adler32.patch" because upstreamed deleted assembler code optimizations: https://github.com/madler/zlib/commit/d0704a820186481da35d08f4b655881e1d32089f Remove upstreamed patches: - 006-fix-CVE-2022-37434.patch - 007-fix-null-dereference-in-fix-CVE-2022-37434.patch Refresh patches: - 002-arm-specific-optimisations-for-inflate.patch - 003-arm-specific-optimisations-for-inflate.patch - 004-attach-sourcefiles-in-patch-002-to-buildsystem.patch Switch to "https github.com" for downloading source files. Release Announcements: https://github.com/madler/zlib/releases/tag/v1.2.13 Signed-off-by: Nick Hainke --- package/libs/zlib/Makefile | 9 +- .../001-neon-implementation-of-adler32.patch | 246 ------------------ ...m-specific-optimisations-for-inflate.patch | 6 - ...m-specific-optimisations-for-inflate.patch | 31 +-- ...rcefiles-in-patch-002-to-buildsystem.patch | 4 +- .../zlib/patches/006-fix-CVE-2022-37434.patch | 32 --- ...ll-dereference-in-fix-CVE-2022-37434.patch | 29 --- 7 files changed, 18 insertions(+), 339 deletions(-) delete mode 100644 package/libs/zlib/patches/001-neon-implementation-of-adler32.patch delete mode 100644 package/libs/zlib/patches/006-fix-CVE-2022-37434.patch delete mode 100644 package/libs/zlib/patches/007-fix-null-dereference-in-fix-CVE-2022-37434.patch diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile index 8512394ff4..092443ab0e 100644 --- a/package/libs/zlib/Makefile +++ b/package/libs/zlib/Makefile @@ -8,13 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib -PKG_VERSION:=1.2.12 +PKG_VERSION:=1.2.13 PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/madler/zlib -PKG_MIRROR_HASH:=a162fc219763635f0c1591ec515d4b08684e4b0bfb4b1c8e65e4eab18d597c27 -PKG_SOURCE_VERSION:=21767c654d31d2dccdde4330529775c6c5fd5389 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/madler/zlib/releases/download/v$(PKG_VERSION) +PKG_HASH:=d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98 PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=README diff --git a/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch b/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch deleted file mode 100644 index c5517299d7..0000000000 --- a/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch +++ /dev/null @@ -1,246 +0,0 @@ -From d2f06cd65d7ac39c6dd6761eef162abc946b155b Mon Sep 17 00:00:00 2001 -From: Adenilson Cavalcanti -Date: Tue, 11 Apr 2017 17:13:02 -0700 -Subject: [PATCH] NEON implementation for Adler32 - -The checksum is calculated in the uncompressed PNG data -and can be made much faster by using SIMD. - -Tests in ARMv8 yielded an improvement of about 3x -(e.g. walltime was 350ms x 125ms for a 4096x4096 bytes -executed 30 times). That results in at least 18% improvement -in image decoding in Chromium. - -Further details at: -https://bugs.chromium.org/p/chromium/issues/detail?id=688601 ---- - CMakeLists.txt | 29 +++++++--- - adler32.c | 5 ++ - contrib/README.contrib | 3 + - contrib/arm/neon_adler32.c | 137 +++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 166 insertions(+), 8 deletions(-) - create mode 100644 contrib/arm/neon_adler32.c - ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -7,6 +7,7 @@ set(VERSION "1.2.12") - - option(ASM686 "Enable building i686 assembly implementation") - option(AMD64 "Enable building amd64 assembly implementation") -+option(ARMv8 "Enable building ARM NEON intrinsics implementation") - - set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") - set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") -@@ -132,14 +133,26 @@ endif() - if(CMAKE_COMPILER_IS_GNUCC) - if(ASM686) - set(ZLIB_ASMS contrib/asm686/match.S) -- elseif (AMD64) -+ elseif(AMD64) - set(ZLIB_ASMS contrib/amd64/amd64-match.S) -- endif () -+ elseif(ARMv8) -+ set(ZLIB_ARMv8 contrib/arm/neon_adler32.c) -+ endif() - -- if(ZLIB_ASMS) -- add_definitions(-DASMV) -- set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE) -- endif() -+ if(ZLIB_ASMS) -+ add_definitions(-DASMV) -+ set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE) -+ elseif(ZLIB_ARMv8) -+ add_definitions(-DARMv8) -+ set(COMPILER ${CMAKE_C_COMPILER}) -+ # NEON is mandatory in ARMv8. -+ if(${COMPILER} MATCHES "aarch64") -+ set_source_files_properties(${ZLIB_ARMv8} PROPERTIES LANGUAGE C COMPILE_FLAGS -march=armv8-a) -+ # But it was optional for ARMv7. -+ elseif(${COMPILER} MATCHES "arm") -+ set_source_files_properties(${ZLIB_ARMv8} PROPERTIES LANGUAGE C COMPILE_FLAGS -mfpu=neon) -+ endif() -+ endif() - endif() - - if(MSVC) -@@ -183,8 +196,8 @@ if(MINGW) - set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) - endif(MINGW) - --add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) --add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -+add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_ARMv8} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -+add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_ARMv8} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) - set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) - set_target_properties(zlib PROPERTIES SOVERSION 1) - ---- a/adler32.c -+++ b/adler32.c -@@ -136,7 +136,14 @@ uLong ZEXPORT adler32(adler, buf, len) - const Bytef *buf; - uInt len; - { -+#ifdef ARMv8 -+# pragma message("Using NEON-ized Adler32.") -+unsigned long NEON_adler32(unsigned long adler, const unsigned char *buf, -+ const unsigned int len); -+ return NEON_adler32(adler, buf, len); -+#else - return adler32_z(adler, buf, len); -+#endif - } - - /* ========================================================================= */ ---- a/contrib/README.contrib -+++ b/contrib/README.contrib -@@ -8,6 +8,9 @@ ada/ by Dmitriy Anisimkov -+ ARM optimizations (NEON and ARMv8 code). -+ - blast/ by Mark Adler - Decompressor for output of PKWare Data Compression Library (DCL) - ---- /dev/null -+++ b/contrib/arm/neon_adler32.c -@@ -0,0 +1,137 @@ -+/* Copyright (C) 1995-2011, 2016 Mark Adler -+ * Copyright (C) 2017 ARM Holdings Inc. -+ * Authors: Adenilson Cavalcanti -+ * Simon Hosie -+ * This software is provided 'as-is', without any express or implied -+ * warranty. In no event will the authors be held liable for any damages -+ * arising from the use of this software. -+ * Permission is granted to anyone to use this software for any purpose, -+ * including commercial applications, and to alter it and redistribute it -+ * freely, subject to the following restrictions: -+ * 1. The origin of this software must not be misrepresented; you must not -+ * claim that you wrote the original software. If you use this software -+ * in a product, an acknowledgment in the product documentation would be -+ * appreciated but is not required. -+ * 2. Altered source versions must be plainly marked as such, and must not be -+ * misrepresented as being the original software. -+ * 3. This notice may not be removed or altered from any source distribution. -+ */ -+ -+#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) -+#include -+ -+static void NEON_accum32(uint32_t *s, const unsigned char *buf, -+ unsigned int len) -+{ -+ static const uint8_t taps[32] = { -+ 32, 31, 30, 29, 28, 27, 26, 25, -+ 24, 23, 22, 21, 20, 19, 18, 17, -+ 16, 15, 14, 13, 12, 11, 10, 9, -+ 8, 7, 6, 5, 4, 3, 2, 1 }; -+ -+ uint32x2_t adacc2, s2acc2, as; -+ uint8x16_t t0 = vld1q_u8(taps), t1 = vld1q_u8(taps + 16); -+ -+ uint32x4_t adacc = vdupq_n_u32(0), s2acc = vdupq_n_u32(0); -+ adacc = vsetq_lane_u32(s[0], adacc, 0); -+ s2acc = vsetq_lane_u32(s[1], s2acc, 0); -+ -+ while (len >= 2) { -+ uint8x16_t d0 = vld1q_u8(buf), d1 = vld1q_u8(buf + 16); -+ uint16x8_t adler, sum2; -+ s2acc = vaddq_u32(s2acc, vshlq_n_u32(adacc, 5)); -+ adler = vpaddlq_u8( d0); -+ adler = vpadalq_u8(adler, d1); -+ sum2 = vmull_u8( vget_low_u8(t0), vget_low_u8(d0)); -+ sum2 = vmlal_u8(sum2, vget_high_u8(t0), vget_high_u8(d0)); -+ sum2 = vmlal_u8(sum2, vget_low_u8(t1), vget_low_u8(d1)); -+ sum2 = vmlal_u8(sum2, vget_high_u8(t1), vget_high_u8(d1)); -+ adacc = vpadalq_u16(adacc, adler); -+ s2acc = vpadalq_u16(s2acc, sum2); -+ len -= 2; -+ buf += 32; -+ } -+ -+ while (len > 0) { -+ uint8x16_t d0 = vld1q_u8(buf); -+ uint16x8_t adler, sum2; -+ s2acc = vaddq_u32(s2acc, vshlq_n_u32(adacc, 4)); -+ adler = vpaddlq_u8(d0); -+ sum2 = vmull_u8( vget_low_u8(t1), vget_low_u8(d0)); -+ sum2 = vmlal_u8(sum2, vget_high_u8(t1), vget_high_u8(d0)); -+ adacc = vpadalq_u16(adacc, adler); -+ s2acc = vpadalq_u16(s2acc, sum2); -+ buf += 16; -+ len--; -+ } -+ -+ adacc2 = vpadd_u32(vget_low_u32(adacc), vget_high_u32(adacc)); -+ s2acc2 = vpadd_u32(vget_low_u32(s2acc), vget_high_u32(s2acc)); -+ as = vpadd_u32(adacc2, s2acc2); -+ s[0] = vget_lane_u32(as, 0); -+ s[1] = vget_lane_u32(as, 1); -+} -+ -+static void NEON_handle_tail(uint32_t *pair, const unsigned char *buf, -+ unsigned int len) -+{ -+ /* Oldie K&R code integration. */ -+ unsigned int i; -+ for (i = 0; i < len; ++i) { -+ pair[0] += buf[i]; -+ pair[1] += pair[0]; -+ } -+} -+ -+extern unsigned long NEON_adler32(unsigned long adler, const unsigned char *buf, -+ const unsigned int len) -+{ -+ /* initial Adler-32 value (deferred check for len == 1 speed) */ -+ if (!buf) -+ return 1L; -+ -+ /* The largest prime smaller than 65536. */ -+ const uint32_t M_BASE = 65521; -+ /* This is the threshold where doing accumulation may overflow. */ -+ const int M_NMAX = 5552; -+ -+ unsigned long sum2; -+ uint32_t pair[2]; -+ int n = M_NMAX; -+ unsigned int done = 0; -+ /* Oldie K&R code integration. */ -+ unsigned int i; -+ -+ /* Split Adler-32 into component sums, it can be supplied by -+ * the caller sites (e.g. in a PNG file). -+ */ -+ sum2 = (adler >> 16) & 0xffff; -+ adler &= 0xffff; -+ pair[0] = adler; -+ pair[1] = sum2; -+ -+ for (i = 0; i < len; i += n) { -+ if ((i + n) > len) -+ n = len - i; -+ -+ if (n < 16) -+ break; -+ -+ NEON_accum32(pair, buf + i, n / 16); -+ pair[0] %= M_BASE; -+ pair[1] %= M_BASE; -+ -+ done += (n / 16) * 16; -+ } -+ -+ /* Handle the tail elements. */ -+ if (done < len) { -+ NEON_handle_tail(pair, (buf + done), len - done); -+ pair[0] %= M_BASE; -+ pair[1] %= M_BASE; -+ } -+ -+ /* D = B * 65536 + A, see: https://en.wikipedia.org/wiki/Adler-32. */ -+ return (pair[1] << 16) | pair[0]; -+} -+#endif diff --git a/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch b/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch index d181b034e5..04e66621e1 100644 --- a/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch +++ b/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch @@ -11,9 +11,6 @@ Change-Id: Id4cda552b39bfb39ab35ec499dbe122b43b6d1a1 create mode 100644 contrib/arm/inffast.c create mode 100644 contrib/arm/inflate.c -diff --git a/contrib/arm/inffast.c b/contrib/arm/inffast.c -new file mode 100644 -index 00000000..0dbd1dbc --- /dev/null +++ b/contrib/arm/inffast.c @@ -0,0 +1,323 @@ @@ -340,9 +337,6 @@ index 00000000..0dbd1dbc + */ + +#endif /* !ASMINF */ -diff --git a/contrib/arm/inflate.c b/contrib/arm/inflate.c -new file mode 100644 -index 00000000..ac333e8c --- /dev/null +++ b/contrib/arm/inflate.c @@ -0,0 +1,1561 @@ diff --git a/package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch b/package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch index 9370264c40..1f83b500ba 100644 --- a/package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch +++ b/package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch @@ -16,9 +16,6 @@ Change-Id: I59854eb25d2b1e43561c8a2afaf9175bf10cf674 3 files changed, 335 insertions(+), 62 deletions(-) create mode 100644 contrib/arm/chunkcopy.h -diff --git a/contrib/arm/chunkcopy.h b/contrib/arm/chunkcopy.h -new file mode 100644 -index 00000000..2d6fd6f9 --- /dev/null +++ b/contrib/arm/chunkcopy.h @@ -0,0 +1,279 @@ @@ -301,8 +298,6 @@ index 00000000..2d6fd6f9 +#undef Z_RESTRICT + +#endif /* CHUNKCOPY_H */ -diff --git a/contrib/arm/inffast.c b/contrib/arm/inffast.c -index 0dbd1dbc..f7f50071 100644 --- a/contrib/arm/inffast.c +++ b/contrib/arm/inffast.c @@ -7,6 +7,7 @@ @@ -313,7 +308,7 @@ index 0dbd1dbc..f7f50071 100644 #ifdef ASMINF # pragma message("Assembler code may have bugs -- use at your own risk") -@@ -57,6 +58,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ +@@ -57,6 +58,7 @@ unsigned start; /* inflate()'s s unsigned char FAR *out; /* local strm->next_out */ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ @@ -321,7 +316,7 @@ index 0dbd1dbc..f7f50071 100644 #ifdef INFLATE_STRICT unsigned dmax; /* maximum distance from zlib header */ #endif -@@ -84,12 +86,13 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ +@@ -84,12 +86,13 @@ unsigned start; /* inflate()'s s out = strm->next_out; beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); @@ -336,7 +331,7 @@ index 0dbd1dbc..f7f50071 100644 window = state->window; hold = state->hold; bits = state->bits; -@@ -197,70 +200,51 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ +@@ -197,70 +200,51 @@ unsigned start; /* inflate()'s s #endif } from = window; @@ -371,14 +366,8 @@ index 0dbd1dbc..f7f50071 100644 - } while (--op); - from = out - dist; /* rest from output */ - } -+ out = chunkcopy_safe(out, from, op, limit); -+ from = window; /* more from start of window */ -+ op = wnext; -+ /* This (rare) case can create a situation where -+ the first chunkcopy below must be checked. -+ */ - } - } +- } +- } - else { /* contiguous in window */ - from += wnext - op; - if (op < len) { /* some from window */ @@ -399,6 +388,14 @@ index 0dbd1dbc..f7f50071 100644 - *out++ = *from++; - if (len > 1) - *out++ = *from++; ++ out = chunkcopy_safe(out, from, op, limit); ++ from = window; /* more from start of window */ ++ op = wnext; ++ /* This (rare) case can create a situation where ++ the first chunkcopy below must be checked. ++ */ ++ } ++ } + if (op < len) { /* still need some from output */ + out = chunkcopy_safe(out, from, op, limit); + len -= op; @@ -443,8 +440,6 @@ index 0dbd1dbc..f7f50071 100644 } } else if ((op & 64) == 0) { /* 2nd level distance code */ -diff --git a/contrib/arm/inflate.c b/contrib/arm/inflate.c -index ac333e8c..e40322c3 100644 --- a/contrib/arm/inflate.c +++ b/contrib/arm/inflate.c @@ -84,6 +84,7 @@ diff --git a/package/libs/zlib/patches/004-attach-sourcefiles-in-patch-002-to-buildsystem.patch b/package/libs/zlib/patches/004-attach-sourcefiles-in-patch-002-to-buildsystem.patch index 68f317b24b..81816aed68 100644 --- a/package/libs/zlib/patches/004-attach-sourcefiles-in-patch-002-to-buildsystem.patch +++ b/package/libs/zlib/patches/004-attach-sourcefiles-in-patch-002-to-buildsystem.patch @@ -1,8 +1,6 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e75f66..24d7329 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -95,34 +95,67 @@ set(ZLIB_PUBLIC_HDRS +@@ -91,34 +91,67 @@ set(ZLIB_PUBLIC_HDRS ${CMAKE_CURRENT_BINARY_DIR}/zconf.h zlib.h ) diff --git a/package/libs/zlib/patches/006-fix-CVE-2022-37434.patch b/package/libs/zlib/patches/006-fix-CVE-2022-37434.patch deleted file mode 100644 index dc84d3a1d3..0000000000 --- a/package/libs/zlib/patches/006-fix-CVE-2022-37434.patch +++ /dev/null @@ -1,32 +0,0 @@ -From eff308af425b67093bab25f80f1ae950166bece1 Mon Sep 17 00:00:00 2001 -From: Mark Adler -Date: Sat, 30 Jul 2022 15:51:11 -0700 -Subject: [PATCH] Fix a bug when getting a gzip header extra field with - inflate(). - -If the extra field was larger than the space the user provided with -inflateGetHeader(), and if multiple calls of inflate() delivered -the extra header data, then there could be a buffer overflow of the -provided space. This commit assures that provided space is not -exceeded. ---- - inflate.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/inflate.c b/inflate.c -index 7be8c6366..7a7289749 100644 ---- a/inflate.c -+++ b/inflate.c -@@ -763,9 +763,10 @@ int flush; - copy = state->length; - if (copy > have) copy = have; - if (copy) { -+ len = state->head->extra_len - state->length; - if (state->head != Z_NULL && -- state->head->extra != Z_NULL) { -- len = state->head->extra_len - state->length; -+ state->head->extra != Z_NULL && -+ len < state->head->extra_max) { - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); diff --git a/package/libs/zlib/patches/007-fix-null-dereference-in-fix-CVE-2022-37434.patch b/package/libs/zlib/patches/007-fix-null-dereference-in-fix-CVE-2022-37434.patch deleted file mode 100644 index c5c95a92b2..0000000000 --- a/package/libs/zlib/patches/007-fix-null-dereference-in-fix-CVE-2022-37434.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001 -From: Mark Adler -Date: Mon, 8 Aug 2022 10:50:09 -0700 -Subject: [PATCH] Fix extra field processing bug that dereferences NULL - state->head. - -The recent commit to fix a gzip header extra field processing bug -introduced the new bug fixed here. ---- - inflate.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/inflate.c b/inflate.c -index 7a7289749..2a3c4fe98 100644 ---- a/inflate.c -+++ b/inflate.c -@@ -763,10 +763,10 @@ int flush; - copy = state->length; - if (copy > have) copy = have; - if (copy) { -- len = state->head->extra_len - state->length; - if (state->head != Z_NULL && - state->head->extra != Z_NULL && -- len < state->head->extra_max) { -+ (len = state->head->extra_len - state->length) < -+ state->head->extra_max) { - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); From b2e83c16e1383eb817c1f34d7118b01cefa670d8 Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Sun, 30 Oct 2022 15:56:14 +0100 Subject: [PATCH 10/42] procd: service: pass all arguments to service Passing all arguments to /etc/init.d/$service restores the behaviour of openwrt 21.02. This is relevant for services such as etherwake which take more then one argument, e.g.: "service etherwake start " Signed-off-by: Andrew Ammerlaan --- package/system/procd/files/service | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/files/service b/package/system/procd/files/service index 1ceacfe5ad..0ca7058041 100644 --- a/package/system/procd/files/service +++ b/package/system/procd/files/service @@ -2,17 +2,17 @@ main() { local service="$1" - local cmd="$2" + shift local boot status if [ -f "/etc/init.d/${service}" ]; then - /etc/init.d/"${service}" "${cmd}" + /etc/init.d/"${service}" "$@" exit "$?" fi if [ -n "$service" ]; then - echo "Service \"$1\" not found:" + echo "Service \"$service\" not found:" exit 1 fi From 602a76ed65e51fa4f10f50dbeda821741f2bdbab Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Thu, 20 Oct 2022 16:22:01 -0400 Subject: [PATCH 11/42] libmbedtls: build option submenu menuconfig libmbedtls build option submenu Signed-off-by: Glenn Strauss --- package/libs/mbedtls/Config.in | 193 +++++++++++++++ package/libs/mbedtls/Makefile | 103 +++++--- package/libs/mbedtls/patches/200-config.patch | 228 ------------------ 3 files changed, 259 insertions(+), 265 deletions(-) create mode 100644 package/libs/mbedtls/Config.in delete mode 100644 package/libs/mbedtls/patches/200-config.patch diff --git a/package/libs/mbedtls/Config.in b/package/libs/mbedtls/Config.in new file mode 100644 index 0000000000..58843d08ce --- /dev/null +++ b/package/libs/mbedtls/Config.in @@ -0,0 +1,193 @@ +if PACKAGE_libmbedtls + +comment "Option details in source code: include/mbedtls/mbedtls_config.h" + +comment "Ciphers - unselect old or less-used ciphers to reduce binary size" + +config MBEDTLS_AES_C + bool "MBEDTLS_AES_C" + default y + +config MBEDTLS_CAMELLIA_C + bool "MBEDTLS_CAMELLIA_C" + default n + +config MBEDTLS_CCM_C + bool "MBEDTLS_CCM_C" + default n + +config MBEDTLS_CMAC_C + bool "MBEDTLS_CMAC_C" + default n + +config MBEDTLS_DES_C + bool "MBEDTLS_DES_C" + default n + +config MBEDTLS_GCM_C + bool "MBEDTLS_GCM_C" + default y + +config MBEDTLS_NIST_KW_C + bool "MBEDTLS_NIST_KW_C" + default n + +config MBEDTLS_RIPEMD160_C + bool "MBEDTLS_RIPEMD160_C" + default n + +config MBEDTLS_XTEA_C + bool "MBEDTLS_XTEA_C" + default n + +config MBEDTLS_RSA_NO_CRT + bool "MBEDTLS_RSA_NO_CRT" + default y + +config MBEDTLS_KEY_EXCHANGE_PSK_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_PSK_ENABLED" + default y + +config MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED" + default n + +config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED" + default y + +config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" + default n + +config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED" + default y + +config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED" + default y + +config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED" + default y + +config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED" + default y + +config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" + default n + +config MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED + bool "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED" + default n + +comment "Curves - unselect old or less-used curves to reduce binary size" + +config MBEDTLS_ECP_DP_SECP192R1_ENABLED + bool "MBEDTLS_ECP_DP_SECP192R1_ENABLED" + default n + +config MBEDTLS_ECP_DP_SECP224R1_ENABLED + bool "MBEDTLS_ECP_DP_SECP224R1_ENABLED" + default n + +config MBEDTLS_ECP_DP_SECP256R1_ENABLED + bool "MBEDTLS_ECP_DP_SECP256R1_ENABLED" + default y + +config MBEDTLS_ECP_DP_SECP384R1_ENABLED + bool "MBEDTLS_ECP_DP_SECP384R1_ENABLED" + default y + +config MBEDTLS_ECP_DP_SECP521R1_ENABLED + bool "MBEDTLS_ECP_DP_SECP521R1_ENABLED" + default n + +config MBEDTLS_ECP_DP_SECP192K1_ENABLED + bool "MBEDTLS_ECP_DP_SECP192K1_ENABLED" + default n + +config MBEDTLS_ECP_DP_SECP224K1_ENABLED + bool "MBEDTLS_ECP_DP_SECP224K1_ENABLED" + default n + +config MBEDTLS_ECP_DP_SECP256K1_ENABLED + bool "MBEDTLS_ECP_DP_SECP256K1_ENABLED" + default y + +config MBEDTLS_ECP_DP_BP256R1_ENABLED + bool "MBEDTLS_ECP_DP_BP256R1_ENABLED" + default n + +config MBEDTLS_ECP_DP_BP384R1_ENABLED + bool "MBEDTLS_ECP_DP_BP384R1_ENABLED" + default n + +config MBEDTLS_ECP_DP_BP512R1_ENABLED + bool "MBEDTLS_ECP_DP_BP512R1_ENABLED" + default n + +config MBEDTLS_ECP_DP_CURVE25519_ENABLED + bool "MBEDTLS_ECP_DP_CURVE25519_ENABLED" + default y + +config MBEDTLS_ECP_DP_CURVE448_ENABLED + bool "MBEDTLS_ECP_DP_CURVE448_ENABLED" + default n + +comment "Build Options - unselect features to reduce binary size" + +config MBEDTLS_CERTS_C + bool "MBEDTLS_CERTS_C" + default n + +config MBEDTLS_CIPHER_MODE_OFB + bool "MBEDTLS_CIPHER_MODE_OFB" + default n + +config MBEDTLS_CIPHER_MODE_XTS + bool "MBEDTLS_CIPHER_MODE_XTS" + default n + +config MBEDTLS_DEBUG_C + bool "MBEDTLS_DEBUG_C" + default n + +config MBEDTLS_HKDF_C + bool "MBEDTLS_HKDF_C" + default n + +config MBEDTLS_PLATFORM_C + bool "MBEDTLS_PLATFORM_C" + default n + +config MBEDTLS_SELF_TEST + bool "MBEDTLS_SELF_TEST" + default n + +config MBEDTLS_SSL_TRUNCATED_HMAC + bool "MBEDTLS_SSL_TRUNCATED_HMAC" + default n + +config MBEDTLS_VERSION_C + bool "MBEDTLS_VERSION_C" + default n + +config MBEDTLS_VERSION_FEATURES + bool "MBEDTLS_VERSION_FEATURES" + default n + +comment "Build Options" + +config MBEDTLS_ENTROPY_FORCE_SHA256 + bool "MBEDTLS_ENTROPY_FORCE_SHA256" + default y + +config MBEDTLS_SSL_RENEGOTIATION + bool "MBEDTLS_SSL_RENEGOTIATION" + default n + +endif diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 701d338a2c..a489f56755 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -20,9 +20,60 @@ PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=gpl-2.0.txt PKG_CPE_ID:=cpe:/a:arm:mbed_tls -PKG_CONFIG_DEPENDS := \ - CONFIG_LIBMBEDTLS_DEBUG_C \ - CONFIG_LIBMBEDTLS_HKDF_C +MBEDTLS_BUILD_OPTS_CURVES= \ + CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED \ + CONFIG_MBEDTLS_ECP_DP_CURVE448_ENABLED + +MBEDTLS_BUILD_OPTS_CIPHERS= \ + CONFIG_MBEDTLS_AES_C \ + CONFIG_MBEDTLS_CAMELLIA_C \ + CONFIG_MBEDTLS_CCM_C \ + CONFIG_MBEDTLS_CMAC_C \ + CONFIG_MBEDTLS_DES_C \ + CONFIG_MBEDTLS_GCM_C \ + CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED \ + CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ + CONFIG_MBEDTLS_NIST_KW_C \ + CONFIG_MBEDTLS_RIPEMD160_C \ + CONFIG_MBEDTLS_RSA_NO_CRT \ + CONFIG_MBEDTLS_XTEA_C + +MBEDTLS_BUILD_OPTS= \ + $(MBEDTLS_BUILD_OPTS_CURVES) \ + $(MBEDTLS_BUILD_OPTS_CIPHERS) \ + CONFIG_MBEDTLS_CERTS_C \ + CONFIG_MBEDTLS_CIPHER_MODE_OFB \ + CONFIG_MBEDTLS_CIPHER_MODE_XTS \ + CONFIG_MBEDTLS_DEBUG_C \ + CONFIG_MBEDTLS_ENTROPY_FORCE_SHA256 \ + CONFIG_MBEDTLS_HKDF_C \ + CONFIG_MBEDTLS_PLATFORM_C \ + CONFIG_MBEDTLS_SELF_TEST \ + CONFIG_MBEDTLS_SSL_RENEGOTIATION \ + CONFIG_MBEDTLS_SSL_TRUNCATED_HMAC \ + CONFIG_MBEDTLS_VERSION_C \ + CONFIG_MBEDTLS_VERSION_FEATURES + +PKG_CONFIG_DEPENDS := $(MBEDTLS_BUILD_OPTS) include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -44,28 +95,11 @@ $(call Package/mbedtls/Default) SUBMENU:=SSL TITLE+= (library) ABI_VERSION:=12 + MENU:=1 endef define Package/libmbedtls/config -config LIBMBEDTLS_DEBUG_C - depends on PACKAGE_libmbedtls - bool "Enable debug functions" - default n - help - This option enables mbedtls library's debug functions. - - It increases the uncompressed libmbedtls binary size - by around 60 KiB (for an ARMv5 platform). - - Usually, you don't need this, so don't select this if you're unsure. - -config LIBMBEDTLS_HKDF_C - depends on PACKAGE_libmbedtls - bool "Enable the HKDF algorithm (RFC 5869)" - default n - help - This option adds support for the Hashed Message Authentication Code - (HMAC)-based key derivation function (HKDF). + source "$(SOURCE)/Config.in" endef define Package/mbedtls-util @@ -97,26 +131,21 @@ CMAKE_OPTIONS += \ -DENABLE_PROGRAMS:Bool=ON define Build/Configure - $(Build/Configure/Default) - - awk 'BEGIN { rc = 1 } \ - /#define MBEDTLS_DEBUG_C/ { $$$$0 = "$(if $(CONFIG_LIBMBEDTLS_DEBUG_C),,// )#define MBEDTLS_DEBUG_C"; rc = 0 } \ - { print } \ - END { exit(rc) }' $(PKG_BUILD_DIR)/include/mbedtls/config.h \ - >$(PKG_BUILD_DIR)/include/mbedtls/config.h.new && \ - mv $(PKG_BUILD_DIR)/include/mbedtls/config.h.new $(PKG_BUILD_DIR)/include/mbedtls/config.h - - awk 'BEGIN { rc = 1 } \ - /#define MBEDTLS_HKDF_C/ { $$$$0 = "$(if $(CONFIG_LIBMBEDTLS_HKDF_C),,// )#define MBEDTLS_HKDF_C"; rc = 0 } \ - { print } \ - END { exit(rc) }' $(PKG_BUILD_DIR)/include/mbedtls/config.h \ - >$(PKG_BUILD_DIR)/include/mbedtls/config.h.new && \ - mv $(PKG_BUILD_DIR)/include/mbedtls/config.h.new $(PKG_BUILD_DIR)/include/mbedtls/config.h + $(call Build/Configure/Default) sed -i '/fuzz/d' $(PKG_BUILD_DIR)/programs/CMakeLists.txt sed -i '/test/d' $(PKG_BUILD_DIR)/programs/CMakeLists.txt endef +define Build/Prepare + $(call Build/Prepare/Default) + + $(foreach opt,$(MBEDTLS_BUILD_OPTS), + $(PKG_BUILD_DIR)/scripts/config.py \ + -f $(PKG_BUILD_DIR)/include/mbedtls/config.h \ + $(if $($(opt)),set,unset) $(patsubst CONFIG_%,%,$(opt))) +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/mbedtls $(1)/usr/include/ diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch deleted file mode 100644 index 54d4cf431d..0000000000 --- a/package/libs/mbedtls/patches/200-config.patch +++ /dev/null @@ -1,228 +0,0 @@ ---- a/include/mbedtls/config.h -+++ b/include/mbedtls/config.h -@@ -670,14 +670,14 @@ - * - * Enable Output Feedback mode (OFB) for symmetric ciphers. - */ --#define MBEDTLS_CIPHER_MODE_OFB -+//#define MBEDTLS_CIPHER_MODE_OFB - - /** - * \def MBEDTLS_CIPHER_MODE_XTS - * - * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES. - */ --#define MBEDTLS_CIPHER_MODE_XTS -+//#define MBEDTLS_CIPHER_MODE_XTS - - /** - * \def MBEDTLS_CIPHER_NULL_CIPHER -@@ -795,20 +795,20 @@ - * Comment macros to disable the curve and functions for it - */ - /* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */ --#define MBEDTLS_ECP_DP_SECP192R1_ENABLED --#define MBEDTLS_ECP_DP_SECP224R1_ENABLED -+//#define MBEDTLS_ECP_DP_SECP192R1_ENABLED -+//#define MBEDTLS_ECP_DP_SECP224R1_ENABLED - #define MBEDTLS_ECP_DP_SECP256R1_ENABLED - #define MBEDTLS_ECP_DP_SECP384R1_ENABLED --#define MBEDTLS_ECP_DP_SECP521R1_ENABLED --#define MBEDTLS_ECP_DP_SECP192K1_ENABLED --#define MBEDTLS_ECP_DP_SECP224K1_ENABLED -+//#define MBEDTLS_ECP_DP_SECP521R1_ENABLED -+//#define MBEDTLS_ECP_DP_SECP192K1_ENABLED -+//#define MBEDTLS_ECP_DP_SECP224K1_ENABLED - #define MBEDTLS_ECP_DP_SECP256K1_ENABLED --#define MBEDTLS_ECP_DP_BP256R1_ENABLED --#define MBEDTLS_ECP_DP_BP384R1_ENABLED --#define MBEDTLS_ECP_DP_BP512R1_ENABLED -+//#define MBEDTLS_ECP_DP_BP256R1_ENABLED -+//#define MBEDTLS_ECP_DP_BP384R1_ENABLED -+//#define MBEDTLS_ECP_DP_BP512R1_ENABLED - /* Montgomery curves (supporting ECP) */ - #define MBEDTLS_ECP_DP_CURVE25519_ENABLED --#define MBEDTLS_ECP_DP_CURVE448_ENABLED -+//#define MBEDTLS_ECP_DP_CURVE448_ENABLED - - /** - * \def MBEDTLS_ECP_NIST_OPTIM -@@ -961,7 +961,7 @@ - * See dhm.h for more details. - * - */ --#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED -+//#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - - /** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -@@ -981,7 +981,7 @@ - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - */ --#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -+//#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - - /** - * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -@@ -1006,7 +1006,7 @@ - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - */ --#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -+//#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - - /** - * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -@@ -1140,7 +1140,7 @@ - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - */ --#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -+//#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - - /** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -@@ -1164,7 +1164,7 @@ - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - */ --#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -+//#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - - /** - * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED -@@ -1268,7 +1268,7 @@ - * This option is only useful if both MBEDTLS_SHA256_C and - * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. - */ --//#define MBEDTLS_ENTROPY_FORCE_SHA256 -+#define MBEDTLS_ENTROPY_FORCE_SHA256 - - /** - * \def MBEDTLS_ENTROPY_NV_SEED -@@ -1483,14 +1483,14 @@ - * Uncomment this macro to disable the use of CRT in RSA. - * - */ --//#define MBEDTLS_RSA_NO_CRT -+#define MBEDTLS_RSA_NO_CRT - - /** - * \def MBEDTLS_SELF_TEST - * - * Enable the checkup functions (*_self_test). - */ --#define MBEDTLS_SELF_TEST -+//#define MBEDTLS_SELF_TEST - - /** - * \def MBEDTLS_SHA256_SMALLER -@@ -1761,7 +1761,7 @@ - * configuration of this extension). - * - */ --#define MBEDTLS_SSL_RENEGOTIATION -+//#define MBEDTLS_SSL_RENEGOTIATION - - /** - * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -@@ -2022,7 +2022,7 @@ - * - * Comment this macro to disable support for truncated HMAC in SSL - */ --#define MBEDTLS_SSL_TRUNCATED_HMAC -+//#define MBEDTLS_SSL_TRUNCATED_HMAC - - /** - * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT -@@ -2201,7 +2201,7 @@ - * - * Comment this to disable run-time checking and save ROM space - */ --#define MBEDTLS_VERSION_FEATURES -+//#define MBEDTLS_VERSION_FEATURES - - /** - * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -@@ -2550,7 +2550,7 @@ - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ --#define MBEDTLS_CAMELLIA_C -+//#define MBEDTLS_CAMELLIA_C - - /** - * \def MBEDTLS_ARIA_C -@@ -2616,7 +2616,7 @@ - * This module enables the AES-CCM ciphersuites, if other requisites are - * enabled as well. - */ --#define MBEDTLS_CCM_C -+//#define MBEDTLS_CCM_C - - /** - * \def MBEDTLS_CERTS_C -@@ -2628,7 +2628,7 @@ - * - * This module is used for testing (ssl_client/server). - */ --#define MBEDTLS_CERTS_C -+//#define MBEDTLS_CERTS_C - - /** - * \def MBEDTLS_CHACHA20_C -@@ -2741,7 +2741,7 @@ - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ --#define MBEDTLS_DES_C -+//#define MBEDTLS_DES_C - - /** - * \def MBEDTLS_DHM_C -@@ -2906,7 +2906,7 @@ - * This module adds support for the Hashed Message Authentication Code - * (HMAC)-based key derivation function (HKDF). - */ --#define MBEDTLS_HKDF_C -+//#define MBEDTLS_HKDF_C - - /** - * \def MBEDTLS_HMAC_DRBG_C -@@ -3219,7 +3219,7 @@ - * - * This module enables abstraction of common (libc) functions. - */ --#define MBEDTLS_PLATFORM_C -+//#define MBEDTLS_PLATFORM_C - - /** - * \def MBEDTLS_POLY1305_C -@@ -3295,7 +3295,7 @@ - * Caller: library/md.c - * - */ --#define MBEDTLS_RIPEMD160_C -+//#define MBEDTLS_RIPEMD160_C - - /** - * \def MBEDTLS_RSA_C -@@ -3506,7 +3506,7 @@ - * - * This module provides run-time version information. - */ --#define MBEDTLS_VERSION_C -+//#define MBEDTLS_VERSION_C - - /** - * \def MBEDTLS_X509_USE_C -@@ -3616,7 +3616,7 @@ - * Module: library/xtea.c - * Caller: - */ --#define MBEDTLS_XTEA_C -+//#define MBEDTLS_XTEA_C - - /** \} name SECTION: mbed TLS modules */ - From aeeb12eb83d669ea66dc5315cc490662bbbbd967 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Sat, 22 Oct 2022 13:06:58 -0400 Subject: [PATCH 12/42] libmbedtls: enable crypto algorithms for hostap enable additional crypto algorithms for hostap hostap uses local implementations if not provided by crypto library, so might as well enable in the crypto library for shared use by others. Signed-off-by: Glenn Strauss --- package/libs/mbedtls/Config.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package/libs/mbedtls/Config.in b/package/libs/mbedtls/Config.in index 58843d08ce..067a9aeb78 100644 --- a/package/libs/mbedtls/Config.in +++ b/package/libs/mbedtls/Config.in @@ -17,20 +17,20 @@ config MBEDTLS_CCM_C default n config MBEDTLS_CMAC_C - bool "MBEDTLS_CMAC_C" - default n + bool "MBEDTLS_CMAC_C (old but used by hostapd)" + default y config MBEDTLS_DES_C - bool "MBEDTLS_DES_C" - default n + bool "MBEDTLS_DES_C (old but used by hostapd)" + default y config MBEDTLS_GCM_C bool "MBEDTLS_GCM_C" default y config MBEDTLS_NIST_KW_C - bool "MBEDTLS_NIST_KW_C" - default n + bool "MBEDTLS_NIST_KW_C (old but used by hostapd)" + default y config MBEDTLS_RIPEMD160_C bool "MBEDTLS_RIPEMD160_C" From 106425225953164ca45569c04d8147f16641a696 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Sat, 22 Oct 2022 13:09:14 -0400 Subject: [PATCH 13/42] libmbedtls: disable older RSA ciphers disable older RSA ciphers Signed-off-by: Glenn Strauss --- package/libs/mbedtls/Config.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/mbedtls/Config.in b/package/libs/mbedtls/Config.in index 067a9aeb78..ffabd799d3 100644 --- a/package/libs/mbedtls/Config.in +++ b/package/libs/mbedtls/Config.in @@ -62,11 +62,11 @@ config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED" - default y + default n config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED bool "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED" - default y + default n config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED bool "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED" From a0b25e17aefab01010f98b270dfea99ff10d828e Mon Sep 17 00:00:00 2001 From: Martin Dziura Date: Tue, 25 Oct 2022 22:05:46 +0200 Subject: [PATCH 14/42] ramips: glinet_gl-mt300n-v2: allow to use I2C and UART1 pins as GPIO This is explicitly intended by the official documentation at https://docs.gl-inet.com/en/3/specification/gl-mt300n-v2/#pcb-pinout Signed-off-by: Martin Dziura --- target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts index b002b618b3..a3ce8cc592 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts @@ -75,7 +75,7 @@ &state_default { gpio { - groups = "wdt", "gpio", "wled_an", "p0led_an", "p1led_an", "i2s"; + groups = "wdt", "gpio", "wled_an", "p0led_an", "p1led_an", "i2s", "i2c"; function = "gpio"; }; }; @@ -131,10 +131,6 @@ }; }; -&i2c { - status = "okay"; -}; - &uart1 { status = "okay"; }; From e6b99a4e43917923e31494641f9ef00dd2a489ee Mon Sep 17 00:00:00 2001 From: Mikhail Zhilkin Date: Wed, 2 Nov 2022 08:28:32 +0000 Subject: [PATCH 15/42] ramips: create common dtsi for Sercomm Dxx routers This commit adds common dtsi for the following Sercomm devices with 256 MB NAND: Beeline Smartbox TURBO (Sercomm DF3) Rostelecom RT-SF-1 (Sercomm DKG) Also fixed typo ("Container" mtd name should be with a capital). Signed-off-by: Mikhail Zhilkin --- .../dts/mt7621_beeline_smartbox-turbo.dts | 226 +---------------- .../dts/mt7621_sercomm_dxx_nand_256m.dtsi | 239 ++++++++++++++++++ 2 files changed, 240 insertions(+), 225 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts index 733be13e13..df80f49e97 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts @@ -1,183 +1,14 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621.dtsi" - -#include -#include -#include +#include "mt7621_sercomm_dxx_nand_256m.dtsi" / { compatible = "beeline,smartbox-turbo", "mediatek,mt7621-soc"; model = "Beeline SmartBox TURBO"; - - aliases { - label-mac-device = &gmac0; - - led-boot = &led_status_green; - led-failsafe = &led_status_red; - led-running = &led_status_green; - led-upgrade = &led_status_red; - }; - - leds { - compatible = "gpio-leds"; - - led-1 { - label = "blue:wan"; - color = ; - function = LED_FUNCTION_WAN; - gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; - }; - - led_status_green: led-0 { - label = "green:status"; - color = ; - function = LED_FUNCTION_STATUS; - gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; - }; - - led_status_red: led-2 { - label = "red:status"; - color = ; - function = LED_FUNCTION_STATUS; - gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; - }; - }; - - keys { - compatible = "gpio-keys"; - - wps { - label = "wps"; - gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; - linux,code = ; - }; - - reset { - label = "reset"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - ubi-concat { - compatible = "mtd-concat"; - devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 \ - &ubiconcat3>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "ubi"; - reg = <0x0 0xca00000>; - }; - }; - }; -}; - -&nand { - status = "okay"; - - partitions { - compatible = "sercomm,sc-partitions", "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x100000>; - sercomm,scpart-id = <0>; - read-only; - }; - - partition@100000 { - label = "dynamic partition map"; - reg = <0x100000 0x100000>; - sercomm,scpart-id = <1>; - read-only; - }; - - factory: partition@200000 { - label = "Factory"; - reg = <0x200000 0x100000>; - sercomm,scpart-id = <2>; - read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; - }; - }; - - partition@300000 { - label = "Boot Flag"; - reg = <0x300000 0x100000>; - sercomm,scpart-id = <3>; - }; - - partition@400000 { - label = "kernel"; - reg = <0x400000 0x600000>; - sercomm,scpart-id = <4>; - }; - - partition@a00000 { - label = "Kernel 2"; - reg = <0xa00000 0x600000>; - sercomm,scpart-id = <5>; - read-only; - }; - - ubiconcat0: partition@1000000 { - label = "File System 1"; - reg = <0x1000000 0x2000000>; - sercomm,scpart-id = <6>; - }; - - partition@3000000 { - label = "File System 2"; - reg = <0x3000000 0x2000000>; - sercomm,scpart-id = <7>; - read-only; - }; - - ubiconcat1: partition@5000000 { - label = "Configuration/log"; - reg = <0x5000000 0x1400000>; - sercomm,scpart-id = <8>; - }; - - ubiconcat2: partition@6400000 { - label = "Debug (Ftool)"; - reg = <0x6400000 0x1a00000>; - sercomm,scpart-id = <9>; - }; - - ubiconcat3: partition@8000000 { - label = "container"; - reg = <0x8000000 0x7c00000>; - sercomm,scpart-id = <10>; - }; - }; -}; - -&pcie { - status = "okay"; }; &pcie0 { wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_21000>; nvmem-cell-names = "mac-address"; mac-address-increment = <(5)>; @@ -186,69 +17,14 @@ &pcie1 { wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; - ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_21000>; nvmem-cell-names = "mac-address"; mac-address-increment = <(4)>; }; }; -&gmac0 { - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; -}; - &gmac1 { - status = "okay"; - label = "wan"; - phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_21000>; nvmem-cell-names = "mac-address"; mac-address-increment = <(1)>; }; - -&mdio { - ethphy0: ethernet-phy@0 { - reg = <0>; - }; -}; - -&switch0 { - ports { - port@1 { - status = "okay"; - label = "lan1"; - }; - - port@2 { - status = "okay"; - label = "lan2"; - }; - - port@3 { - status = "okay"; - label = "lan3"; - }; - - port@4 { - status = "okay"; - label = "lan4"; - }; - }; -}; - -&uartlite3 { - status = "okay"; -}; - -&state_default { - gpio { - groups = "jtag", "uart2"; - function = "gpio"; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi new file mode 100644 index 0000000000..a0534bdabd --- /dev/null +++ b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + aliases { + label-mac-device = &gmac0; + + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + leds { + compatible = "gpio-leds"; + + led-1 { + label = "blue:wan"; + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: led-0 { + label = "green:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led-2 { + label = "red:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 \ + &ubiconcat3>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0xca00000>; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "sercomm,sc-partitions", "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x100000>; + sercomm,scpart-id = <0>; + read-only; + }; + + partition@100000 { + label = "dynamic partition map"; + reg = <0x100000 0x100000>; + sercomm,scpart-id = <1>; + read-only; + }; + + factory: partition@200000 { + label = "Factory"; + reg = <0x200000 0x100000>; + sercomm,scpart-id = <2>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_21000: macaddr@21000 { + reg = <0x21000 0x6>; + }; + }; + + partition@300000 { + label = "Boot Flag"; + reg = <0x300000 0x100000>; + sercomm,scpart-id = <3>; + }; + + partition@400000 { + label = "kernel"; + reg = <0x400000 0x600000>; + sercomm,scpart-id = <4>; + }; + + partition@a00000 { + label = "Kernel 2"; + reg = <0xa00000 0x600000>; + sercomm,scpart-id = <5>; + read-only; + }; + + ubiconcat0: partition@1000000 { + label = "File System 1"; + reg = <0x1000000 0x2000000>; + sercomm,scpart-id = <6>; + }; + + partition@3000000 { + label = "File System 2"; + reg = <0x3000000 0x2000000>; + sercomm,scpart-id = <7>; + read-only; + }; + + ubiconcat1: partition@5000000 { + label = "Configuration/log"; + reg = <0x5000000 0x1400000>; + sercomm,scpart-id = <8>; + }; + + ubiconcat2: partition@6400000 { + label = "Debug (Ftool)"; + reg = <0x6400000 0x1a00000>; + sercomm,scpart-id = <9>; + }; + + ubiconcat3: partition@8000000 { + label = "Container"; + reg = <0x8000000 0x7c00000>; + sercomm,scpart-id = <10>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&switch0 { + ports { + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan3"; + }; + + port@4 { + status = "okay"; + label = "lan4"; + }; + }; +}; + +&uartlite3 { + status = "okay"; +}; + +&state_default { + gpio { + groups = "jtag", "uart2"; + function = "gpio"; + }; +}; From 0cfd15552e335528743f1fcc4961959126788bf5 Mon Sep 17 00:00:00 2001 From: Mikhail Zhilkin Date: Wed, 2 Nov 2022 08:44:46 +0000 Subject: [PATCH 16/42] ramips: add support for Rostelecom RT-SF-1 Rostelecom RT-SF-1 is a wireless WiFi 5 router manufactured by Sercomm company. Device specification -------------------- SoC Type: MediaTek MT7621AT RAM: 256 MiB Flash: 256 MiB, Micron MT29F2G08ABAGA3W Wireless 2.4 GHz (MT7603EN): b/g/n, 2x2 Wireless 5 GHz (MT7615E): a/n/ac, 4x4 Ethernet: 5xGbE (WAN, LAN1, LAN2, LAN3, LAN4) USB ports: 1xUSB3.0 ZigBee: 3.0, EFR32 MG1B232GG Button: 2 buttons (Reset & WPS) LEDs: - 1x Status (RGB) - 1x 2.4G (blue, hardware, mt76-phy0) - 1x 5G (blue, hardware, mt76-phy1) Power: 12 VDC, 1.5 A Connector type: barrel Bootloader: U-Boot Installation ----------------- 1. Remove dots from the OpenWrt factory image filename 2. Login to the router web interface 3. Update firmware using web interface with the OpenWrt factory image 4. If OpenWrt is booted, then no further steps are required. Enjoy! Otherwise (Stock firmware has booted again) proceed to the next step. 5. Update firmware using web interface with any version of the Stock firmware 6. Update firmware using web interface with the OpenWrt factory image Revert to stock --------------- Change bootflag to Sercomm1 in OpenWrt CLI and then reboot: printf 1 | dd bs=1 seek=7 count=1 of=/dev/mtdblock3 Recovery -------- Use sercomm-recovery tool. Link: https://github.com/danitool/sercomm-recovery MAC Addresses ------------- +-----+------------+------------+ | use | address | example | +-----+------------+------------+ | LAN | label | *:72, *:d2 | | WAN | label + 11 | *:7d, *:dd | | 2g | label + 2 | *:74, *:d4 | | 5g | label + 3 | *:75, *:d5 | +-----+------------+------------+ The label MAC address was found in Factory 0x21000 Signed-off-by: Mikhail Zhilkin --- package/boot/uboot-envtools/files/ramips | 3 +- .../ramips/dts/mt7621_rostelecom_rt-sf-1.dts | 30 +++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 13 ++++++++ .../mt7621/base-files/etc/board.d/01_leds | 3 +- .../mt7621/base-files/etc/init.d/bootcount | 3 +- .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 6 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 70d70dfed0..6c649bfacc 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -32,7 +32,8 @@ ampedwireless,ally-r1900k) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4" ;; beeline,smartbox-giga|\ -beeline,smartbox-turbo) +beeline,smartbox-turbo|\ +rostelecom,rt-sf-1) ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000" ;; buffalo,wsr-1166dhp|\ diff --git a/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts b/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts new file mode 100644 index 0000000000..c476cf9495 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_sercomm_dxx_nand_256m.dtsi" + +/ { + compatible = "rostelecom,rt-sf-1", "mediatek,mt7621-soc"; + model = "Rostelecom RT-SF-1"; +}; + +&pcie0 { + wifi@0,0 { + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(3)>; + }; +}; + +&pcie1 { + wifi@0,0 { + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(2)>; + }; +}; + +&gmac1 { + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(11)>; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index de10da7cb6..e7b38aaacf 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1740,6 +1740,19 @@ define Device/renkforce_ws-wn530hp3-a endef TARGET_DEVICES += renkforce_ws-wn530hp3-a +define Device/rostelecom_rt-sf-1 + $(Device/sercomm_dxx) + IMAGE_SIZE := 32768k + SERCOMM_HWID := DKG + SERCOMM_HWVER := 10110 + SERCOMM_SWVER := 1026 + DEVICE_VENDOR := Rostelecom + DEVICE_MODEL := RT-SF-1 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware \ + kmod-usb3 uboot-envtools +endef +TARGET_DEVICES += rostelecom_rt-sf-1 + define Device/samknows_whitebox-v8 $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index a3c233a20f..98db9fb9fc 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -25,7 +25,8 @@ asus,rt-n56u-b1) ;; beeline,smartbox-flash|\ beeline,smartbox-giga|\ -beeline,smartbox-turbo) +beeline,smartbox-turbo|\ +rostelecom,rt-sf-1) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" ;; belkin,rt1800) diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index 99b318a922..597c2da60f 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -8,7 +8,8 @@ boot() { [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\ echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s - ;; - beeline,smartbox-turbo) + beeline,smartbox-turbo|\ + rostelecom,rt-sf-1) [[ $(hexdump -n 1 -e '/1 "%1d"' -s $((0x20001)) /dev/mtd3) == \ $((0xff)) ]] || printf '\xff' | dd of=/dev/mtdblock3 \ count=1 bs=1 seek=$((0x20001)) diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index d380ea66f7..95bba16194 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -95,6 +95,7 @@ platform_do_upgrade() { netgear,wax202|\ netis,wf2881|\ raisecom,msg1500-x-00|\ + rostelecom,rt-sf-1|\ sercomm,na502|\ sercomm,na502s|\ sim,simax1800t|\ From 794d1645b3d4e6735b4a749f39cfeaa05f60b101 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Tue, 25 Oct 2022 01:13:30 +0000 Subject: [PATCH 17/42] ramips: add support for Amped Wireless B1200EX This device is almost identical to the already supported Edimax EW-7476RP5, the only differences are: - There is no mode selection slider switch on this device - The two wireless LEDs are green instead of blue - Model name in the CSYS header is RN10 Additional changes: - Moved WiFi LEDs and the slider switch to the individual dt files - Added ieee80211-freq-limit to the mt7612e radio to properly disable 2.4GHz band on this radio Device specifications: SoC: MediaTek MT7620a @ 580MHz RAM: 64M (Winbond W9751G6KB-25) FLASH: 8MB (Macronix) WiFi: SoC-integrated: MediaTek MT7620a bgn WiFi: MediaTek MT7612EN nac GbE: 1x (RTL8211E) BTN: WPS/RESET LED: - WiFi 5G (green) - WiFi 2.4G (green) - Signal Strength (green) - Power (green) - WPS (green) - LAN (green) UART: UART is present as Pads with throughholes on the PCB. They are located next to the WPS button 3.3V - RX - GND - TX / 57600-8N1 3.3V is the square pad Installation: Upload the sysupgrade image via the default web interface Signed-off-by: Daniel Fuchs --- .../dts/mt7620a_ampedwireless_b1200ex.dts | 27 +++++++++++++ .../ramips/dts/mt7620a_edimax_ew-7476rpc.dts | 35 +++++++++++++++++ .../ramips/dts/mt7620a_edimax_ew-7478ac.dts | 35 +++++++++++++++++ .../ramips/dts/mt7620a_edimax_ew-747x.dtsi | 38 +++---------------- target/linux/ramips/image/mt7620.mk | 13 +++++++ .../mt7620/base-files/etc/board.d/01_leds | 1 + .../mt7620/base-files/etc/board.d/02_network | 1 + 7 files changed, 118 insertions(+), 32 deletions(-) create mode 100644 target/linux/ramips/dts/mt7620a_ampedwireless_b1200ex.dts diff --git a/target/linux/ramips/dts/mt7620a_ampedwireless_b1200ex.dts b/target/linux/ramips/dts/mt7620a_ampedwireless_b1200ex.dts new file mode 100644 index 0000000000..10871140e9 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_ampedwireless_b1200ex.dts @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a_edimax_ew-747x.dtsi" + +/ { + compatible = "ampedwireless,b1200ex", "ralink,mt7620a-soc"; + model = "Amped Wireless B1200EX"; + + leds { + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&gpio2 31 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + signal_strength { + label = "green:signal_strength"; + gpios = <&gpio2 29 GPIO_ACTIVE_LOW>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7476rpc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7476rpc.dts index ebab7e4089..e4fc2d03e4 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-7476rpc.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7476rpc.dts @@ -5,4 +5,39 @@ / { compatible = "edimax,ew-7476rpc", "ralink,mt7620a-soc"; model = "Edimax EW-7476RPC"; + + keys { + switch_high { + label = "switch high"; + gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + switch_off { + label = "switch off"; + gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; + + leds { + wlan2g { + label = "blue:wlan2g"; + gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; + + wlan5g { + label = "blue:wlan5g"; + gpios = <&gpio2 31 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + crossband { + label = "green:crossband"; + gpios = <&gpio2 29 GPIO_ACTIVE_LOW>; + }; + }; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478ac.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478ac.dts index a0fa2e3da8..97da9cda4b 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478ac.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478ac.dts @@ -5,4 +5,39 @@ / { compatible = "edimax,ew-7478ac", "ralink,mt7620a-soc"; model = "Edimax EW-7478AC"; + + keys { + switch_high { + label = "switch high"; + gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + switch_off { + label = "switch off"; + gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; + + leds { + wlan2g { + label = "blue:wlan2g"; + gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; + + wlan5g { + label = "blue:wlan5g"; + gpios = <&gpio2 31 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + crossband { + label = "green:crossband"; + gpios = <&gpio2 29 GPIO_ACTIVE_LOW>; + }; + }; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi index 1d77c27f5f..abac0208d0 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi @@ -24,20 +24,6 @@ gpios = <&gpio2 20 GPIO_ACTIVE_LOW>; linux,code = ; }; - - switch_high { - label = "switch high"; - gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; - linux,code = ; - linux,input-type = ; - }; - - switch_off { - label = "switch off"; - gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; - linux,code = ; - linux,input-type = ; - }; }; leds { @@ -53,27 +39,10 @@ gpios = <&gpio2 26 GPIO_ACTIVE_LOW>; }; - wlan2g { - label = "blue:wlan2g"; - gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1radio"; - }; - - wlan5g { - label = "blue:wlan5g"; - gpios = <&gpio2 31 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0radio"; - }; - wps { label = "green:wps"; gpios = <&gpio2 28 GPIO_ACTIVE_LOW>; }; - - crossband { - label = "green:crossband"; - gpios = <&gpio2 29 GPIO_ACTIVE_LOW>; - }; }; }; @@ -206,6 +175,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; }; &pcie { @@ -216,7 +187,10 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; - mediatek,2ghz = <0>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 231f6ad47d..6c22dfbbdd 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -75,6 +75,19 @@ define Device/amit_jboot DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-usb-ohci endef +define Device/ampedwireless_b1200ex + SOC := mt7620a + DEVICE_VENDOR := Amped Wireless + DEVICE_MODEL := B1200EX + BLOCKSIZE := 4k + IMAGE_SIZE := 7744k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m RN10 -f 0x70000 -S 0x01100000 | pad-rootfs | \ + check-size | append-metadata + DEVICE_PACKAGES := kmod-mt76x2 kmod-phy-realtek +endef +TARGET_DEVICES += ampedwireless_b1200ex + define Device/asus_rp-n53 SOC := mt7620a IMAGE_SIZE := 7872k diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index b1dc36672d..d52beefdcc 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -101,6 +101,7 @@ edimax,br-6478ac-v2|\ edimax,ew-7478apc) ucidef_set_led_netdev "wifi_led" "wifi" "blue:wlan" "wlan0" ;; +ampedwireless,b1200ex|\ edimax,ew-7476rpc|\ edimax,ew-7478ac) ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x20" diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index ac1cf5e62a..13f9453442 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -38,6 +38,7 @@ ramips_setup_interfaces() "3:lan" "4:wan" "6@eth0" ;; alfa-network,tube-e4g|\ + ampedwireless,b1200ex|\ buffalo,wmr-300|\ dlink,dch-m225|\ edimax,ew-7476rpc|\ From 6afc355b2e120ff2701cc9aca66af19c6a0aeca2 Mon Sep 17 00:00:00 2001 From: Ivaylo Ivanov Date: Thu, 25 Aug 2022 09:10:13 +0300 Subject: [PATCH 18/42] ramips: Add support for D-Link DIR-3060 A1 Hardware specification: SoC: MediaTek MT7621AT Flash: Winbond W29N01HVSINA 128MB RAM: Micron MT41K128M16JT-125 256MB Ethernet: 4x 10/100/1000 Mbps WiFi1: MT7615DN 2.4GHz N 2x2:2 WiFi2: MT7615DN 5GHz AC 2x2:2 WiFi3: MT7615N 5GHz AC 4x4:4 Button: WPS, Reset Flash instructions: OpenWrt can be installed via D-Link Recovery GUI: Push and hold reset button (on the bottom of the device) until power led starts flashing (about 10 secs or so) while plugging in the power cable. Give it ~30 seconds, to boot the recovery mode GUI Connect your client computer to LAN1 of the device Set your client IP address manually to 192.168.0.2 / 255.255.255.0. Call the recovery page for the device at http://192.168.0.1/ Use the provided emergency web GUI to upload and flash a new firmware to the device Signed-off-by: Ivaylo Ivanov --- .../ramips/dts/mt7621_dlink_dir-3060-a1.dts | 241 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 7 + .../mt7621/base-files/etc/board.d/01_leds | 4 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 4 files changed, 253 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts new file mode 100644 index 0000000000..675a3aa631 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "dlink,dir-3060-a1", "mediatek,mt7621-soc"; + model = "D-Link DIR-3060 A1"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_power_orange; + led-failsafe = &led_power_white; + led-running = &led_power_white; + led-upgrade = &led_net_orange; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power_white: power_white { + label = "white:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_net_orange: net_orange { + label = "orange:net"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + net_white { + label = "white:net"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + usb2_white { + label = "white:usb2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + + usb3_white { + label = "white:usb3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; + + wlan2g { + label = "white:wlan2g"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0radio"; + }; + + wlan5glb { + label = "white:wlan5glb"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1radio"; + }; + + wlan5ghb { + label = "white:wlan5ghb"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy2radio"; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "config"; + reg = <0x80000 0x80000>; + read-only; + }; + + factory: partition@100000 { + label = "factory"; + reg = <0x100000 0x40000>; + read-only; + }; + + partition@140000 { + label = "config2"; + reg = <0x140000 0x40000>; + read-only; + }; + + partition@180000 { + label = "firmware"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,padding = <96>; + reg = <0x180000 0x2800000>; + }; + + partition@2980000 { + label = "private"; + reg = <0x2980000 0x2000000>; + read-only; + }; + + partition@4980000 { + label = "firmware2"; + reg = <0x4980000 0x2800000>; + read-only; + }; + + partition@7180000 { + label = "mydlink"; + reg = <0x7180000 0x600000>; + read-only; + }; + + partition@7780000 { + label = "reserved"; + reg = <0x7780000 0x880000>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi0: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 6000000>; + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + }; +}; + +&pcie1 { + wifi1: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <3>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + + port@4 { + status = "okay"; + label = "wan"; + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index e7b38aaacf..81ee50e0af 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -547,6 +547,13 @@ define Device/dlink_dir-2660-a1 endef TARGET_DEVICES += dlink_dir-2660-a1 +define Device/dlink_dir-3060-a1 + $(Device/dlink_dir-xx60-a1) + DEVICE_MODEL := DIR-3060 + DEVICE_VARIANT := A1 +endef +TARGET_DEVICES += dlink_dir-3060-a1 + define Device/dlink_dir-853-a3 $(Device/dlink_dir-xx60-a1) DEVICE_MODEL := DIR-853 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 98db9fb9fc..9bac8228a0 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -55,6 +55,10 @@ dlink,dir-2640-a1|\ dlink,dir-2660-a1) ucidef_set_led_netdev "wan" "wan" "white:net" "wan" ;; +dlink,dir-3060-a1) + ucidef_set_led_netdev "net_white" "WAN Link" "white:net" "wan" "link" + ucidef_set_led_netdev "net_orange" "WAN Activity" "orange:net" "wan" "tx rx" + ;; dlink,dir-853-a3) ucidef_set_led_netdev "wan" "wan" "blue:net" "wan" ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 95bba16194..06a35077dc 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -62,6 +62,7 @@ platform_do_upgrade() { dlink,dir-1960-a1|\ dlink,dir-2640-a1|\ dlink,dir-2660-a1|\ + dlink,dir-3060-a1|\ dlink,dir-853-a3|\ h3c,tx1800-plus|\ h3c,tx1801-plus|\ From a98fa043626473460ccd05c5dcf9efb87b6650ed Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Mon, 10 Aug 2020 21:40:37 +0200 Subject: [PATCH 19/42] uboot-envtools: ath79: add support for Ubiquiti XM devices Inspired by commit 9565c5726a34da7c9c953d2293b70fdbfef0e0be, and by facts that all Ubiquiti XM devices share flash layout, and images are mostly compatible between all of them - enable uboot-envtools support for whole XM line. Build tested on: Ubiquiti Airrouter, Bullet-M (7240,7241), Nanobridge-M, Nanostation-M (+ Loco), Picostation-M, Powerbridge-M, Rocket-M. Runtime tested on: Ubiquiti Nanobridge M5 (XM). Signed-off-by: Lech Perczak --- package/boot/uboot-envtools/files/ath79 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index f255040f7d..89eb830575 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -66,7 +66,15 @@ openmesh,om5p-an|\ openmesh,om5p-ac-v1|\ openmesh,om5p-ac-v2|\ samsung,wam250|\ +ubnt,airrouter|\ +ubnt,bullet-m-ar7240|\ +ubnt,bullet-m-ar7241|\ +ubnt,nanobridge-m|\ +ubnt,nanostation-loco-m|\ ubnt,nanostation-m|\ +ubnt,picostation-m|\ +ubnt,powerbridge-m|\ +ubnt,rocket-m|\ watchguard,ap100|\ watchguard,ap200|\ watchguard,ap300|\ From 6fdeb48c1ec207e7952bfff1596b65626fb336fd Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Thu, 1 Sep 2022 23:00:02 +0200 Subject: [PATCH 20/42] ath79: support Ruckus ZoneFlex 7025 Ruckus ZoneFlex 7025 is a single 2.4GHz radio 802.11n 1x1 enterprise access point with built-in Ethernet switch, in an electrical outlet form factor. Hardware highligts: - CPU: Atheros AR7240 SoC at 400 MHz - RAM: 64MB DDR2 - Flash: 16MB SPI-NOR - Wi-Fi: AR9285 built-in 2.4GHz 1x1 radio - Ethernet: single Fast Ethernet port inside the electrical enclosure, coupled with internal LSA connector for direct wiring, four external Fast Ethernet ports on the lower side of the device. - PoE: 802.3af PD input inside the electrical box. 802.3af PSE output on the LAN4 port, capable of sourcing class 0 or class 2 devices, depending on power supply capacity. - External 8P8C pass-through connectors on the back and right side of the device - Standalone 48V power input on the side, through 2/1mm micro DC barrel jack Serial console: 115200-8-N-1 on internal JP1 header. Pinout: ---------- JP1 |5|4|3|2|1| ---------- Pin 1 is near the "H1" marking. 1 - RX 2 - n/c 3 - VCC (3.3V) 4 - GND 5 - TX Installation: There are two methods of installation: - Using serial console [1] - requires some disassembly, 3.3V USB-Serial adapter, TFTP server, and removing a single T10 screw, but with much less manual steps, and is generally recommended, being safer. - Using stock firmware root shell exploit, SSH and TFTP [2]. Does not work on some rare versions of stock firmware. A more involved, and requires installing `mkenvimage` from u-boot-tools package if you choose to rebuild your own environment, but can be used without disassembly or removal from installation point, if you have the credentials. If for some reason, size of your sysupgrade image exceeds 13312kB, proceed with method [1]. For official images this is not likely to happen ever. [1] Using serial console: 0. Connect serial console to H1 header. Ensure the serial converter does not back-power the board, otherwise it will fail to boot. 1. Power-on the board. Then quickly connect serial converter to PC and hit Ctrl+C in the terminal to break boot sequence. If you're lucky, you'll enter U-boot shell. Then skip to point 3. Connection parameters are 115200-8-N-1. 2. Allow the board to boot. Press the reset button, so the board reboots into U-boot again and go back to point 1. 3. Set the "bootcmd" variable to disable the dual-boot feature of the system and ensure that uImage is loaded. This is critical step, and needs to be done only on initial installation. > setenv bootcmd "bootm 0x9f040000" > saveenv 4. Boot the OpenWrt initramfs using TFTP. Replace IP addresses as needed: > setenv serverip 192.168.1.2 > setenv ipaddr 192.168.1.1 > tftpboot 0x81000000 openwrt-ath79-generic-ruckus_zf7025-initramfs-kernel.bin > bootm 0x81000000 5. Optional, but highly recommended: back up contents of "firmware" partition: $ ssh root@192.168.1.1 cat /dev/mtd1 > ruckus_zf7025_fw1_backup.bin 6. Copy over sysupgrade image, and perform actual installation. OpenWrt shall boot from flash afterwards: $ ssh root@192.168.1.1 # sysupgrade -n openwrt-ath79-generic-ruckus_zf7025-squashfs-sysupgrade.bin [2] Using stock root shell: 0. Reset the device to factory defaullts. Power-on the device and after it boots, hold the reset button near Ethernet connectors for 5 seconds. 1. Connect the device to the network. It will acquire address over DHCP, so either find its address using list of DHCP leases by looking for label MAC address, or try finding it by scanning for SSH port: $ nmap 10.42.0.0/24 -p22 From now on, we assume your computer has address 10.42.0.1 and the device has address 10.42.0.254. 2. Set up a TFTP server on your computer. We assume that TFTP server root is at /srv/tftp. 3. Obtain root shell. Connect to the device over SSH. The SSHD ond the frmware is pretty ancient and requires enabling HMAC-MD5. $ ssh 10.42.0.254 \ -o UserKnownHostsFile=/dev/null \ -o StrictHostKeyCheking=no \ -o MACs=hmac-md5 Login. User is "super", password is "sp-admin". Now execute a hidden command: Ruckus It is case-sensitive. Copy and paste the following string, including quotes. There will be no output on the console for that. ";/bin/sh;" Hit "enter". The AP will respond with: grrrr OK Now execute another hidden command: !v54! At "What's your chow?" prompt just hit "enter". Congratulations, you should now be dropped to Busybox shell with root permissions. 4. Optional, but highly recommended: backup the flash contents before installation. At your PC ensure the device can write the firmware over TFTP: $ sudo touch /srv/tftp/ruckus_zf7025_firmware{1,2}.bin $ sudo chmod 666 /srv/tftp/ruckus_zf7025_firmware{1,2}.bin Locate partitions for primary and secondary firmware image. NEVER blindly copy over MTD nodes, because MTD indices change depending on the currently active firmware, and all partitions are writable! # grep rcks_wlan /proc/mtd Copy over both images using TFTP, this will be useful in case you'd like to return to stock FW in future. Make sure to backup both, as OpenWrt uses bot firmwre partitions for storage! # tftp -l /dev/ -r ruckus_zf7025_firmware1.bin -p 10.42.0.1 # tftp -l /dev/ -r ruckus_zf7025_firmware2.bin -p 10.42.0.1 When the command finishes, copy over the dump to a safe place for storage. $ cp /srv/tftp/ruckus_zf7025_firmware{1,2}.bin ~/ 5. Ensure the system is running from the BACKUP image, i.e. from rcks_wlan.bkup partition or "image 2". Otherwise the installation WILL fail, and you will need to access mtd0 device to write image which risks overwriting the bootloader, and so is not covered here and not supported. Switching to backup firmware can be achieved by executing a few consecutive reboots of the device, or by updating the stock firmware. The system will boot from the image it was not running from previously. Stock firmware available to update was conveniently dumped in point 4 :-) 6. Prepare U-boot environment image. Install u-boot-tools package. Alternatively, if you build your own images, OpenWrt provides mkenvimage in host staging directory as well. It is recommended to extract environment from the device, and modify it, rather then relying on defaults: $ sudo touch /srv/tftp/u-boot-env.bin $ sudo chmod 666 /srv/tftp/u-boot-env.bin On the device, find the MTD partition on which environment resides. Beware, it may change depending on currently active firmware image! # grep u-boot-env /proc/mtd Now, copy over the partition # tftp -l /dev/mtd -r u-boot-env.bin -p 10.42.0.1 Store the stock environment in a safe place: $ cp /srv/tftp/u-boot-env.bin ~/ Extract the values from the dump: $ strings u-boot-env.bin | tee u-boot-env.txt Now clean up the debris at the end of output, you should end up with each variable defined once. After that, set the bootcmd variable like this: bootcmd=bootm 0x9f040000 You should end up with something like this: bootcmd=bootm 0x9f040000 bootargs=console=ttyS0,115200 rootfstype=squashfs init=/sbin/init baudrate=115200 ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee mtdparts=mtdparts=ar7100-nor0:256k(u-boot),7168k(rcks_wlan.main),7168k(rcks_wlan.bkup),1280k(datafs),256k(u-boot-env) mtdids=nor0=ar7100-nor0 bootdelay=2 filesize=52e000 fileaddr=81000000 ethact=eth0 stdin=serial stdout=serial stderr=serial partition=nor0,0 mtddevnum=0 mtddevname=u-boot ipaddr=192.168.0.1 serverip=192.168.0.2 stderr=serial ethact=eth0 These are the defaults, you can use most likely just this as input to mkenvimage. Now, create environment image and copy it over to TFTP root: $ mkenvimage -s 0x40000 -b -o u-boot-env.bin u-boot-env.txt $ sudo cp u-boot-env.bin /srv/tftp This is the same image, gzipped and base64-encoded: H4sICOLMEGMAA3UtYm9vdC1lbnYtbmV3LmJpbgDt0E1u00AUAGDfgm2XDUrTsUV/pTkFSxZoEk+o lcQJtlNaLsURwU4FikDiBN+3eDNvLL/3Zt5/+vFuud8Pq10dp3V3EV4e1uFDGBXTQeq+9HG1b/v9 NsdheP0Y5mV5U4Vw0Y1f1/3wesix/3pM/dO6v2jaZojX/bJpr6dtsUzHuktDjm//FHl4SnXdxfAS wmN4SWkMy+UYVqsx1PUYci52Q31I3dDHP5vU3ZUhXLX7LjxWN7eby+PVNNxsflfe3m8uu9Wm//xt m9rFLjXtv6fLzfEwm5fVfdhc1mlI6342Pytzldvn2dS1qfs49Tjvd3qFOm/Ta6yKdbPNffM9x5sq Ty805acL3Zfh5HTD1RDHJRT9WLGNfe6atJ2S/XE4y3LX/c6mSzZDs29P3edhmqXOz+1xF//s0y7H t3GL5nDqWT5Ui/Gii7Aoi7HQ81jrcHZY/dXkfLLiJwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8 xy8jb4zOAAAEAA== 7. Perform actual installation. Copy over OpenWrt sysupgrade image to TFTP root: $ sudo cp openwrt-ath79-generic-ruckus_zf7025-squashfs-sysupgrade.bin /srv/tftp Now load both to the device over TFTP: # tftp -l /tmp/u-boot-env.bin -r u-boot-env.bin -g 10.42.0.1 # tftp -l /tmp/openwrt.bin -r openwrt-ath79-generic-ruckus_zf7025-squashfs-sysupgrade.bin -g 10.42.0.1 Verify checksums of both images to ensure the transfer over TFTP was completed: # sha256sum /tmp/u-boot-env.bin /tmp/openwrt.bin And compare it against source images: $ sha256sum /srv/tftp/u-boot-env.bin /srv/tftp/openwrt-ath79-generic-ruckus_zf7025-squashfs-sysupgrade.bin Locate MTD partition of the primary image: # grep rcks_wlan.main /proc/mtd Now, write the images in place. Write U-boot environment last, so unit still can boot from backup image, should power failure occur during this. Replace MTD placeholders with real MTD nodes: # flashcp /tmp/openwrt.bin /dev/ # flashcp /tmp/u-boot-env.bin /dev/ Finally, reboot the device. The device should directly boot into OpenWrt. Look for the characteristic power LED blinking pattern. # reboot -f After unit boots, it should be available at the usual 192.168.1.1/24. Return to factory firmware: 1. Boot into OpenWrt initramfs as for initial installation. To do that without disassembly, you can write an initramfs image to the device using 'sysupgrade -F' first. 2. Unset the "bootcmd" variable: fw_setenv bootcmd "" 3. Concatenate the firmware backups, if you took them during installation using method 2: $ cat ruckus_zf7025_fw1_backup.bin ruckus_zf7025_fw2_backup.bin > ruckus_zf7025_backup.bin 3. Write factory images downloaded from manufacturer website into fwconcat0 and fwconcat1 MTD partitions, or restore backup you took before installation: # mtd write ruckus_zf7025_backup.bin /dev/mtd1 4. Reboot the system, it should load into factory firmware again. Quirks and known issues: - Flash layout is changed from the factory, to use both firmware image partitions for storage using mtd-concat, and uImage format is used to actually boot the system, which rules out the dual-boot capability. - The 2.4 GHz radio has its own EEPROM on board, not connected to CPU. - The stock firmware has dual-boot capability, which is not supported in OpenWrt by choice. It is controlled by data in the top 64kB of RAM which is unmapped, to avoid the interference in the boot process and accidental switch to the inactive image, although boot script presence in form of "bootcmd" variable should prevent this entirely. - On some versions of stock firmware, it is possible to obtain root shell, however not much is available in terms of debugging facitilies. 1. Login to the rkscli 2. Execute hidden command "Ruckus" 3. Copy and paste ";/bin/sh;" including quotes. This is required only once, the payload will be stored in writable filesystem. 4. Execute hidden command "!v54!". Press Enter leaving empty reply for "What's your chow?" prompt. 5. Busybox shell shall open. Source: https://alephsecurity.com/vulns/aleph-2019014 Signed-off-by: Lech Perczak --- package/boot/uboot-envtools/files/ath79 | 3 + .../linux/ath79/dts/ar7240_ruckus_zf7025.dts | 196 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 7 + .../generic/base-files/etc/board.d/02_network | 6 + target/linux/ath79/image/generic.mk | 19 +- 5 files changed, 228 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/dts/ar7240_ruckus_zf7025.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 89eb830575..60aa3c6ba4 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -138,6 +138,9 @@ plasmacloud,pa300e) qihoo,c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; +ruckus,zf7025) + ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x40000" "0x40000" + ;; ruckus,zf7321|\ ruckus,zf7372) ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x40000" "0x10000" diff --git a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts new file mode 100644 index 0000000000..9e0671d638 --- /dev/null +++ b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts @@ -0,0 +1,196 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7240.dtsi" + +#include +#include + + +/ { + model = "Ruckus ZoneFlex 7025"; + compatible = "ruckus,zf7025", "qca,ar7240"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + hard-reset { + label = "hard-reset"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds: leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>; + + dir { + label = "green:dir"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "green:lan1"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "green:lan2"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "green:lan3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "green:lan4"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan5 { + label = "green:lan5"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + opt { + label = "green:opt"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power_red: power-red { + label = "red:power"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_power_green: power-green { + label = "green:power"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan-green { + label = "green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0assoc"; + }; + + wlan-yellow { + label = "yellow:wlan"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ruckus-himem@3ff0000 { + /* Ruckus Himem area used to control + * redundant boot image selection + */ + compatible = "nvmem-rmem"; + reg = <0x3ff0000 0x10000>; + no-map; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <104000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x40000>; + label = "u-boot"; + read-only; + }; + + /* On stock FW this encompasses rcks_wlan.main, + * rcks_wlan.bkup and datafs partitions + */ + partition@40000 { + compatible = "openwrt,uimage", "denx,uimage"; + reg = <0x40000 0xf40000>; + label = "firmware"; + }; + + partition@f80000 { + compatible = "u-boot,env"; + reg = <0xf80000 0x40000>; + label = "u-boot-env"; + }; + + board_data: partition@fc0000 { + reg = <0xfc0000 0x40000>; + label = "board-data"; + read-only; + }; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_board_data_66>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + status = "okay"; + nvmem-cells = <&macaddr_board_data_6c>; + nvmem-cell-names = "mac-address"; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,002b"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&macaddr_board_data_60>; + nvmem-cell-names = "mac-address"; + }; +}; + +&board_data { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_board_data_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_board_data_6c: macaddr@6c { + reg = <0x6c 0x6>; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 7fe9343876..cfcd2dfeda 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -327,6 +327,13 @@ qca,ap143-16m) qihoo,c301) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" ;; +ruckus,zf7025) + ucidef_set_led_netdev "lan" "LAN5" "green:lan5" "eth0" + ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02" + ;; ruckus,zf7372) ucidef_set_led_switch "lan" "LAN" "green:eth1" "switch0" "0x02" ;; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 339005f051..50576be9c5 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -434,6 +434,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:wan" ;; + ruckus,zf7025) + ucidef_set_interface_lan "eth0 eth1" + ucidef_add_switch "switch0" \ + "0u@eth1" "4:lan:1" "3:lan:2" "2:lan:3" "1:lan:4" + ;; teltonika,rut955|\ teltonika,rut955-h7v3c0) ucidef_set_interface_wan "eth1" @@ -716,6 +721,7 @@ ath79_setup_macs() wan_mac=$(mtd_get_mac_binary factory 0x0) lan_mac=$(macaddr_setbit_la "$wan_mac") ;; + ruckus,zf7025|\ ruckus,zf7321|\ ruckus,zf7372) lan_mac=$(mtd_get_mac_binary board-data 0x807E) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index e5bc73e5a6..c9bbb412b6 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -2402,15 +2402,28 @@ define Device/rosinson_wr818 endef TARGET_DEVICES += rosinson_wr818 -define Device/ruckus_zf73xx_common +define Device/ruckus_common DEVICE_VENDOR := Ruckus - DEVICE_PACKAGES := -swconfig kmod-usb2 kmod-usb-chipidea2 - IMAGE_SIZE := 31744k LOADER_TYPE := bin KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | uImage none endef +define Device/ruckus_zf7025 + $(Device/ruckus_common) + SOC := ar7240 + DEVICE_MODEL := ZoneFlex 7025 + IMAGE_SIZE := 15616k + BLOCKSIZE := 256k +endef +TARGET_DEVICES += ruckus_zf7025 + +define Device/ruckus_zf73xx_common + $(Device/ruckus_common) + DEVICE_PACKAGES := -swconfig kmod-usb2 kmod-usb-chipidea2 + IMAGE_SIZE := 31744k +endef + define Device/ruckus_zf7321 $(Device/ruckus_zf73xx_common) SOC := ar9342 From c984fc762412f206ebeb3e873742988ff760fb90 Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sun, 13 Nov 2022 21:29:26 +0800 Subject: [PATCH 21/42] rockchip: use LZMA FIT for kernel image Use LZMA compressed kernel to save some space in boot partition. Fixes: #11197 Tested-by: Tianling Shen [NanoPi R2S] Signed-off-by: Chuanhong Guo --- target/linux/rockchip/image/Makefile | 3 +-- target/linux/rockchip/image/armv8.mk | 3 +++ target/linux/rockchip/image/mmc.bootscript | 3 +-- target/linux/rockchip/image/nanopi-r2s.bootscript | 3 +-- target/linux/rockchip/image/nanopi-r4s.bootscript | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile index e4db1e5d58..e232166e51 100644 --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile @@ -16,7 +16,6 @@ define Build/boot-common rm -fR $@.boot mkdir -p $@.boot - $(CP) $(DTS_DIR)/$(DEVICE_DTS).dtb $@.boot/rockchip.dtb $(CP) $(IMAGE_KERNEL) $@.boot/kernel.img endef @@ -48,7 +47,7 @@ endef ### Devices ### define Device/Default PROFILES := Default - KERNEL := kernel-bin + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb IMAGES := sysupgrade.img.gz DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1))) endef diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index 6cc31f1d8c..f95416323d 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -2,6 +2,9 @@ # # Copyright (C) 2020 Tobias Maedel +# FIT will be loaded at 0x02080000. Leave 16M for that, align it to 2M and load the kernel after it. +KERNEL_LOADADDR := 0x03200000 + define Device/friendlyarm_nanopi-r2s DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2S diff --git a/target/linux/rockchip/image/mmc.bootscript b/target/linux/rockchip/image/mmc.bootscript index b70a62c4c7..9269fda9cf 100644 --- a/target/linux/rockchip/image/mmc.bootscript +++ b/target/linux/rockchip/image/mmc.bootscript @@ -2,7 +2,6 @@ part uuid mmc ${devnum}:2 uuid setenv bootargs "console=ttyS2,1500000 console=tty1 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait" -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb load mmc ${devnum}:1 ${kernel_addr_r} kernel.img -booti ${kernel_addr_r} - ${fdt_addr_r} +bootm ${kernel_addr_r} diff --git a/target/linux/rockchip/image/nanopi-r2s.bootscript b/target/linux/rockchip/image/nanopi-r2s.bootscript index 5198881a26..8f961d3732 100644 --- a/target/linux/rockchip/image/nanopi-r2s.bootscript +++ b/target/linux/rockchip/image/nanopi-r2s.bootscript @@ -2,7 +2,6 @@ part uuid mmc ${devnum}:2 uuid setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff130000 root=PARTUUID=${uuid} rw rootwait" -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb load mmc ${devnum}:1 ${kernel_addr_r} kernel.img -booti ${kernel_addr_r} - ${fdt_addr_r} +bootm ${kernel_addr_r} diff --git a/target/linux/rockchip/image/nanopi-r4s.bootscript b/target/linux/rockchip/image/nanopi-r4s.bootscript index abe9c24ee3..1e53200027 100644 --- a/target/linux/rockchip/image/nanopi-r4s.bootscript +++ b/target/linux/rockchip/image/nanopi-r4s.bootscript @@ -2,7 +2,6 @@ part uuid mmc ${devnum}:2 uuid setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait" -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb load mmc ${devnum}:1 ${kernel_addr_r} kernel.img -booti ${kernel_addr_r} - ${fdt_addr_r} +bootm ${kernel_addr_r} From 9a2d362bf7296d955b3cb8ab625bf1ec25703f89 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 12 Nov 2022 09:50:36 +0100 Subject: [PATCH 22/42] scripts: fix dl_cleanup.py argument handling The -w|--whitelist and -D|--download-dir arguments pass an additional value, properly evaluate that. Also allow to pass the download directory without -D|--download-dir, just as the usage describes. Finally fix spitting out the wrong error messages about those args. Signed-off-by: Andre Heider --- scripts/dl_cleanup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/dl_cleanup.py b/scripts/dl_cleanup.py index b15a9bb1a7..cdbcb83f20 100755 --- a/scripts/dl_cleanup.py +++ b/scripts/dl_cleanup.py @@ -224,7 +224,7 @@ def main(argv): try: (opts, args) = getopt.getopt( argv[1:], - "hdBwDb:", + "hdBw:D:b:", [ "help", "dry-run", @@ -268,12 +268,15 @@ def main(argv): if o in ("-b", "--build-dir"): builddir = v + if args: + directory = args[0] + if not os.path.exists(directory): - print("Can't find dl path", directory) + print("Can't find download directory", directory) return 1 if not os.path.exists(builddir): - print("Can't find dl path", builddir) + print("Can't find build directory", builddir) return 1 # Create a directory listing and parse the file names. From ebe2b7190b7d8815a588eaf8a5cfdf9edfd85c36 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 15 Nov 2022 18:45:52 +0000 Subject: [PATCH 23/42] kernel: modules: package Marvell gigE PHY driver Some copper SFP modules come with Marvell's 88E1xxx PHY and need this module to function. Package it, so users can easily install this PHY driver and use e.g. FINISAR CORP. FCLF-8521-3-HC SFP. Without marvell PHY driver: sfp sfp2: module FINISAR CORP. FCLF-8521-3-HC rev A sn XXXXXXX dc XXXXXX mt7530 mdio-bus:1f sfp2: validation with support 0000000,00000000,00000000 failed: -22 sfp sfp2: sfp_add_phy failed: -22 With marvell PHY driver: sfp sfp2: module FINISAR CORP. FCLF-8521-3-HC rev A sn XXXXXXX dc XXXXXX mt7530 mdio-bus:1f sfp2: switched to inband/sgmii link mode mt7530 mdio-bus:1f sfp2: PHY [i2c:sfp2:16] driver [Marvell 88E1111] (irq=POLL) mt7530 mdio-bus:1f sfp2: Link is Up - 1Gbps/Full - flow control rx/tx Signed-off-by: Daniel Golle --- package/kernel/linux/modules/netdevices.mk | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 394180902d..518d83f9a2 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -273,6 +273,40 @@ endef $(eval $(call KernelPackage,phy-bcm84881)) +define KernelPackage/phy-marvell + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Marvell Gigabit Ethernet PHY driver + KCONFIG:=CONFIG_MARVELL_PHY + DEPENDS:=+kmod-libphy + FILES:=$(LINUX_DIR)/drivers/net/phy/marvell.ko + AUTOLOAD:=$(call AutoLoad,18,marvell) +endef + +define KernelPackage/phy-marvell/description + Supports Marvell Gigabit Ethernet PHYs: + * 88E1101 + * 88E1112 + * 88E1111 (incl. Finisar variant) + * 88E1118 + * 88E1121R + * 88E1145 + * 88E1149R + * 88E1240 + * 88E1318S + * 88E1116R + * 88E1510 + * 88E1540 + * 88E1545 + * 88E3016 + * 88E6341 family + * 88E6390 family + * 88E6393 family + * 88E1340S + * 88E1548P +endef + +$(eval $(call KernelPackage,phy-marvell)) + define KernelPackage/phy-realtek SUBMENU:=$(NETWORK_DEVICES_MENU) From ce6f86e1344ccf79b8f8bcd0923f0865b9eb8db4 Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Sat, 22 Oct 2022 23:04:30 +0800 Subject: [PATCH 24/42] cypress-nvram: remove PROVIDES in NVRAM packages PROVIDES for these packages will cause ambiguity and circular dependency in planned changes. For example, if there is a package `brcmfmac-firmware-43455-sdio-rpi-cm4` that depends on `brcmfmac-firmware-43455-sdio-rpi-4b`, there is no way to tell which one of below packages the system will go for. - package named `brcmfmac-firmware-43455-sdio-rpi-4b` - package named `cypress-nvram-43455-sdio-rpi-4b` that PROVIDES `brcmfmac-firmware-43455-sdio-rpi-4b` When ambiguity is unacceptable, PROVIDES (aliases) shall be removed and packages shall only be used through their exact name. So remove PROVIDES and keep only CONFLICTS. Signed-off-by: Kuan-Yi Li --- package/firmware/cypress-nvram/Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/package/firmware/cypress-nvram/Makefile b/package/firmware/cypress-nvram/Makefile index f8b45fbef2..2bf71cd889 100644 --- a/package/firmware/cypress-nvram/Makefile +++ b/package/firmware/cypress-nvram/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=cypress-nvram PKG_SOURCE_DATE:=2019-09-03 PKG_SOURCE_VERSION:=e7b78df22f2a0c5f56abb7b5880661611de35e5f PKG_MIRROR_HASH:=1cb20a749696852be0a512d51961365dd9c031362af0af1a2b9f5a3fb894885f -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/openwrt/cypress-nvram.git @@ -37,7 +37,6 @@ define Package/cypress-nvram-43430-sdio-rpi-3b $(Package/cypress-nvram-default) TITLE:=CYW43430 NVRAM for Raspberry Pi 3B DEPENDS:=@TARGET_bcm27xx - PROVIDES:=brcmfmac-firmware-43430-sdio-rpi-3b CONFLICTS:=brcmfmac-firmware-43430-sdio-rpi-3b endef @@ -55,7 +54,6 @@ define Package/cypress-nvram-43430-sdio-rpi-zero-w $(Package/cypress-nvram-default) TITLE:=CYW43430 NVRAM for Raspberry Pi Zero W DEPENDS:=@TARGET_bcm27xx - PROVIDES:=brcmfmac-firmware-43430-sdio-rpi-zero-w CONFLICTS:=brcmfmac-firmware-43430-sdio-rpi-zero-w endef @@ -73,7 +71,6 @@ define Package/cypress-nvram-43455-sdio-rpi-3b-plus $(Package/cypress-nvram-default) TITLE:=CYW43455 NVRAM for Raspberry Pi 3B+ DEPENDS:=@TARGET_bcm27xx - PROVIDES:=brcmfmac-firmware-43455-sdio-rpi-3b-plus CONFLICTS:=brcmfmac-firmware-43455-sdio-rpi-3b-plus endef @@ -91,7 +88,6 @@ define Package/cypress-nvram-43455-sdio-rpi-4b $(Package/cypress-nvram-default) TITLE:=CYW43455 NVRAM for Raspberry Pi 4B DEPENDS:=@TARGET_bcm27xx - PROVIDES:=brcmfmac-firmware-43455-sdio-rpi-4b CONFLICTS:=brcmfmac-firmware-43455-sdio-rpi-4b endef @@ -112,7 +108,6 @@ define Package/cypress-nvram-4339-pico-pi-imx7d $(Package/cypress-nvram-default) TITLE:=BCM4339 NVRAM for TechNexion PICO-PI-IMX7D DEPENDS:=@TARGET_imx_cortexa7 - PROVIDES:=brcmfmac-firmware-4339-pico-pi-imx7d CONFLICTS:=brcmfmac-firmware-4339-pico-pi-imx7d endef From efaad5e901508621a47044dd729c4b776633b9b7 Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Sat, 22 Oct 2022 23:09:19 +0800 Subject: [PATCH 25/42] cypress-nvram: use symlink to provide NVRAM for some RPis This is to align the implementation with upstream `linux-firmware`. Some Raspberry Pi boards do not have dedicated NVRAM in `linux-firmware` source repository, their NVRAM is provided through a symbolic link to NVRAM of another board with an identical wireless design. Signed-off-by: Kuan-Yi Li --- package/firmware/cypress-nvram/Makefile | 36 +++++++++++++++++-------- target/linux/bcm27xx/image/Makefile | 13 +++++---- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/package/firmware/cypress-nvram/Makefile b/package/firmware/cypress-nvram/Makefile index 2bf71cd889..7c999540ca 100644 --- a/package/firmware/cypress-nvram/Makefile +++ b/package/firmware/cypress-nvram/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=cypress-nvram PKG_SOURCE_DATE:=2019-09-03 PKG_SOURCE_VERSION:=e7b78df22f2a0c5f56abb7b5880661611de35e5f PKG_MIRROR_HASH:=1cb20a749696852be0a512d51961365dd9c031362af0af1a2b9f5a3fb894885f -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/openwrt/cypress-nvram.git @@ -44,7 +44,7 @@ define Package/cypress-nvram-43430-sdio-rpi-3b/install $(INSTALL_DIR) $(1)/lib/firmware/brcm $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ - $(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt + $(1)/lib/firmware/brcm/ endef $(eval $(call BuildPackage,cypress-nvram-43430-sdio-rpi-3b)) @@ -53,14 +53,14 @@ $(eval $(call BuildPackage,cypress-nvram-43430-sdio-rpi-3b)) define Package/cypress-nvram-43430-sdio-rpi-zero-w $(Package/cypress-nvram-default) TITLE:=CYW43430 NVRAM for Raspberry Pi Zero W - DEPENDS:=@TARGET_bcm27xx + DEPENDS:=@TARGET_bcm27xx +cypress-nvram-43430-sdio-rpi-3b CONFLICTS:=brcmfmac-firmware-43430-sdio-rpi-zero-w endef define Package/cypress-nvram-43430-sdio-rpi-zero-w/install $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt \ + $(LN) \ + brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ $(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt endef @@ -78,7 +78,7 @@ define Package/cypress-nvram-43455-sdio-rpi-3b-plus/install $(INSTALL_DIR) $(1)/lib/firmware/brcm $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt \ - $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt + $(1)/lib/firmware/brcm/ endef $(eval $(call BuildPackage,cypress-nvram-43455-sdio-rpi-3b-plus)) @@ -95,14 +95,28 @@ define Package/cypress-nvram-43455-sdio-rpi-4b/install $(INSTALL_DIR) $(1)/lib/firmware/brcm $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ - $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ - $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt + $(1)/lib/firmware/brcm/ endef $(eval $(call BuildPackage,cypress-nvram-43455-sdio-rpi-4b)) +# Cypress 43455 SDIO Raspberry Pi CM4 NVRAM +define Package/cypress-nvram-43455-sdio-rpi-cm4 + $(Package/cypress-nvram-default) + TITLE:=CYW43455 NVRAM for Raspberry Pi CM4 + DEPENDS:=@TARGET_bcm27xx +cypress-nvram-43455-sdio-rpi-4b + CONFLICTS:=brcmfmac-firmware-43455-sdio-rpi-cm4 +endef + +define Package/cypress-nvram-43455-sdio-rpi-cm4/install + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt +endef + +$(eval $(call BuildPackage,cypress-nvram-43455-sdio-rpi-cm4)) + # Cypress 4339 SDIO PICO-PI-IMX7D define Package/cypress-nvram-4339-pico-pi-imx7d $(Package/cypress-nvram-default) @@ -115,7 +129,7 @@ define Package/cypress-nvram-4339-pico-pi-imx7d/install $(INSTALL_DIR) $(1)/lib/firmware/brcm $(INSTALL_DATA) \ ./files/brcmfmac4339-sdio.technexion,imx7d-pico-pi.txt \ - $(1)/lib/firmware/brcm/brcmfmac4339-sdio.technexion,imx7d-pico-pi.txt + $(1)/lib/firmware/brcm/ endef $(eval $(call BuildPackage,cypress-nvram-4339-pico-pi-imx7d)) diff --git a/target/linux/bcm27xx/image/Makefile b/target/linux/bcm27xx/image/Makefile index 4cd1052941..650d673025 100644 --- a/target/linux/bcm27xx/image/Makefile +++ b/target/linux/bcm27xx/image/Makefile @@ -87,10 +87,10 @@ define Device/rpi-2 DEVICE_MODEL := 2B/2B 1.2 DEVICE_VARIANT := (32bit) DEVICE_ALT0_VENDOR := Raspberry Pi - DEVICE_ALT0_MODEL := 3B/3B+/3CM + DEVICE_ALT0_MODEL := 3B/3B+/CM3 DEVICE_ALT0_VARIANT := (32bit) DEVICE_ALT1_VENDOR := Raspberry Pi - DEVICE_ALT1_MODEL := 4B/400/4CM + DEVICE_ALT1_MODEL := 4B/400/CM4 DEVICE_ALT1_VARIANT := (32bit) DEVICE_DTS := \ bcm2709-rpi-2-b bcm2710-rpi-2-b \ @@ -109,7 +109,9 @@ define Device/rpi-2 cypress-firmware-43430-sdio \ cypress-nvram-43430-sdio-rpi-3b \ cypress-firmware-43455-sdio \ - cypress-nvram-43455-sdio-rpi-3b-plus cypress-nvram-43455-sdio-rpi-4b \ + cypress-nvram-43455-sdio-rpi-3b-plus \ + cypress-nvram-43455-sdio-rpi-4b \ + cypress-nvram-43455-sdio-rpi-cm4 \ kmod-brcmfmac wpad-basic-wolfssl IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata IMAGE/factory.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip @@ -119,7 +121,7 @@ ifeq ($(SUBTARGET),bcm2709) endif define Device/rpi-3 - DEVICE_MODEL := 3B/3B+/3CM + DEVICE_MODEL := 3B/3B+/CM3 DEVICE_VARIANT := (64bit) DEVICE_ALT0_VENDOR := Raspberry Pi DEVICE_ALT0_MODEL := 2B-1.2 @@ -148,7 +150,7 @@ ifeq ($(SUBTARGET),bcm2710) endif define Device/rpi-4 - DEVICE_MODEL := 4B/400/4CM + DEVICE_MODEL := 4B/400/CM4 DEVICE_VARIANT := (64bit) KERNEL_IMG := kernel8.img DEVICE_DTS := \ @@ -162,6 +164,7 @@ define Device/rpi-4 DEVICE_PACKAGES := \ cypress-firmware-43455-sdio \ cypress-nvram-43455-sdio-rpi-4b \ + cypress-nvram-43455-sdio-rpi-cm4 \ kmod-brcmfmac wpad-basic-wolfssl \ kmod-usb-net-lan78xx IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata From 22e9d8bc896bb982868fab497beff9c806604d78 Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Thu, 20 Oct 2022 10:26:13 +0800 Subject: [PATCH 26/42] cypress-firmware: use symlink to provide firmware in brcm This is to align the implementation with upstream `linux-firmware`. Instead of moving these firmware files to `brcm` subdirectory and changing their names, leave them in `cypress` subdirectory, keep their names intact and use symbolic links to provide compatibility with Broadcom FullMAC driver. This gives more context to where the firmware comes from. Signed-off-by: Kuan-Yi Li --- package/firmware/cypress-firmware/Makefile | 124 +++++++++++++++++---- 1 file changed, 101 insertions(+), 23 deletions(-) diff --git a/package/firmware/cypress-firmware/Makefile b/package/firmware/cypress-firmware/Makefile index 769e69a973..f0f25e53b5 100644 --- a/package/firmware/cypress-firmware/Makefile +++ b/package/firmware/cypress-firmware/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cypress-firmware PKG_VERSION:=5.4.18-2021_0812 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/Infineon/ifx-linux-firmware/ @@ -38,12 +38,19 @@ define Package/cypress-firmware-43012-sdio endef define Package/cypress-firmware-43012-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43012-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac43012-sdio.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43012-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac43012-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac43012-sdio.bin + $(LN) \ + ../cypress/cyfmac43012-sdio.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac43012-sdio.clm_blob endef @@ -56,9 +63,13 @@ define Package/cypress-firmware-43340-sdio endef define Package/cypress-firmware-43340-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43340-sdio.bin \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac43340-sdio.bin \ $(1)/lib/firmware/brcm/brcmfmac43340-sdio.bin endef @@ -73,9 +84,13 @@ define Package/cypress-firmware-43362-sdio endef define Package/cypress-firmware-43362-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43362-sdio.bin \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac43362-sdio.bin \ $(1)/lib/firmware/brcm/brcmfmac43362-sdio.bin endef @@ -90,12 +105,19 @@ define Package/cypress-firmware-43430-sdio endef define Package/cypress-firmware-43430-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43430-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43430-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac43430-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin + $(LN) \ + ../cypress/cyfmac43430-sdio.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob endef @@ -110,12 +132,19 @@ define Package/cypress-firmware-43455-sdio endef define Package/cypress-firmware-43455-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43455-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac43455-sdio.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43455-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac43455-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.bin + $(LN) \ + ../cypress/cyfmac43455-sdio.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob endef @@ -128,12 +157,19 @@ define Package/cypress-firmware-4354-sdio endef define Package/cypress-firmware-4354-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4354-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac4354-sdio.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4354-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac4354-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac4354-sdio.bin + $(LN) \ + ../cypress/cyfmac4354-sdio.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac4354-sdio.clm_blob endef @@ -146,12 +182,19 @@ define Package/cypress-firmware-4356-pcie endef define Package/cypress-firmware-4356-pcie/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4356-pcie.bin \ - $(1)/lib/firmware/brcm/brcmfmac4356-pcie.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4356-pcie.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../firmware/cyfmac4356-pcie.bin \ + $(1)/lib/firmware/brcm/brcmfmac4356-pcie.bin + $(LN) \ + ../firmware/cyfmac4356-pcie.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac4356-pcie.clm_blob endef @@ -164,12 +207,19 @@ define Package/cypress-firmware-4356-sdio endef define Package/cypress-firmware-4356-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4356-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac4356-sdio.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4356-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac4356-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac4356-sdio.bin + $(LN) \ + ../cypress/cyfmac4356-sdio.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac4356-sdio.clm_blob endef @@ -182,12 +232,19 @@ define Package/cypress-firmware-43570-pcie endef define Package/cypress-firmware-43570-pcie/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43570-pcie.bin \ - $(1)/lib/firmware/brcm/brcmfmac43570-pcie.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac43570-pcie.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac43570-pcie.bin \ + $(1)/lib/firmware/brcm/brcmfmac43570-pcie.bin + $(LN) \ + ../cypress/cyfmac43570-pcie.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac43570-pcie.clm_blob endef @@ -200,12 +257,19 @@ define Package/cypress-firmware-4373-sdio endef define Package/cypress-firmware-4373-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4373-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac4373-sdio.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4373-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac4373-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac4373-sdio.bin + $(LN) \ + ../cypress/cyfmac4373-sdio.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac4373-sdio.clm_blob endef @@ -218,12 +282,19 @@ define Package/cypress-firmware-4373-usb endef define Package/cypress-firmware-4373-usb/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4373-usb.bin \ - $(1)/lib/firmware/brcm/brcmfmac4373-usb.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac4373.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac4373-usb.bin \ + $(1)/lib/firmware/brcm/brcmfmac4373-usb.bin + $(LN) \ + ../cypress/cyfmac4373.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac4373.clm_blob endef @@ -236,12 +307,19 @@ define Package/cypress-firmware-54591-pcie endef define Package/cypress-firmware-54591-pcie/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DIR) $(1)/lib/firmware/cypress $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac54591-pcie.bin \ - $(1)/lib/firmware/brcm/brcmfmac54591-pcie.bin + $(1)/lib/firmware/cypress/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/firmware/cyfmac54591-pcie.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac54591-pcie.bin \ + $(1)/lib/firmware/brcm/brcmfmac54591-pcie.bin + $(LN) \ + ../cypress/cyfmac54591-pcie.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac54591-pcie.clm_blob endef From 60832584aa6fbc3e19250bf44b0dc9b8b0939b8d Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Thu, 20 Oct 2022 10:26:44 +0800 Subject: [PATCH 27/42] linux-firmware: broadcom: use symlink to provide NVRAM for some RPis This is to align the implementation with upstream `linux-firmware`. Some Raspberry Pi boards do not have dedicated NVRAM in `linux-firmware` source repository, their NVRAM is provided through a symbolic link to NVRAM of another board with an identical wireless design. Signed-off-by: Kuan-Yi Li --- package/firmware/linux-firmware/Makefile | 2 +- package/firmware/linux-firmware/broadcom.mk | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile index 6c5ff542a1..2c4d361012 100644 --- a/package/firmware/linux-firmware/Makefile +++ b/package/firmware/linux-firmware/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=linux-firmware PKG_VERSION:=20221109 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk index 26f6534632..b48677a378 100644 --- a/package/firmware/linux-firmware/broadcom.mk +++ b/package/firmware/linux-firmware/broadcom.mk @@ -43,11 +43,11 @@ define Package/brcmfmac-firmware-43430-sdio-rpi-3b/install endef $(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio-rpi-3b)) -Package/brcmfmac-firmware-43430-sdio-rpi-zero-w = $(call Package/firmware-default,Broadcom BCM43430 NVRAM for Raspberry Pi Zero W) +Package/brcmfmac-firmware-43430-sdio-rpi-zero-w = $(call Package/firmware-default,Broadcom BCM43430 NVRAM for Raspberry Pi Zero W,+brcmfmac-firmware-43430-sdio-rpi-3b) define Package/brcmfmac-firmware-43430-sdio-rpi-zero-w/install $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ + $(LN) \ + brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ $(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt endef $(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio-rpi-zero-w)) @@ -79,6 +79,15 @@ define Package/brcmfmac-firmware-43455-sdio-rpi-4b/install endef $(eval $(call BuildPackage,brcmfmac-firmware-43455-sdio-rpi-4b)) +Package/brcmfmac-firmware-43455-sdio-rpi-cm4 = $(call Package/firmware-default,Broadcom BCM43455 NVRAM for Raspberry Pi CM4,+brcmfmac-firmware-43455-sdio-rpi-4b) +define Package/brcmfmac-firmware-43455-sdio-rpi-cm4/install + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt +endef +$(eval $(call BuildPackage,brcmfmac-firmware-43455-sdio-rpi-cm4)) + Package/brcmfmac-firmware-usb = $(call Package/firmware-default,Broadcom BCM43xx fullmac USB firmware) define Package/brcmfmac-firmware-usb/install $(INSTALL_DIR) $(1)/lib/firmware/brcm From 729cdff71dc00f6432fcd3d5045c610d8ff27ed9 Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Sat, 22 Oct 2022 23:26:35 +0800 Subject: [PATCH 28/42] bcm27xx: switch to linux-firmware SDIO NVRAM Package `cypress-nvram` was added because back then the files for newer RPi models on `linux-firmware` didn't have the proper values. It is the other way around nowadays, so switch back to `linux-firmware`. Signed-off-by: Kuan-Yi Li --- target/linux/bcm27xx/image/Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/linux/bcm27xx/image/Makefile b/target/linux/bcm27xx/image/Makefile index 650d673025..e605a9a5c8 100644 --- a/target/linux/bcm27xx/image/Makefile +++ b/target/linux/bcm27xx/image/Makefile @@ -76,7 +76,7 @@ define Device/rpi raspberrypi,model-zero raspberrypi,model-zero-w DEVICE_PACKAGES := \ cypress-firmware-43430-sdio \ - cypress-nvram-43430-sdio-rpi-zero-w \ + brcmfmac-firmware-43430-sdio-rpi-zero-w \ kmod-brcmfmac wpad-basic-wolfssl endef ifeq ($(SUBTARGET),bcm2708) @@ -107,11 +107,11 @@ define Device/rpi-2 raspberrypi,model-zero-2 DEVICE_PACKAGES := \ cypress-firmware-43430-sdio \ - cypress-nvram-43430-sdio-rpi-3b \ + brcmfmac-firmware-43430-sdio-rpi-3b \ cypress-firmware-43455-sdio \ - cypress-nvram-43455-sdio-rpi-3b-plus \ - cypress-nvram-43455-sdio-rpi-4b \ - cypress-nvram-43455-sdio-rpi-cm4 \ + brcmfmac-firmware-43455-sdio-rpi-3b-plus \ + brcmfmac-firmware-43455-sdio-rpi-4b \ + brcmfmac-firmware-43455-sdio-rpi-cm4 \ kmod-brcmfmac wpad-basic-wolfssl IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata IMAGE/factory.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip @@ -140,9 +140,9 @@ define Device/rpi-3 raspberrypi,model-zero-2 DEVICE_PACKAGES := \ cypress-firmware-43430-sdio \ - cypress-nvram-43430-sdio-rpi-3b \ + brcmfmac-firmware-43430-sdio-rpi-3b \ cypress-firmware-43455-sdio \ - cypress-nvram-43455-sdio-rpi-3b-plus \ + brcmfmac-firmware-43455-sdio-rpi-3b-plus \ kmod-brcmfmac wpad-basic-wolfssl endef ifeq ($(SUBTARGET),bcm2710) @@ -163,8 +163,8 @@ define Device/rpi-4 raspberrypi,4-model-b DEVICE_PACKAGES := \ cypress-firmware-43455-sdio \ - cypress-nvram-43455-sdio-rpi-4b \ - cypress-nvram-43455-sdio-rpi-cm4 \ + brcmfmac-firmware-43455-sdio-rpi-4b \ + brcmfmac-firmware-43455-sdio-rpi-cm4 \ kmod-brcmfmac wpad-basic-wolfssl \ kmod-usb-net-lan78xx IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata From a110418027a4c6f97c33980b8e4d7f07d39726de Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Thu, 20 Oct 2022 11:31:19 +0800 Subject: [PATCH 29/42] linux-firmware: offer two versions of firmware for CYW4339 According to commit 6f6c2fb321, AP6335 module used in PICO-PI-IMX7D works only with firmware from `linux-firmware`. However, firmware from `cypress-firmware` suite is directly from the chip company (Infineon) and is actually newer. Instead of dropping the firmware from Infineon, create a package named `brcmfmac-firmware-4339-sdio`, and keep the Infineon version of `cypress-firmware-4339-sdio` around. This gives us devs the option to choose. Also, it means that - packages `brcmfmac-firmware-*` uniformly come from `linux-firmware` - packages `cypress-firmware-*` uniformly come from `cypress-firmware` so hopefully brings more clarity. Tested-by: Lech Perczak Signed-off-by: Kuan-Yi Li --- package/firmware/cypress-firmware/Makefile | 23 ++++++++++++++++++++- package/firmware/linux-firmware/Makefile | 2 +- package/firmware/linux-firmware/broadcom.mk | 13 ++++++++++++ package/firmware/linux-firmware/cypress.mk | 8 ------- target/linux/imx/image/cortexa7.mk | 2 +- 5 files changed, 37 insertions(+), 11 deletions(-) delete mode 100644 package/firmware/linux-firmware/cypress.mk diff --git a/package/firmware/cypress-firmware/Makefile b/package/firmware/cypress-firmware/Makefile index f0f25e53b5..2cd3da9822 100644 --- a/package/firmware/cypress-firmware/Makefile +++ b/package/firmware/cypress-firmware/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cypress-firmware PKG_VERSION:=5.4.18-2021_0812 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/Infineon/ifx-linux-firmware/ @@ -96,6 +96,27 @@ endef $(eval $(call BuildPackage,cypress-firmware-43362-sdio)) +# Cypress 4339 SDIO Firmware +define Package/cypress-firmware-4339-sdio + $(Package/cypress-firmware-default) + TITLE:=CYW4339 FullMac SDIO firmware + PROVIDES:=brcmfmac-firmware-4339-sdio + CONFLICTS:=brcmfmac-firmware-4339-sdio +endef + +define Package/cypress-firmware-4339-sdio/install + $(INSTALL_DIR) $(1)/lib/firmware/cypress + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac4339-sdio.bin \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac4339-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac4339-sdio.bin +endef + +$(eval $(call BuildPackage,cypress-firmware-4339-sdio)) + # Cypress 43430 SDIO Firmware define Package/cypress-firmware-43430-sdio $(Package/cypress-firmware-default) diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile index 2c4d361012..2656f9c01f 100644 --- a/package/firmware/linux-firmware/Makefile +++ b/package/firmware/linux-firmware/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=linux-firmware PKG_VERSION:=20221109 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk index b48677a378..c0d315c19c 100644 --- a/package/firmware/linux-firmware/broadcom.mk +++ b/package/firmware/linux-firmware/broadcom.mk @@ -1,3 +1,16 @@ +Package/brcmfmac-firmware-4339-sdio = $(call Package/firmware-default,Broadcom 4339 FullMAC SDIO firmware) +define Package/brcmfmac-firmware-4339-sdio/install + $(INSTALL_DIR) $(1)/lib/firmware/cypress + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/cypress/cyfmac4339-sdio.bin \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac4339-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac4339-sdio.bin +endef +$(eval $(call BuildPackage,brcmfmac-firmware-4339-sdio)) + Package/brcmfmac-firmware-43602a1-pcie = $(call Package/firmware-default,Broadcom 43602a1 FullMAC PCIe firmware) define Package/brcmfmac-firmware-43602a1-pcie/install $(INSTALL_DIR) $(1)/lib/firmware/brcm diff --git a/package/firmware/linux-firmware/cypress.mk b/package/firmware/linux-firmware/cypress.mk deleted file mode 100644 index 2f5b66fecf..0000000000 --- a/package/firmware/linux-firmware/cypress.mk +++ /dev/null @@ -1,8 +0,0 @@ -Package/cypress-firmware-4339-sdio = $(call Package/firmware-default,Broadcom BCM4339 FullMac SDIO firmware) -define Package/cypress-firmware-4339-sdio/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/cypress/cyfmac4339-sdio.bin \ - $(1)/lib/firmware/brcm/brcmfmac4339-sdio.bin -endef -$(eval $(call BuildPackage,cypress-firmware-4339-sdio)) diff --git a/target/linux/imx/image/cortexa7.mk b/target/linux/imx/image/cortexa7.mk index b4ac1b6904..6306ed421d 100644 --- a/target/linux/imx/image/cortexa7.mk +++ b/target/linux/imx/image/cortexa7.mk @@ -21,7 +21,7 @@ define Device/technexion_imx7d-pico-pi DEVICE_PACKAGES := kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \ kmod-can kmod-can-flexcan kmod-can-raw kmod-leds-gpio \ kmod-input-touchscreen-edt-ft5x06 kmod-usb-hid kmod-btsdio \ - kmod-brcmfmac cypress-firmware-4339-sdio cypress-nvram-4339-pico-pi-imx7d + kmod-brcmfmac brcmfmac-firmware-4339-sdio cypress-nvram-4339-pico-pi-imx7d FILESYSTEMS := squashfs IMAGES := combined.bin sysupgrade.bin IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx-sdcard-raw-uboot From 0d43c22d47b91fd64fea707290f9dce3ba2a273f Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Tue, 15 Nov 2022 17:12:56 -0500 Subject: [PATCH 30/42] libmbedtls: use defaults if no build opts selected use defaults if no build opts selected (allows build with defaults when mbedtls not selected and configured) Signed-off-by: Glenn Strauss --- package/libs/mbedtls/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index a489f56755..fd0f821d85 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -140,10 +140,11 @@ endef define Build/Prepare $(call Build/Prepare/Default) - $(foreach opt,$(MBEDTLS_BUILD_OPTS), + $(if $(strip $(foreach opt,$(MBEDTLS_BUILD_OPTS),$($(opt)))), + $(foreach opt,$(MBEDTLS_BUILD_OPTS), $(PKG_BUILD_DIR)/scripts/config.py \ -f $(PKG_BUILD_DIR)/include/mbedtls/config.h \ - $(if $($(opt)),set,unset) $(patsubst CONFIG_%,%,$(opt))) + $(if $($(opt)),set,unset) $(patsubst CONFIG_%,%,$(opt))),) endef define Build/InstallDev From f74275c936e9cc62959822746270abb60339d18b Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Fri, 7 Oct 2022 14:22:23 +0200 Subject: [PATCH 31/42] kernel: add missing symbol in generic config Found during work on qoriq target. Signed-off-by: Pawel Dembicki [improve commit message, remove from target configs] Signed-off-by: Stijn Tintel --- target/linux/generic/config-5.10 | 1 + target/linux/generic/config-5.15 | 1 + target/linux/qoriq/config-5.10 | 1 - target/linux/qoriq/config-5.15 | 1 - 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index 103fe6de15..5010091ea9 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -2970,6 +2970,7 @@ CONFIG_LBDAF=y CONFIG_LDISC_AUTOLOAD=y # CONFIG_LDM_PARTITION is not set CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y +# CONFIG_LD_HEAD_STUB_CATCH is not set # CONFIG_LEDS_AN30259A is not set # CONFIG_LEDS_APU is not set # CONFIG_LEDS_AW2013 is not set diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index c36cba7053..735b3d0588 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -3082,6 +3082,7 @@ CONFIG_LBDAF=y CONFIG_LDISC_AUTOLOAD=y # CONFIG_LDM_PARTITION is not set CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y +# CONFIG_LD_HEAD_STUB_CATCH is not set # CONFIG_LEDS_AN30259A is not set # CONFIG_LEDS_APU is not set # CONFIG_LEDS_AW2013 is not set diff --git a/target/linux/qoriq/config-5.10 b/target/linux/qoriq/config-5.10 index 5bf31de3ea..c40f2b3084 100644 --- a/target/linux/qoriq/config-5.10 +++ b/target/linux/qoriq/config-5.10 @@ -194,7 +194,6 @@ CONFIG_KERNEL_GZIP=y CONFIG_KERNEL_START=0xc000000000000000 CONFIG_KPROBES=y CONFIG_KRETPROBES=y -# CONFIG_LD_HEAD_STUB_CATCH is not set CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y diff --git a/target/linux/qoriq/config-5.15 b/target/linux/qoriq/config-5.15 index ef6442a1b1..bf487462d5 100644 --- a/target/linux/qoriq/config-5.15 +++ b/target/linux/qoriq/config-5.15 @@ -201,7 +201,6 @@ CONFIG_KERNEL_GZIP=y CONFIG_KERNEL_START=0xc000000000000000 CONFIG_KPROBES=y CONFIG_KRETPROBES=y -# CONFIG_LD_HEAD_STUB_CATCH is not set CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y From 22fd8b0df6ca4abc972ab79242b6307468983c00 Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Wed, 16 Nov 2022 12:47:41 +0800 Subject: [PATCH 32/42] cypress-nvram: disassociate from external source repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since all NVRAM files in external repo are now upstreamed and to lower future maintenance cost, disassociate the package from external source repo. All upstream pending NVRAM files shall be stored locally from now on. Signed-off-by: Kuan-Yi Li [Remove outdated URL, add SPDX-License-Identifier] Signed-off-by: Álvaro Fernández Rojas --- package/firmware/cypress-nvram/Makefile | 119 +++--------------- ...co-pi.txt => brcmfmac4339-sdio.AP6335.txt} | 0 target/linux/imx/image/cortexa7.mk | 2 +- 3 files changed, 19 insertions(+), 102 deletions(-) rename package/firmware/cypress-nvram/files/{brcmfmac4339-sdio.technexion,imx7d-pico-pi.txt => brcmfmac4339-sdio.AP6335.txt} (100%) diff --git a/package/firmware/cypress-nvram/Makefile b/package/firmware/cypress-nvram/Makefile index 7c999540ca..b08f6ca63c 100644 --- a/package/firmware/cypress-nvram/Makefile +++ b/package/firmware/cypress-nvram/Makefile @@ -1,135 +1,52 @@ -# -# Copyright (C) 2019 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# +# SPDX-License-Identifier: GPL-2.0-or-later include $(TOPDIR)/rules.mk PKG_NAME:=cypress-nvram -PKG_SOURCE_DATE:=2019-09-03 -PKG_SOURCE_VERSION:=e7b78df22f2a0c5f56abb7b5880661611de35e5f -PKG_MIRROR_HASH:=1cb20a749696852be0a512d51961365dd9c031362af0af1a2b9f5a3fb894885f -PKG_RELEASE:=4 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/openwrt/cypress-nvram.git +PKG_RELEASE:=5 PKG_MAINTAINER:=Álvaro Fernández Rojas -PKG_FLAGS:=nonshared - include $(INCLUDE_DIR)/package.mk define Package/cypress-nvram-default SECTION:=firmware CATEGORY:=Firmware - URL:=https://community.cypress.com/community/linux endef define Build/Compile true endef -# Cypress 43430 SDIO Raspberry Pi 3B NVRAM -define Package/cypress-nvram-43430-sdio-rpi-3b +# Cypress 4339 SDIO AP6335 NVRAM +define Package/cypress-nvram-4339-sdio-ap6335 $(Package/cypress-nvram-default) - TITLE:=CYW43430 NVRAM for Raspberry Pi 3B - DEPENDS:=@TARGET_bcm27xx - CONFLICTS:=brcmfmac-firmware-43430-sdio-rpi-3b + TITLE:=BCM4339 NVRAM for AP6335 + CONFLICTS:=brcmfmac-firmware-4339-sdio-ap6335 endef -define Package/cypress-nvram-43430-sdio-rpi-3b/install +define Package/cypress-nvram-4339-sdio-ap6335/install $(INSTALL_DIR) $(1)/lib/firmware/brcm $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ + ./files/brcmfmac4339-sdio.AP6335.txt \ $(1)/lib/firmware/brcm/ endef -$(eval $(call BuildPackage,cypress-nvram-43430-sdio-rpi-3b)) +$(eval $(call BuildPackage,cypress-nvram-4339-sdio-ap6335)) -# Cypress 43430 SDIO Raspberry Pi Zero W NVRAM -define Package/cypress-nvram-43430-sdio-rpi-zero-w - $(Package/cypress-nvram-default) - TITLE:=CYW43430 NVRAM for Raspberry Pi Zero W - DEPENDS:=@TARGET_bcm27xx +cypress-nvram-43430-sdio-rpi-3b - CONFLICTS:=brcmfmac-firmware-43430-sdio-rpi-zero-w -endef - -define Package/cypress-nvram-43430-sdio-rpi-zero-w/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(LN) \ - brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ - $(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt -endef - -$(eval $(call BuildPackage,cypress-nvram-43430-sdio-rpi-zero-w)) - -# Cypress 43455 SDIO Raspberry Pi 3B+ NVRAM -define Package/cypress-nvram-43455-sdio-rpi-3b-plus - $(Package/cypress-nvram-default) - TITLE:=CYW43455 NVRAM for Raspberry Pi 3B+ - DEPENDS:=@TARGET_bcm27xx - CONFLICTS:=brcmfmac-firmware-43455-sdio-rpi-3b-plus -endef - -define Package/cypress-nvram-43455-sdio-rpi-3b-plus/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt \ - $(1)/lib/firmware/brcm/ -endef - -$(eval $(call BuildPackage,cypress-nvram-43455-sdio-rpi-3b-plus)) - -# Cypress 43455 SDIO Raspberry Pi 4B NVRAM -define Package/cypress-nvram-43455-sdio-rpi-4b - $(Package/cypress-nvram-default) - TITLE:=CYW43455 NVRAM for Raspberry Pi 4B - DEPENDS:=@TARGET_bcm27xx - CONFLICTS:=brcmfmac-firmware-43455-sdio-rpi-4b -endef - -define Package/cypress-nvram-43455-sdio-rpi-4b/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ - $(1)/lib/firmware/brcm/ -endef - -$(eval $(call BuildPackage,cypress-nvram-43455-sdio-rpi-4b)) - -# Cypress 43455 SDIO Raspberry Pi CM4 NVRAM -define Package/cypress-nvram-43455-sdio-rpi-cm4 - $(Package/cypress-nvram-default) - TITLE:=CYW43455 NVRAM for Raspberry Pi CM4 - DEPENDS:=@TARGET_bcm27xx +cypress-nvram-43455-sdio-rpi-4b - CONFLICTS:=brcmfmac-firmware-43455-sdio-rpi-cm4 -endef - -define Package/cypress-nvram-43455-sdio-rpi-cm4/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(LN) \ - brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ - $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt -endef - -$(eval $(call BuildPackage,cypress-nvram-43455-sdio-rpi-cm4)) - -# Cypress 4339 SDIO PICO-PI-IMX7D -define Package/cypress-nvram-4339-pico-pi-imx7d +# Cypress 4339 SDIO PICO-PI-IMX7D NVRAM +define Package/cypress-nvram-4339-sdio-pico-pi-imx7d $(Package/cypress-nvram-default) TITLE:=BCM4339 NVRAM for TechNexion PICO-PI-IMX7D - DEPENDS:=@TARGET_imx_cortexa7 - CONFLICTS:=brcmfmac-firmware-4339-pico-pi-imx7d + DEPENDS:=+cypress-nvram-4339-sdio-ap6335 + CONFLICTS:=brcmfmac-firmware-4339-sdio-pico-pi-imx7d endef -define Package/cypress-nvram-4339-pico-pi-imx7d/install +define Package/cypress-nvram-4339-sdio-pico-pi-imx7d/install $(INSTALL_DIR) $(1)/lib/firmware/brcm - $(INSTALL_DATA) \ - ./files/brcmfmac4339-sdio.technexion,imx7d-pico-pi.txt \ - $(1)/lib/firmware/brcm/ + $(LN) \ + brcmfmac4339-sdio.AP6335.txt \ + $(1)/lib/firmware/brcm/brcmfmac4339-sdio.technexion,imx7d-pico-pi.txt endef -$(eval $(call BuildPackage,cypress-nvram-4339-pico-pi-imx7d)) +$(eval $(call BuildPackage,cypress-nvram-4339-sdio-pico-pi-imx7d)) diff --git a/package/firmware/cypress-nvram/files/brcmfmac4339-sdio.technexion,imx7d-pico-pi.txt b/package/firmware/cypress-nvram/files/brcmfmac4339-sdio.AP6335.txt similarity index 100% rename from package/firmware/cypress-nvram/files/brcmfmac4339-sdio.technexion,imx7d-pico-pi.txt rename to package/firmware/cypress-nvram/files/brcmfmac4339-sdio.AP6335.txt diff --git a/target/linux/imx/image/cortexa7.mk b/target/linux/imx/image/cortexa7.mk index 6306ed421d..00c57c3e12 100644 --- a/target/linux/imx/image/cortexa7.mk +++ b/target/linux/imx/image/cortexa7.mk @@ -21,7 +21,7 @@ define Device/technexion_imx7d-pico-pi DEVICE_PACKAGES := kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \ kmod-can kmod-can-flexcan kmod-can-raw kmod-leds-gpio \ kmod-input-touchscreen-edt-ft5x06 kmod-usb-hid kmod-btsdio \ - kmod-brcmfmac brcmfmac-firmware-4339-sdio cypress-nvram-4339-pico-pi-imx7d + kmod-brcmfmac brcmfmac-firmware-4339-sdio cypress-nvram-4339-sdio-pico-pi-imx7d FILESYSTEMS := squashfs IMAGES := combined.bin sysupgrade.bin IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx-sdcard-raw-uboot From c6e86d8095e45cb6ad084a2f447594263b0eddfe Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Mon, 14 Nov 2022 12:11:06 +0800 Subject: [PATCH 33/42] linux-firmware: broadcom: consolidate NVRAM packages NVRAM packages for the same wireless chip are consolidated into one as they contain only small text files and symlinks. Signed-off-by: Kuan-Yi Li --- package/firmware/cypress-nvram/Makefile | 6 +- package/firmware/linux-firmware/Makefile | 2 +- package/firmware/linux-firmware/broadcom.mk | 102 ++++++++++++++------ target/linux/bcm27xx/image/Makefile | 15 ++- 4 files changed, 85 insertions(+), 40 deletions(-) diff --git a/package/firmware/cypress-nvram/Makefile b/package/firmware/cypress-nvram/Makefile index b08f6ca63c..598abd4d99 100644 --- a/package/firmware/cypress-nvram/Makefile +++ b/package/firmware/cypress-nvram/Makefile @@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cypress-nvram -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_MAINTAINER:=Álvaro Fernández Rojas @@ -22,7 +22,7 @@ endef define Package/cypress-nvram-4339-sdio-ap6335 $(Package/cypress-nvram-default) TITLE:=BCM4339 NVRAM for AP6335 - CONFLICTS:=brcmfmac-firmware-4339-sdio-ap6335 + CONFLICTS:=brcmfmac-nvram-4339-sdio endef define Package/cypress-nvram-4339-sdio-ap6335/install @@ -39,7 +39,7 @@ define Package/cypress-nvram-4339-sdio-pico-pi-imx7d $(Package/cypress-nvram-default) TITLE:=BCM4339 NVRAM for TechNexion PICO-PI-IMX7D DEPENDS:=+cypress-nvram-4339-sdio-ap6335 - CONFLICTS:=brcmfmac-firmware-4339-sdio-pico-pi-imx7d + CONFLICTS:=brcmfmac-nvram-4339-sdio endef define Package/cypress-nvram-4339-sdio-pico-pi-imx7d/install diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile index 2656f9c01f..4a665ad724 100644 --- a/package/firmware/linux-firmware/Makefile +++ b/package/firmware/linux-firmware/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=linux-firmware PKG_VERSION:=20221109 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk index c0d315c19c..48d986e218 100644 --- a/package/firmware/linux-firmware/broadcom.mk +++ b/package/firmware/linux-firmware/broadcom.mk @@ -47,23 +47,53 @@ define Package/brcmfmac-firmware-4329-sdio/install endef $(eval $(call BuildPackage,brcmfmac-firmware-4329-sdio)) -Package/brcmfmac-firmware-43430-sdio-rpi-3b = $(call Package/firmware-default,Broadcom BCM43430 NVRAM for Raspberry Pi 3B) -define Package/brcmfmac-firmware-43430-sdio-rpi-3b/install +Package/brcmfmac-nvram-43430-sdio = $(call Package/firmware-default,Broadcom BCM43430 SDIO NVRAM) +define Package/brcmfmac-nvram-43430-sdio/install $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/ + $(LN) \ + brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bpi-m2-plus.txt + $(LN) \ + brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt + $(LN) \ + brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bpi-m2-ultra.txt + $(LN) \ + brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bpi-m3.txt + $(LN) \ + brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.friendlyarm,nanopi-r1.txt + $(LN) \ + brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.starfive,visionfive-v1.txt + $(LN) \ + brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100-a1.txt + $(LN) \ + brcmfmac43430-sdio.AP6212.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100-r0.txt + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt \ + $(1)/lib/firmware/brcm/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.MUR1DX.txt \ + $(1)/lib/firmware/brcm/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ - $(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt -endef -$(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio-rpi-3b)) - -Package/brcmfmac-firmware-43430-sdio-rpi-zero-w = $(call Package/firmware-default,Broadcom BCM43430 NVRAM for Raspberry Pi Zero W,+brcmfmac-firmware-43430-sdio-rpi-3b) -define Package/brcmfmac-firmware-43430-sdio-rpi-zero-w/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(1)/lib/firmware/brcm/ $(LN) \ brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ $(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt + $(LN) \ + brcmfmac43430-sdio.raspberrypi,3-model-b.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-2-w.txt endef -$(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio-rpi-zero-w)) +$(eval $(call BuildPackage,brcmfmac-nvram-43430-sdio)) Package/brcmfmac-firmware-43430a0-sdio = $(call Package/firmware-default,Broadcom BCM43430a0 FullMac SDIO firmware) define Package/brcmfmac-firmware-43430a0-sdio/install @@ -74,32 +104,50 @@ define Package/brcmfmac-firmware-43430a0-sdio/install endef $(eval $(call BuildPackage,brcmfmac-firmware-43430a0-sdio)) -Package/brcmfmac-firmware-43455-sdio-rpi-3b-plus = $(call Package/firmware-default,Broadcom BCM43455 NVRAM for Raspberry Pi 3B+) -define Package/brcmfmac-firmware-43455-sdio-rpi-3b-plus/install +Package/brcmfmac-nvram-43455-sdio = $(call Package/firmware-default,Broadcom BCM43455 SDIO NVRAM) +define Package/brcmfmac-nvram-43455-sdio/install $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.acepc-t8.txt \ + $(1)/lib/firmware/brcm/ $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt \ - $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt -endef -$(eval $(call BuildPackage,brcmfmac-firmware-43455-sdio-rpi-3b-plus)) - -Package/brcmfmac-firmware-43455-sdio-rpi-4b = $(call Package/firmware-default,Broadcom BCM43455 NVRAM for Raspberry Pi 4B) -define Package/brcmfmac-firmware-43455-sdio-rpi-4b/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(1)/lib/firmware/brcm/ + $(LN) \ + brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-a-plus.txt $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ - $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt -endef -$(eval $(call BuildPackage,brcmfmac-firmware-43455-sdio-rpi-4b)) - -Package/brcmfmac-firmware-43455-sdio-rpi-cm4 = $(call Package/firmware-default,Broadcom BCM43455 NVRAM for Raspberry Pi CM4,+brcmfmac-firmware-43455-sdio-rpi-4b) -define Package/brcmfmac-firmware-43455-sdio-rpi-cm4/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(1)/lib/firmware/brcm/ $(LN) \ brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ $(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt + $(LN) \ + brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.Raspberry\ Pi\ Foundation-Raspberry\ Pi\ 4\ Model\ B.txt + $(LN) \ + brcmfmac43455-sdio.raspberrypi,4-model-b.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.Raspberry\ Pi\ Foundation-Raspberry\ Pi\ Compute\ Module\ 4.txt + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.MINIX-NEO\ Z83-4.txt \ + $(1)/lib/firmware/brcm/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.AW-CM256SM.txt \ + $(1)/lib/firmware/brcm/ + $(LN) \ + brcmfmac43455-sdio.AW-CM256SM.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.beagle,am5729-beagleboneai.txt + $(LN) \ + brcmfmac43455-sdio.AW-CM256SM.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.pine64,pinebook-pro.txt + $(LN) \ + brcmfmac43455-sdio.AW-CM256SM.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.pine64,pinephone-pro.txt + $(LN) \ + brcmfmac43455-sdio.AW-CM256SM.txt \ + $(1)/lib/firmware/brcm/brcmfmac43455-sdio.pine64,quartz64-b.txt endef -$(eval $(call BuildPackage,brcmfmac-firmware-43455-sdio-rpi-cm4)) +$(eval $(call BuildPackage,brcmfmac-nvram-43455-sdio)) Package/brcmfmac-firmware-usb = $(call Package/firmware-default,Broadcom BCM43xx fullmac USB firmware) define Package/brcmfmac-firmware-usb/install diff --git a/target/linux/bcm27xx/image/Makefile b/target/linux/bcm27xx/image/Makefile index e605a9a5c8..1334386c57 100644 --- a/target/linux/bcm27xx/image/Makefile +++ b/target/linux/bcm27xx/image/Makefile @@ -76,7 +76,7 @@ define Device/rpi raspberrypi,model-zero raspberrypi,model-zero-w DEVICE_PACKAGES := \ cypress-firmware-43430-sdio \ - brcmfmac-firmware-43430-sdio-rpi-zero-w \ + brcmfmac-nvram-43430-sdio \ kmod-brcmfmac wpad-basic-wolfssl endef ifeq ($(SUBTARGET),bcm2708) @@ -107,11 +107,9 @@ define Device/rpi-2 raspberrypi,model-zero-2 DEVICE_PACKAGES := \ cypress-firmware-43430-sdio \ - brcmfmac-firmware-43430-sdio-rpi-3b \ + brcmfmac-nvram-43430-sdio \ cypress-firmware-43455-sdio \ - brcmfmac-firmware-43455-sdio-rpi-3b-plus \ - brcmfmac-firmware-43455-sdio-rpi-4b \ - brcmfmac-firmware-43455-sdio-rpi-cm4 \ + brcmfmac-nvram-43455-sdio \ kmod-brcmfmac wpad-basic-wolfssl IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata IMAGE/factory.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip @@ -140,9 +138,9 @@ define Device/rpi-3 raspberrypi,model-zero-2 DEVICE_PACKAGES := \ cypress-firmware-43430-sdio \ - brcmfmac-firmware-43430-sdio-rpi-3b \ + brcmfmac-nvram-43430-sdio \ cypress-firmware-43455-sdio \ - brcmfmac-firmware-43455-sdio-rpi-3b-plus \ + brcmfmac-nvram-43455-sdio \ kmod-brcmfmac wpad-basic-wolfssl endef ifeq ($(SUBTARGET),bcm2710) @@ -163,8 +161,7 @@ define Device/rpi-4 raspberrypi,4-model-b DEVICE_PACKAGES := \ cypress-firmware-43455-sdio \ - brcmfmac-firmware-43455-sdio-rpi-4b \ - brcmfmac-firmware-43455-sdio-rpi-cm4 \ + brcmfmac-nvram-43455-sdio \ kmod-brcmfmac wpad-basic-wolfssl \ kmod-usb-net-lan78xx IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata From 49bbfd9968879f3aa6df07871703a2643254bf60 Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Mon, 14 Nov 2022 13:09:58 +0800 Subject: [PATCH 34/42] cypress-nvram: consolidate NVRAM packages NVRAM packages for the same wireless chip are consolidated into one as they contain only small text files and symlinks. Signed-off-by: Kuan-Yi Li --- package/firmware/cypress-nvram/Makefile | 26 ++++++------------------- target/linux/imx/image/cortexa7.mk | 2 +- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/package/firmware/cypress-nvram/Makefile b/package/firmware/cypress-nvram/Makefile index 598abd4d99..dcf09d9599 100644 --- a/package/firmware/cypress-nvram/Makefile +++ b/package/firmware/cypress-nvram/Makefile @@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cypress-nvram -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_MAINTAINER:=Álvaro Fernández Rojas @@ -18,35 +18,21 @@ define Build/Compile true endef -# Cypress 4339 SDIO AP6335 NVRAM -define Package/cypress-nvram-4339-sdio-ap6335 +# Cypress 4339 SDIO NVRAM +define Package/cypress-nvram-4339-sdio $(Package/cypress-nvram-default) - TITLE:=BCM4339 NVRAM for AP6335 + TITLE:=BCM4339 SDIO NVRAM CONFLICTS:=brcmfmac-nvram-4339-sdio endef -define Package/cypress-nvram-4339-sdio-ap6335/install +define Package/cypress-nvram-4339-sdio/install $(INSTALL_DIR) $(1)/lib/firmware/brcm $(INSTALL_DATA) \ ./files/brcmfmac4339-sdio.AP6335.txt \ $(1)/lib/firmware/brcm/ -endef - -$(eval $(call BuildPackage,cypress-nvram-4339-sdio-ap6335)) - -# Cypress 4339 SDIO PICO-PI-IMX7D NVRAM -define Package/cypress-nvram-4339-sdio-pico-pi-imx7d - $(Package/cypress-nvram-default) - TITLE:=BCM4339 NVRAM for TechNexion PICO-PI-IMX7D - DEPENDS:=+cypress-nvram-4339-sdio-ap6335 - CONFLICTS:=brcmfmac-nvram-4339-sdio -endef - -define Package/cypress-nvram-4339-sdio-pico-pi-imx7d/install - $(INSTALL_DIR) $(1)/lib/firmware/brcm $(LN) \ brcmfmac4339-sdio.AP6335.txt \ $(1)/lib/firmware/brcm/brcmfmac4339-sdio.technexion,imx7d-pico-pi.txt endef -$(eval $(call BuildPackage,cypress-nvram-4339-sdio-pico-pi-imx7d)) +$(eval $(call BuildPackage,cypress-nvram-4339-sdio)) diff --git a/target/linux/imx/image/cortexa7.mk b/target/linux/imx/image/cortexa7.mk index 00c57c3e12..d5a23fc6e9 100644 --- a/target/linux/imx/image/cortexa7.mk +++ b/target/linux/imx/image/cortexa7.mk @@ -21,7 +21,7 @@ define Device/technexion_imx7d-pico-pi DEVICE_PACKAGES := kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \ kmod-can kmod-can-flexcan kmod-can-raw kmod-leds-gpio \ kmod-input-touchscreen-edt-ft5x06 kmod-usb-hid kmod-btsdio \ - kmod-brcmfmac brcmfmac-firmware-4339-sdio cypress-nvram-4339-sdio-pico-pi-imx7d + kmod-brcmfmac brcmfmac-firmware-4339-sdio cypress-nvram-4339-sdio FILESYSTEMS := squashfs IMAGES := combined.bin sysupgrade.bin IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx-sdcard-raw-uboot From 170f3d7b0a13d9dd28940f57f9dd09fa812f91f6 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 16 Nov 2022 07:19:10 -0500 Subject: [PATCH 35/42] kernel: bump 5.15 to 5.15.79 All other patches automatically rebased Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/mt7621 Run-tested: bcm2711/RPi4B, ramips/mt7621 Signed-off-by: John Audia --- include/kernel-5.15 | 4 ++-- ...sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch | 2 +- ...sound-usb-call-usb_autopm_get_interface-for-devices-.patch | 2 +- target/linux/generic/hack-5.15/221-module_exports.patch | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/kernel-5.15 b/include/kernel-5.15 index d3a43826a6..a7d4d0ca72 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .78 -LINUX_KERNEL_HASH-5.15.78 = 0db99f7347a38c27b8c155f3c9c8b260011aea0a4ded85ee95e6095b1e69a499 +LINUX_VERSION-5.15 = .79 +LINUX_KERNEL_HASH-5.15.79 = cba39031dbc0eed0785b8afdc8c58cf23df83e47001b2354fa44486ae699c154 diff --git a/target/linux/bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch b/target/linux/bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch index c1f31d65dc..524f689904 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch @@ -16,7 +16,7 @@ Signed-off-by: Jonathan Bell --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -1883,6 +1883,8 @@ static const struct usb_audio_quirk_flag +@@ -1884,6 +1884,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */ QUIRK_FLAG_GENERIC_IMPLICIT_FB), diff --git a/target/linux/bcm27xx/patches-5.15/950-0471-sound-usb-call-usb_autopm_get_interface-for-devices-.patch b/target/linux/bcm27xx/patches-5.15/950-0471-sound-usb-call-usb_autopm_get_interface-for-devices-.patch index 5ca57a6b0a..a586d075dd 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0471-sound-usb-call-usb_autopm_get_interface-for-devices-.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0471-sound-usb-call-usb_autopm_get_interface-for-devices-.patch @@ -19,7 +19,7 @@ Signed-off-by: Jonathan Bell --- a/sound/usb/card.c +++ b/sound/usb/card.c -@@ -843,8 +843,14 @@ static int usb_audio_probe(struct usb_in +@@ -855,8 +855,14 @@ static int usb_audio_probe(struct usb_in if (ignore_ctl_error) chip->quirk_flags |= QUIRK_FLAG_IGNORE_CTL_ERROR; diff --git a/target/linux/generic/hack-5.15/221-module_exports.patch b/target/linux/generic/hack-5.15/221-module_exports.patch index af21a2db8b..405dc5f78c 100644 --- a/target/linux/generic/hack-5.15/221-module_exports.patch +++ b/target/linux/generic/hack-5.15/221-module_exports.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau /* Align . to a 8 byte boundary equals to maximum function alignment. */ #define ALIGN_FUNCTION() . = ALIGN(8) -@@ -484,14 +494,14 @@ +@@ -485,14 +495,14 @@ /* Kernel symbol table: Normal symbols */ \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __start___ksymtab = .; \ @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau __stop___ksymtab_gpl = .; \ } \ \ -@@ -511,7 +521,7 @@ +@@ -512,7 +522,7 @@ \ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ From 9e137bb10e2652dd1eb826e228d9842f872789f9 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 16 Nov 2022 07:17:49 -0500 Subject: [PATCH 36/42] kernel: bump 5.10 to 5.10.155 All patches automatically rebased. Signed-off-by: John Audia --- include/kernel-5.10 | 4 ++-- ...net-pass-the-dst-buffer-to-of_get_mac_address.patch | 10 +++++----- .../linux/generic/hack-5.10/221-module_exports.patch | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/kernel-5.10 b/include/kernel-5.10 index 6420451109..dec15dddaa 100644 --- a/include/kernel-5.10 +++ b/include/kernel-5.10 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.10 = .154 -LINUX_KERNEL_HASH-5.10.154 = c6ae3d4da4324933160260d0f092a40cd27f9ed03449380790afbe6ce91ee688 +LINUX_VERSION-5.10 = .155 +LINUX_KERNEL_HASH-5.10.155 = f1b027526c58e7bd127f35b17736e4a6c865866b9048898f05c5358d4d52d4f3 diff --git a/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch index 1c1884e571..3c559938fe 100644 --- a/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch +++ b/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch @@ -775,7 +775,7 @@ Signed-off-by: David S. Miller /* bring up the dma engine and IP core */ --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c -@@ -2700,7 +2700,6 @@ static int mv643xx_eth_shared_of_add_por +@@ -2701,7 +2701,6 @@ static int mv643xx_eth_shared_of_add_por struct platform_device *ppdev; struct mv643xx_eth_platform_data ppd; struct resource res; @@ -783,7 +783,7 @@ Signed-off-by: David S. Miller int ret; int dev_num = 0; -@@ -2731,9 +2730,7 @@ static int mv643xx_eth_shared_of_add_por +@@ -2732,9 +2731,7 @@ static int mv643xx_eth_shared_of_add_por return -EINVAL; } @@ -1250,7 +1250,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -@@ -372,7 +372,7 @@ static int meson8b_dwmac_probe(struct pl +@@ -370,7 +370,7 @@ static int meson8b_dwmac_probe(struct pl if (ret) return ret; @@ -1455,7 +1455,7 @@ Signed-off-by: David S. Miller of_node_put(node); --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c -@@ -1306,7 +1306,6 @@ static int cpsw_probe_dt(struct cpsw_pla +@@ -1308,7 +1308,6 @@ static int cpsw_probe_dt(struct cpsw_pla for_each_available_child_of_node(node, slave_node) { struct cpsw_slave_data *slave_data = data->slave_data + i; @@ -1463,7 +1463,7 @@ Signed-off-by: David S. Miller int lenp; const __be32 *parp; -@@ -1378,10 +1377,8 @@ static int cpsw_probe_dt(struct cpsw_pla +@@ -1380,10 +1379,8 @@ static int cpsw_probe_dt(struct cpsw_pla } no_phy_slave: diff --git a/target/linux/generic/hack-5.10/221-module_exports.patch b/target/linux/generic/hack-5.10/221-module_exports.patch index 11f473f09f..0b0cbfe66c 100644 --- a/target/linux/generic/hack-5.10/221-module_exports.patch +++ b/target/linux/generic/hack-5.10/221-module_exports.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau /* Align . to a 8 byte boundary equals to maximum function alignment. */ #define ALIGN_FUNCTION() . = ALIGN(8) -@@ -473,14 +483,14 @@ +@@ -474,14 +484,14 @@ /* Kernel symbol table: Normal symbols */ \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __start___ksymtab = .; \ @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau __stop___ksymtab_gpl = .; \ } \ \ -@@ -542,7 +552,7 @@ +@@ -543,7 +553,7 @@ \ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ From 511d02a758b32cbd92f03c6dff16a193d2ff214e Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 16 Nov 2022 09:44:09 +0100 Subject: [PATCH 37/42] tools/xz: update to 5.2.8 Update to latest release. Signed-off-by: Nick Hainke --- tools/xz/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/xz/Makefile b/tools/xz/Makefile index 845fefe9af..37a9d79efc 100644 --- a/tools/xz/Makefile +++ b/tools/xz/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xz -PKG_VERSION:=5.2.7 +PKG_VERSION:=5.2.8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/lzmautils \ http://tukaani.org/xz -PKG_HASH:=b65f1d0c2708e57716f4dd2216989a73847ac6fdb4168ffceb155767e22b834b +PKG_HASH:=1f8a43d9fcf325d049a31fe4514dc8c44a6d00ce8860d48c4212d1e349d2a3ed PKG_CPE_ID:=cpe:/a:tukaani:xz HOST_BUILD_PARALLEL:=1 From 941132cb3c6777e007a33eb47fa4517b4796b7ce Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sat, 15 Oct 2022 15:36:00 +0200 Subject: [PATCH 38/42] mpc85xx: fix missing kernel config symbol While compiling OpenWrt master for Turris 1.x routers (p2020), it reported following error: Gianfar Ethernet (GIANFAR) [Y/n/m/?] y Freescale DPAA2 Ethernet Switch (FSL_DPAA2_SWITCH) [N/m/y/?] (NEW) Error in reading or end of file. Let's fix it by disabling it. Signed-off-by: Josef Schlehofer --- target/linux/mpc85xx/config-5.15 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/mpc85xx/config-5.15 b/target/linux/mpc85xx/config-5.15 index 4f27d3bd70..8734038d33 100644 --- a/target/linux/mpc85xx/config-5.15 +++ b/target/linux/mpc85xx/config-5.15 @@ -71,6 +71,7 @@ CONFIG_ENABLE_MUST_CHECK=y CONFIG_ETHERNET_PACKET_MANGLE=y CONFIG_FIXED_PHY=y CONFIG_FSL_BOOKE=y +# CONFIG_FSL_DPAA2_SWITCH is not set CONFIG_FSL_EMB_PERFMON=y # CONFIG_FSL_FMAN is not set CONFIG_FSL_LBC=y From c0fb12c42e1731b0bd397df3a57d053e32eb4cf9 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Tue, 15 Nov 2022 19:20:30 +0100 Subject: [PATCH 39/42] treewide: uniform vendor name for ASUS Their own website (https://www.asus.com) always uses the upper case style name. Signed-off-by: Moritz Warning --- target/linux/bcm4908/image/Makefile | 4 ++-- target/linux/ramips/image/mt7620.mk | 10 +++++----- target/linux/ramips/image/mt76x8.mk | 12 ++++++------ target/linux/ramips/image/rt288x.mk | 2 +- target/linux/ramips/image/rt305x.mk | 10 +++++----- target/linux/ramips/image/rt3883.mk | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile index 8e751a8d02..658ec810d1 100644 --- a/target/linux/bcm4908/image/Makefile +++ b/target/linux/bcm4908/image/Makefile @@ -75,7 +75,7 @@ define Device/Default endef define Device/asus_gt-ac5300 - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := GT-AC5300 DEVICE_DTS := broadcom/bcmbca/bcm4908-asus-gt-ac5300 IMAGES := bin @@ -88,7 +88,7 @@ endef TARGET_DEVICES += asus_gt-ac5300 define Device/asus_gt-ax6000 - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := GT-AX6000 DEVICE_DTS := broadcom/bcmbca/bcm4912-asus-gt-ax6000 IMAGES := pkgtb diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 6c22dfbbdd..7fff06665e 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -91,7 +91,7 @@ TARGET_DEVICES += ampedwireless_b1200ex define Device/asus_rp-n53 SOC := mt7620a IMAGE_SIZE := 7872k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RP-N53 DEVICE_PACKAGES := kmod-rt2800-pci SUPPORTED_DEVICES += rp-n53 @@ -101,7 +101,7 @@ TARGET_DEVICES += asus_rp-n53 define Device/asus_rt-ac51u SOC := mt7620a IMAGE_SIZE := 16064k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-AC51U DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci \ kmod-usb-ledtrig-usbport @@ -112,7 +112,7 @@ TARGET_DEVICES += asus_rt-ac51u define Device/asus_rt-ac54u SOC := mt7620a IMAGE_SIZE := 16064k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-AC54U DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci \ kmod-usb-ledtrig-usbport @@ -122,7 +122,7 @@ TARGET_DEVICES += asus_rt-ac54u define Device/asus_rt-n12p SOC := mt7620n IMAGE_SIZE := 16064k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N11P/RT-N12+/RT-N12Eb1 SUPPORTED_DEVICES += rt-n12p endef @@ -131,7 +131,7 @@ TARGET_DEVICES += asus_rt-n12p define Device/asus_rt-n14u SOC := mt7620n IMAGE_SIZE := 16064k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N14u DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci SUPPORTED_DEVICES += rt-n14u diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 100d5d9c6c..5e8d05b042 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -40,9 +40,9 @@ TARGET_DEVICES += alfa-network_awusfree1 define Device/asus_rt-ac1200 IMAGE_SIZE := 16064k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-AC1200 - DEVICE_ALT0_VENDOR := Asus + DEVICE_ALT0_VENDOR := ASUS DEVICE_ALT0_MODEL := RT-N600 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci \ kmod-usb-ledtrig-usbport @@ -52,7 +52,7 @@ TARGET_DEVICES += asus_rt-ac1200 define Device/asus_rt-ac1200-v2 BLOCKSIZE := 64k IMAGE_SIZE := 16064k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-AC1200 DEVICE_VARIANT := V2 IMAGES += factory.bin @@ -64,7 +64,7 @@ TARGET_DEVICES += asus_rt-ac1200-v2 define Device/asus_rt-n10p-v3 IMAGE_SIZE := 7872k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N10P DEVICE_VARIANT := V3 endef @@ -72,7 +72,7 @@ TARGET_DEVICES += asus_rt-n10p-v3 define Device/asus_rt-n11p-b1 IMAGE_SIZE := 7872k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N11P DEVICE_VARIANT := B1 DEVICE_ALT0_VENDOR := ASUS @@ -86,7 +86,7 @@ TARGET_DEVICES += asus_rt-n11p-b1 define Device/asus_rt-n12-vp-b1 IMAGE_SIZE := 7872k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N12 VP DEVICE_VARIANT := B1 endef diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk index eff5a22030..5e69e291d2 100644 --- a/target/linux/ramips/image/rt288x.mk +++ b/target/linux/ramips/image/rt288x.mk @@ -40,7 +40,7 @@ TARGET_DEVICES += airlink101_ar725w define Device/asus_rt-n15 BLOCKSIZE := 64k IMAGE_SIZE := 3776k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N15 DEVICE_PACKAGES := kmod-switch-rtl8366s SUPPORTED_DEVICES += rt-n15 diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index 6b8dada3c9..e6536da3f3 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -209,7 +209,7 @@ define Device/asus_rt-g32-b1 SOC := rt3050 BLOCKSIZE := 4k IMAGE_SIZE := 3776k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-G32 DEVICE_VARIANT := B1 SUPPORTED_DEVICES += rt-g32-b1 @@ -221,7 +221,7 @@ define Device/asus_rt-n10-plus SOC := rt3050 BLOCKSIZE := 64k IMAGE_SIZE := 3776k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N10+ SUPPORTED_DEVICES += rt-n10-plus DEFAULT := n @@ -231,7 +231,7 @@ TARGET_DEVICES += asus_rt-n10-plus define Device/asus_rt-n13u SOC := rt3052 IMAGE_SIZE := 7872k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N13U DEVICE_PACKAGES := kmod-leds-gpio kmod-rt2800-pci kmod-usb-dwc2 SUPPORTED_DEVICES += rt-n13u @@ -242,7 +242,7 @@ define Device/asus_wl-330n SOC := rt3050 BLOCKSIZE := 4k IMAGE_SIZE := 3776k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := WL-330N SUPPORTED_DEVICES += wl-330n DEFAULT := n @@ -253,7 +253,7 @@ define Device/asus_wl-330n3g SOC := rt3050 BLOCKSIZE := 4k IMAGE_SIZE := 3776k - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := WL-330N3G DEVICE_PACKAGES := SUPPORTED_DEVICES += wl-330n3g diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk index 8bdcdccd36..3335dbc810 100644 --- a/target/linux/ramips/image/rt3883.mk +++ b/target/linux/ramips/image/rt3883.mk @@ -10,7 +10,7 @@ define Device/asus_rt-n56u BLOCKSIZE := 64k IMAGE_SIZE := 7872k IMAGE/sysupgrade.bin += | mkrtn56uimg -s - DEVICE_VENDOR := Asus + DEVICE_VENDOR := ASUS DEVICE_MODEL := RT-N56U DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 SUPPORTED_DEVICES += rt-n56u From 4c67d1e06657c64aee271c3d2ae061d66e2c2fdc Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 15 Nov 2022 21:23:06 +0000 Subject: [PATCH 40/42] uboot-mediatek: optimize MMC erase Fix mmc_write_vol hush script used by many boards to avoid timeouts on slow SD cards: Instead of erasing a complete partition, only erase blocks for the to-be-written image when writing to MMC. Signed-off-by: Daniel Golle --- .../uboot-mediatek/patches/400-update-bpir2-defconfig.patch | 2 +- .../uboot-mediatek/patches/401-update-u7623-defconfig.patch | 2 +- .../patches/404-add-bananapi_bpi-r64_defconfigs.patch | 4 ++-- package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch b/package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch index a6b8865854..599c882c0b 100644 --- a/package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch +++ b/package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch @@ -198,7 +198,7 @@ +emmc_read_recovery=mmc dev 0 0 ; part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol +mmc_write_production=if test "$bootedfrom" = "SD" ; then run sdmmc_write_production ; else run emmc_write_production ; fi +mmc_write_recovery=if test "$bootedfrom" = "SD" ; run sdmmc_write_recovery ; else run emmc_write_recovery ; fi -+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$part_size && mmc write $loadaddr 0x$part_addr 0x$image_size ++mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size +mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200 +reset_factory=eraseenv && reset +sdmmc_read_emmc_hdr=mmc dev 1 && mmc read $loadaddr 0x1ff8 0x8 diff --git a/package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch b/package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch index 38d4a01894..ff2c3af41f 100644 --- a/package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch +++ b/package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch @@ -196,7 +196,7 @@ +emmc_write_recovery=mmc dev 0 0 ; iminfo $loadaddr && part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol +emmc_read_production=mmc dev 0 0 ; part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol +emmc_read_recovery=mmc dev 0 0 ; part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol -+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$part_size && mmc write $loadaddr 0x$part_addr 0x$image_size ++mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size +mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200 +reset_factory=eraseenv && reset +_init_env=setenv _init_env ; saveenv ; saveenv diff --git a/package/boot/uboot-mediatek/patches/404-add-bananapi_bpi-r64_defconfigs.patch b/package/boot/uboot-mediatek/patches/404-add-bananapi_bpi-r64_defconfigs.patch index de37764b68..5bb444a18e 100644 --- a/package/boot/uboot-mediatek/patches/404-add-bananapi_bpi-r64_defconfigs.patch +++ b/package/boot/uboot-mediatek/patches/404-add-bananapi_bpi-r64_defconfigs.patch @@ -214,7 +214,7 @@ +emmc_write_hdr=mmc dev 0 0 && mmc erase 0x0 0x40 && mmc write $loadaddr 0x0 0x40 +emmc_write_production=mmc dev 0 && part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol +emmc_write_recovery=mmc dev 0 && part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol -+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$part_size && mmc write $loadaddr 0x$part_addr 0x$image_size ++mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size +mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200 +part_default=production +part_recovery=recovery @@ -444,7 +444,7 @@ +emmc_write_fip=mmc dev 0 0 && mmc erase 0x1000 0x1000 && mmc write $loadaddr 0x1000 0x1000 && mmc erase 0x2000 0x800 +emmc_read_production=mmc dev 0 && part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol +emmc_read_recovery=mmc dev 0 && part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol -+mmc_write_vol=imszb $fileaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$part_size && mmc write $fileaddr 0x$part_addr 0x$image_size ++mmc_write_vol=imszb $fileaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $fileaddr 0x$part_addr 0x$image_size +mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size +part_default=production +part_recovery=recovery diff --git a/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch b/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch index fded107a63..ed873c083d 100644 --- a/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch +++ b/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch @@ -1139,7 +1139,7 @@ +boot_tftp_production=run boot_update_conf ; tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run sdmmc_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi +boot_tftp_recovery=run boot_update_conf ; tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run sdmmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi +boot_tftp=run boot_update_conf ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf -+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$part_size && mmc write $loadaddr 0x$part_addr 0x$image_size ++mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size +mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200 +part_default=production +part_recovery=recovery @@ -1294,7 +1294,7 @@ +ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data +ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic 2 && ubi write $loadaddr fit $filesize +ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic 3 && ubi write $loadaddr recovery $filesize -+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$part_size && mmc write $loadaddr 0x$part_addr 0x$image_size ++mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size +emmc_init=mmc dev 0 && mmc bootbus 0 0 0 0 && run emmc_init_bl && run emmc_init_openwrt ; env default bootcmd ; saveenv ; saveenv +emmc_init_bl=run ubi_read_emmc_install && setenv fileaddr $loadaddr && run emmc_write_bl2 && setexpr fileaddr $loadaddr + 0x100000 && run emmc_write_fip && setexpr fileaddr $loadaddr + 0x500000 && run emmc_write_hdr +emmc_init_openwrt=run ubi_read_recovery && iminfo $loadaddr && run emmc_write_recovery ; run ubi_read_production && iminfo $loadaddr && run emmc_write_production @@ -1351,7 +1351,7 @@ +boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2 +boot_tftp=run boot_update_conf ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf +boot_update_conf=if nand info ; then setenv bootconf config-mt7986a-bananapi-bpi-r3-emmc-snand ; else setenv bootconf config-mt7986a-bananapi-bpi-r3-emmc-nor ; fi -+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$part_size && mmc write $loadaddr 0x$part_addr 0x$image_size ++mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size +mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200 +part_default=production +part_recovery=recovery From 0db537975d4e708d0496037055cb8321a4a4fcd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 17 Nov 2022 12:27:41 +0100 Subject: [PATCH 41/42] cypress-firmware: fix cyfmac4356-pcie symbolic links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The symbolic link introduced in 22e9d8bc896b is wrong. Fixes: 22e9d8bc896b ("cypress-firmware: use symlink to provide firmware in brcm") Signed-off-by: Álvaro Fernández Rojas --- package/firmware/cypress-firmware/Makefile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/package/firmware/cypress-firmware/Makefile b/package/firmware/cypress-firmware/Makefile index 2cd3da9822..a3768bc43b 100644 --- a/package/firmware/cypress-firmware/Makefile +++ b/package/firmware/cypress-firmware/Makefile @@ -1,15 +1,10 @@ -# -# Copyright (C) 2019-2020 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# +# SPDX-License-Identifier: GPL-2.0-or-later include $(TOPDIR)/rules.mk PKG_NAME:=cypress-firmware PKG_VERSION:=5.4.18-2021_0812 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/Infineon/ifx-linux-firmware/ @@ -212,10 +207,10 @@ define Package/cypress-firmware-4356-pcie/install $(1)/lib/firmware/cypress/ $(INSTALL_DIR) $(1)/lib/firmware/brcm $(LN) \ - ../firmware/cyfmac4356-pcie.bin \ + ../cypress/cyfmac4356-pcie.bin \ $(1)/lib/firmware/brcm/brcmfmac4356-pcie.bin $(LN) \ - ../firmware/cyfmac4356-pcie.clm_blob \ + ../cypress/cyfmac4356-pcie.clm_blob \ $(1)/lib/firmware/brcm/brcmfmac4356-pcie.clm_blob endef From 1996d600bd4693279929fe9d1914c2fe4d2dd9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 17 Nov 2022 11:31:59 +0100 Subject: [PATCH 42/42] cypress-firmware: update to v5.10.9-2022_0909 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following firmwares have been updated: - cyfmac43012-sdio (v13.10.271.266 -> v13.10.271.289) - cyfmac43430-sdio (v7.45.98.118 -> v7.45.98.125) - cyfmac43455-sdio (v7.45.234 -> v7.45.250) - cyfmac4354-sdio (v7.35.349.104 -> v7.35.349.117) - cyfmac4356-pcie (v7.35.180.208 -> v7.35.180.212) - cyfmac4356-sdio (v7.35.349.104 -> v7.35.349.115) - cyfmac4373-sdio (v13.10.246.253 -> v13.10.246.289) - cyfmac4373-usb (v13.10.246.253 -> v13.10.246.289) - cyfmac54591-pcie (v13.35.225 -> v13.35.284) The following firmwares have been added: - cyfmac43439-sdio (v7.95.55) - cyfmac4373-pcie (v13.35.205.66) - cyfmac54591-sdio (v13.35.284) - cyfmac55560-pcie (v18.53.53.4) - cyfmac55572-pcie (v18.53.117.2) - cyfmac55572-sdio (v18.53.117.2) More info: https://github.com/Infineon/ifx-linux-firmware/compare/release-v5.4.18-2021_0812...release-v5.10.9-2022_0909 Signed-off-by: Álvaro Fernández Rojas --- package/firmware/cypress-firmware/Makefile | 150 ++++++++++++++++++++- 1 file changed, 147 insertions(+), 3 deletions(-) diff --git a/package/firmware/cypress-firmware/Makefile b/package/firmware/cypress-firmware/Makefile index a3768bc43b..6a14ff9938 100644 --- a/package/firmware/cypress-firmware/Makefile +++ b/package/firmware/cypress-firmware/Makefile @@ -3,12 +3,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cypress-firmware -PKG_VERSION:=5.4.18-2021_0812 -PKG_RELEASE:=4 +PKG_VERSION:=5.10.9-2022_0909 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/Infineon/ifx-linux-firmware/ -PKG_MIRROR_HASH:=ac882b482dd401b53cdecc6004cd2bd3d65e888c19206dcf10931a28033ada4d +PKG_MIRROR_HASH:=944faae3a80013f1a963b6692d7f50a38c97edcf91fd163de521df755e6922b5 PKG_SOURCE_VERSION:=release-v$(PKG_VERSION) PKG_MAINTAINER:=Álvaro Fernández Rojas @@ -139,6 +139,31 @@ endef $(eval $(call BuildPackage,cypress-firmware-43430-sdio)) +# Cypress 43439 SDIO Firmware +define Package/cypress-firmware-43439-sdio + $(Package/cypress-firmware-default) + TITLE:=CYW43439 FullMac SDIO firmware +endef + +define Package/cypress-firmware-43439-sdio/install + $(INSTALL_DIR) $(1)/lib/firmware/cypress + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac43439-sdio.bin \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac43439-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac43439-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac43439-sdio.bin + $(LN) \ + ../cypress/cyfmac43439-sdio.clm_blob \ + $(1)/lib/firmware/brcm/brcmfmac43439-sdio.clm_blob +endef + +$(eval $(call BuildPackage,cypress-firmware-43439-sdio)) + # Cypress 43455 SDIO Firmware define Package/cypress-firmware-43455-sdio $(Package/cypress-firmware-default) @@ -266,6 +291,31 @@ endef $(eval $(call BuildPackage,cypress-firmware-43570-pcie)) +# Cypress 4373 PCIe Firmware +define Package/cypress-firmware-4373-pcie + $(Package/cypress-firmware-default) + TITLE:=CYW4373 FullMac PCIe firmware +endef + +define Package/cypress-firmware-4373-pcie/install + $(INSTALL_DIR) $(1)/lib/firmware/cypress + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac4373-pcie.bin \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac4373-pcie.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac4373-pcie.bin \ + $(1)/lib/firmware/brcm/brcmfmac4373-pcie.bin + $(LN) \ + ../cypress/cyfmac4373-pcie.clm_blob \ + $(1)/lib/firmware/brcm/brcmfmac4373-pcie.clm_blob +endef + +$(eval $(call BuildPackage,cypress-firmware-4373-pcie)) + # Cypress 4373 SDIO Firmware define Package/cypress-firmware-4373-sdio $(Package/cypress-firmware-default) @@ -340,3 +390,97 @@ define Package/cypress-firmware-54591-pcie/install endef $(eval $(call BuildPackage,cypress-firmware-54591-pcie)) + +# Cypress 54591 SDIO Firmware +define Package/cypress-firmware-54591-sdio + $(Package/cypress-firmware-default) + TITLE:=CYW54591 FullMac SDIO firmware +endef + +define Package/cypress-firmware-54591-sdio/install + $(INSTALL_DIR) $(1)/lib/firmware/cypress + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac54591-sdio.bin \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac54591-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac54591-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac54591-sdio.bin + $(LN) \ + ../cypress/cyfmac54591-sdio.clm_blob \ + $(1)/lib/firmware/brcm/brcmfmac54591-sdio.clm_blob +endef + +$(eval $(call BuildPackage,cypress-firmware-54591-sdio)) + +# Cypress 55560 PCIe Firmware +define Package/cypress-firmware-55560-pcie + $(Package/cypress-firmware-default) + TITLE:=CYW55560 FullMac PCIe firmware +endef + +define Package/cypress-firmware-55560-pcie/install + $(INSTALL_DIR) $(1)/lib/firmware/cypress + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac55560-pcie.trxse \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac55560-pcie.trxse \ + $(1)/lib/firmware/brcm/brcmfmac55560-pcie.trxse +endef + +$(eval $(call BuildPackage,cypress-firmware-55560-pcie)) + +# Cypress 55572 PCIe Firmware +define Package/cypress-firmware-55572-pcie + $(Package/cypress-firmware-default) + TITLE:=CYW55572 FullMac PCIe firmware +endef + +define Package/cypress-firmware-55572-pcie/install + $(INSTALL_DIR) $(1)/lib/firmware/cypress + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac55572-pcie.trxse \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac55572-pcie.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac55572-pcie.trxse \ + $(1)/lib/firmware/brcm/brcmfmac55572-pcie.trxse + $(LN) \ + ../cypress/cyfmac55572-pcie.clm_blob \ + $(1)/lib/firmware/brcm/brcmfmac55572-pcie.clm_blob +endef + +$(eval $(call BuildPackage,cypress-firmware-55572-pcie)) + +# Cypress 55572 SDIO Firmware +define Package/cypress-firmware-55572-sdio + $(Package/cypress-firmware-default) + TITLE:=CYW55572 FullMac SDIO firmware +endef + +define Package/cypress-firmware-55572-sdio/install + $(INSTALL_DIR) $(1)/lib/firmware/cypress + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac55572-sdio.trxse \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/firmware/cyfmac55572-sdio.clm_blob \ + $(1)/lib/firmware/cypress/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../cypress/cyfmac55572-sdio.trxse \ + $(1)/lib/firmware/brcm/brcmfmac55572-sdio.trxse + $(LN) \ + ../cypress/cyfmac55572-sdio.clm_blob \ + $(1)/lib/firmware/brcm/brcmfmac55572-sdio.clm_blob +endef + +$(eval $(call BuildPackage,cypress-firmware-55572-sdio))