From 0b4ad46cb329f5543290d2f11d22c4e10b8fbf87 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Mon, 21 Dec 2020 23:39:51 +0100 Subject: [PATCH] ath79: add support for Ubiquiti LiteStation SR71 Specifications: SoC: AR7130 DRAM: 32Mb DDR1 Flash: 16Mb SPI-NOR LAN: 2x 10/100Mbps via ADM6996 switch on MII (1 with PoE) PCI: 1x mini-PCI UART: standard UART header JTAG: yes LEDs: 8x LEDs Installation instructions: The original FIS partitioning does not provide enough space for the kernel, so the installation must start with re-partitioning the flash from RedBoot. The MAC address is stored in the "boardconfig" partition, which is automatically created. Signed-off-by: Zoltan HERPAI --- target/linux/ath79/dts/ar7130_ubnt_sr71.dts | 104 ++++++++++++++++++ .../base-files/lib/upgrade/platform.sh | 3 +- target/linux/ath79/generic/config-default | 1 + target/linux/ath79/image/generic-ubnt.mk | 19 ++++ 4 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/ar7130_ubnt_sr71.dts diff --git a/target/linux/ath79/dts/ar7130_ubnt_sr71.dts b/target/linux/ath79/dts/ar7130_ubnt_sr71.dts new file mode 100644 index 0000000000..09fe7ad166 --- /dev/null +++ b/target/linux/ath79/dts/ar7130_ubnt_sr71.dts @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7100.dtsi" + +#include +#include + +/ { + compatible = "ubnt,sr71", "qca,ar7130"; + model = "Ubiquiti LiteStation SR71"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + extosc: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-output-names = "ref"; + clock-frequency = <40000000>; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "green:system"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + d28 { + label = "green:d28"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "sw4"; + linux,code = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +ð0 { + status = "okay"; +}; + +ð1 { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "ecoscentric,redboot-fis-partitions"; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + phy-mode = "mii"; + + fixed-link { + speed = <100>; + full-duplex; + }; +}; + +ð1 { + phy-mode = "rmii"; + + fixed-link { + speed = <100>; + full-duplex; + }; +}; diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 703bf08c08..d817469422 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -64,7 +64,8 @@ platform_do_upgrade() { ;; atheros,pb42|\ ubnt,routerstation|\ - ubnt,routerstation-pro) + ubnt,routerstation-pro|\ + ubnt,sr71) redboot_fis_do_upgrade "$1" kernel ;; jjplus,ja76pf2) diff --git a/target/linux/ath79/generic/config-default b/target/linux/ath79/generic/config-default index 0ac756642f..2561a6693a 100644 --- a/target/linux/ath79/generic/config-default +++ b/target/linux/ath79/generic/config-default @@ -15,6 +15,7 @@ CONFIG_MARVELL_PHY=y CONFIG_MICREL_PHY=y CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-3 CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y CONFIG_MTD_SPLIT_EVA_FW=y CONFIG_PHY_AR7100_USB=y CONFIG_PHY_AR7200_USB=y diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 733d803d7a..824fce6a6e 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -448,3 +448,22 @@ define Device/ubnt_unifi-ap-pro SUPPORTED_DEVICES += uap-pro endef TARGET_DEVICES += ubnt_unifi-ap-pro + +define Device/ubnt_sr71 + DEVICE_PACKAGES := -uboot-envtools kmod-usb-ohci kmod-usb2 fconfig + DEVICE_VENDOR := Ubiquiti + DEVICE_MODEL := LiteStation SR71 + SOC := ar7130 + BLOCKSIZE := 256k + IMAGE_SIZE := 15616k + IMAGES += kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | \ + append-metadata | check-size + KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE) + KERNEL_INITRAMFS := kernel-bin | append-dtb + UBNT_BOARD := LS-SR71 + UBNT_CHIP := ar7100 +endef +TARGET_DEVICES += ubnt_sr71 -- 2.30.2