From e8a2fd241d270097b938cae4d11c7d2fd43561d8 Mon Sep 17 00:00:00 2001 From: Dirk Buchwalder Date: Mon, 4 Mar 2024 21:33:32 +0100 Subject: [PATCH 01/10] ipq-wifi: update to version 2024-03-04 The new version adds support for the Netgear WAX214. Signed-off-by: Dirk Buchwalder --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 0da6b58b2c..959e7e4b10 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2024-02-25 -PKG_SOURCE_VERSION:=fc30aeeb8ec5d069710a446f4eb5e30fc26145c1 -PKG_MIRROR_HASH:=7fe83e3f36541444e0385a56fa8a048772d0531e16787cc10bce29775c7db235 +PKG_SOURCE_DATE:=2024-03-04 +PKG_SOURCE_VERSION:=38c02ae4302f9cb73f6914574239fe84799caa84 +PKG_MIRROR_HASH:=0f6a2dea8466ea0e8df3262bff643d60b1725f2218589c41d9f87fb37843c362 PKG_FLAGS:=nonshared From 93610492b634c94e882dc048fde23d67a056ea1a Mon Sep 17 00:00:00 2001 From: Dirk Buchwalder Date: Sun, 3 Mar 2024 16:00:46 +0100 Subject: [PATCH 02/10] qualcommax: ipq60xx: add support for netgear wax214 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Netgear WAX214 is a 802.11 ax dual-band AP with PoE. (similar to Engenius EWS357APV3) Specifications: • CPU: Qualcomm IPQ6010 Quad core Cortex-A53 • RAM: 512MB of DDR3 • Storage: 128MB NAND (Macronix MX30UF1G18AC) • Ethernet: 1x 1G RJ45 port (QCA8072) PoE • WIFI: 2.4GHz: Qualcomm QCN5022 2x2 802.11b/g/n/ax 574 Mbps PHY rate 5GHz: Qualcomm QCN5052 2x2 802.11a/b/g/n/ac/ax 1201 PHY rate • LEDs: 4 x GPIO-controlled LEDs - 1 Power LED (orange) - 1 LAN LED (blue) - 1 WIFI 5g LED (blue) - 1 WIFI 2g LED (blue) black_small_square Buttons: 1x soft reset black_small_square Power: 12V DC jack or PoE (802.3af ) An populated serial header is onboard, format is 1.25mm 4p (DF13A-4P-1.25H) RX/TX is working, bootwait is active, secure boot is not enabled. The root password of the stock firmware is unknown, but failsafe mode can be entered to reset the password. Installation Instructions: - obtain serial access - stop auto boot (press "4", Entr boot command line interface) - setenv active_fw 0 (to boot from the primary rootfs, or set to 1 to boot from the secondary rootfs partition) - saveenv - tftpboot the initramfs image - bootm - copy openwrt-qualcommax-ipq60xx-netgear_wax214-squashfs-factory.ubi to the device - write the image to the NAND: - cat /proc/mtd and look for rootfs partition (should be mtd11, or mtd12 if you choose active_fw 1) - ubiformat /dev/mtd11 -f -y openwrt-qualcommax-ipq60xx-netgear_wax214-squashfs-factory.ubi - reboot Note: the firmware is senao-based. But I was unable to build a valid senao-header into the image. Maybe they changed the header format and senaoFW isn't working any more. Signed-off-by: Dirk Buchwalder --- .../uboot-envtools/files/qualcommax_ipq60xx | 5 + package/firmware/ipq-wifi/Makefile | 2 + .../arm64/boot/dts/qcom/ipq6010-wax214.dts | 172 ++++++++++++++++++ target/linux/qualcommax/image/ipq60xx.mk | 13 ++ .../ipq60xx/base-files/etc/board.d/02_network | 3 + .../etc/hotplug.d/firmware/11-ath11-caldata | 3 + .../base-files/lib/upgrade/platform.sh | 3 + 7 files changed, 201 insertions(+) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6010-wax214.dts diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq60xx b/package/boot/uboot-envtools/files/qualcommax_ipq60xx index df19a30335..33cb94f99d 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq60xx +++ b/package/boot/uboot-envtools/files/qualcommax_ipq60xx @@ -14,6 +14,11 @@ case "$board" in [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" ;; +netgear,wax214) + idx="$(find_mtd_index 0:appsblenv)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2" + ;; esac config_load ubootenv diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 959e7e4b10..b6c1a34bde 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -40,6 +40,7 @@ ALLWIFIBOARDS:= \ linksys_mx5300 \ netgear_lbr20 \ netgear_rax120v2 \ + netgear_wax214 \ netgear_wax218 \ netgear_wax620 \ netgear_wax630 \ @@ -157,6 +158,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200)) $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300)) $(eval $(call generate-ipq-wifi-package,netgear_lbr20,Netgear LBR20)) $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2)) +$(eval $(call generate-ipq-wifi-package,netgear_wax214,Netgear WAX214)) $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218)) $(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620)) $(eval $(call generate-ipq-wifi-package,netgear_wax630,Netgear WAX630)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6010-wax214.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6010-wax214.dts new file mode 100644 index 0000000000..90a4828c17 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6010-wax214.dts @@ -0,0 +1,172 @@ +// SPDX-License-Identifier: (GPL-2.0+) + +/dts-v1/; + +#include "ipq6018.dtsi" +#include "ipq6018-cp-cpu.dtsi" +#include "ipq6018-ess.dtsi" +#include +#include +#include + +/ { + model = "Netgear WAX214"; + compatible = "netgear,wax214", "qcom,ipq6018"; + + aliases { + serial0 = &blsp1_uart3; + ethernet0 = &dp3; + label-mac-device = &dp3; + led-boot = &pwr; + led-failsafe = &pwr; + led-running = &pwr; + led-upgrade = &pwr; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + pwr: pwr { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; + }; + + lan { + color = ; + function = LED_FUNCTION_LAN; + gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; + }; + + wlan2g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <0>; + gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0radio"; + }; + + wlan5g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <1>; + gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1radio"; + }; + }; +}; + +&blsp1_uart3 { + pinctrl-0 = <&serial_3_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio64"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio65"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&dp3 { + status = "okay"; + + phy-handle = <&qca8072_4>; + label = "lan"; +}; + +&edma { + status = "okay"; +}; + +&mdio { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>; + reset-delay-us = <10000>; + reset-post-delay-us = <50000>; + + ethernet-phy-package@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "qcom,qca8075-package"; + reg = <0>; + + qcom,package-mode = "psgmii"; + + qca8072_4: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <4>; + }; + }; +}; + +&switch { + status = "okay"; + + switch_lan_bmp = ; + switch_mac_mode = ; + port3_pcs_channel = <4>; + + qcom,port_phyinfo { + port@3 { + port_id = <3>; + phy_address = <4>; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + + +&wifi { + status = "okay"; + qcom,ath11k-fw-memory-mode = <1>; + qcom,ath11k-calibration-variant = "Netgear-WAX214"; +}; \ No newline at end of file diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk index 00dead93ad..a7851e3dc5 100644 --- a/target/linux/qualcommax/image/ipq60xx.mk +++ b/target/linux/qualcommax/image/ipq60xx.mk @@ -10,3 +10,16 @@ define Device/8devices_mango-dvk DEVICE_PACKAGES := ipq-wifi-8devices_mango endef TARGET_DEVICES += 8devices_mango-dvk + +define Device/netgear_wax214 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Netgear + DEVICE_MODEL := WAX214 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@cp03-c1 + SOC := ipq6010 + DEVICE_PACKAGES := ipq-wifi-netgear_wax214 +endef +TARGET_DEVICES += netgear_wax214 diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network index 081d894e1e..aaa2522c92 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network @@ -14,6 +14,9 @@ ipq60xx_setup_interfaces() 8devices,mango-dvk) ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ;; + netgear,wax214) + ucidef_set_interfaces_lan_wan "lan" + ;; *) echo "Unsupported hardware. Network interfaces not initialized" ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata index c14722c799..89d4c265ab 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata @@ -12,6 +12,9 @@ case "$FIRMWARE" in 8devices,mango-dvk) caldata_extract "0:ART" 0x1000 0x20000 ;; + netgear,wax214) + caldata_extract "0:art" 0x1000 0x10000 + ;; esac ;; *) diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh index 3d3c17b3b9..4008cb0224 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh @@ -10,6 +10,9 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in + netgear,wax214) + nand_do_upgrade "$1" + ;; *) default_do_upgrade "$1" ;; From 4efbfcd996abd351547203cf5d51d53564ada5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 4 Mar 2024 15:18:13 +0100 Subject: [PATCH 03/10] base-files: sysupgrade: handle errors when generating backup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Return error if any step of generating tar file fails 2. Use pipefail to avoid calling "gzip" if tar failed Fixes: e36cc530927c ("base-files: sysupgrade: use tar helper to include installed_packages.txt") Reported-by: Luiz Angelo Daros de Luca Cc: Luiz Angelo Daros de Luca Cc: Jo-Philipp Wich Signed-off-by: Rafał Miłecki --- package/base-files/files/sbin/sysupgrade | 47 +++++++++++++++--------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index ed8871b892..9b422107d8 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -237,6 +237,7 @@ include /lib/upgrade create_backup_archive() { local conf_tar="$1" local disabled + local err [ "$(rootfs_type)" = "tmpfs" ] && { echo "Cannot save config while running from ramdisk." >&2 @@ -251,31 +252,43 @@ create_backup_archive() { v "Saving config files..." [ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V="" sed -i -e 's,^/,,' "$CONFFILES" + set -o pipefail { - for service in /etc/init.d/*; do - if ! $service enabled; then + local ret=0 + + if [ $ret -eq 0 ]; then + for service in /etc/init.d/*; do + if ! $service enabled; then disabled="$disabled$service disable\n" - fi - done - disabled="$disabled\nexit 0" - tar_print_member "/etc/uci-defaults/10_disable_services" "$(echo -e $disabled)" + fi + done + disabled="$disabled\nexit 0" + tar_print_member "/etc/uci-defaults/10_disable_services" "$(echo -e $disabled)" || ret=1 + fi # Part of archive with installed packages info - if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then - # Format: pkg-name{rom,overlay,unknown} - # rom is used for pkgs in /rom, even if updated later - tar_print_member "$INSTALLED_PACKAGES" "$(find /usr/lib/opkg/info -name "*.control" \( \ - \( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \ - \( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \ - \( -exec echo {} unknown \; \) \ - \) | sed -e 's,.*/,,;s/\.control /\t/')" + if [ $ret -eq 0 ]; then + if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then + # Format: pkg-name{rom,overlay,unknown} + # rom is used for pkgs in /rom, even if updated later + tar_print_member "$INSTALLED_PACKAGES" "$(find /usr/lib/opkg/info -name "*.control" \( \ + \( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \ + \( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \ + \( -exec echo {} unknown \; \) \ + \) | sed -e 's,.*/,,;s/\.control /\t/')" || ret=1 + fi fi # Rest of archive with config files and ending padding - tar c${TAR_V} -C / -T "$CONFFILES" - } | gzip > "${conf_tar:-/proc/self/fd/1}" + if [ $ret -eq 0 ]; then + tar c${TAR_V} -C / -T "$CONFFILES" || ret=1 + fi + + [ $ret -eq 0 ] + } | gzip > "${conf_tar:-/proc/self/fd/1}" + err=$? + set +o pipefail - local err=$? if [ "$err" -ne 0 ]; then echo "Failed to create the configuration backup." [ -f "$conf_tar" ] && rm -f "$conf_tar" From 3e6f64d443f476a6e936de4f36f22db51fc1340f Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Tue, 5 Mar 2024 20:15:55 +0100 Subject: [PATCH 04/10] kernel: crypto: package SHA3 SHA3 is now required by jitterentropy_rng in kernel 6.6, so lets start preparing by packaging SHA3 support as its supported in 5.15 and 6.1 kernels as well. AFAIK, only ARMv8.2 has a crypto extension for SHA3, however I am not aware of any SoC we support that uses ARMv8.2 ISA so its not enabled currently. Signed-off-by: Robert Marko --- package/kernel/linux/modules/crypto.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index dd17d868fa..84c4668b97 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -958,6 +958,18 @@ endif $(eval $(call KernelPackage,crypto-sha1)) +define KernelPackage/crypto-sha3 + TITLE:=SHA3 digest CryptoAPI module + DEPENDS:=+kmod-crypto-hash + KCONFIG:= CONFIG_CRYPTO_SHA3 + FILES:=$(LINUX_DIR)/crypto/sha3_generic.ko + AUTOLOAD:=$(call AutoLoad,09,sha3_generic) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-sha3)) + + define KernelPackage/crypto-sha256 TITLE:=SHA224 SHA256 digest CryptoAPI module DEPENDS:=+kmod-crypto-hash From fdb563c1a55ea15c6dcd3da75315297db8010e6b Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 29 Feb 2024 22:18:20 +0100 Subject: [PATCH 05/10] kernel: qca-ssdk: refresh PCS patch Recently added PCS patch requires a refresh, so lets do it. Signed-off-by: Robert Marko --- ...-selecting-PCS-channel-for-PORT3-on-.patch | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/package/kernel/qca-ssdk/patches/102-qca-ssdk-support-selecting-PCS-channel-for-PORT3-on-.patch b/package/kernel/qca-ssdk/patches/102-qca-ssdk-support-selecting-PCS-channel-for-PORT3-on-.patch index a8863bf463..5e390d8ee3 100644 --- a/package/kernel/qca-ssdk/patches/102-qca-ssdk-support-selecting-PCS-channel-for-PORT3-on-.patch +++ b/package/kernel/qca-ssdk/patches/102-qca-ssdk-support-selecting-PCS-channel-for-PORT3-on-.patch @@ -22,8 +22,6 @@ Signed-off-by: Mantas Pucka src/init/ssdk_dts.c | 27 +++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 8 deletions(-) -diff --git a/include/init/ssdk_dts.h b/include/init/ssdk_dts.h -index 00fa4c1..210c788 100755 --- a/include/init/ssdk_dts.h +++ b/include/init/ssdk_dts.h @@ -101,6 +101,7 @@ typedef struct @@ -34,7 +32,7 @@ index 00fa4c1..210c788 100755 } ssdk_dt_cfg; #define SSDK_MAX_NR_ETH 6 -@@ -163,6 +164,7 @@ a_uint32_t ssdk_device_id_get(a_uint32_t index); +@@ -162,6 +163,7 @@ a_uint32_t ssdk_device_id_get(a_uint32_t struct device_node *ssdk_dts_node_get(a_uint32_t dev_id); struct clk *ssdk_dts_essclk_get(a_uint32_t dev_id); struct clk *ssdk_dts_cmnclk_get(a_uint32_t dev_id); @@ -42,8 +40,6 @@ index 00fa4c1..210c788 100755 int ssdk_switch_device_num_init(void); void ssdk_switch_device_num_exit(void); -diff --git a/src/adpt/cppe/adpt_cppe_portctrl.c b/src/adpt/cppe/adpt_cppe_portctrl.c -index 00d0404..6b32f79 100755 --- a/src/adpt/cppe/adpt_cppe_portctrl.c +++ b/src/adpt/cppe/adpt_cppe_portctrl.c @@ -33,6 +33,7 @@ @@ -54,7 +50,7 @@ index 00d0404..6b32f79 100755 #include "adpt.h" #include "adpt_hppe.h" #include "adpt_cppe_portctrl.h" -@@ -60,8 +61,7 @@ _adpt_cppe_port_mux_mac_set(a_uint32_t dev_id, fal_port_t port_id, +@@ -60,8 +61,7 @@ _adpt_cppe_port_mux_mac_set(a_uint32_t d case SSDK_PHYSICAL_PORT3: case SSDK_PHYSICAL_PORT4: if (mode0 == PORT_WRAPPER_PSGMII) { @@ -64,11 +60,9 @@ index 00d0404..6b32f79 100755 cppe_port_mux_ctrl.bf.port3_pcs_sel = CPPE_PORT3_PCS_SEL_PCS0_CHANNEL4; cppe_port_mux_ctrl.bf.port4_pcs_sel = -diff --git a/src/adpt/hppe/adpt_hppe_uniphy.c b/src/adpt/hppe/adpt_hppe_uniphy.c -index 5e36602..bad1eab 100644 --- a/src/adpt/hppe/adpt_hppe_uniphy.c +++ b/src/adpt/hppe/adpt_hppe_uniphy.c -@@ -1122,9 +1122,6 @@ __adpt_hppe_uniphy_psgmii_mode_set(a_uint32_t dev_id, a_uint32_t uniphy_index) +@@ -1122,9 +1122,6 @@ __adpt_hppe_uniphy_psgmii_mode_set(a_uin { a_uint32_t i; sw_error_t rv = SW_OK; @@ -78,7 +72,7 @@ index 5e36602..bad1eab 100644 union uniphy_mode_ctrl_u uniphy_mode_ctrl; -@@ -1134,9 +1131,7 @@ __adpt_hppe_uniphy_psgmii_mode_set(a_uint32_t dev_id, a_uint32_t uniphy_index) +@@ -1134,9 +1131,7 @@ __adpt_hppe_uniphy_psgmii_mode_set(a_uin SSDK_DEBUG("uniphy %d is psgmii mode\n", uniphy_index); #if defined(CPPE) if (adpt_ppe_type_get(dev_id) == CPPE_TYPE) { @@ -89,11 +83,9 @@ index 5e36602..bad1eab 100644 SSDK_INFO("cypress uniphy %d is qca8072 psgmii mode\n", uniphy_index); rv = __adpt_cppe_uniphy_mode_set(dev_id, uniphy_index, PORT_WRAPPER_PSGMII); -diff --git a/src/init/ssdk_dts.c b/src/init/ssdk_dts.c -index 686b6d2..70b0a09 100644 --- a/src/init/ssdk_dts.c +++ b/src/init/ssdk_dts.c -@@ -279,6 +279,13 @@ struct clk *ssdk_dts_cmnclk_get(a_uint32_t dev_id) +@@ -272,6 +272,13 @@ struct clk *ssdk_dts_cmnclk_get(a_uint32 return cfg->cmnblk_clk; } @@ -107,7 +99,7 @@ index 686b6d2..70b0a09 100644 #ifndef BOARD_AR71XX #if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) static void ssdk_dt_parse_mac_mode(a_uint32_t dev_id, -@@ -313,6 +320,25 @@ static void ssdk_dt_parse_mac_mode(a_uint32_t dev_id, +@@ -306,6 +313,25 @@ static void ssdk_dt_parse_mac_mode(a_uin return; } @@ -133,7 +125,7 @@ index 686b6d2..70b0a09 100644 #ifdef IN_UNIPHY static void ssdk_dt_parse_uniphy(a_uint32_t dev_id) { -@@ -1307,6 +1333,7 @@ sw_error_t ssdk_dt_parse(ssdk_init_cfg *cfg, a_uint32_t num, a_uint32_t *dev_id) +@@ -1292,6 +1318,7 @@ sw_error_t ssdk_dt_parse(ssdk_init_cfg * rv = ssdk_dt_parse_access_mode(switch_node, ssdk_dt_priv); SW_RTN_ON_ERROR(rv); ssdk_dt_parse_mac_mode(*dev_id, switch_node, cfg); @@ -141,6 +133,3 @@ index 686b6d2..70b0a09 100644 ssdk_dt_parse_mdio(*dev_id, switch_node, cfg); ssdk_dt_parse_port_bmp(*dev_id, switch_node, cfg); ssdk_dt_parse_interrupt(*dev_id, switch_node); --- -2.7.4 - From d40d64fc62f51a83b48a6c21b68d8a00e83c72c3 Mon Sep 17 00:00:00 2001 From: Weijie Gao Date: Sun, 7 Jan 2024 13:42:00 +0800 Subject: [PATCH 06/10] cryptodev-linux: update to 1.13 Update to 1.13 with upstream backports. Signed-off-by: Weijie Gao --- package/kernel/cryptodev-linux/Makefile | 4 +- ...ev_verbosity-fix-build-for-linux-6.4.patch | 41 +++++++++++++ ...01-zero-copy-fix-build-for-linux-6.4.patch | 34 +++++++++++ ...nux-version-ifdefs-from-v6.4-to-v6.5.patch | 60 +++++++++++++++++++ .../0004-fix-build-for-linux-6.7-rc1.patch | 35 +++++++++++ 5 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 package/kernel/cryptodev-linux/patches/0001-cryptodev_verbosity-fix-build-for-linux-6.4.patch create mode 100644 package/kernel/cryptodev-linux/patches/0001-zero-copy-fix-build-for-linux-6.4.patch create mode 100644 package/kernel/cryptodev-linux/patches/0003-move-recent-linux-version-ifdefs-from-v6.4-to-v6.5.patch create mode 100644 package/kernel/cryptodev-linux/patches/0004-fix-build-for-linux-6.7-rc1.patch diff --git a/package/kernel/cryptodev-linux/Makefile b/package/kernel/cryptodev-linux/Makefile index 0c1f63a605..0b794a3cd9 100644 --- a/package/kernel/cryptodev-linux/Makefile +++ b/package/kernel/cryptodev-linux/Makefile @@ -10,12 +10,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=cryptodev-linux -PKG_VERSION:=1.12 +PKG_VERSION:=1.13 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/$(PKG_NAME)-$(PKG_VERSION)? PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=f51c2254749233b1b1d7ec9445158bd709f124f88e1c650fe2faac83c3a81938 +PKG_HASH:=33b7915c46eb39a37110e88c681423c0dd0df25d784b6e1475ac3196367f0db5 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING diff --git a/package/kernel/cryptodev-linux/patches/0001-cryptodev_verbosity-fix-build-for-linux-6.4.patch b/package/kernel/cryptodev-linux/patches/0001-cryptodev_verbosity-fix-build-for-linux-6.4.patch new file mode 100644 index 0000000000..390faec9c2 --- /dev/null +++ b/package/kernel/cryptodev-linux/patches/0001-cryptodev_verbosity-fix-build-for-linux-6.4.patch @@ -0,0 +1,41 @@ +From 99ae2a39ddc3f89c66d9f09783b591c0f2dbf2e9 Mon Sep 17 00:00:00 2001 +From: Gaurav Jain +Date: Wed, 28 Jun 2023 12:44:32 +0530 +Subject: [PATCH] cryptodev_verbosity: Fix build for Linux 6.4 + +register_sysctl_table api is removed in kernel. +migrate to the new api register_sysctl. + +child is also removed in linux 6.4 ctl_table struct. + +Signed-off-by: Gaurav Jain +--- + ioctl.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/ioctl.c b/ioctl.c +index 8f241b86..4262bbd5 100644 +--- a/ioctl.c ++++ b/ioctl.c +@@ -1246,7 +1246,9 @@ static struct ctl_table verbosity_ctl_root[] = { + { + .procname = "ioctl", + .mode = 0555, ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) + .child = verbosity_ctl_dir, ++#endif + }, + {}, + }; +@@ -1267,7 +1269,11 @@ static int __init init_cryptodev(void) + return rc; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) + verbosity_sysctl_header = register_sysctl_table(verbosity_ctl_root); ++#else ++ verbosity_sysctl_header = register_sysctl(verbosity_ctl_root->procname, verbosity_ctl_dir); ++#endif + + pr_info(PFX "driver %s loaded.\n", VERSION); + diff --git a/package/kernel/cryptodev-linux/patches/0001-zero-copy-fix-build-for-linux-6.4.patch b/package/kernel/cryptodev-linux/patches/0001-zero-copy-fix-build-for-linux-6.4.patch new file mode 100644 index 0000000000..0b8147d56e --- /dev/null +++ b/package/kernel/cryptodev-linux/patches/0001-zero-copy-fix-build-for-linux-6.4.patch @@ -0,0 +1,34 @@ +From 592017c3a910a3905b1925aee88c4674e9a596b7 Mon Sep 17 00:00:00 2001 +From: Gaurav Jain +Date: Tue, 30 May 2023 17:09:42 +0530 +Subject: [PATCH] zero copy: Fix build for Linux 6.4 + +get_user_pages_remote api prototype is changed in kernel. +struct vm_area_struct **vmas argument is removed. +Migrate to the new API. + +Signed-off-by: Gaurav Jain +--- + zc.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/zc.c b/zc.c +index fdf7da17..6637945a 100644 +--- a/zc.c ++++ b/zc.c +@@ -80,10 +80,14 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write, + ret = get_user_pages_remote(task, mm, + (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, + pg, NULL, NULL); +-#else ++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) + ret = get_user_pages_remote(mm, + (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, + pg, NULL, NULL); ++#else ++ ret = get_user_pages_remote(mm, ++ (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, ++ pg, NULL); + #endif + #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) + up_read(&mm->mmap_sem); diff --git a/package/kernel/cryptodev-linux/patches/0003-move-recent-linux-version-ifdefs-from-v6.4-to-v6.5.patch b/package/kernel/cryptodev-linux/patches/0003-move-recent-linux-version-ifdefs-from-v6.4-to-v6.5.patch new file mode 100644 index 0000000000..baf5b805cd --- /dev/null +++ b/package/kernel/cryptodev-linux/patches/0003-move-recent-linux-version-ifdefs-from-v6.4-to-v6.5.patch @@ -0,0 +1,60 @@ +From bb8bc7cf60d2c0b097c8b3b0e807f805b577a53f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= +Date: Mon, 3 Jul 2023 00:46:02 +0000 +Subject: [PATCH] Move recent Linux version #ifdefs from v6.4 to v6.5 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The latest commits, meant to fix the build on Linux 6.4, are actually +fixing the build for API changes introduced in the merge window of the +yet-unreleased Linux 6.5, and actually break the build for Linux 6.4. + +In particular, the upstream commits introducing the API changes are the +following, which are *not* included in the Linux v6.4 tag: +* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=19c4e618a1bc3d0cad1f04c857be8076cb05bbb2 +* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca5e863233e8f6acd1792fd85d6bc2729a1b2c10 + +Change to #ifdef's to v6.5, where they will most likely be included. + +Signed-off-by: Joan Bruguera Micó +--- + ioctl.c | 4 ++-- + zc.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ioctl.c b/ioctl.c +index 4262bbd..e3eefe1 100644 +--- a/ioctl.c ++++ b/ioctl.c +@@ -1246,7 +1246,7 @@ static struct ctl_table verbosity_ctl_root[] = { + { + .procname = "ioctl", + .mode = 0555, +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) + .child = verbosity_ctl_dir, + #endif + }, +@@ -1269,7 +1269,7 @@ static int __init init_cryptodev(void) + return rc; + } + +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) + verbosity_sysctl_header = register_sysctl_table(verbosity_ctl_root); + #else + verbosity_sysctl_header = register_sysctl(verbosity_ctl_root->procname, verbosity_ctl_dir); +diff --git a/zc.c b/zc.c +index 6637945..00e00c1 100644 +--- a/zc.c ++++ b/zc.c +@@ -80,7 +80,7 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write, + ret = get_user_pages_remote(task, mm, + (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, + pg, NULL, NULL); +-#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) ++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) + ret = get_user_pages_remote(mm, + (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, + pg, NULL, NULL); diff --git a/package/kernel/cryptodev-linux/patches/0004-fix-build-for-linux-6.7-rc1.patch b/package/kernel/cryptodev-linux/patches/0004-fix-build-for-linux-6.7-rc1.patch new file mode 100644 index 0000000000..3ef9e28ce7 --- /dev/null +++ b/package/kernel/cryptodev-linux/patches/0004-fix-build-for-linux-6.7-rc1.patch @@ -0,0 +1,35 @@ +From 5e7121e45ff283d30097da381fd7e97c4bb61364 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= +Date: Sun, 10 Dec 2023 13:57:55 +0000 +Subject: [PATCH] Fix build for Linux 6.7-rc1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since Linux 6.7-rc1, no ahash algorithms set a nonzero alignmask, +and therefore `crypto_ahash_alignmask` has been removed. + +See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0f8660c82b79af595b056f6b9f4f227edeb88574 + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c626910f3f1bbce6ad18bc613d895d2a089ed95e + +Signed-off-by: Joan Bruguera Micó +--- + cryptlib.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/cryptlib.c b/cryptlib.c +index 4d739e5..0e59d4c 100644 +--- a/cryptlib.c ++++ b/cryptlib.c +@@ -381,7 +381,11 @@ int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name, + } + + hdata->digestsize = crypto_ahash_digestsize(hdata->async.s); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0)) + hdata->alignmask = crypto_ahash_alignmask(hdata->async.s); ++#else ++ hdata->alignmask = 0; ++#endif + + init_completion(&hdata->async.result.completion); + From 9425064bdbc873a285f476da101199433d3a80e4 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 6 Mar 2024 11:47:45 +0100 Subject: [PATCH 07/10] kernel: crypto: add SHA1 ARM64 CE optimized module Kernel has optimized version of SHA1 using the ARMv8 Crypto Extensions, so lets package it. Use it by default for qualcommax as it uses Cortex-A53 core and has ARMv8 CE extensions present. Signed-off-by: Robert Marko --- package/kernel/linux/modules/crypto.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 84c4668b97..9d5c80f8e5 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -908,6 +908,7 @@ define KernelPackage/crypto-sha1 CONFIG_CRYPTO_SHA1 \ CONFIG_CRYPTO_SHA1_ARM \ CONFIG_CRYPTO_SHA1_ARM_NEON \ + CONFIG_CRYPTO_SHA1_ARM64_CE \ CONFIG_CRYPTO_SHA1_OCTEON \ CONFIG_CRYPTO_SHA1_PPC_SPE \ CONFIG_CRYPTO_SHA1_SSSE3 @@ -927,9 +928,15 @@ define KernelPackage/crypto-sha1/arm-neon AUTOLOAD+=$(call AutoLoad,09,sha1-arm-neon) endef +define KernelPackage/crypto-sha1/aarch64-ce + FILES+=$(LINUX_DIR)/arch/arm64/crypto/sha1-ce.ko + AUTOLOAD+=$(call AutoLoad,09,sha1-ce) +endef + KernelPackage/crypto-sha1/imx=$(KernelPackage/crypto-sha1/arm-neon) KernelPackage/crypto-sha1/ipq40xx=$(KernelPackage/crypto-sha1/arm-neon) KernelPackage/crypto-sha1/mvebu/cortexa9=$(KernelPackage/crypto-sha1/arm-neon) +KernelPackage/crypto-sha1/qualcommax=$(KernelPackage/crypto-sha1/aarch64-ce) define KernelPackage/crypto-sha1/octeon FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha1.ko From 09207c0348299e0760dfc4e97dfaab27135a9ad1 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 6 Mar 2024 18:30:21 +0100 Subject: [PATCH 08/10] kernel: crypto: add SHA256 ARM64 ASM optimized module Kernel has an ASM optimized version of SHA256 that was ported from OpenSSL, so lets package it as it provides significant perfomance improvement compared to the generic implementation. Signed-off-by: Robert Marko --- package/kernel/linux/modules/crypto.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 9d5c80f8e5..839e1bd45f 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -984,6 +984,7 @@ define KernelPackage/crypto-sha256 CONFIG_CRYPTO_SHA256 \ CONFIG_CRYPTO_SHA256_OCTEON \ CONFIG_CRYPTO_SHA256_PPC_SPE \ + CONFIG_CRYPTO_SHA256_ARM64 \ CONFIG_CRYPTO_SHA256_SSSE3 FILES:= \ $(LINUX_DIR)/crypto/sha256_generic.ko \ @@ -992,6 +993,11 @@ define KernelPackage/crypto-sha256 $(call AddDepends/crypto) endef +define KernelPackage/crypto-sha256/aarch64 + FILES+=$(LINUX_DIR)/arch/arm64/crypto/sha256-arm64.ko + AUTOLOAD+=$(call AutoLoad,09,sha256-arm64) +endef + define KernelPackage/crypto-sha256/octeon FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha256.ko AUTOLOAD+=$(call AutoLoad,09,octeon-sha256) From 4443470a575b6fd775ff7c9d5eb40024db003213 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 6 Mar 2024 18:38:28 +0100 Subject: [PATCH 09/10] kernel: crypto: add SHA2(224 and 256) ARM64 CE optimized module Kernel has optimized version of SHA2(224 and 256) using the ARMv8 Crypto Extensions, so lets package it. Use it by default for qualcommax as it uses Cortex-A53 core and has ARMv8 CE extensions present. Signed-off-by: Robert Marko --- package/kernel/linux/modules/crypto.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 839e1bd45f..f7ba0a7b29 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -985,6 +985,7 @@ define KernelPackage/crypto-sha256 CONFIG_CRYPTO_SHA256_OCTEON \ CONFIG_CRYPTO_SHA256_PPC_SPE \ CONFIG_CRYPTO_SHA256_ARM64 \ + CONFIG_CRYPTO_SHA2_ARM64_CE \ CONFIG_CRYPTO_SHA256_SSSE3 FILES:= \ $(LINUX_DIR)/crypto/sha256_generic.ko \ @@ -998,6 +999,12 @@ define KernelPackage/crypto-sha256/aarch64 AUTOLOAD+=$(call AutoLoad,09,sha256-arm64) endef +define KernelPackage/crypto-sha256/aarch64-ce + $(call KernelPackage/crypto-sha256/aarch64) + FILES+=$(LINUX_DIR)/arch/arm64/crypto/sha2-ce.ko + AUTOLOAD+=$(call AutoLoad,09,sha2-ce) +endef + define KernelPackage/crypto-sha256/octeon FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha256.ko AUTOLOAD+=$(call AutoLoad,09,octeon-sha256) @@ -1015,6 +1022,8 @@ define KernelPackage/crypto-sha256/x86_64 endef endif +KernelPackage/crypto-sha256/qualcommax=$(KernelPackage/crypto-sha256/aarch64-ce) + ifdef KernelPackage/crypto-sha256/$(ARCH) KernelPackage/crypto-sha256/$(CRYPTO_TARGET)=\ $(KernelPackage/crypto-sha256/$(ARCH)) From 5b1d6d4607e4a062319225dd8930541cd1974ebe Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 6 Mar 2024 21:54:07 +0100 Subject: [PATCH 10/10] kernel: crypto: add SHA512 ARM64 ASM optimized module Kernel has an ASM optimized version of SHA512 that was ported from OpenSSL, so lets package it as it provides significant perfomance improvement compared to the generic implementation. There is a Cryptographic Extension based version as well, but that relies on ARMv8.2 ISA which I am not aware any of the OpenWrt supported SoC-s use. Signed-off-by: Robert Marko --- package/kernel/linux/modules/crypto.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index f7ba0a7b29..55988ba92c 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -1038,6 +1038,7 @@ define KernelPackage/crypto-sha512 KCONFIG:= \ CONFIG_CRYPTO_SHA512 \ CONFIG_CRYPTO_SHA512_ARM \ + CONFIG_CRYPTO_SHA512_ARM64 \ CONFIG_CRYPTO_SHA512_OCTEON \ CONFIG_CRYPTO_SHA512_SSSE3 FILES:=$(LINUX_DIR)/crypto/sha512_generic.ko @@ -1050,6 +1051,11 @@ define KernelPackage/crypto-sha512/arm AUTOLOAD+=$(call AutoLoad,09,sha512-arm) endef +define KernelPackage/crypto-sha512/aarch64 + FILES+=$(LINUX_DIR)/arch/arm64/crypto/sha512-arm64.ko + AUTOLOAD+=$(call AutoLoad,09,sha512-arm64) +endef + KernelPackage/crypto-sha512/imx=$(KernelPackage/crypto-sha512/arm) KernelPackage/crypto-sha512/ipq40xx=$(KernelPackage/crypto-sha512/arm) KernelPackage/crypto-sha512/mvebu/cortexa9=$(KernelPackage/crypto-sha512/arm)