qualcommax: ipq50xx: add CMCC RAX3000Q support

This commit is contained in:
coolsnowwolf 2025-02-13 18:17:57 +08:00
parent 9dc66796d5
commit bf665a29b2
7 changed files with 435 additions and 1 deletions

View File

@ -31,6 +31,7 @@ ALLWIFIBOARDS:= \
aliyun_ap8220 \
arcadyan_aw1000 \
buffalo_wxr-5950ax12 \
cmcc_rax3000q \
compex_wpq873 \
dynalink_dl-wrx36 \
edgecore_eap102 \
@ -101,10 +102,12 @@ define ipq-wifi-install-one
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ6018/hw1.0),\
$(if $(filter $(suffix $(1)),.IPQ8074 .ipq8074),\
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ8074/hw2.0),\
$(if $(filter $(suffix $(1)),.QCN6122 .qcn6122),\
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),QCN6122/hw1.0),\
$(if $(filter $(suffix $(1)),.QCN9074 .qcn9074),\
$(call ipq-wifi-install-ath11-one-to,$(1),$(2),QCN9074/hw1.0),\
$(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
)))))))))
))))))))))
endef
# Blank line required at end of above define due to foreach context
@ -143,6 +146,7 @@ endef
$(eval $(call generate-ipq-wifi-package,aliyun_ap8220,Aliyun AP8220))
$(eval $(call generate-ipq-wifi-package,arcadyan_aw1000,Arcadyan AW1000))
$(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12))
$(eval $(call generate-ipq-wifi-package,cmcc_rax3000q,CMCC RAX3000Q))
$(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_eap102,Edgecore EAP102))

View File

@ -0,0 +1,414 @@
// SPDX-License-Identifier: (GPL-2.0+)
/dts-v1/;
#include "ipq5018.dtsi"
#include "ipq5018-ess.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
#address-cells = <0x2>;
#size-cells = <0x2>;
model = "CMCC RAX3000Q";
compatible = "cmcc,rax3000q", "qcom,ipq5018";
interrupt-parent = <&intc>;
aliases {
ethernet1 = &dp2;
label-mac-device = &dp2;
serial0 = &blsp1_uart1;
led-boot = &led_blue;
led-failsafe = &led_blue;
led-running = &led_blue;
led-upgrade = &led_white;
};
chosen {
stdout-path = "serial0:115200n8";
bootargs-append = " root=/dev/ubiblock0_1";
};
keys {
compatible = "gpio-keys";
pinctrl-0 = <&button_pins>;
pinctrl-names = "default";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
pinctrl-0 = <&leds_pins>;
pinctrl-names = "default";
led_blue: status_blue {
label = "blue:status";
gpio = <&tlmm 24 GPIO_ACTIVE_HIGH>;
};
led_white: status_white {
label = "white:status";
gpio = <&tlmm 23 GPIO_ACTIVE_HIGH>;
};
};
reserved-memory {
tz_appps@4a400000 {
no-map;
reg = <0x0 0x4a400000 0x0 0x400000>;
};
q6_mem_regions: q6_mem_regions@4b000000 {
no-map;
reg = <0x0 0x4b000000 0x0 0x3000000>;
};
};
};
&sleep_clk {
clock-frequency = <32000>;
};
&xo_board_clk {
clock-frequency = <24000000>;
};
&blsp1_uart1 {
pinctrl-0 = <&blsp0_uart_pins>;
pinctrl-names = "default";
status = "okay";
};
&crypto {
status = "okay";
};
&cryptobam {
status = "okay";
};
&dp1 {
status = "okay";
};
&dp2 {
phy-mode = "sgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
};
};
&ge_phy {
status = "okay";
};
&mdio0 {
status = "okay";
};
&mdio1 {
pinctrl-0 = <&mdio1_pins>;
pinctrl-names = "default";
reset-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>;
status = "okay";
// QCA8337 Phy0 -> WAN
qca8337_0: ethernet-phy@0 {
reg = <0>;
};
// QCA8337 Phy1 -> LAN1
qca8337_1: ethernet-phy@1 {
reg = <1>;
};
// QCA8337 Phy3 -> LAN2
qca8337_2: ethernet-phy@2 {
reg = <2>;
};
// QCA8337 Phy2 -> IPQ5018 GE Phy
qca8337_3: ethernet-phy@3 {
reg = <3>;
};
// QCA8337 Phy4 -> LAN3
qca8337_4: ethernet-phy@4 {
reg = <4>;
};
// QCA8337 switch
switch0: ethernet-switch@17 {
compatible = "qca,qca8337";
reg = <17>;
#address-cells = <1>;
#size-cells = <0>;
switch_cpu_bmp = <0x48>; // CPU port bitmap: 3 6
switch_lan_bmp = <0x34>; // LAN port bitmap: 2 4 5
switch_wan_bmp = <0x02>; // WAN port bitmap: 1
ports {
#address-cells = <1>;
#size-cells = <0>;
switch0cpu: port@0 {
reg = <0>;
label = "cpu";
phy-mode = "sgmii";
ethernet = <&dp2>;
qca,sgmii-enable-pll;
fixed-link {
speed = <1000>;
full-duplex;
};
};
// QCA8337 Phy0 -> WAN
port@1 {
reg = <1>;
label = "wan";
phy-handle = <&qca8337_0>;
port_id = <1>;
phy_address = <0>;
};
// QCA8337 Phy1 -> LAN1
port@2 {
reg = <2>;
label = "lan1";
phy-handle = <&qca8337_1>;
port_id = <2>;
phy_address = <1>;
};
// QCA8337 Phy3 -> LAN2
port@3 {
reg = <3>;
label = "lan2";
phy-handle = <&qca8337_2>;
port_id = <3>;
phy_address = <2>;
};
// QCA8337 Phy4 -> LAN3
port@5 {
reg = <5>;
label = "lan3";
phy-handle = <&qca8337_4>;
port_id = <5>;
phy_address = <4>;
};
};
};
};
&prng {
status = "okay";
};
&q6v5_wcss {
status = "okay";
memory-region = <&q6_mem_regions>;
firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
"ath11k/IPQ5018/hw1.0/m3_fw.mdt",
"ath11k/qcn6122/hw1.0/m3_fw.mdt";
boot-args =
</* type: */ 0x1 /* PCIE0 */
/* length: */ 4
/* PD id: */ 3
/* reset GPIO: */ 15
/* reserved: */ 0 0>;
// IPQ5018
q6_wcss_pd1: pd-1 {
firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
resets =
<&gcc GCC_WCSSAON_RESET>,
<&gcc GCC_WCSS_BCR>,
<&gcc GCC_CE_BCR>;
reset-names =
"wcss_aon_reset",
"wcss_reset",
"ce_reset";
clocks =
<&gcc GCC_WCSS_AHB_S_CLK>,
<&gcc GCC_WCSS_ACMT_CLK>,
<&gcc GCC_WCSS_AXI_M_CLK>;
clock-names =
"gcc_wcss_ahb_s_clk",
"gcc_wcss_acmt_clk",
"gcc_wcss_axi_m_clk";
interrupts-extended =
<&wcss_smp2p_in 8 0>,
<&wcss_smp2p_in 9 0>,
<&wcss_smp2p_in 12 0>,
<&wcss_smp2p_in 11 0>;
interrupt-names =
"fatal",
"ready",
"spawn-ack",
"stop-ack";
qcom,smem-states =
<&wcss_smp2p_out 8>,
<&wcss_smp2p_out 9>,
<&wcss_smp2p_out 10>;
qcom,smem-state-names =
"shutdown",
"stop",
"spawn";
};
// QCN6102 5G
q6_wcss_pd3: pd-3 {
firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
interrupts-extended =
<&wcss_smp2p_in 24 0>,
<&wcss_smp2p_in 25 0>,
<&wcss_smp2p_in 28 0>,
<&wcss_smp2p_in 27 0>;
interrupt-names =
"fatal",
"ready",
"spawn-ack",
"stop-ack";
qcom,smem-states =
<&wcss_smp2p_out 24>,
<&wcss_smp2p_out 25>,
<&wcss_smp2p_out 26>;
qcom,smem-state-names =
"shutdown",
"stop",
"spawn";
};
};
&qpic_bam {
status = "okay";
};
&qpic_nand {
pinctrl-0 = <&qpic_pins>;
pinctrl-names = "default";
status = "okay";
nand@0 {
compatible = "spi-nand";
#address-cells = <1>;
#size-cells = <1>;
reg = <0>;
nand-ecc-engine = <&qpic_nand>;
nand-ecc-strength = <4>;
nand-ecc-step-size = <512>;
nand-bus-width = <8>;
partitions {
compatible = "qcom,smem-part";
};
};
};
&switch {
switch_mac_mode = <MAC_MODE_SGMII_CHANNEL0>;
status = "okay";
qcom,port_phyinfo {
// MAC0 -> GE Phy -> QCA8337 Phy2
port@0 {
port_id = <1>;
mdiobus = <&mdio0>;
phy_address = <7>;
phy_dac = <0x10 0x10>;
};
// MAC1 ---SGMII---> QCA8337 SerDes
port@1 {
port_id = <2>;
forced-speed = <1000>;
forced-duplex = <1>;
};
};
};
&tlmm {
blsp0_uart_pins: uart_pins {
blsp0_uart_rx_tx {
pins = "gpio20", "gpio21";
function = "blsp0_uart0";
bias-disable;
};
};
button_pins: button_pins {
mux {
pins = "gpio27";
function = "gpio";
drive-strength = <8>;
bias-pull-up;
};
};
leds_pins: leds_pins {
mux {
pins = "gpio23", "gpio24";
function = "gpio";
drive-strength = <8>;
bias-pull-down;
};
};
mdio1_pins: mdio-state {
mdc-pins {
pins = "gpio36";
function = "mdc";
drive-strength = <8>;
bias-pull-up;
};
mdio-pins {
pins = "gpio37";
function = "mdio";
drive-strength = <8>;
bias-pull-up;
};
};
qpic_pins: qpic-state {
clock-pins {
pins = "gpio9";
function = "qspi_clk";
drive-strength = <8>;
bias-disable;
};
cs-pins {
pins = "gpio8";
function = "qspi_cs";
drive-strength = <8>;
bias-disable;
};
data-pins {
pins = "gpio4", "gpio5", "gpio6", "gpio7";
function = "qspi_data";
drive-strength = <8>;
bias-disable;
};
};
};
&wifi0 {
qcom,rproc = <&q6_wcss_pd1>;
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
qcom,ath11k-calibration-variant = "CMCC-RAX3000Q";
qcom,ath11k-fw-memory-mode = <2>;
qcom,bdf-addr = <0x4c400000>;
status = "okay";
};
&wifi1 {
qcom,rproc = <&q6_wcss_pd3>;
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
qcom,ath11k-calibration-variant = "CMCC-RAX3000Q";
qcom,ath11k-fw-memory-mode = <2>;
qcom,bdf-addr = <0x4d100000>;
qcom,m3-dump-addr = <0x4df00000>;
status = "okay";
};

View File

@ -5,6 +5,19 @@ define Device/EmmcImage
IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
endef
define Device/cmcc_rax3000q
$(call Device/FitImage)
$(call Device/UbiFit)
SOC := ipq5018
DEVICE_VENDOR := CMCC
DEVICE_MODEL := RAX3000Q
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@mp02.1
DEVICE_PACKAGES := ath11k-firmware-qcn6122 ipq-wifi-cmcc_rax3000q
endef
TARGET_DEVICES += cmcc_rax3000q
define Device/glinet_gl-b3000
$(call Device/FitImage)
$(call Device/UbiFit)

View File

@ -10,6 +10,7 @@ ipq50xx_setup_interfaces()
glinet,gl-b3000)
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
;;
cmcc,rax3000q|\
jdcloud,re-cs-03|\
linksys,mx2000|\
linksys,mx5500)

View File

@ -9,6 +9,7 @@ board=$(board_name)
case "$FIRMWARE" in
"ath11k/IPQ5018/hw1.0/cal-ahb-c000000.wifi.bin")
case "$board" in
cmcc,rax3000q|\
glinet,gl-b3000)
caldata_extract "0:ART" 0x1000 0x20000
addr=$(mtd_get_mac_binary "0:ART" 0x6)
@ -30,6 +31,7 @@ case "$FIRMWARE" in
;;
"ath11k/QCN6122/hw1.0/cal-ahb-b00a040.wifi1.bin")
case "$board" in
cmcc,rax3000q|\
glinet,gl-b3000)
caldata_extract "0:ART" 0x26800 0x20000
addr=$(mtd_get_mac_binary "0:ART" 0x6)