From 1082c6556ea824ec6ff3cae05b4f0764d28552db Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Tue, 21 May 2024 11:28:07 +0200 Subject: [PATCH 1/9] kernel: qca-nss-dp: add back printing attached PHY-s During the last update to 12.5.r2 printing of the attached PHY-s was removed, so lets bring it back as it is very helpfull for debugging OpenWrt issues without users having to modify NSS-DP to know if a PHY was attached. Refresh patches since nss_dp_main.c was edited. Link: https://github.com/openwrt/openwrt/pull/15537 Signed-off-by: Robert Marko --- ...nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch | 3 ++- ...nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch | 2 +- .../0011-03-nss_dp_main-swap-dp_exit-function-call.patch | 4 ++-- ...nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch | 4 ++-- ...nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch b/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch index 20a7e6b350..518e961760 100644 --- a/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch +++ b/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch @@ -149,7 +149,7 @@ Signed-off-by: Robert Marko #if defined(NSS_DP_PPE_SUPPORT) uint32_t vsi_id; fal_port_t port_id; -@@ -940,22 +883,15 @@ static int32_t nss_dp_probe(struct platf +@@ -940,22 +883,16 @@ static int32_t nss_dp_probe(struct platf dp_priv->drv_flags |= NSS_DP_PRIV_FLAG(INIT_DONE); @@ -177,6 +177,7 @@ Signed-off-by: Robert Marko + netdev_err(netdev, "failed to connect to phy device\n"); + goto phy_setup_fail; + } ++ phy_attached_info(dp_priv->phydev); } #if defined(NSS_DP_PPE_SUPPORT) diff --git a/package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch b/package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch index 8379fcf20c..5abf178d38 100644 --- a/package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch +++ b/package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch @@ -26,7 +26,7 @@ Signed-off-by: Christian Marangi --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -972,6 +972,10 @@ static int nss_dp_remove(struct platform +@@ -970,6 +970,10 @@ static int nss_dp_remove(struct platform if (!dp_priv) continue; diff --git a/package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch b/package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch index 68a9821ceb..08088954fb 100644 --- a/package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch +++ b/package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch @@ -15,7 +15,7 @@ Signed-off-by: Christian Marangi --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -1163,6 +1163,8 @@ int __init nss_dp_init(void) +@@ -1161,6 +1161,8 @@ int __init nss_dp_init(void) */ void __exit nss_dp_exit(void) { @@ -24,7 +24,7 @@ Signed-off-by: Christian Marangi /* * TODO Move this to soc_ops */ -@@ -1170,8 +1172,6 @@ void __exit nss_dp_exit(void) +@@ -1168,8 +1170,6 @@ void __exit nss_dp_exit(void) nss_dp_hal_cleanup(); dp_global_ctx.common_init_done = false; } diff --git a/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch b/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch index 2721d2cfba..f8daa525fe 100644 --- a/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch +++ b/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch @@ -15,7 +15,7 @@ Signed-off-by: Christian Marangi --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -979,6 +979,9 @@ static int nss_dp_remove(struct platform +@@ -977,6 +977,9 @@ static int nss_dp_remove(struct platform dp_ops = dp_priv->data_plane_ops; hal_ops = dp_priv->gmac_hal_ops; @@ -25,7 +25,7 @@ Signed-off-by: Christian Marangi if (dp_priv->phydev) phy_disconnect(dp_priv->phydev); -@@ -990,7 +993,6 @@ static int nss_dp_remove(struct platform +@@ -988,7 +991,6 @@ static int nss_dp_remove(struct platform #endif hal_ops->exit(dp_priv->gmac_hal_ctx); dp_ops->deinit(dp_priv->dpc); diff --git a/package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch b/package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch index 3c99cae2d5..1633e009ea 100644 --- a/package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch +++ b/package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch @@ -15,7 +15,7 @@ Signed-off-by: Christian Marangi --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -983,7 +983,7 @@ static int nss_dp_remove(struct platform +@@ -981,7 +981,7 @@ static int nss_dp_remove(struct platform unregister_netdev(dp_priv->netdev); if (dp_priv->phydev) From cd9241db230e43387962cf13b4e8bbdc61f1581c Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Tue, 21 May 2024 19:24:06 +0200 Subject: [PATCH 2/9] qualcommax: ipq807x: sax1v1k: fix QCA8081 reset It seems that on Spectrum SAX1V1K QCA8081 is being brought out of reset too quickly and thus causing it to get stuck in an invalid autoneg register configuration mode. Setting an deasset delay seems to fix this, so lets set it. Fixes: #15493 Link: https://github.com/openwrt/openwrt/pull/15541 Signed-off-by: Robert Marko --- .../files/arch/arm64/boot/dts/qcom/ipq8072-sax1v1k.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-sax1v1k.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-sax1v1k.dts index 01ac1c5fd6..fbb652a097 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-sax1v1k.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-sax1v1k.dts @@ -136,6 +136,7 @@ compatible = "ethernet-phy-id004d.d101"; reg = <28>; reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>; + reset-deassert-us = <10000>; }; }; From 9db53fb6aa261c4aa73da7d1ec6cf2d3b06b8fb8 Mon Sep 17 00:00:00 2001 From: Marius Dinu Date: Tue, 21 May 2024 18:08:33 +0300 Subject: [PATCH 3/9] scripts: fix revision calculation using new "main" branch Fix revision calculation when local branch is rebased on new "main" branch instead of "master". Signed-off-by: Marius Dinu Link: https://github.com/openwrt/openwrt/pull/15538 Signed-off-by: Christian Marangi --- scripts/getver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/getver.sh b/scripts/getver.sh index 61906040b1..0659d8004a 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -26,7 +26,7 @@ try_git() { *) BRANCH="$(git rev-parse --abbrev-ref HEAD)" ORIGIN="$(git rev-parse --verify --symbolic-full-name ${BRANCH}@{u} 2>/dev/null)" - [ -n "$ORIGIN" ] || ORIGIN="$(git rev-parse --verify --symbolic-full-name master@{u} 2>/dev/null)" + [ -n "$ORIGIN" ] || ORIGIN="$(git rev-parse --verify --symbolic-full-name main@{u} 2>/dev/null)" REV="$(git rev-list ${REBOOT}..$GET_REV 2>/dev/null | wc -l | awk '{print $1}')" if [ -n "$ORIGIN" ]; then From 725389b7c745b0fa68426986c9bca14171f16887 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 22 May 2024 11:38:49 +0200 Subject: [PATCH 4/9] host-build: always define Host/Prepare/Default We currently skip defining Host/Prepare/Default if HOST_UNPACK is not defined. This is mostly the case for Host packages that just provide files with the src directory and don't need to be downloaded/extracted. This was probably done lots of times ago due to quilt causing error as the patches directory wasn't present. This has changed now and quilt can correctly detect if no patches needs to be applied (instead of terminating with error) Always define Host/Prepare/Default to make tools/refresh correctly works as HOST_QUILT is hardcoded enabled for this make target and will complain for tool not prepared for quilt patches. Signed-off-by: Christian Marangi --- include/host-build.mk | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/host-build.mk b/include/host-build.mk index 819fff5664..235caaa6fb 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -35,13 +35,11 @@ include $(INCLUDE_DIR)/autotools.mk _host_target:=$(if $(HOST_QUILT),,.) Host/Patch:=$(Host/Patch/Default) -ifneq ($(strip $(HOST_UNPACK)),) - define Host/Prepare/Default - $(HOST_UNPACK) +define Host/Prepare/Default + $(if $(strip $(HOST_UNPACK)),$(HOST_UNPACK)) [ ! -d ./src/ ] || $(CP) ./src/* $(HOST_BUILD_DIR) $(Host/Patch) - endef -endif +endef define Host/Prepare $(call Host/Prepare/Default) From 46bcbe42236bbe058eaeb89a0d1a4f22926cfdf9 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 22 May 2024 11:53:52 +0200 Subject: [PATCH 5/9] tools/missing-macros: install files from HOST_BUILD_DIR instead of src Install files from HOST_BUILD_DIR instead of src. These files are now correctly copied to HOST_BUILD_DIR and can be referenced from there. Signed-off-by: Christian Marangi --- tools/missing-macros/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/missing-macros/Makefile b/tools/missing-macros/Makefile index edbcb84302..15a1cc9b97 100644 --- a/tools/missing-macros/Makefile +++ b/tools/missing-macros/Makefile @@ -20,9 +20,9 @@ endef define Host/Install $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/aclocal - $(INSTALL_DATA) ./src/m4/*.m4 $(STAGING_DIR_HOST)/share/aclocal/ + $(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/*.m4 $(STAGING_DIR_HOST)/share/aclocal/ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin - $(INSTALL_BIN) ./src/bin/* $(STAGING_DIR_HOST)/bin/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/* $(STAGING_DIR_HOST)/bin/ $(LN) makeinfo $(STAGING_DIR_HOST)/bin/texi2any $(LN) makeinfo $(STAGING_DIR_HOST)/bin/texi2pdf $(LN) makeinfo $(STAGING_DIR_HOST)/bin/texi2dvi From 01048c7456785bc4a45452c84d8f31635e1fa60b Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 22 May 2024 11:56:45 +0200 Subject: [PATCH 6/9] tools/padjffs2: use Host/Prepare/Default instead of raw commands Now that Host/Prepare/Default is always defined, we can use that instead of using raw commands to move files from the src directory to HOST_BUILD_DIR. Signed-off-by: Christian Marangi --- tools/padjffs2/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/padjffs2/Makefile b/tools/padjffs2/Makefile index 422d14db30..b893fadce5 100644 --- a/tools/padjffs2/Makefile +++ b/tools/padjffs2/Makefile @@ -13,8 +13,7 @@ PKG_RELEASE:=1 include $(INCLUDE_DIR)/host-build.mk define Host/Prepare - mkdir -p $(HOST_BUILD_DIR) - $(CP) ./src/* $(HOST_BUILD_DIR)/ + $(call Host/Prepare/Default) find $(HOST_BUILD_DIR) -name .svn | $(XARGS) rm -rf endef From 0f5c28b96b4e04332b6e9f31280c57b03c672cfd Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Mon, 21 Aug 2023 09:48:45 +0100 Subject: [PATCH 7/9] qualcommax: ipq807x support Netgear Orbi Pro SXK80 This commit adds support for Netgear Orbi Pro SXR80 and SXS80 (collectively known as SXK80) Specifications: --------------- * CPU: Qualcomm IPQ8074A Quad core Cortex-A53 * RAM: 1024MB * Storage: SPI-NAND 512 MiB (Winbond W29N04GZ) * Ethernet: 4x 1G RJ45 ports (QCA8075) 1x 2.5G RJ45 LAN/WAN (QCA8081) * WLAN: - 2.4 GHz: Qualcomm QCN5024 4x4 - 2x 5 GHz: Qualcomm QCN5054 4x4 (second radio high channels only) * LEDs: - Power: (Green and red) - Front: (Blue, green, red and white) * Buttons: - 1x Soft reset - 1x Sync/WPS * Power: 12V DC Jack Installation instructions (Telnet): ----------------------------------- *Note, this guide assumes SXR80, for SXS80 change the firmware file name as appropriate 1. Put firmware file openwrt-qualcommax-ipq807x-netgear_sxr80-initramfs-uImage.itb in root of TFTP server available at 192.168.1.10. 2. Enable telnet by going to http://[ip of device]/debug.htm and clicking on the tickbox 'Enable telnet' 3. Telnet into the device and login using the same username and password as the web interface: 4. Run the following command: `fw_setenv bootcmd 'env default -a; saveenv; reset'` 5. Reboot the router, once the web interface is available again re-enable telnet via http://[ip of device]/debug.htm and telnet into the device. 6. Run the following command: `fw_printenv` It should look similar to the below: ``` baudrate=115200 bootargs=console=ttyMSM0,115200n8 bootcmd=mii write 0x0 0x0 0x800; sleep 1; nmrp; bootdni; boot_DNI_secureboot bootdelay=2 ipaddr=192.168.1.1 netmask=255.255.255.0 serverip=192.168.1.10 soc_version_major=2 soc_version_minor=0 ``` **If you see the message:** `Warning: Bad CRC, using default environment` **DO NOT CONTINUE, YOU WILL BRICK YOUR DEVICE** 7. Run the following command: `fw_setenv originalboot 'mii write 0x0 0x0 0x800; sleep 1; nmrp; bootdni; boot_DNI_secureboot'` (This should match what's in the bootcmd variable displayed in step 6) 8. Run the following commands: ``` fw_setenv wrttftp 'mii write 0x0 0x0 0x800; sleep 1; nmrp; if tftpboot openwrt-qualcommax-ipq807x-netgear_sxr80-initramfs-uImage.itb; then bootm; fi; bootdni; boot_DNI_secureboot' fw_setenv wrtboot 'mii write 0x0 0x0 0x800; sleep 1; nmrp; nand read 0x40000000 0x1980000 0x06d00000; bootm 0x40000000' fw_setenv bootcmd 'run wrttftp' ``` 9. Ensure SXR/S device is attached via ethernet (LAN port) to the same ethernet segment as the TFTP server. 10. Reboot the device, it should reboot into OpenWrt and be available on 192.168.1.1 11. Once OpenWrt has booted, update the bootcmd using the following command: `fw_setenv bootcmd 'run wrtboot'` 12. Flash the sysupgrade image 13. It should boot into OpenWrt References to SXK80 GPL source: https://www.downloads.netgear.com/files/GPL/SXK80-V3.2.0.108_gpl_src.tar.bz2.zip Signed-off-by: Flole Systems Signed-off-by: Andrew Smith Link: https://github.com/openwrt/openwrt/pull/14939 Signed-off-by: Robert Marko --- .../uboot-envtools/files/qualcommax_ipq807x | 6 + package/firmware/ipq-wifi/Makefile | 2 + target/linux/qualcommax/config-6.6 | 2 + .../arm64/boot/dts/qcom/ipq8074-sxk80.dtsi | 541 ++++++++++++++++++ .../arm64/boot/dts/qcom/ipq8074-sxr80.dts | 11 + .../arm64/boot/dts/qcom/ipq8074-sxs80.dts | 11 + target/linux/qualcommax/image/ipq807x.mk | 27 + .../ipq807x/base-files/etc/board.d/02_network | 4 + .../etc/hotplug.d/firmware/11-ath11k-caldata | 2 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 7 + .../base-files/lib/upgrade/platform.sh | 2 + 11 files changed, 615 insertions(+) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxk80.dtsi create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxr80.dts create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxs80.dts diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-envtools/files/qualcommax_ipq807x index 060871396b..4ae0de4e26 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq807x +++ b/package/boot/uboot-envtools/files/qualcommax_ipq807x @@ -37,6 +37,12 @@ linksys,mx8500) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2" ;; +netgear,sxr80|\ +netgear,sxs80) + idx="$(find_mtd_index 0:appsblenv)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" + ;; redmi,ax6|\ xiaomi,ax3600|\ xiaomi,ax9000) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 2ffd2e014c..fc578115f3 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -40,6 +40,7 @@ ALLWIFIBOARDS:= \ linksys_mx8500 \ netgear_lbr20 \ netgear_rax120v2 \ + netgear_sxk80 \ netgear_wax214 \ netgear_wax218 \ netgear_wax620 \ @@ -161,6 +162,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300)) $(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500)) $(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_sxk80,Netgear SXK80)) $(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)) diff --git a/target/linux/qualcommax/config-6.6 b/target/linux/qualcommax/config-6.6 index 71b54041c5..1d05868caf 100644 --- a/target/linux/qualcommax/config-6.6 +++ b/target/linux/qualcommax/config-6.6 @@ -216,6 +216,7 @@ CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y # CONFIG_KPSS_XCC is not set +CONFIG_LEDS_TLC591XX=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y @@ -441,6 +442,7 @@ CONFIG_RANDSTRUCT_NONE=y CONFIG_RAS=y CONFIG_RATIONAL=y CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y # CONFIG_REGULATOR_CPR3 is not set diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxk80.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxk80.dtsi new file mode 100644 index 0000000000..7f8b813749 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxk80.dtsi @@ -0,0 +1,541 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (c) 2021, Flole + * Copyright (c) 2023, Andrew Smith + */ + +/dts-v1/; + +#include "ipq8074.dtsi" +#include "ipq8074-ess.dtsi" +#include "ipq8074-hk-cpu.dtsi" +#include +#include +#include + +/ { + aliases { + serial0 = &blsp1_uart5; + led-boot = &led_front_blue; + led-failsafe = &led_front_red; + led-running = &led_front_green; + led-upgrade = &led_front_white; + label-mac-device = &dp2; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " ubi.mtd=rootfs root=/dev/ubiblock0_0"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_front_blue: front-blue { + function = LED_FUNCTION_STATUS; + gpios = <&tlmm 33 GPIO_ACTIVE_LOW>; + color = ; + }; + + led_front_green: front-green { + function = LED_FUNCTION_STATUS; + gpios = <&tlmm 29 GPIO_ACTIVE_LOW>; + color = ; + }; + + led_front_red: front-red { + function = LED_FUNCTION_STATUS; + gpios = <&tlmm 31 GPIO_ACTIVE_LOW>; + color = ; + }; + + led_front_white: front-white { + function = LED_FUNCTION_STATUS; + gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; + color = ; + }; + + led_power_green: power-green { + function = LED_FUNCTION_POWER; + gpios = <&tlmm 21 GPIO_ACTIVE_LOW>; + color = ; + default-state = "on"; + }; + + led_power_red: power-red { + function = LED_FUNCTION_POWER; + gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + color = ; + panic-indicator; + }; + }; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio68"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio69"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + leds_pins: leds_pinmux { + led_power_green { + pins = "gpio21"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + + led_power_red { + pins = "gpio22"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + + led_white { + pins = "gpio26"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + + led_green { + pins = "gpio29"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + + led_red { + pins = "gpio31"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + + led_blue { + pins = "gpio33"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; +}; + +&blsp1_uart5 { + status = "okay"; +}; + +&blsp1_i2c2 { + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; + + status = "okay"; + + tlc59208f@27 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,tlc59108"; + reg = <0x27>; + + led@0 { + label = "rgb:led0"; + reg = <0>; + linux,default-trigger = "default-off"; + }; + + led@1 { + label = "rgb:led1"; + reg = <1>; + linux,default-trigger = "default-off"; + }; + + led@2 { + label = "rgb:led2"; + reg = <2>; + linux,default-trigger = "default-off"; + }; + + led@3 { + label = "rgb:led3"; + reg = <3>; + linux,default-trigger = "default-off"; + }; + }; +}; + +&prng { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + /* + * Bootloader will find the NAND DT node by the compatible and + * then "fixup" it by adding the partitions from the SMEM table + * using the legacy bindings thus making it impossible for us + * to change the partition table or utilize NVMEM for calibration. + * So add a dummy partitions node that bootloader will populate + * and set it as disabled so the kernel ignores it instead of + * printing warnings due to the broken way bootloader adds the + * partitions. + */ + partitions { + status = "disabled"; + }; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:sbl1"; + reg = <0x00 0x100000>; + read-only; + }; + + partition@100000 { + label = "0:mibib"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "0:bootconfig"; + reg = <0x200000 0x80000>; + read-only; + }; + + partition@280000 { + label = "0:bootconfig_1"; + reg = <0x280000 0x80000>; + read-only; + }; + + partition@300000 { + label = "0:qsee"; + reg = <0x300000 0x300000>; + read-only; + }; + + partition@600000 { + label = "0:qsee_1"; + reg = <0x600000 0x300000>; + read-only; + }; + + partition@900000 { + label = "0:devcfg"; + reg = <0x900000 0x80000>; + read-only; + }; + + partition@980000 { + label = "0:devcfg_1"; + reg = <0x980000 0x80000>; + read-only; + }; + + partition@a00000 { + label = "0:apdp"; + reg = <0xa00000 0x80000>; + read-only; + }; + + partition@a80000 { + label = "0:apdp_1"; + reg = <0xa80000 0x80000>; + read-only; + }; + + partition@b00000 { + label = "0:rpm"; + reg = <0xb00000 0x80000>; + read-only; + }; + + partition@b80000 { + label = "0:rpm_1"; + reg = <0xb80000 0x80000>; + read-only; + }; + + partition@c00000 { + label = "0:cdt"; + reg = <0xc00000 0x80000>; + read-only; + }; + + partition@c80000 { + label = "0:cdt_1"; + reg = <0xc80000 0x80000>; + read-only; + }; + + partition@d00000 { + label = "0:appsblenv"; + reg = <0xd00000 0x80000>; + }; + + partition@d80000 { + label = "0:appsbl"; + reg = <0xd80000 0x100000>; + read-only; + }; + + partition@e80000 { + label = "0:appsbl_1"; + reg = <0xe80000 0x100000>; + read-only; + }; + + partition@f80000 { + label = "0:art"; + reg = <0xf80000 0x80000>; + read-only; + }; + + partition@1000000 { + label = "0:art.bak"; + reg = <0x1000000 0x80000>; + read-only; + }; + + partition@1080000 { + label = "config"; + reg = <0x1080000 0x100000>; + }; + + partition@1180000 { + label = "boarddata1"; + reg = <0x1180000 0x100000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boarddata1_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_boarddata1_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; + }; + + partition@1280000 { + label = "boarddata2"; + reg = <0x1280000 0x100000>; + }; + + partition@1380000 { + label = "pot"; + reg = <0x1380000 0x100000>; + read-only; + }; + + partition@1480000 { + label = "dnidata"; + reg = <0x1480000 0x500000>; + read-only; + }; + + partition@1980000 { + label = "kernel"; + reg = <0x1980000 0x620000>; + }; + + partition@1fa0000 { + label = "rootfs"; + reg = <0x1fa0000 0x66e0000>; + }; + + partition@8680000 { + label = "kernel2"; + reg = <0x8680000 0x620000>; + read-only; + }; + + partition@8ca0000 { + label = "rootfs2"; + reg = <0x8ca0000 0x66e0000>; + read-only; + }; + }; + }; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>; + + ethernet-phy-package@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + compatible = "qcom,qca8075-package"; + + qca8075_1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + + qca8075_2: ethernet-phy@2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + }; + + qca8075_3: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <3>; + }; + + qca8075_4: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <4>; + }; + }; + + qca8081_28: ethernet-phy@28 { + compatible = "ethernet-phy-id004d.d101"; + reg = <28>; + reset-deassert-us = <10000>; + reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>; + }; +}; + +&switch { + status = "okay"; + + switch_lan_bmp = <(ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ + + qcom,port_phyinfo { + port@2 { + port_id = <2>; + phy_address = <1>; + }; + port@3 { + port_id = <3>; + phy_address = <2>; + }; + port@4 { + port_id = <4>; + phy_address = <3>; + }; + port@5 { + port_id = <5>; + phy_address = <4>; + }; + port@6 { + port_id = <6>; + phy_address = <28>; + port_mac_sel = "QGMAC_PORT"; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp2 { + status = "okay"; + phy-handle = <&qca8075_1>; + label = "lan2"; + nvmem-cells = <&macaddr_boarddata1_0>; + nvmem-cell-names = "mac-address"; +}; + +&dp3 { + status = "okay"; + phy-handle = <&qca8075_2>; + label = "lan3"; + nvmem-cells = <&macaddr_boarddata1_0>; + nvmem-cell-names = "mac-address"; +}; + +&dp4 { + status = "okay"; + phy-handle = <&qca8075_3>; + label = "lan4"; + nvmem-cells = <&macaddr_boarddata1_0>; + nvmem-cell-names = "mac-address"; +}; + +&dp5 { + status = "okay"; + phy-handle = <&qca8075_4>; + label = "lan5"; + nvmem-cells = <&macaddr_boarddata1_0>; + nvmem-cell-names = "mac-address"; +}; + +&dp6 { + status = "okay"; + phy-handle = <&qca8081_28>; + label = "wan"; + nvmem-cells = <&macaddr_boarddata1_6>; + nvmem-cell-names = "mac-address"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "Netgear-SXK80"; +}; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxr80.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxr80.dts new file mode 100644 index 0000000000..d90e75da30 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxr80.dts @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2021, Flole */ + +/dts-v1/; + +#include "ipq8074-sxk80.dtsi" + +/ { + model = "Netgear SXR80"; + compatible = "netgear,sxr80", "qcom,ipq8074"; +}; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxs80.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxs80.dts new file mode 100644 index 0000000000..0d7240cf07 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-sxs80.dts @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2021, Flole */ + +/dts-v1/; + +#include "ipq8074-sxk80.dtsi" + +/ { + model = "Netgear SXS80"; + compatible = "netgear,sxs80", "qcom,ipq8074"; +}; diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index 007c73555e..b305c9dbaa 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -172,6 +172,33 @@ define Device/netgear_rax120v2 endef TARGET_DEVICES += netgear_rax120v2 +define Device/netgear_sxk80 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_PACKAGES += ipq-wifi-netgear_sxk80 + DEVICE_VENDOR := Netgear + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@hk01 + SOC := ipq8074 + KERNEL_SIZE := 6272k + NETGEAR_HW_ID := 29766265+0+512+1024+4x4+4x4+4x4 +endef + +define Device/netgear_sxr80 + $(call Device/netgear_sxk80) + DEVICE_MODEL := SXR80 + NETGEAR_BOARD_ID := SXR80 +endef +TARGET_DEVICES += netgear_sxr80 + +define Device/netgear_sxs80 + $(call Device/netgear_sxk80) + DEVICE_MODEL := SXS80 + NETGEAR_BOARD_ID := SXS80 +endef +TARGET_DEVICES += netgear_sxs80 + define Device/netgear_wax218 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network index 380588bbab..0bf224f380 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network @@ -43,6 +43,10 @@ ipq807x_setup_interfaces() netgear,rax120v2) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" "wan" ;; + netgear,sxr80|\ + netgear,sxs80) + ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan" + ;; netgear,wax218|\ netgear,wax620) ucidef_set_interface_lan "lan" "dhcp" diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 018e828859..a116d884e2 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -17,6 +17,8 @@ case "$FIRMWARE" in edgecore,eap102|\ edimax,cax1800|\ linksys,mx5300|\ + netgear,sxr80|\ + netgear,sxs80|\ netgear,wax218|\ netgear,wax620|\ netgear,wax630|\ diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 17284a0d9e..9552536ade 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -23,6 +23,13 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress ;; + netgear,sxr80|\ + netgear,sxs80) + [ "$PHYNBR" = "0" ] && mtd_get_mac_binary boarddata1 0x0c > /sys${DEVPATH}/macaddress + #boarddata1 doesn't have a MAC for the 2G interface + [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "2" ] && mtd_get_mac_binary boarddata1 0x12 > /sys${DEVPATH}/macaddress + ;; zbtlink,zbt-z800ax) [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) -1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) -2 > /sys${DEVPATH}/macaddress diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index b99657fb4c..2008334213 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -49,6 +49,8 @@ platform_do_upgrade() { dynalink,dl-wrx36|\ edimax,cax1800|\ netgear,rax120v2|\ + netgear,sxr80|\ + netgear,sxs80|\ netgear,wax218|\ netgear,wax620|\ netgear,wax630|\ From 4a78c46cbd64a69e0ce799d13a3c021260771b83 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 22 May 2024 16:55:51 +0200 Subject: [PATCH 8/9] ipq40xx: dont panic on PSGMII calibration fail Currently, in case that PSGMII calibration fails it will panic the kernel which is not ideal and is preventing any debugging to be done. So, since PGMII calibration failing only means that wired networking wont work lets convet the panic() call to dev_error. Link: https://github.com/openwrt/openwrt/pull/15542 Signed-off-by: Robert Marko --- .../706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch b/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch index e0331d28ab..20dd345c69 100644 --- a/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch +++ b/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch @@ -654,7 +654,7 @@ Signed-off-by: Robert Marko + } + } + -+ panic("PSGMII work is unstable !!! " ++ dev_err(priv->dev, "PSGMII work is unstable !!! " + "Repeated recalibration attempts did not help(0x%x) !\n", + test_result); + From 9a11bc3682dd7e95eb0534da9e2dbe3cdaa1c6de Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 22 May 2024 16:19:45 +0200 Subject: [PATCH 9/9] build: generate private key for APK early Other than OPKG which only uses signed package list, APK uses individually signed packages in addition to signed package lists. Hence, in order to be able to generate package, the private key needs to be generated before compiling packages. Express that dependency and generate the private key before building any packages instead of doing so as part of the base-files package build. Fixes: d788ab376f ("build: add APK package build capabilities") Signed-off-by: Daniel Golle --- package/Makefile | 8 +++++++- package/base-files/Makefile | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package/Makefile b/package/Makefile index 301a9e6cd5..eb7cfcf962 100644 --- a/package/Makefile +++ b/package/Makefile @@ -59,6 +59,12 @@ else -$(foreach pdir,$(PACKAGE_SUBDIRS),$(if $(wildcard $(pdir)/*.ipk),ln -s $(pdir)/*.ipk $(PACKAGE_DIR_ALL);)) endif +$(BUILD_KEY_APK_SEC): + $(STAGING_DIR_HOST)/bin/openssl ecparam -name prime256v1 -genkey -noout -out $(BUILD_KEY_APK_SEC) + +$(BUILD_KEY_APK_PUB): $(BUILD_KEY_APK_SEC) + $(STAGING_DIR_HOST)/bin/openssl ec -in $(BUILD_KEY_APK_SEC) -pubout > $(BUILD_KEY_APK_PUB) + $(curdir)/merge-index: $(curdir)/merge ifneq ($(CONFIG_USE_APK),) (cd $(PACKAGE_DIR_ALL) && $(STAGING_DIR_HOST)/bin/apk mkndx \ @@ -75,7 +81,7 @@ endif ifndef SDK $(curdir)//compile = $(STAGING_DIR)/.prepared $(BIN_DIR) ifneq ($(CONFIG_USE_APK),) - $(curdir)/compile: $(curdir)/system/apk/host/compile + $(curdir)/compile: $(curdir)/system/apk/host/compile $(BUILD_KEY_APK_SEC) $(BUILD_KEY_APK_PUB) else $(curdir)/compile: $(curdir)/system/opkg/host/compile endif diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 0aa7ecd854..4425bb346d 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -117,12 +117,6 @@ endef Build/Compile = $(Build/Compile/Default) ifneq ($(CONFIG_USE_APK),) - define Build/Configure - [ -s $(BUILD_KEY_APK_SEC) -a -s $(BUILD_KEY_APK_PUB) ] || \ - $(STAGING_DIR_HOST)/bin/openssl ecparam -name prime256v1 -genkey -noout -out $(BUILD_KEY_APK_SEC); \ - $(STAGING_DIR_HOST)/bin/openssl ec -in $(BUILD_KEY_APK_SEC) -pubout > $(BUILD_KEY_APK_PUB) - endef - ifndef CONFIG_BUILDBOT define Package/base-files/install-key mkdir -p $(1)/etc/apk/keys