From: Robert Marko Date: Wed, 18 Sep 2019 18:04:43 +0000 (+0200) Subject: ipq40xx: Add support for Mikrotik Wireless Wire dish LHGG-60ad X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=9e31a45ba2504329bc0ee097f249894050273c9a;p=openwrt%2Fstaging%2Flynxis.git ipq40xx: Add support for Mikrotik Wireless Wire dish LHGG-60ad LHGG-60ad is IPQ4019 + wil6210 based. Specification: - Qualcomm IPQ4019 (717 MHz) - 256 MB of RAM (DDR3L) - 16 MB (SPI NOR) of flash - 1x Gbit ethernet, 802.3af/at POE IN connected through AR8035. - WLAN: wil6210 802.11ad PCI card - No USB or SD card ports - UART disabled - 8x LEDs Biggest news is the wil6210 PCI card. Integration for its configuration and detection will be in other patches. Install instructions: Since ipq-aux-loader enables native support its installed like ar71xx RB boards. Signed-off-by: Robert Marko --- diff --git a/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/target/linux/ipq40xx/base-files/etc/board.d/01_leds index e8e67af3a9..223acf4e4e 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds +++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -24,7 +24,8 @@ avm,fritzbox-4040) ucidef_set_led_switch "lan" "LAN" "fritz4040:green:lan" "switch0" "0x1e" ;; avm,fritzbox-7530 |\ -glinet,gl-b1300) +glinet,gl-b1300 |\ +mikrotik,lhgg-60ad) ucidef_set_led_wlan "wlan" "WLAN" "${boardname}:green:wlan" "phy0tpt" ;; edgecore,oap100) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 9ca29d8071..bef9044334 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -26,6 +26,7 @@ ipq40xx_setup_interfaces() engenius,eap1300|\ engenius,emd1|\ meraki,mr33|\ + mikrotik,lhgg-60ad|\ netgear,ex6100v2|\ netgear,ex6150v2|\ zyxel,wre6606) @@ -164,6 +165,9 @@ ipq40xx_setup_macs() lan_mac=$(macaddr_add $wan_mac 1) label_mac="$wan_mac" ;; + mikrotik,lhgg-60ad) + lan_mac=$(mtd_get_mac_binary hard_config 0x10) + ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index b3c51d0089..372ade8df4 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -126,6 +126,7 @@ platform_pre_upgrade() { local board=$(board_name) case "$board" in + mikrotik,lhgg-60ad|\ mikrotik,hap-ac2) [ -z "$(rootfs_type)" ] && mtd erase firmware ;; diff --git a/target/linux/ipq40xx/config-4.19 b/target/linux/ipq40xx/config-4.19 index c70c761d25..261e6fa1a0 100644 --- a/target/linux/ipq40xx/config-4.19 +++ b/target/linux/ipq40xx/config-4.19 @@ -326,6 +326,7 @@ CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_SPLIT_WRGG_FW=y +CONFIG_MTD_SPLIT_MINOR_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts new file mode 100644 index 0000000000..158811ce62 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts @@ -0,0 +1,258 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, Robert Marko + * + * 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. + * + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Mikrotik Wireless Wire Dish LHGG-60ad"; + compatible = "mikrotik,lhgg-60ad"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &user; + led-failsafe = &user; + led-running = &user; + led-upgrade = &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-switch@c000000 { + switch_mac_mode = <0x3>; /* mac mode for RGMII RMII */ + switch_lan_bmp = <0x0>; /* lan port bitmap */ + switch_wan_bmp = <0x10>; /* wan port bitmap */ + }; + + edma@c080000 { + qcom,single-phy; + qcom,num_gmac = <1>; + phy-mode = "rgmii-id"; + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power: power { + label = "lhgg-60ad:blue:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + panic-indicator; + }; + + user: user { + label = "lhgg-60ad:yellow:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "lhgg-60ad:green:wlan"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + }; + + align-left { + label = "lhgg-60ad:green:align-left"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + align-right { + label = "lhgg-60ad:green:align-right"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + + wlan-rx { + label = "lhgg-60ad:green:align-down"; + gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + }; + + wlan-tx { + label = "lhgg-60ad:green:align-up"; + 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 { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + status = "okay"; + + m25p80@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition0@0 { + label = "RouterBoot"; + reg = <0x80000 0xe000>; + read-only; + }; + + partition1@8e000 { + label = "hard_config"; + reg = <0x8e000 0x01000>; + }; + + partition2@90000 { + label = "dts_config"; + reg = <0x90000 0x10000>; + read-only; + }; + + partition3@bd000 { + label = "soft_config"; + reg = <0xbd000 0x01000>; + }; + + partition4@1000000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 42 GPIO_ACTIVE_HIGH>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + /* wil6210 802.11ad card */ + wifi: wifi@1,0 { + status = "okay"; + /* wil6210 driver has no compatible */ + reg = <0x00010000 0 0 0 0>; + }; + }; +}; + +&gmac0 { + qcom,phy_mdio_addr = <0>; + qcom,poll_required = <1>; + vlan_tag = <0 0x20>; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index efe6dccd01..8c98fd32c1 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -591,6 +591,14 @@ define Device/mikrotik_hap-ac2 endef TARGET_DEVICES += mikrotik_hap-ac2 +define Device/mikrotik_lhgg-60ad + $(call Device/MikrotikNOR) + DEVICE_MODEL := Wireless Wire Dish LHGG-60ad + DEVICE_DTS := qcom-ipq4019-lhgg-60ad + DEVICE_PACKAGES += -kmod-ath10k-ct -ath10k-firmware-qca4019-ct kmod-wil6210 +endef +TARGET_DEVICES += mikrotik_lhgg-60ad + define Device/mobipromo_cm520-79f $(call Device/FitzImage) $(call Device/UbiFit) diff --git a/target/linux/ipq40xx/image/ipq-aux-loader/Makefile b/target/linux/ipq40xx/image/ipq-aux-loader/Makefile index 5659b69194..4c7f34d335 100644 --- a/target/linux/ipq40xx/image/ipq-aux-loader/Makefile +++ b/target/linux/ipq40xx/image/ipq-aux-loader/Makefile @@ -50,6 +50,7 @@ loader-compile: $(PKG_BUILD_DIR)/.prepared TEXT_BASE2_FAT=$(TEXT_BASE2_FAT) \ CPU_TYPE=$(CPU_TYPE) KERNEL_IMAGE=$(LOADER_DATA) \ BLOCKSIZE=$(BLOCKSIZE) PAGESIZE=$(PAGESIZE) \ + UART=$(UART) \ clean $(LOADER_TYPE) loader.elf: $(PKG_BUILD_DIR)/bin/loader.elf 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 f69a923361..0499ff219b 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 @@ -12,7 +12,7 @@ Index: linux-5.4.63/arch/arm/boot/dts/Makefile =================================================================== --- linux-5.4.63.orig/arch/arm/boot/dts/Makefile +++ linux-5.4.63/arch/arm/boot/dts/Makefile -@@ -837,11 +837,53 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,54 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -30,6 +30,7 @@ Index: linux-5.4.63/arch/arm/boot/dts/Makefile + qcom-ipq4018-ex6150v2.dtb \ + qcom-ipq4018-fritzbox-4040.dtb \ + qcom-ipq4018-hap-ac2.dtb \ ++ qcom-ipq4019-lhgg-60ad.dts \ + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-meshpoint-one.dtb \ + qcom-ipq4018-nbg6617.dtb \