From f9b94cbbad5d429474644484677e5fa8319ea6d2 Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Wed, 27 May 2020 11:52:26 +0800 Subject: [PATCH] ath79: add support for Arris SBC-AC1750 Specifications: - SoC: QCA9558 - Flash: 128M NAND - RAM: 256M - Ethernet: QCA8337, 1 WAN and 4 LANs - 2.4GHz wireless: SoC integrated - 5GHz wireless: QCA9880 - 2 buttons (Reset and WPS) - 4 GPIO-LEDs - USB 2.0 port Flash instructions: (To be done) Note: This router has an external watchdog connected to SoC's GPIO 18. If the watchdog is not fed for about 2 seconds, it will reset the SoC. Unfortunately, the stock U-boot has a bug that it does not feed the watchdog when decompressing kernel. If the kernel is LZMA-compressed, it might take too long before watchdog timeout. So we have to use gzip instead for faster decompressing speed. For initramfs image, compression is not used because it is bigger and will take even more time to decompress. Signed-off-by: DENG Qingfang Signed-off-by: CN_SZTL --- .../ath79/dts/qca9558_arris_sbr-ac1750.dts | 205 ++++++++++++++++++ target/linux/ath79/image/nand.mk | 19 ++ .../nand/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 4 + target/linux/ath79/nand/config-default | 2 + 5 files changed, 231 insertions(+) create mode 100644 target/linux/ath79/dts/qca9558_arris_sbr-ac1750.dts diff --git a/target/linux/ath79/dts/qca9558_arris_sbr-ac1750.dts b/target/linux/ath79/dts/qca9558_arris_sbr-ac1750.dts new file mode 100644 index 0000000000..e5402fee64 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_arris_sbr-ac1750.dts @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca955x.dtsi" + +/ { + model = "Arris SBR-AC1750"; + compatible = "arris,sbr-ac1750", "qca,qca9557"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + aliases { + led-boot = &led_wps; + led-failsafe = &led_wps; + led-upgrade = &led_wps; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + usb { + label = "green:usb"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port0>, <&hub_port1>; + linux,default-trigger = "usbport"; + }; + + led_wps: wps { + label = "green:wps"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wps { + linux,code = ; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + hw_margin_ms = <1600>; + always-running; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x100000>; + read-only; + }; + + partition@100000 { + label = "boot-flag"; + reg = <0x100000 0x100000>; + }; + + partition@200000 { + label = "kernel"; + reg = <0x200000 0x400000>; + }; + + partition@600000 { + label = "ubi"; + reg = <0x600000 0x6400000>; + }; + + ft: partition@6a00000 { + label = "ft"; + reg = <0x6a00000 0x100000>; + read-only; + }; + + partition@6b00000 { + label = "PKI"; + reg = <0x6b00000 0x200000>; + read-only; + }; + + caldata: partition@6d00000 { + label = "caldata"; + reg = <0x6d00000 0x100000>; + read-only; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ + 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0 STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&ft 0x0>; + pll-data = <0x56000000 0x00000101 0x00001616>; + phy-handle = <&phy0>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&ft 0x6>; + pll-data = <0x03000101 0x00000101 0x00001616>; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&caldata 0x1000>; + mtd-mac-address = <&ft 0xc>; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 4194a2db43..65c55ff1eb 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -72,6 +72,25 @@ define Device/aerohive_hiveap-121 endef TARGET_DEVICES += aerohive_hiveap-121 +define Device/arris_sbr-ac1750 + SOC := qca9558 + DEVICE_VENDOR := Arris + DEVICE_MODEL := SBR-AC1750 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + KERNEL_SIZE := 4096k + BLOCKSIZE := 128k + IMAGE_SIZE := 32m + PAGESIZE := 2048 + KERNEL := kernel-bin | append-dtb | gzip | uImage gzip + KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none + IMAGES += kernel1.bin rootfs1.bin + IMAGE/kernel1.bin := append-kernel | check-size $$$$(KERNEL_SIZE) + IMAGE/rootfs1.bin := append-ubi | check-size + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + UBINIZE_OPTS := -E 5 +endef +TARGET_DEVICES += arris_sbr-ac1750 + define Device/domywifi_dw33d SOC := qca9558 DEVICE_VENDOR := DomyWifi diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index a6287df6c8..ac0fd9c6b1 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -34,6 +34,7 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" ;; + arris,sbr-ac1750|\ zyxel,nbg6716) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index e0ffbd9334..28dfba6487 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -9,6 +9,10 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in + arris,sbr-ac1750) + caldata_extract "caldata" 0x5000 0x844 + ath10k_patch_mac $(mtd_get_mac_binary ft 0x12) + ;; domywifi,dw33d|\ domywifi,dw33d-nor) caldata_extract "art" 0x5000 0x844 diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index 9ae059508f..d6f5f4a747 100644 --- a/target/linux/ath79/nand/config-default +++ b/target/linux/ath79/nand/config-default @@ -3,6 +3,8 @@ CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_HASH_INFO=y CONFIG_CRYPTO_LZO=y +CONFIG_GPIO_WATCHDOG=y +CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MTD_NAND=y