From d1f1e5269ed992e6fc30d575b43b0913c9e58ca2 Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Fri, 23 Oct 2020 16:05:28 +0200 Subject: [PATCH] ipq40xx: add support for MikroTik SXTsq 5 ac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for the MikroTik SXTsq 5 ac (RBSXTsqG-5acD), an outdoor 802.11ac wireless CPE with one 10/100/1000 Mbps Ethernet port. Specifications: - SoC: Qualcomm Atheros IPQ4018 - RAM: 256 MB - Storage: 16 MB NOR - Wireless: IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 16 dBi antennae - Ethernet: IPQ4018 (SoC) 1x 10/100/1000 port, 10-28 Vdc PoE in - 1x Ethernet LED (green) - 7x user-controllable LEDs · 1x power (blue) · 1x user (green) · 5x rssi (green) Note: Serial UART is probably available on the board, but it has not been tested. Flashing: Boot via TFTP the initramfs image. Then, upload a sysupgrade image via SSH and flash it normally. More info at the "Common procedures for MikroTik products" page https://openwrt.org/toh/mikrotik/common. Signed-off-by: Roger Pueyo Centelles --- package/firmware/ipq-wifi/Makefile | 2 + .../board-mikrotik_sxtsq-5-ac.qca4019 | Bin 0 -> 12176 bytes .../ipq40xx/base-files/etc/board.d/01_leds | 8 + .../ipq40xx/base-files/etc/board.d/02_network | 5 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 3 +- .../base-files/lib/upgrade/platform.sh | 3 +- .../arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts | 242 ++++++++++++++++++ target/linux/ipq40xx/image/mikrotik.mk | 8 + .../901-arm-boot-add-dts-files.patch | 3 +- 9 files changed, 271 insertions(+), 3 deletions(-) create mode 100644 package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 770360443a28f2..e3b25bb556658e 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -44,6 +44,7 @@ ALLWIFIBOARDS:= \ linksys_mr8300-v0 \ luma_wrtq-329acn \ mikrotik_hap-ac2 \ + mikrotik_sxtsq-5-ac \ mobipromo_cm520-79f \ nec_wg2600hp3 \ plasmacloud_pa1200 \ @@ -128,6 +129,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) $(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN)) $(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2)) +$(eval $(call generate-ipq-wifi-package,mikrotik_sxtsq-5-ac,MikroTik SXTsq 5 ac)) $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) $(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3)) $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200)) diff --git a/package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 b/package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 new file mode 100644 index 0000000000000000000000000000000000000000..97f982637a8b10fd5bf2e6fb3cfbb3bf98cca1e1 GIT binary patch literal 12176 zcmeHN|5Fp!7Qa{!^#x_~MIZ@FNI()M31;C*3IRe0bPHRc78TG(0a3}4ln{_2@r_JN z-$37rRw{+m6=bxf%51GN)PAw__1kM_bjNvrK>vXEgPC#Oyy-6w-ra-{z9dSf)-TMS zPZOKCc{Kt}EQCXQNbl%$$>=cMZqL3_?%K^s%fglpzx;6AQU%iiqjg?_1&Eg61 zy_FDz^$j&~?b@|a<}fzyo(WPIr*)W5Kw5`e(1i~OVi8{BQ3{Vua3*4uf}y;|BfulT zBe3xhXl$(CUsFSr8G%q3ALr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<>4~M=wlV zo|?WsbL;j$e*EQb$UzJn zvGLJ;Zf=8(Rp@$p#+CaUjt-4n{D_&I`)4?PW1$k */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MikroTik SXTsq 5 ac (RBSXTsqG-5acD)"; + compatible = "mikrotik,sxtsq-5-ac"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + phy-mode = "rgmii"; + qcom,num_gmac = <1>; + qcom,single-phy; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "blue:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + panic-indicator; + }; + + led_user: user { + label = "green:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + rssilow { + label = "green:rssilow"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + }; + + rssimediumlow { + label = "green:rssimediumlow"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + rssimedium { + label = "green:rssimedium"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + + rssimediumhigh { + label = "green:rssimediumhigh"; + gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <2>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + read-only; + + hard_config { + read-only; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + + partition@100000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-SXTsq-5-ac"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x20>; +}; + +&mdio { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/image/mikrotik.mk b/target/linux/ipq40xx/image/mikrotik.mk index 9509ef8577391f..7c2fa52738f77e 100644 --- a/target/linux/ipq40xx/image/mikrotik.mk +++ b/target/linux/ipq40xx/image/mikrotik.mk @@ -18,3 +18,11 @@ define Device/mikrotik_hap-ac2 kmod-ath10k-ct-smallbuffers endef TARGET_DEVICES += mikrotik_hap-ac2 + +define Device/mikrotik_sxtsq-5-ac + $(call Device/mikrotik_nor) + DEVICE_MODEL := SXTsq 5 ac (RBSXTsqG-5acD) + SOC := qcom-ipq4018 + DEVICE_PACKAGES := ipq-wifi-mikrotik_sxtsq-5-ac rssileds +endef +TARGET_DEVICES += mikrotik_sxtsq-5-ac diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 6a421b90079b12..6b7c68bf6360cc 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,59 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,60 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -32,6 +32,7 @@ Signed-off-by: John Crispin + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-meshpoint-one.dtb \ + qcom-ipq4018-hap-ac2.dtb \ ++ qcom-ipq4018-sxtsq-5-ac.dtb \ + qcom-ipq4018-nbg6617.dtb \ + qcom-ipq4019-oap100.dtb \ + qcom-ipq4018-pa1200.dtb \