openwrt/package/boot/uboot-envtools/files
Ozgur Can Leonard d009033911 ramips: add support for Xiaomi Mi Router 3 Pro
Hardware:

CPU:   MediaTek MT7621AT (2x880MHz)
RAM:   512MB DDR3
FLASH: 256MB NAND
WiFi:  2.4GHz 4x4 MT7615 b/g/n (Needs driver, See Issues!)
WiFI:  5GHz 4x4 MT7615 a/n/ac  (Needs driver, See Issues!)
USB:   1x 3.0
ETH:   1x WAN 10/100/1000 3x LAN 10/100/1000
LED:   Power/Status
BTN:   RESET
UART:  115200 8n1

Partition layout and boot:

Stock Xiaomi firmware has the MTD split into (among others)

- kernel0 (@0x200000)
- kernel1 (@0x600000)
- rootfs0
- rootfs1
- overlay (ubi)

Xiaomi uboot expects to find kernels at 0x200000 & 0x600000
referred to as system 1 & system 2 respectively.
a kernel is considered suitable for handing control over
if its linux magic number exists & uImage CRC are correct.
If either of those conditions fail, a matching sys'n'_fail flag
is set in uboot env & a restart performed in the hope that the
alternate kernel is okay.
If neither kernel checksums ok and both are marked failed, system 2
is booted anyway.

Note uboot's tftp flash install writes the transferred
image to both kernel partitions.

Installation:

Similar to the Xiaomi MIR3G, we keep stock Xiaomi firmware in
kernel0 for ease of recovery, and install OpenWRT into kernel1 and
after.

The installation file for OpenWRT is a *squashfs-factory.bin file that
contains the kernel and a ubi partition. This is flashed as follows:

nvram set flag_try_sys1_failed=1
nvram set flag_try_sys2_failed=0
nvram commit
dd if=factory.bin bs=1M count=4 | mtd write - kernel1
dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0
reboot

Reverting to stock:

The part of stock firmware we've kept in kernel0 allows us to run stock
recovery, which will re-flash stock firmware from a *.bin file on a USB.

For this we do the following:

fw_setenv flag_try_sys1_failed 0
fw_setenv flag_try_sys2_failed 1
reboot

After reboot the LED status light will blink red, at which point pressing
the 'reset' button will cause stock firmware to be installed from USB.

Issues:

OpenWRT currently does not have support for the MT7615 wifi chips. There is
ongoing work to add mt7615 support to the open source mt76 driver. Until that
support is in place, there are closed-source kernel modules that can be used.

See: https://forum.openwrt.org/t/support-for-xiaomi-wifi-r3p-pro/20290/170

Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[02_network remaps, Added link to notes]
2019-03-13 16:25:34 +01:00
..
apm821xx apm821xx: add support for the Netgear WNDAP620 and WNDAP660 2018-11-26 12:05:46 +01:00
ar71xx uboot-envtools: Add domywifi dw33d support 2019-01-02 22:24:52 +01:00
ath79 ath79: add support for LibreRouter v1 2019-03-13 16:25:34 +01:00
cns3xxx treewide: use the generic board_name function 2017-07-15 23:13:34 +02:00
imx6 treewide: use the generic board_name function 2017-07-15 23:13:34 +02:00
ipq40xx uboot-envtools: add support for ALFA Network AP120C-AC 2019-02-26 00:16:22 +01:00
ipq806x uboot-envtools: adds r7800 uboot env support 2018-10-07 02:12:06 +02:00
kirkwood kirkwood: add support for Iomega Storcenter ix2-200 2018-07-30 15:21:00 +02:00
lantiq lantiq: use the compatible string as board name 2017-12-16 23:33:56 +01:00
layerscape uboot-envtools: add configuration for Traverse LS1043 boards. 2018-07-30 10:53:57 +02:00
mpc85xx mpc85xx: add support for OCEDO Panda 2019-01-26 17:10:19 +01:00
mvebu mvebu: add support for WRT32X (venom) 2018-05-14 17:20:10 +02:00
mxs uboot-envtools: fix configuration for I2SE Duckbills 2018-12-18 20:17:22 +01:00
oxnas uboot-envtools: oxnas: sync with current oxnas/ox820 DTS 2019-03-01 03:36:53 +01:00
pistachio pistachio: remove custom board detection override 2017-03-22 11:43:22 +01:00
ramips ramips: add support for Xiaomi Mi Router 3 Pro 2019-03-13 16:25:34 +01:00
uboot-envtools.sh move boot related packages to their own folder 2012-10-16 13:44:25 +00:00