From 2cfd15377cd38187a0ba5fd5d716df28942aa469 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Sun, 26 Jul 2020 16:11:12 +0800 Subject: [PATCH] ramips: add support for Northbound Networks Zodiac GX Hardware spec - MT7621A dual-core 880MHz - 16MB Flash - 256MB RAM - 5 GbE ports OEM firmware is based on OpenWrt and it accepts sysupgrade.bin image just fine. Vendor device page: https://northboundnetworks.com/products/zodiac-gx Signed-off-by: Yousong Zhou --- .../ramips/base-files/etc/board.d/02_network | 4 + .../mt7621_northbound-networks_zodiac-gx.dts | 94 +++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 10 ++ 3 files changed, 108 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_northbound-networks_zodiac-gx.dts diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index f743ce851a..6e50808310 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -370,6 +370,10 @@ ramips_setup_interfaces() "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0" ucidef_set_interface_wan "usb0" ;; + northbound-networks,zodiac-gx) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0" + ;; hc5761) ucidef_add_switch "switch0" \ "1:lan" "4:lan" "0:wan" "6@eth0" diff --git a/target/linux/ramips/dts/mt7621_northbound-networks_zodiac-gx.dts b/target/linux/ramips/dts/mt7621_northbound-networks_zodiac-gx.dts new file mode 100644 index 0000000000..3baf46036c --- /dev/null +++ b/target/linux/ramips/dts/mt7621_northbound-networks_zodiac-gx.dts @@ -0,0 +1,94 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "northbound-networks,zodiac-gx", "mediatek,mt7621-soc"; + model = "Northbound Networks Zodiac GX"; + + aliases { + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + leds { + compatible = "gpio-leds"; + + led_status: status { + label = "zodiac:green:status"; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "wdt", "rgmii2", "jtag", "mdio"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 28ae0d451f..72eabcc49c 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -306,6 +306,16 @@ define Device/mt7621 endef TARGET_DEVICES += mt7621 +# OEM firmware requires that sysupgrade firmware has "zodiac-gx" in the +# SUPPORTED_DEVICES list. +define Device/northbound-networks_zodiac-gx + DEVICE_TITLE := Northbound Networks Zodiac GX + DTS := mt7621_northbound-networks_zodiac-gx + IMAGE_SIZE := 16064k + SUPPORTED_DEVICES += zodiac-gx +endef +TARGET_DEVICES += northbound-networks_zodiac-gx + define Device/newifi-d1 DTS := Newifi-D1 IMAGE_SIZE := $(ralink_default_fw_size_32M) -- 2.30.2