From 11b00344d11b238ba658d86789be62f04c0ed772 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Thu, 2 May 2024 14:11:04 -0500 Subject: [PATCH 1/4] ipq40xx: Enable NVMEM_U_BOOT_ENV config It's needed to get the MAC addresses for the Engenius EAP1300. Signed-off-by: Corey Minyard Link: https://github.com/openwrt/openwrt/pull/15358 Signed-off-by: Christian Marangi Link: https://github.com/openwrt/openwrt/pull/15402 Signed-off-by: Robert Marko --- target/linux/ipq40xx/config-5.15 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ipq40xx/config-5.15 b/target/linux/ipq40xx/config-5.15 index 4966352271..fa0de60172 100644 --- a/target/linux/ipq40xx/config-5.15 +++ b/target/linux/ipq40xx/config-5.15 @@ -310,6 +310,7 @@ CONFIG_NVMEM=y CONFIG_NVMEM_QCOM_QFPROM=y # CONFIG_NVMEM_QCOM_SEC_QFPROM is not set # CONFIG_NVMEM_SPMI_SDAM is not set +CONFIG_NVMEM_U_BOOT_ENV=y CONFIG_NVMEM_SYSFS=y CONFIG_OF=y CONFIG_OF_ADDRESS=y From 89088ba638c0bb2f44adbe31caaeb52c06e4db66 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Wed, 1 May 2024 15:43:16 -0500 Subject: [PATCH 2/4] ipq40xx: convert Engenius EAP1300 to DSA This commit converts the EAP1300 to DSA setup. Signed-off-by: Corey Minyard Link: https://github.com/openwrt/openwrt/pull/15358 Signed-off-by: Christian Marangi Link: https://github.com/openwrt/openwrt/pull/15402 Signed-off-by: Robert Marko --- .../ipq40xx/base-files/etc/board.d/02_network | 1 + .../arch/arm/boot/dts/qcom-ipq4018-eap1300.dts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) 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 5de62f1d7d..060474b718 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -50,6 +50,7 @@ ipq40xx_setup_interfaces() aruba,ap-365|\ avm,fritzrepeater-1200|\ dlink,dap-2610|\ + engenius,eap1300|\ extreme-networks,ws-ap3915i|\ meraki,mr33|\ meraki,mr74|\ diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts index a8f24aa00e..af9a438e2e 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts @@ -215,6 +215,23 @@ status = "okay"; }; +&switch { + status = "okay"; +}; + +&swport5 { + status = "okay"; + label = "lan"; +}; + +&gmac { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration"; From 66952b9ff4743459a3bf77216933a43096865cbc Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Fri, 3 May 2024 08:12:38 -0500 Subject: [PATCH 3/4] ipq40xx: Properly set MAC addresses for the EAP1300 The code that was there was just taking whatever was left in the registers, which was just wrong. Set the addresses using the value from the u-boot environment, the same way the OEM firmware does. Signed-off-by: Corey Minyard Link: https://github.com/openwrt/openwrt/pull/15358 Signed-off-by: Christian Marangi Link: https://github.com/openwrt/openwrt/pull/15402 Signed-off-by: Robert Marko --- .../arch/arm/boot/dts/qcom-ipq4018-eap1300.dts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts index af9a438e2e..a72cb02ff1 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts @@ -194,8 +194,13 @@ reg = <0x190000 0x1dc0000>; }; partition9@1f50000 { + compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x01f50000 0x00010000>; + + macaddr_ubootenv_ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; }; partition10@1f60000 { label = "userconfig"; @@ -222,6 +227,8 @@ &swport5 { status = "okay"; label = "lan"; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_ubootenv_ethaddr 0>; }; &gmac { @@ -234,14 +241,14 @@ &wifi0 { status = "okay"; - nvmem-cell-names = "pre-calibration"; - nvmem-cells = <&precal_art_1000>; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_ubootenv_ethaddr 1>; qcom,ath10k-calibration-variant = "EnGenius-EAP1300"; }; &wifi1 { status = "okay"; - nvmem-cell-names = "pre-calibration"; - nvmem-cells = <&precal_art_5000>; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_ubootenv_ethaddr 2>; qcom,ath10k-calibration-variant = "EnGenius-EAP1300"; }; From 7a0d5a5c8bda19fc984429d183d14ee0b95a9be6 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Fri, 3 May 2024 08:14:31 -0500 Subject: [PATCH 4/4] ipq40xx: Enable the Engenius EAP1300 Now that DSA is enabled and the MAC addresses are set properly, we can use it. Signed-off-by: Corey Minyard Link: https://github.com/openwrt/openwrt/pull/15358 Signed-off-by: Christian Marangi Link: https://github.com/openwrt/openwrt/pull/15402 Signed-off-by: Robert Marko --- target/linux/ipq40xx/image/generic.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index ff5d5f26aa..a84031f645 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -455,8 +455,7 @@ define Device/engenius_eap1300 IMAGE_SIZE := 25344k IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata endef -# Missing DSA Setup -#TARGET_DEVICES += engenius_eap1300 +TARGET_DEVICES += engenius_eap1300 define Device/engenius_eap2200 $(call Device/FitImage)