diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 3e2953be6ecb21..eb473b263127d8 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -37,6 +37,7 @@ ALLWIFIBOARDS:= \ dynalink_dl-wrx36 \ edgecore_eap102 \ edimax_cax1800 \ + gl-b3000 \ linksys_mx2000 \ linksys_mx4200 \ linksys_mx5300 \ @@ -170,6 +171,7 @@ $(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)) $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800)) +$(eval $(call generate-ipq-wifi-package,gl-b3000,Gl.iNet B3000)) $(eval $(call generate-ipq-wifi-package,linksys_mx2000,Linksys MX2000)) $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200)) $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300)) diff --git a/package/firmware/ipq-wifi/src/board-gl-b3000.bin.IPQ5018 b/package/firmware/ipq-wifi/src/board-gl-b3000.bin.IPQ5018 new file mode 100644 index 00000000000000..2738dc3fabeb44 Binary files /dev/null and b/package/firmware/ipq-wifi/src/board-gl-b3000.bin.IPQ5018 differ diff --git a/package/firmware/ipq-wifi/src/board-gl-b3000.bin.qcn6122 b/package/firmware/ipq-wifi/src/board-gl-b3000.bin.qcn6122 new file mode 100644 index 00000000000000..9b7763b7a31530 Binary files /dev/null and b/package/firmware/ipq-wifi/src/board-gl-b3000.bin.qcn6122 differ diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5000-gl-b3000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5000-gl-b3000.dts new file mode 100644 index 00000000000000..34080a1e705a15 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5000-gl-b3000.dts @@ -0,0 +1,478 @@ +// SPDX-License-Identifier: (GPL-2.0+) + +/dts-v1/; +#include "ipq5018.dtsi" +#include "ipq5018-ess.dtsi" +#include +#include +/ { + model = "GL.iNET B3000"; + compatible = "glinet,gl-b3000", "qcom,ipq5018"; + + interrupt-parent = <&intc>; + + aliases { + serial0 = &blsp1_uart1; + + ethernet0 = &dp1; + ethernet1 = &dp2; + label-mac-device = &dp2; + + led-boot = &led_system_blue; + led-failsafe = &led_status_white; + led-running = &led_status_white; + led-upgrade = &led_system_blue; + }; + chosen { + bootargs-append = " root=/dev/ubiblock0_1 swiotlb=1 coherent_pool=2M"; + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&leds_pins>; + pinctrl-names = "default"; + led_system_blue: led_system_blue { + label = "led_system_blue"; + gpio = <&tlmm 24 0>; + default-state = "on"; + }; + + led_status_white: led_status_white { + label = "led_status_white"; + gpio = <&tlmm 23 0>; + default-state = "off"; + }; + }; + + button { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + button_reset { + label = "reset"; + gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; + linux,input-type = ;//<1>; + linux,code = ; + debounce-interval = <60>; + }; + }; + 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>; + }; + }; +}; +&switch { + status = "okay"; + switch_mac_mode = ; + qcom,port_phyinfo { + // MAC0 -> GE Phy -> QCA8337 Phy2 + port@0 { + port_id = <1>; + mdiobus = <&mdio0>; + phy_address = <7>; + phy_dac = <0x10 0x10>; + // status = "disabled"; + }; + // MAC1 ---SGMII---> QCA8337 SerDes + port@1 { + port_id = <2>; + forced-speed = <1000>; + forced-duplex = <1>; + }; + }; +}; +// MAC0 -> GE Phy +&dp1 { + status = "okay"; +}; +// MAC1 ---SGMII---> QCA8337 SerDes +&dp2 { + status = "okay"; + phy-mode = "sgmii"; + nvmem-cells = <&macaddr_dp2>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; +&mdio0 { + status = "okay"; +}; +// IPQ5018 GE Phy -> QCA8337 Phy1 +&ge_phy { + status = "okay"; +}; +&mdio1 { + status = "okay"; + pinctrl-0 = <&mdio1_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>; + // 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 switch + switch0: ethernet-switch@17 { + compatible = "qca,qca8337"; + reg = <17>; + #address-cells = <1>; + #size-cells = <0>; + switch_cpu_bmp = <0x40>; /* cpu port bitmap */ + switch_lan_bmp = <0x0c>; /* lan port bitmap */ + switch_wan_bmp = <0x02>; /* wan port bitmap */ + 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>; + + }; + }; + }; +}; +&sleep_clk { + clock-frequency = <32000>; +}; +&xo_board_clk { + clock-frequency = <24000000>; +}; +&blsp1_uart1 { + status = "okay"; + pinctrl-0 = <&blsp_uart0_pins>; + pinctrl-names = "default"; +}; +&crypto { + status = "okay"; +}; +&cryptobam { + status = "okay"; +}; +&qpic_bam { + status = "okay"; +}; +&qpic_nand { + pinctrl-0 = <&qpic_pins>; + pinctrl-names = "default"; + status = "okay"; + partitions { + status = "disabled"; + }; + nand@0 { + compatible = "spi-nand"; + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + nand-ecc-engine = <&qpic_nand>; + 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 = "0:SBL1"; + reg = <0x00000000 0x80000>; + read-only; + }; + partition@80000 { + label = "0:MIBIB"; + reg = <0x00080000 0x80000>; + read-only; + }; + partition@100000 { + label = "0:BOOTCONFIG"; + reg = <0x00100000 0x40000>; + read-only; + }; + partition@140000 { + label = "0:QSEE"; + reg = <0x00140000 0x100000>; + read-only; + }; + partition@240000 { + label = "0:DEVCFG"; + reg = <0x00240000 0x40000>; + read-only; + }; + partition@280000 { + label = "0:CDT"; + reg = <0x00280000 0x40000>; + read-only; + }; + partition@2c0000 { + label = "0:APPSBLENV"; + reg = <0x002c0000 0x80000>; + }; + partition@340000 { + label = "0:APPSBL"; + reg = <0x00340000 0x140000>; + read-only; + }; + partition@480000 { + label = "0:ART"; + reg = <0x00480000 0x100000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + macaddr_dp2: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + }; + partition@580000 { + label = "0:TRAINING"; + reg = <0x00580000 0x80000>; + read-only; + }; + partition@600000 { + label = "CFG"; + reg = <0x00600000 0x200000>; + }; + partition@800000 { + label = "rootfs"; + reg = <0x00800000 0x7800000>; + }; + }; + }; +}; +&tlmm { + 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; + }; + }; + + leds_pins: leds_pins { + led_system_blue { + pins = "gpio24"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + + led_status_white { + pins = "gpio23"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; + button_pins: button_pins { + button_reset { + pins = "gpio27"; + function = "gpio"; + 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; + }; + }; + blsp_uart0_pins: blsp_uart0_pins { + pins = + "gpio20", // RX + "gpio21"; // TX + function = "blsp0_uart0"; + drive-strength = <8>; + bias-disable; + }; +}; + +&tsens { + status = "disabled"; +}; + +&pcie_x2phy { + status = "disabled"; +}; + +&pcie_x2 { + status = "disabled"; + perst-gpios = <&tlmm 15 GPIO_ACTIVE_LOW>; +}; + +&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 = + ; + + // 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"; + status = "okay"; + }; + + // 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"; + + status = "okay"; + }; +}; +&wifi0 { + // IPQ5018 + qcom,rproc = <&q6_wcss_pd1>; + qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; + qcom,ath11k-calibration-variant = "GL-iNet-GL-B3000"; + 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 = "GL-iNet-GL-B3000"; + qcom,ath11k-fw-memory-mode = <2>; + qcom,bdf-addr = <0x4d100000>; + qcom,m3-dump-addr = <0x4df00000>; + status = "okay"; +}; \ No newline at end of file diff --git a/target/linux/qualcommax/image/ipq50xx.mk b/target/linux/qualcommax/image/ipq50xx.mk index 997a2ecf67e793..2af8e55c6d01ac 100644 --- a/target/linux/qualcommax/image/ipq50xx.mk +++ b/target/linux/qualcommax/image/ipq50xx.mk @@ -1,3 +1,17 @@ +define Device/glinet_gl-b3000 + $(call Device/FitImage) + $(call Device/UbiFit) + SOC := ipq5000 + DEVICE_VENDOR := GL.iNET + DEVICE_MODEL := GL-B3000 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@mp03.5-c1 + UBINIZE_OPTS := -E 5 + DEVICE_PACKAGES := ath11k-firmware-qcn6122 ipq-wifi-gl-b3000 +endef +TARGET_DEVICES += glinet_gl-b3000 + define Device/linksys_mx2000 $(call Device/FitImageLzma) DEVICE_VENDOR := Linksys diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network index bcf606c75680b9..3fa76e36e2ec0d 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network @@ -7,6 +7,9 @@ ipq50xx_setup_interfaces() { local board="$1" case $board in + glinet,gl-b3000) + ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" + ;; linksys,mx2000|\ linksys,mx5500) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index ad1e0f153528ad..1369788e3a642b 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -17,6 +17,9 @@ case "$FIRMWARE" in ath11k_remove_regdomain ath11k_set_macflag ;; + glinet,gl-b3000) + caldata_extract "0:ART" 0x1000 0x20000 + ;; esac ;; "ath11k/qcn6122/hw1.0/cal-ahb-soc@0:wifi1@c000000.bin") @@ -28,6 +31,9 @@ case "$FIRMWARE" in ath11k_remove_regdomain ath11k_set_macflag ;; + glinet,gl-b3000) + caldata_extract "0:ART" 0x26800 0x20000 + ;; esac ;; "ath11k/QCN9074/hw1.0/cal-pci-0001:01:00.0.bin") @@ -39,6 +45,8 @@ case "$FIRMWARE" in ath11k_remove_regdomain ath11k_set_macflag ;; + glinet,gl-b3000) + caldata_extract "0:ART" 0x26800 0x20000 esac ;; *) diff --git a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh index 5be51c77fd68d1..1702201f15e99f 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh @@ -10,6 +10,9 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in + glinet,gl-b3000) + nand_do_upgrade "$1" + ;; linksys,mx2000|\ linksys,mx5500) boot_part="$(fw_printenv -n boot_part)"