[openwrt/openwrt] qualcommax: ipq60xx: add Qihoo 360V6 support
LEDE Commits
lede-commits at lists.infradead.org
Fri Dec 6 01:59:48 PST 2024
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/025dbeb70cf8cbbd51fe4eb9c836f0d65e41a874
commit 025dbeb70cf8cbbd51fe4eb9c836f0d65e41a874
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Fri Jun 21 23:18:21 2024 +0800
qualcommax: ipq60xx: add Qihoo 360V6 support
Specifications:
SoC: Qualcomm IPQ6000 1.5GHz
RAM: NTCC256M16ER-EK 512MiB
Flash: W29N01HZSINA 128MiB
ETH: QCA8075 (3x LAN, 1x WAN)
WLAN1: 2.4GHz 802.11b/g/n/ax 2x2
WLAN2: 5GHz 802.11a/n/ac/ax 2x2
Power: DC 12V 1.5A
Button: Reset, Wps
USB: 1x 2.0
Flash instructions:
1. Download the initramfs image, rename it to
initramfs.itb, host it with the tftp server.
2. Interrupt U-Boot and run these commands:
tftpboot initramfs.itb
bootm
3. After openwrt boots up, use scp or luci web
to upload sysupgrade.bin to upgrade.
Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/15940
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
package/firmware/ipq-wifi/Makefile | 2 +
.../arch/arm64/boot/dts/qcom/ipq6000-360v6.dts | 219 +++++++++++++++++++++
target/linux/qualcommax/image/ipq60xx.mk | 13 ++
.../ipq60xx/base-files/etc/board.d/02_network | 24 +++
.../etc/hotplug.d/firmware/11-ath11-caldata | 7 +
.../ipq60xx/base-files/lib/upgrade/platform.sh | 3 +-
6 files changed, 267 insertions(+), 1 deletion(-)
diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index af2a62b158..b80665efdb 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -49,6 +49,7 @@ ALLWIFIBOARDS:= \
netgear_wax620 \
netgear_wax630 \
prpl_haze \
+ qihoo_360v6 \
qnap_301w \
redmi_ax6 \
skspruce_wia3300-20 \
@@ -175,6 +176,7 @@ $(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))
+$(eval $(call generate-ipq-wifi-package,qihoo_360v6,Qihoo 360V6))
$(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
$(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
$(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts
new file mode 100644
index 0000000000..07aabe045a
--- /dev/null
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts
@@ -0,0 +1,219 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "ipq6018-512m.dtsi"
+#include "ipq6018-ess.dtsi"
+#include "ipq6018-cp-cpu.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+ model = "Qihoo 360V6";
+ compatible = "qihoo,360v6", "qcom,ipq6018";
+
+ aliases {
+ serial0 = &blsp1_uart3;
+ led-boot = &led_status_red;
+ led-failsafe = &led_status_red;
+ led-running = &led_status_green;
+ led-upgrade = &led_status_orange;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ bootargs-append = " root=/dev/ubiblock0_1";
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ wps {
+ label = "wps";
+ linux,code = <KEY_WPS_BUTTON>;
+ gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
+ };
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_status_red: red {
+ color = <LED_COLOR_ID_RED>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&tlmm 71 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_status_orange: orange {
+ color = <LED_COLOR_ID_ORANGE>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&tlmm 72 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_status_green: green {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&tlmm 73 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&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;
+ };
+ };
+};
+
+&blsp1_uart3 {
+ pinctrl-0 = <&serial_3_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
+&qpic_bam {
+ status = "okay";
+};
+
+&qpic_nand {
+ status = "okay";
+
+ nand at 0 {
+ reg = <0>;
+ nand-ecc-strength = <4>;
+ nand-ecc-step-size = <512>;
+ nand-bus-width = <8>;
+
+ partitions {
+ compatible = "qcom,smem-part";
+ };
+ };
+};
+
+&qusb_phy_0 {
+ status = "okay";
+};
+
+&ssphy_0 {
+ status = "okay";
+};
+
+&usb3 {
+ status = "okay";
+};
+
+&mdio {
+ status = "okay";
+
+ pinctrl-0 = <&mdio_pins>;
+ pinctrl-names = "default";
+ reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
+
+ ethernet-phy-package at 0 {
+ compatible = "qcom,qca8075-package";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ qca8075_0: ethernet-phy at 0 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0>;
+ };
+
+ qca8075_1: ethernet-phy at 1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <1>;
+ };
+
+ qca8075_2: ethernet-phy at 2 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <2>;
+ };
+
+ qca8075_3: ethernet-phy at 3 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <3>;
+ };
+ };
+};
+
+&switch {
+ status = "okay";
+
+ switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3)>;
+ switch_wan_bmp = <ESS_PORT4>;
+ switch_mac_mode = <MAC_MODE_PSGMII>;
+
+ qcom,port_phyinfo {
+ port at 1 {
+ port_id = <1>;
+ phy_address = <0>;
+ };
+ port at 2 {
+ port_id = <2>;
+ phy_address = <1>;
+ };
+ port at 3 {
+ port_id = <3>;
+ phy_address = <2>;
+ };
+ port at 4 {
+ port_id = <4>;
+ phy_address = <3>;
+ };
+ };
+};
+
+&edma {
+ status = "okay";
+};
+
+&dp1 {
+ status = "okay";
+ phy-handle = <&qca8075_0>;
+ label = "lan1";
+};
+
+&dp2 {
+ status = "okay";
+ phy-handle = <&qca8075_1>;
+ label = "lan2";
+};
+
+&dp3 {
+ status = "okay";
+ phy-handle = <&qca8075_2>;
+ label = "lan3";
+};
+
+&dp4 {
+ status = "okay";
+ phy-handle = <&qca8075_3>;
+ label = "wan";
+};
+
+&wifi {
+ status = "okay";
+
+ qcom,ath11k-fw-memory-mode = <1>;
+ qcom,ath11k-calibration-variant = "Qihoo-360V6";
+};
diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk
index 75a69d3c6b..d861f82d1c 100644
--- a/target/linux/qualcommax/image/ipq60xx.mk
+++ b/target/linux/qualcommax/image/ipq60xx.mk
@@ -37,6 +37,19 @@ define Device/netgear_wax214
endef
TARGET_DEVICES += netgear_wax214
+define Device/qihoo_360v6
+ $(call Device/FitImage)
+ $(call Device/UbiFit)
+ DEVICE_VENDOR := Qihoo
+ DEVICE_MODEL := 360V6
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ SOC := ipq6000
+ DEVICE_DTS_CONFIG := config at cp03-c1
+ DEVICE_PACKAGES := ipq-wifi-qihoo_360v6
+endef
+TARGET_DEVICES += qihoo_360v6
+
define Device/yuncore_fap650
$(call Device/FitImage)
$(call Device/UbiFit)
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 86d55de7b8..86ed04f34b 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
@@ -20,6 +20,9 @@ ipq60xx_setup_interfaces()
netgear,wax214)
ucidef_set_interfaces_lan_wan "lan"
;;
+ qihoo,360v6)
+ ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
+ ;;
yuncore,fap650)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
@@ -29,9 +32,30 @@ ipq60xx_setup_interfaces()
esac
}
+ipq60xx_setup_macs()
+{
+ local board="$1"
+ local lan_mac=""
+ local wan_mac=""
+ local label_mac=""
+
+ case "$board" in
+ qihoo,360v6)
+ lan_mac=$(mtd_get_mac_ascii factory lanMac)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ label_mac=$lan_mac
+ ;;
+ esac
+
+ [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+ [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
+}
+
board_config_update
board=$(board_name)
ipq60xx_setup_interfaces $board
+ipq60xx_setup_macs $board
board_config_flush
exit 0
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 cc2de7514e..e35413e1e0 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
@@ -18,6 +18,13 @@ case "$FIRMWARE" in
netgear,wax214)
caldata_extract "0:art" 0x1000 0x10000
;;
+ qihoo,360v6)
+ caldata_extract "0:art" 0x1000 0x10000
+ label_mac=$(mtd_get_mac_ascii factory lanMac)
+ ath11k_patch_mac $(macaddr_add $label_mac 3) 0
+ ath11k_patch_mac $(macaddr_add $label_mac 2) 1
+ ath11k_set_macflag
+ ;;
yuncore,fap650)
caldata_extract "0:art" 0x1000 0x20000
;;
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 cbc6292978..c545746b31 100644
--- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
@@ -37,7 +37,8 @@ platform_do_upgrade() {
fw_setenv bootcount 0
nand_do_upgrade "$1"
;;
- netgear,wax214)
+ netgear,wax214|\
+ qihoo,360v6)
nand_do_upgrade "$1"
;;
yuncore,fap650)
More information about the lede-commits
mailing list