diff options
-rwxr-xr-x | target/linux/ramips/base-files/etc/board.d/02_network | 4 | ||||
-rw-r--r-- | target/linux/ramips/dts/XIAOMI-MIR4A-100M.dts | 147 | ||||
-rw-r--r-- | target/linux/ramips/image/mt76x8.mk | 8 |
3 files changed, 159 insertions, 0 deletions
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 48ba1ba6a6..9c9f2bef9c 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -458,6 +458,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" ;; + xiaomi,mir4a-100m) + ucidef_add_switch "switch0" \ + "4:lan:1" "2:lan:2" "0:wan" "6@eth0" + ;; zbtlink,zbt-we1226|\ y1) ucidef_add_switch "switch0" \ diff --git a/target/linux/ramips/dts/XIAOMI-MIR4A-100M.dts b/target/linux/ramips/dts/XIAOMI-MIR4A-100M.dts new file mode 100644 index 0000000000..8a33745f7f --- /dev/null +++ b/target/linux/ramips/dts/XIAOMI-MIR4A-100M.dts @@ -0,0 +1,147 @@ +//SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + +/ { + compatible = "xiaomi,mir4a-100m", "mediatek,mt7628an-soc"; + model = "Xiaomi Mi Router 4A (100M Edition)"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + aliases { + led-boot = &power_yellow; + led-failsafe = &power_yellow; + led-running = &power_blue; + led-upgrade = &power_yellow; + }; + + leds { + compatible = "gpio-leds"; + + power_blue: power_blue { + label = "mir4a-100m:blue:power"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + power_yellow: power_yellow { + label = "mir4a-100m:yellow:power"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = <KEY_RESTART>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "config"; + reg = <0x20000 0x10000>; + read-only; + }; + + factory: partition@30000 { + label = "factory"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "crash"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "cfg_bak"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "overlay"; + reg = <0x60000 0x100000>; + read-only; + }; + + partition@160000 { + label = "firmware"; + reg = <0x160000 0xea0000>; + compatible = "denx,uimage"; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "gpio", "wdt", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <(-1)>; +}; + +&esw { + mediatek,portmap = <0x2f>; + mediatek,portdisable = <0x2a>; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index ca279a7d61..4e6a5d1ca9 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -450,6 +450,14 @@ define Device/wrtnode2r endef TARGET_DEVICES += wrtnode2r +define Device/xiaomi_mir4a-100m + DTS := XIAOMI-MIR4A-100M + IMAGE_SIZE := 14976k + DEVICE_TITLE := Xiaomi Mi Router 4A (100M Edition) + DEVICE_PACKAGES := kmod-mt76x2 +endef +TARGET_DEVICES += xiaomi_mir4a-100m + define Device/zbtlink_zbt-we1226 DTS := ZBT-WE1226 IMAGE_SIZE := $(ralink_default_fw_size_8M) |