From 4eee58acd574b7b5cfb4051548c9710caf9422cc Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 23 Apr 2021 09:58:05 +0800 Subject: [PATCH] ath79: add support for Arris SBC-AC1750 --- .../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 000000000..cfbf9697d --- /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 = "arris:green:wlan2g"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "arris:green:wlan5g"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + usb { + label = "arris:green:usb"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port0>, <&hub_port1>; + linux,default-trigger = "usbport"; + }; + + led_wps: wps { + label = "arris: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 05f8c2308..ff40dab90 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -74,6 +74,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 910df517a..b306b7559 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 @@ -33,6 +33,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 d5fd3db24..1eace3b6e 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) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary art 0x12) diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index 738f2f0a5..1b208967b 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