From b6f5ffdf18ead8952566453c7b63c7a40b086713 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Thu, 12 Sep 2019 00:24:40 -0700 Subject: [PATCH] ramips: add XiaoYu mt7621 support --- .../ramips/base-files/etc/board.d/01_leds | 1 + .../ramips/base-files/etc/board.d/02_network | 4 + target/linux/ramips/dts/XiaoYu-C5.dts | 117 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 11 +- 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/XiaoYu-C5.dts diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 6f2e624a1..fd0a4ea96 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -416,6 +416,7 @@ wrh-300cr) set_wifi_led "$boardname:green:wlan" ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0" ;; +XiaoYu-C5|\ xzwifi,creativebox-v1) ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10" ;; 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 258d8f251..fb0896db6 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -34,6 +34,10 @@ ramips_setup_interfaces() 11acnas|\ d-team,newifi-d2|\ w2914nsv2|\ + XiaoYu-C5) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" + ;; zbt-we2026) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0" diff --git a/target/linux/ramips/dts/XiaoYu-C5.dts b/target/linux/ramips/dts/XiaoYu-C5.dts new file mode 100644 index 000000000..5152714b8 --- /dev/null +++ b/target/linux/ramips/dts/XiaoYu-C5.dts @@ -0,0 +1,117 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "XiaoYu-C5", "mediatek,mt7621-soc"; + model = "XiaoYu-C5"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led_system:system { + label = "XiaoYu-C5:green:system"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + }; + + work { + label = "XiaoYu-C5:green:usb3.0"; + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + 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>; + m25p,chunked-io = <32>; + + 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 0x1fa0000>; + }; + partition@1ff0000 { + label = "mib0"; + reg = <0x1ff0000 0x10000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "jtag" , "uart2", "uart3"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 1c414bd8a..cc6639066 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -580,6 +580,15 @@ define Device/wsr-600 endef TARGET_DEVICES += wsr-600 +define Device/XiaoYu-C5 + DTS := XiaoYu-C5 + IMAGE_SIZE := $(ralink_default_fw_size_32M) + DEVICE_TITLE := XiaoYu-C5 + DEVICE_PACKAGES := \ + kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic +endef +TARGET_DEVICES += XiaoYu-C5 + define Device/zbt-we1326 DTS := ZBT-WE1326 IMAGE_SIZE := $(ralink_default_fw_size_16M) @@ -629,4 +638,4 @@ define Device/zbt-wg3526-32M kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef -TARGET_DEVICES += zbt-wg3526-32M +TARGET_DEVICES += zbt-wg3526-32M \ No newline at end of file