WIP: Edgecore EAP101 eap101
authorStijn Tintel <stijn@linux-ipv6.be>
Sun, 5 May 2024 19:54:25 +0000 (22:54 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Wed, 22 May 2024 10:58:35 +0000 (13:58 +0300)
What works:
WAN port w/ correct MAC address
WiFi 2.4 + 5
sysupgrade to non-active rootfs partition

package/boot/uboot-envtools/files/qualcommax_ipq60xx
package/firmware/ipq-wifi/Makefile
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-eap101.dts [new file with mode: 0644]
target/linux/qualcommax/image/ipq60xx.mk
target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network
target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata
target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount
target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh

index 749b053aabce477b07dc16ddfd6cc94a619823c9..7ac4f5eaca3cf680bd271393bfe433f4a2af3a7e 100644 (file)
@@ -9,7 +9,8 @@ board=$(board_name)
 
 case "$board" in
 8devices,mango-dvk|\
-8devices,mango-dvk-sfp)
+8devices,mango-dvk-sfp|\
+edgecore,eap101)
        idx="$(find_mtd_index 0:APPSBLENV)"
        [ -n "$idx" ] && \
                ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
index 68448a6ec1d1f909074cf6cac7f64b8daba5864a..ab0b6a98a2025302fe92ab6a6c12d9e86e7c6c1e 100644 (file)
@@ -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-04-26
-PKG_SOURCE_VERSION:=644ba9ea2e6685e420561ef098cb6fbaaf136cbf
-PKG_MIRROR_HASH:=3b913fd6fb0fac404b16e67c66d36c10315dba5459a8d495d870afcb1e2c33cd
+PKG_SOURCE_DATE:=2024-05-06
+PKG_SOURCE_VERSION:=35d8f7e91ee854ce6251f901538feea17490a66d
+PKG_MIRROR_HASH:=f42a71275beb80c759f566fe204a394f7ee2a166516d223959abc870107baa28
 PKG_FLAGS:=nonshared
 
 include $(INCLUDE_DIR)/package.mk
@@ -33,6 +33,7 @@ ALLWIFIBOARDS:= \
        cmcc_rm2-6 \
        compex_wpq873 \
        dynalink_dl-wrx36 \
+       edgecore_eap101 \
        edgecore_eap102 \
        edimax_cax1800 \
        linksys_mx4200 \
@@ -153,6 +154,7 @@ $(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX1
 $(eval $(call generate-ipq-wifi-package,cmcc_rm2-6,CMCC RM2-6))
 $(eval $(call generate-ipq-wifi-package,compex_wpq873,Compex WPQ-873))
 $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36))
+$(eval $(call generate-ipq-wifi-package,edgecore_eap101,Edgecore EAP101))
 $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
 $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
 $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200))
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-eap101.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-eap101.dts
new file mode 100644 (file)
index 0000000..1f4e2b8
--- /dev/null
@@ -0,0 +1,515 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * IPQ6018 CP01 board device tree source
+ *
+ * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include "ipq6018.dtsi"
+#include "ipq6018-cp-cpu.dtsi"
+#include "ipq6018-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+
+/ {
+       model = "Edgecore EAP101";
+       compatible = "edgecore,eap101", "qcom,ipq6018-cp01", "qcom,ipq6018";
+
+       aliases {
+               ethernet0 = &dp5;
+               ethernet1 = &dp2;
+               ethernet2 = &dp3;
+               led-boot = &led_power;
+               led-failsafe = &led_power;
+               led-running = &led_power;
+               led-upgrade = &led_power;
+               serial0 = &blsp1_uart3;
+               serial1 = &blsp1_uart2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+               bootargs-append = " root=/dev/ubiblock0_1 swiotlb=1";
+       };
+
+       keys {
+               compatible = "gpio-keys";
+               pinctrl-0 = <&button_pins>;
+               pinctrl-names = "default";
+
+               reset {
+                       label = "reset";
+                       gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <&leds_pins>;
+               pinctrl-names = "default";
+
+               led@25 {
+                       label = "green:wifi5";
+                       gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "wf188:green:5g";
+                       default-state = "off";
+               };
+               led@24 {
+                       label = "green:wifi2";
+                       gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "wf188:green:2g";
+                       default-state = "off";
+               };
+               led_power: led@16 {
+                       label = "green:led_pwr";
+                       gpios = <&tlmm 74 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "green:power";
+                       default-state = "off";
+               };
+               led@61 {
+                       label = "green:lan1";
+                       gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "green:power";
+                       default-state = "off";
+               };
+               led@62 {
+                       label = "green:wan";
+                       gpios = <&tlmm 62 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "green:power";
+                       default-state = "off";
+               };
+               led@63 {
+                       label = "green:lan2";
+                       gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "green:power";
+                       default-state = "off";
+               };
+       };
+};
+
+&blsp1_uart3 {
+       pinctrl-0 = <&serial_3_pins>;
+       pinctrl-names = "default";
+       status = "ok";
+};
+
+&blsp1_spi1 {
+       pinctrl-0 = <&spi_0_pins>;
+       pinctrl-names = "default";
+       cs-select = <0>;
+       status = "ok";
+
+       m25p80@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               reg = <0>;
+               compatible = "mx25u25635f", "jedec,spi-nor";
+               spi-max-frequency = <50000000>;
+               use-default-sizes;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "SBL1";
+                               reg = <0x0 0xc0000>;
+                               read-only;
+                       };
+
+                       partition@c0000 {
+                               label = "MIBIB";
+                               reg = <0xc0000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@d0000 {
+                               label = "BOOTCONFIG";
+                               reg = <0xd0000 0x20000>;
+                               read-only;
+                       };
+
+                       partition@f0000 {
+                               label = "BOOTCONFIG1";
+                               reg = <0xf0000 0x20000>;
+                               read-only;
+                       };
+
+                       partition@110000 {
+                               label = "QSEE";
+                               reg = <0x110000 0x1a0000>;
+                               read-only;
+                       };
+
+                       partition@2b0000 {
+                               label = "QSEE_1";
+                               reg = <0x2b0000 0x1a0000>;
+                               read-only;
+                       };
+
+                       partition@450000 {
+                               label = "DEVCFG";
+                               reg = <0x450000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@460000 {
+                               label = "DEVCFG_1";
+                               reg = <0x460000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@470000 {
+                               label = "RPM";
+                               reg = <0x470000 0x40000>;
+                               read-only;
+                       };
+
+                       partition@4b0000 {
+                               label = "RPM_1";
+                               reg = <0x4b0000 0x40000>;
+                               read-only;
+                       };
+
+                       partition@4f0000 {
+                               label = "CDT";
+                               reg = <0x4f0000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@500000 {
+                               label = "CDT_1";
+                               reg = <0x500000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@510000 {
+                               label = "0:APPSBLENV";
+                               reg = <0x510000 0x10000>;
+                       };
+
+                       partition@520000 {
+                               label = "APPSBL";
+                               reg = <0x520000 0xa0000>;
+                               read-only;
+                       };
+
+                       partition@5c0000 {
+                               label = "APPSBL_1";
+                               reg = <0x5c0000 0xa0000>;
+                               read-only;
+                       };
+
+                       partition@660000 {
+                               label = "0:ART";
+                               reg = <0x660000 0x40000>;
+                               read-only;
+                       };
+
+                       partition@6a0000 {
+                               label = "Product_Info";
+                               reg = <0x6a0000 0x80000>;
+                               read-only;
+                       };
+
+                       partition@720000 {
+                               label = "priv_data1";
+                               reg = <0x720000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@730000 {
+                               label = "priv_data2";
+                               reg = <0x730000 0x10000>;
+                               read-only;
+                       };
+               };
+       };
+
+       slb9670@1{
+               compatible = "infineon,slb9670";
+               reg = <1>; /* CE1 */
+               #address-cells = <1>;
+               #size-cells = <0>;
+               spi-max-frequency = <40000000>;
+               status = "okay";
+       };
+};
+
+&blsp1_uart2 {
+       pinctrl-0 = <&hsuart_pins &btcoex_pins>;
+       pinctrl-names = "default";
+       dmas = <&blsp_dma 2>,
+               <&blsp_dma 3>;
+       dma-names = "tx", "rx";
+       status = "ok";
+};
+
+&dp5 {
+       status = "okay";
+       phy-handle = <&qca8081>;
+       phy-mode = "sgmii";
+       label = "wan";
+};
+
+&tlmm {
+       spi_0_pins: spi-0-pins {
+               pins = "gpio38", "gpio39", "gpio40", "gpio41";
+               function = "blsp0_spi";
+               drive-strength = <8>;
+               bias-pull-down;
+       };
+
+       spi_1_pins: spi_1_pins {
+               mux {
+                       pins = "gpio69", "gpio71", "gpio72";
+                       function = "blsp1_spi";
+                       drive-strength = <8>;
+                       bias-pull-down;
+               };
+               spi_cs {
+                       pins = "gpio70";
+                       function = "blsp1_spi";
+                       drive-strength = <8>;
+                       bias-disable;
+               };
+               quartz_interrupt {
+                       pins = "gpio78";
+                       function = "gpio";
+                       input;
+                       bias-disable;
+               };
+               quartz_reset {
+                       pins = "gpio79";
+                       function = "gpio";
+                       output-low;
+                       bias-disable;
+               };
+
+       };
+
+       sd_pins: sd-pinmux {
+               pins = "gpio62";
+               function = "sd_card";
+               drive-strength = <8>;
+               bias-pull-up;
+       };
+
+       button_pins: button_pins {
+               wps_button {
+                       pins = "gpio19";
+                       function = "gpio";
+                       drive-strength = <8>;
+                       bias-pull-up;
+               };
+       };
+
+       mdio_pins: mdio_pinmux {
+               mux_0 {
+                       pins = "gpio64";
+                       function = "mdc";
+                       drive-strength = <8>;
+                       bias-pull-up;
+               };
+               mux_1 {
+                       pins = "gpio65";
+                       function = "mdio";
+                       drive-strength = <8>;
+                       bias-pull-up;
+               };
+               mux_2 {
+                       pins = "gpio75";
+                       function = "gpio";
+                       bias-pull-up;
+               };
+               mux_3 {
+                       pins = "gpio77";
+                       function = "gpio";
+                       bias-pull-up;
+               };
+       };
+
+       pwm_pins: pwm_pinmux {
+               pins = "gpio18";
+               function = "pwm00";
+               drive-strength = <8>;
+       };
+
+       hsuart_pins: hsuart_pins {
+               mux {
+                       pins = "gpio71", "gpio72", "gpio69", "gpio70";
+                       function = "blsp1_uart";
+                       drive-strength = <8>;
+                       bias-disable;
+               };
+       };
+
+       leds_pins: leds_pins {
+               led_pwr {
+                       pins = "gpio74";
+                       function = "gpio";
+                       drive-strength = <8>;
+                       bias-pull-down;
+               };
+               led_5g {
+                       pins = "gpio35";
+                       function = "gpio";
+                       drive-strength = <8>;
+                       bias-pull-down;
+               };
+               led_2g {
+                       pins = "gpio37";
+                       function = "gpio";
+                       drive-strength = <8>;
+                       bias-pull-down;
+               };
+       };
+
+       btcoex_pins: btcoex_pins {
+               mux_0 {
+                       pins = "gpio51";
+                       function = "pta1_1";
+                       drive-strength = <6>;
+                       bias-pull-down;
+               };
+               mux_1 {
+                       pins = "gpio53";
+                       function = "pta1_0";
+                       drive-strength = <6>;
+                       bias-pull-down;
+               };
+               mux_2 {
+                       pins = "gpio52";
+                       function = "pta1_2";
+                       drive-strength = <6>;
+                       bias-pull-down;
+               };
+       };
+};
+
+&soc {
+       gpio_export {
+               compatible = "gpio-export";
+               #size-cells = <0>;
+
+               ble_reset {
+                       gpio-export,name = "ble_reset";
+                       gpio-export,output = <0>;
+                       gpios = <&tlmm 79 GPIO_ACTIVE_HIGH>;
+               };
+
+               ble_backdoor {
+                       gpio-export,name = "ble_backdoor";
+                       gpio-export,output = <1>;
+                       gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&edma {
+       status = "okay";
+};
+
+&mdio {
+       status = "okay";
+       pinctrl-0 = <&mdio_pins>;
+       pinctrl-names = "default";
+       reset-gpios = <&tlmm 75 GPIO_ACTIVE_HIGH>;
+       reset-delay-us = <10000>;
+       reset-post-delay-us = <50000>;
+
+       qca8081: ethernet-phy@28 {
+               compatible = "ethernet-phy-id004d.d101";
+               reg = <28>;
+               reset-gpios = <&tlmm 77 GPIO_ACTIVE_LOW>;
+               reset-assert-us = <10000>;
+               reset-deassert-us = <50000>;
+       };
+};
+
+&qpic_bam {
+       status = "ok";
+};
+
+&qpic_nand {
+       status = "ok";
+
+       nand@0 {
+               reg = <0>;
+
+               nand-ecc-strength = <8>;
+               nand-ecc-step-size = <512>;
+               nand-bus-width = <8>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "rootfs1";
+                               reg = <0x00000000 0x03c00000>;
+                       };
+
+                       partition@3c00000 {
+                               label = "rootfs2";
+                               reg = <0x03c00000 0x03c00000>;
+                       };
+               };
+       };
+};
+
+&pcie_phy {
+       status = "ok";
+};
+
+&pcie0 {
+       status = "ok";
+};
+
+&qusb_phy_1 {
+       status = "ok";
+};
+
+&usb2 {
+       status = "ok";
+};
+
+&qusb_phy_0 {
+       status = "ok";
+};
+
+&ssphy_0 {
+       status = "ok";
+};
+
+&switch {
+       status = "okay";
+
+       // switch_lan_bmp = <(ESS_PORT3|ESS_PORT4)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
+       switch_mac_mode = <MAC_MODE_PSGMII>; /* mac mode for uniphy instance0*/
+       switch_mac_mode1 = <MAC_MODE_SGMII_CHANNEL0>;
+
+       qcom,port_phyinfo {
+               port@5 {
+                       port_id = <5>;
+                       phy_address = <28>;
+                       port_mac_sel = "QGMAC_PORT";
+               };
+       };
+};
+
+&usb3 {
+       status = "ok";
+};
+
+&wifi {
+        status = "okay";
+        qcom,ath11k-calibration-variant = "edgecore-eap101";
+};
index 79822ceb0118bff010aa07f42b2354626e91a339..35d071c0085add4ef408876c9fbb0a5e0d26c280 100644 (file)
@@ -11,6 +11,20 @@ define Device/8devices_mango-dvk
 endef
 TARGET_DEVICES += 8devices_mango-dvk
 
+define Device/edgecore_eap101
+       $(call Device/FitImage)
+       $(call Device/UbiFit)
+       DEVICE_VENDOR := Edgecore
+       DEVICE_MODEL := EAP101
+       DEVICE_DTS_CONFIG := config@cp01-c1
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       SOC := ipq6018
+       SUPPORTED_DEVICES := edgecore,eap101
+       DEVICE_PACKAGES := ipq-wifi-edgecore-eap101
+endef
+TARGET_DEVICES += edgecore_eap101
+
 define Device/netgear_wax214
        $(call Device/FitImage)
        $(call Device/UbiFit)
index f5fd35cf440787b68b052b7339e1b958a6bb194c..322573d1507c49d6a21430d002a7dc4a3170d420 100644 (file)
@@ -11,7 +11,8 @@ ipq60xx_setup_interfaces()
        local board="$1"
 
        case "$board" in
-       8devices,mango-dvk)
+       8devices,mango-dvk|\
+       edgecore,eap101)
                ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
                ;;
        netgear,wax214)
index 23a3da0b4bffe24376e8b1298865bc47771875d9..870017452a63c89855b492ca690629659add2a6a 100644 (file)
@@ -9,7 +9,8 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath11k/IPQ6018/hw1.0/cal-ahb-c000000.wifi.bin")
        case "$board" in
-       8devices,mango-dvk)
+       8devices,mango-dvk|\
+       edgecore,eap101)
                caldata_extract "0:ART" 0x1000 0x20000
                ;;
        netgear,wax214)
index b34fbd82d7b3becd2aece96406f18b5947c72e12..c62aee4372728d2d8ac71875e4f316d2a81ffa91 100755 (executable)
@@ -4,6 +4,7 @@ START=99
 
 boot() {
        case $(board_name) in
+       edgecore,eap101|\
        yuncore,fap650)
                fw_setenv owrt_bootcount 0
        ;;
index a8e4872cdd55e443aa6c8d735f029da42874838d..290d77be629649587bbea2279a68566b4d9cb547 100644 (file)
@@ -33,6 +33,17 @@ EOF
 
 platform_do_upgrade() {
        case "$(board_name)" in
+       edgecore,eap101)
+               local active="$(fw_printenv -n active 2>/dev/null)"
+               CI_ROOTPART="ubi_rootfs"
+               if [ "$active" = "2" ]; then
+                       CI_UBIPART="rootfs1"
+               else
+                       CI_UBIPART="rootfs2"
+               fi
+               fw_setenv active $((3 - active))
+               nand_do_upgrade "$1"
+               ;;
        netgear,wax214)
                nand_do_upgrade "$1"
                ;;