From f22581a84b21f7ef54ae90b2e3432bb06aff49f2 Mon Sep 17 00:00:00 2001 From: LGA1150 Date: Wed, 9 Oct 2019 09:20:26 +0800 Subject: [PATCH] ath79: add CSAC --- target/linux/ath79/dts/qca9563_xwrt_csac.dts | 170 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 7 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ath79/image/generic.mk | 9 + 4 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9563_xwrt_csac.dts diff --git a/target/linux/ath79/dts/qca9563_xwrt_csac.dts b/target/linux/ath79/dts/qca9563_xwrt_csac.dts new file mode 100644 index 0000000000..55e98dcaab --- /dev/null +++ b/target/linux/ath79/dts/qca9563_xwrt_csac.dts @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + model = "XWRT CSAC"; + compatible = "xwrt,csac", "qca,qca9563"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: sys { + label = "xwrt:blue:sys"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "xwrt:blue:wlan2g"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "xwrt:blue:wlan5g"; + gpios = <&gpio 9 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + lte_modem_enable { + gpio-export,name = "lte_modem_enable"; + gpio-export,output = <1>; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&spi { + num-cs = <1>; + + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfa0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x50 0xcc35cc35 /* LED_CTRL0 */ + 0x54 0xcb37cb37 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x00f3cf00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&art 0x0>; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 518ca6f91a..4df27fae1a 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -216,7 +216,8 @@ ath79_setup_interfaces() iodata,wn-ag300dgr|\ pcs,cr5000|\ sitecom,wlr-7100|\ - wd,mynet-n750) + wd,mynet-n750|\ + xwrt,csac) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" ;; @@ -571,6 +572,10 @@ ath79_setup_macs() wd,mynet-wifi-rangeextender) lan_mac=$(nvram get et0macaddr) ;; + xwrt,csac) + wan_mac=$(mtd_get_mac_binary art 0) + lan_mac=$(mtd_get_mac_binary art 6) + ;; zyxel,nbg6616) label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 02ddc19564..4794934a6d 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -263,6 +263,7 @@ case "$FIRMWARE" in ath10kcal_extract "art" 0x5000 0x2f20 ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) ;; + xwrt,csac|\ yuncore,a782|\ yuncore,xd4200) ath10kcal_extract "art" 0x5000 0x2f20 diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 64dfc04244..d939156ec0 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1545,6 +1545,15 @@ define Device/xiaomi_mi-router-4q endef TARGET_DEVICES += xiaomi_mi-router-4q +define Device/xwrt_csac + SOC := qca9563 + DEVICE_VENDOR := XWRT + DEVICE_MODEL := CSAC + IMAGE_SIZE := 16000k + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct kmod-usb2 +endef +TARGET_DEVICES += xwrt_csac + define Device/yuncore_a770 SOC := qca9531 DEVICE_VENDOR := YunCore