forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ramips: add support for Xiaomi Mi Router 4A (100M Edition)
- SoC: MediaTek MT7628AN - Flash: 16MB (Winbond W25Q128JV) - RAM: 64MB - Serial: As marked on PCB, 3V3 logic, baudrate is 115200 - Ethernet: 3x 10/100 Mbps (switched, 2x LAN + WAN) - WIFI0: MT7628AN 2.4GHz 802.11b/g/n - WIFI1: MT7612EN 5GHz 802.11ac - Antennas: 4x external (2 per radio), non-detachable - LEDs: Programmable power-LED (two-colored, yellow/blue) Non-programmable internet-LED (shows WAN-activity) - Buttons: Reset INSTALLATION: 1. Connect to the serial port of the router and power it up. If you get a prompt asking for boot-mode, go to step 3. 2. Unplug the router after > Erasing SPI Flash... > raspi_erase: offs:20000 len:10000 occurs on the serial port. Plug the router back in. 3. At the prompt select option 2 (Load system code then write to Flash via TFTP.) 4. Enter 192.168.1.1 as the device IP and 192.168.1.2 as the Server-IP. 5. Connect your computer to LAN1 and assign it as 192.168.1.2/24. 6. Rename the sysupgrade image to test.bin and serve it via TFTP. 7. Enter test.bin on the serial console and press enter. Signed-off-by: Markus Scheck <[email protected]> Signed-off-by: Christian Lamparter <[email protected]> [added mt76 compatible]
- Loading branch information
Showing
3 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters