From dc41a0fd0c2693ab999a5186e2373baadd0541b4 Mon Sep 17 00:00:00 2001 From: Jesse Wu Date: Wed, 28 May 2025 18:25:48 +0800 Subject: [PATCH] ipq60xx: Support EMPLUS WAP386V2 model Device specifications: ====================== SoC: Qualcomm IPQ6018 RAM: 1 x 1G DDR4 RAM Flash: NAND 128MB Radio: 2T2R@2.4GHz, 2T2R@5GHz Ethernet: 1 x 1GbE PHY Reset Button: 1 Power Source: AC, Standard PoE 802.3af/at LED Indicator: 4 x Single-color LED indicator (GPIO Control) Signed-off-by: Jesse Wu --- feeds/ipq807x_v5.4/ath11k-wifi/Makefile | 2 + .../ipq60xx/base-files/etc/board.d/01_leds | 6 + .../ipq60xx/base-files/etc/board.d/02_network | 7 +- .../etc/hotplug.d/firmware/10-ath11k-caldata | 4 +- .../base-files/lib/upgrade/platform.sh | 4 +- .../dts/qcom/qcom-ipq6018-emplus-wap386v2.dts | 356 ++++++++++++++++++ feeds/ipq807x_v5.4/ipq60xx/image/ipq60xx.mk | 9 + .../certificates/files/usr/bin/mount_certs | 1 + profiles/emplus_wap386v2.yml | 24 ++ 9 files changed, 409 insertions(+), 4 deletions(-) create mode 100644 feeds/ipq807x_v5.4/ipq60xx/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-emplus-wap386v2.dts create mode 100644 profiles/emplus_wap386v2.yml diff --git a/feeds/ipq807x_v5.4/ath11k-wifi/Makefile b/feeds/ipq807x_v5.4/ath11k-wifi/Makefile index d158bf6de..47f16c126 100755 --- a/feeds/ipq807x_v5.4/ath11k-wifi/Makefile +++ b/feeds/ipq807x_v5.4/ath11k-wifi/Makefile @@ -41,6 +41,7 @@ ALLWIFIBOARDS:= \ edgecore-oap102 \ edgecore-oap103 \ edgecore-eap104 \ + emplus-wap386v2 \ liteon-wpx8324 \ indio-um-310ax-v1 \ indio-um-510axp-v1 \ @@ -404,6 +405,7 @@ $(eval $(call generate-ath11k-wifi-package,edgecore-eap102,Edgecore EAP102)) $(eval $(call generate-ath11k-wifi-package,edgecore-oap102,Edgecore OAP102)) $(eval $(call generate-ath11k-wifi-package,edgecore-oap103,Edgecore OAP103)) $(eval $(call generate-ath11k-wifi-package,edgecore-eap104,Edgecore EAP104)) +$(eval $(call generate-ath11k-wifi-package,emplus-wap386v2,Emplus WAP386 V2)) $(eval $(call generate-ath11k-wifi-package,liteon-wpx8324,Liteon WPX8324)) $(eval $(call generate-ath11k-wifi-package,indio-um-310ax-v1,Indio UM-310AX V1)) $(eval $(call generate-ath11k-wifi-package,indio-um-510axp-v1,Indio UM-510AXP V1)) diff --git a/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/board.d/01_leds b/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/board.d/01_leds index 48a2810e0..1d6ee3945 100755 --- a/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/board.d/01_leds +++ b/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/board.d/01_leds @@ -26,6 +26,12 @@ edgecore,eap101) ucidef_set_led_netdev "poe" "poe" "green:wan" "eth0" ucidef_set_led_default "power" "POWER" "green:led_pwr" "on" ;; +emplus,wap386v2) + ucidef_set_led_default "power" "POWER" "red:power" "on" + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" "tx rx link" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wifi2" "phy1tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wifi5" "phy0tpt" + ;; hfcl,ion4xi|\ hfcl,ion4x|\ hfcl,ion4x_2|\ diff --git a/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/board.d/02_network b/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/board.d/02_network index 9232547ad..5db02d385 100755 --- a/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/board.d/02_network +++ b/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/board.d/02_network @@ -34,10 +34,10 @@ qcom_setup_interfaces() ucidef_set_interface_lan "eth1" ucidef_set_interface_wan "eth0" ;; - cig,wf660a) + cig,wf660a|\ + emplus,wap386v2) ucidef_set_interface_wan "eth0" ;; - yuncore,fap650) ucidef_set_interface_lan "eth3 eth2 eth1 eth0" ucidef_set_interface_wan "eth4" @@ -76,6 +76,9 @@ qcom_setup_macs() ucidef_set_network_device_mac eth0 $wan_mac ip link set eth0 address $wan_mac ;; + emplus,wap386v2) + wan_mac=$(cat /sys/class/net/eth0/address) + ;; yuncore,ax840) wan_mac=$(cat /sys/class/net/eth1/address) lan_mac=$(macaddr_add "$wan_mac" 1) diff --git a/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/hotplug.d/firmware/10-ath11k-caldata b/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/hotplug.d/firmware/10-ath11k-caldata index 2b8c059ce..aadeef578 100755 --- a/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/hotplug.d/firmware/10-ath11k-caldata +++ b/feeds/ipq807x_v5.4/ipq60xx/base-files/etc/hotplug.d/firmware/10-ath11k-caldata @@ -76,6 +76,7 @@ case "$FIRMWARE" in cig,wf188n|\ cig,wf660a|\ edgecore,eap101|\ + emplus,wap386v2|\ hfcl,ion4xi|\ hfcl,ion4x|\ hfcl,ion4x_2|\ @@ -109,7 +110,8 @@ ath11k-macs) edgecore,eap101) ath11k_generate_macs_eap101 ;; - cig,wf188n) + cig,wf188n|\ + emplus,wap386v2) ath11k_generate_macs ;; cig,wf660a) diff --git a/feeds/ipq807x_v5.4/ipq60xx/base-files/lib/upgrade/platform.sh b/feeds/ipq807x_v5.4/ipq60xx/base-files/lib/upgrade/platform.sh index e7d702f2e..d3073caae 100755 --- a/feeds/ipq807x_v5.4/ipq60xx/base-files/lib/upgrade/platform.sh +++ b/feeds/ipq807x_v5.4/ipq60xx/base-files/lib/upgrade/platform.sh @@ -122,6 +122,7 @@ platform_check_image() { wallys,dr6018|\ wallys,dr6018-v4|\ edgecore,eap101|\ + emplus,wap386v2|\ hfcl,ion4xi|\ hfcl,ion4x|\ hfcl,ion4x_2|\ @@ -145,7 +146,8 @@ platform_do_upgrade() { cig,wf660a) spi_nor_emmc_do_upgrade_bootconfig $1 ;; - cig,wf188n) + cig,wf188n|\ + emplus,wap386v2) [ -f /proc/boot_info/rootfs/upgradepartition ] && { CI_UBIPART="$(cat /proc/boot_info/rootfs/upgradepartition)" CI_BOOTCFG=1 diff --git a/feeds/ipq807x_v5.4/ipq60xx/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-emplus-wap386v2.dts b/feeds/ipq807x_v5.4/ipq60xx/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-emplus-wap386v2.dts new file mode 100644 index 000000000..f2dd02066 --- /dev/null +++ b/feeds/ipq807x_v5.4/ipq60xx/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-emplus-wap386v2.dts @@ -0,0 +1,356 @@ +/* + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/dts-v1/; + +#include "ipq6018.dtsi" +#include "ipq6018-cpr-regulator.dtsi" +#include + +/ { + model = "Emplus WAP386 v2"; + compatible = "emplus,wap386v2", "qcom,ipq6018-cp03", "qcom,ipq6018"; + + aliases { + /* + * Aliases as required by u-boot + * to patch MAC addresses + */ + ethernet0 = "/soc/dp1"; + + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " swiotlb=1 coherent_pool=2M"; + }; + + /* + * +=========+==============+========================+ + * | | | | + * | Region | Start Offset | Size | + * | | | | + * +--------+--------------+-------------------------+ + * | | | | + * | | | | + * | | | | + * | | | | + * | Linux | 0x41000000 | 139MB | + * | | | | + * | | | | + * | | | | + * +--------+--------------+-------------------------+ + * | TZ App | 0x49B00000 | 6MB | + * +--------+--------------+-------------------------+ + * + * From the available 145 MB for Linux in the first 256 MB, + * we are reserving 6 MB for TZAPP. + * + * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi + * for memory layout. + */ + +/* TZAPP is enabled only in default memory profile */ +#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) + reserved-memory { + tzapp:tzapp@49B00000 { /* TZAPPS */ + no-map; + reg = <0x0 0x49B00000 0x0 0x00600000>; + }; + }; +#endif +}; + +&tlmm { + gpio-reserved-ranges = <20 1>; + + uart_pins: uart_pins { + mux { + pins = "gpio44", "gpio45"; + function = "blsp2_uart"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + spi_0_pins: spi_0_pins { + mux { + pins = "gpio38", "gpio39", "gpio40", "gpio41"; + function = "blsp0_spi"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + button_pins: button_pins { + reset_button { + pins = "gpio9"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + 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; + }; + }; + + leds_pins: leds_pins { + led_5g { + pins = "gpio31"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + led_2g { + pins = "gpio30"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; +}; + +&soc { + mdio@90000 { + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + phy-reset-gpio = <&tlmm 75 0>; + status = "ok"; + phy0: ethernet-phy@0 { + reg = <3>; + }; + phy1: ethernet-phy@1 { + reg = <4>; + }; + }; + + ess-switch@3a000000 { + switch_cpu_bmp = <0x1>; /* cpu port bitmap */ + switch_lan_bmp = <0x08>; /* lan port bitmap */ + switch_wan_bmp = <0x10>; /* wan port bitmap */ + switch_inner_bmp = <0xc0>; /*inner port bitmap*/ + switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ + switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ + qcom,port_phyinfo { + port@0 { + port_id = <2>; + phy_address = <3>; + }; + port@1 { + port_id = <3>; + phy_address = <4>; + }; + }; + }; + + dp1 { + device_type = "network"; + compatible = "qcom,nss-dp"; + qcom,id = <3>; + reg = <0x3a001400 0x200>; + qcom,mactype = <0>; + local-mac-address = [000000000000]; + qcom,link-poll = <1>; + qcom,phy-mdio-addr = <4>; + phy-mode = "sgmii"; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + button@9 { + label = "reset"; + linux,code = ; + gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; + linux,input-type = <1>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&leds_pins>; + pinctrl-names = "default"; + + led_power: led@28 { + label = "red:power"; + gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "wap386v2:red:power"; + default-state = "on"; + }; + led@29 { + label = "blue:wan"; + gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "wap386v2:blue:eth"; + default-state = "on"; + }; + led@30 { + label = "blue:wifi2"; + gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "wap386v2:blue:2g"; + default-state = "on"; + }; + led@31 { + label = "blue:wifi5"; + gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "wap386v2:blue:5g"; + default-state = "on"; + }; + }; +}; + +&blsp1_uart3 { + pinctrl-0 = <&uart_pins>; + pinctrl-names = "default"; + status = "ok"; +}; + +&spi_0 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-select = <0>; + status = "ok"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + compatible = "n25q128a11"; + linux,modalias = "m25p80", "n25q128a11"; + spi-max-frequency = <50000000>; + use-default-sizes; + }; +}; + +&wifi0 { + qcom,board_id = <0x30>; +}; + +&pcie_phy { + status = "ok"; +}; + +&pcie0 { +#if defined(__CNSS2__) + status = "ok"; +#endif +}; + +&qpic_bam { + status = "ok"; +}; + +&qpic_nand { + status = "ok"; + + nand@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + }; +}; + +&ssphy_0 { + status = "ok"; +}; + +&nss_crypto { + status = "ok"; +}; + +&CPU0 { + operating-points = < + /* kHz uV (fixed) */ + 864000 1100000 + 1056000 1100000 + 1320000 1100000 + 1440000 1100000 + 1608000 1100000 + 1800000 1100000 + >; + clock-latency = <200000>; +}; + +&CPU1 { + operating-points = < + /* kHz uV (fixed) */ + 864000 1100000 + 1056000 1100000 + 1320000 1100000 + 1440000 1100000 + 1608000 1100000 + 1800000 1100000 + >; + clock-latency = <200000>; +}; + +&CPU2 { + operating-points = < + /* kHz uV (fixed) */ + 864000 1100000 + 1056000 1100000 + 1320000 1100000 + 1440000 1100000 + 1608000 1100000 + 1800000 1100000 + >; + clock-latency = <200000>; +}; + +&CPU3 { + operating-points = < + /* kHz uV (fixed) */ + 864000 1100000 + 1056000 1100000 + 1320000 1100000 + 1440000 1100000 + 1608000 1100000 + 1800000 1100000 + >; + clock-latency = <200000>; +}; + +&rpm_glink { + status = "disabled"; +}; diff --git a/feeds/ipq807x_v5.4/ipq60xx/image/ipq60xx.mk b/feeds/ipq807x_v5.4/ipq60xx/image/ipq60xx.mk index 585b751fa..540dfe500 100644 --- a/feeds/ipq807x_v5.4/ipq60xx/image/ipq60xx.mk +++ b/feeds/ipq807x_v5.4/ipq60xx/image/ipq60xx.mk @@ -76,6 +76,15 @@ define Device/edgecore_eap101 endef TARGET_DEVICES += edgecore_eap101 +define Device/emplus_wap386v2 + DEVICE_TITLE := Emplus WAP386v2 + DEVICE_DTS := qcom-ipq6018-emplus-wap386v2 + DEVICE_DTS_CONFIG := config@cp03-c1 + SUPPORTED_DEVICES := emplus,wap386v2 + DEVICE_PACKAGES := ath11k-wifi-qcom-ipq6018 uboot-env +endef +TARGET_DEVICES += emplus_wap386v2 + define Device/indio_um-310ax-v1 DEVICE_TITLE := Indio UM-310AX V1 DEVICE_DTS := qcom-ipq6018-indio-um-310ax-v1 diff --git a/feeds/tip/certificates/files/usr/bin/mount_certs b/feeds/tip/certificates/files/usr/bin/mount_certs index 378ded061..f3a1f19d5 100755 --- a/feeds/tip/certificates/files/usr/bin/mount_certs +++ b/feeds/tip/certificates/files/usr/bin/mount_certs @@ -88,6 +88,7 @@ cig,wf189h|\ cig,wf186h|\ cig,wf196|\ cig,wf188n|\ +emplus,wap386v2|\ yuncore,ax840|\ yuncore,fap655) PART_NAME=rootfs_1 diff --git a/profiles/emplus_wap386v2.yml b/profiles/emplus_wap386v2.yml new file mode 100644 index 000000000..b3124aa3f --- /dev/null +++ b/profiles/emplus_wap386v2.yml @@ -0,0 +1,24 @@ +--- +profile: emplus_wap386v2 +target: ipq60xx +subtarget: generic +description: Build image for the EMPLUS WAP386V2 +image: bin/targets/ipq60xx/generic/openwrt-ipq60xx-emplus_wap386v2-squashfs-sysupgrade.tar +feeds: + - name: ipq807x + path: ../../feeds/ipq807x_v5.4 +include: + - ucentral-ap +packages: + - ipq60xx + - iperf3 +diffconfig: | + CONFIG_BUSYBOX_CUSTOM=y + CONFIG_BUSYBOX_CONFIG_TFTP=y + CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PROGRESS_BAR=y + CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_HPA_COMPAT=y + CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_GET=y + CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PUT=y + CONFIG_BUSYBOX_CONFIG_LSOF=y + CONFIG_BUSYBOX_CONFIG_MPSTAT=y + CONFIG_BUSYBOX_CONFIG_PSTREE=y