difos/package/boot
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
..
apex apex: Remove dead URL. 2018-08-22 11:21:53 +02:00
arm-trusted-firmware-sunxi arm-trusted-firmware-sunxi: Replace with official ARM version 2019-01-13 17:35:14 +01:00
at91bootstrap at91: Add SAMA5D2 PTC EK board 2018-05-05 06:55:22 +02:00
fconfig fconfig: Remove dead URLs 2018-08-22 11:22:04 +02:00
grub2 build: remove leftovers from previous x86 commits 2019-02-17 18:22:40 +01:00
imx-bootlets treewide: clean up download hashes 2016-12-16 22:39:22 +01:00
kexec-tools kexec-tools: bump version to 2.0.16 2018-02-11 16:10:51 +01:00
kobs-ng kobs-ng: add header for integer definitions 2017-11-16 22:56:54 +01:00
rbcfg rbcfg: Implement CPU frequency control 2017-10-07 15:00:26 +02:00
uboot-ar71xx uboot-ar71xx: fix musl host build 2019-01-22 13:29:46 +01:00
uboot-at91 at91: Add SAMA5D2 PTC EK board 2018-05-05 06:55:22 +02:00
uboot-envtools ramips: add support for Xiaomi Mi Router 3 Pro 2019-03-13 16:25:34 +01:00
uboot-fritz4040 ipq40xx: add support for FritzBox 7530 2019-02-28 11:32:55 +01:00
uboot-imx6 uboot-imx6: Bump to 2019.01 2019-01-26 21:46:32 +01:00
uboot-kirkwood uboot-kirkwood: update to 2019.01 2019-02-17 19:22:39 +01:00
uboot-lantiq uboot-lantiq: fix compile with modern host dtc 2018-10-07 02:12:06 +02:00
uboot-layerscape layerscape: add LS1021AIOT board support 2018-12-18 20:17:23 +01:00
uboot-layerscape-armv8_32b layerscape: add ls1012afrwy support and drop ls1012afrdm 2018-09-22 21:20:57 +02:00
uboot-mvebu uboot-mvebu: fix build on hosts lacking pkg-config 2018-05-23 09:05:55 +02:00
uboot-mxs uboot-mxs: bump to v2019.01 2019-01-26 21:46:32 +01:00
uboot-omap uboot-omap: add 'rootwait' to the kernel cmdline 2019-01-31 14:07:00 +01:00
uboot-oxnas uboot-oxnas: fix typo accidentally committed during oxnas reboot 2018-06-18 18:55:19 +02:00
uboot-sunxi sunxi: add support for Orange Pi PC Plus 2019-03-09 18:55:15 +01:00
uboot-xburst treewide: clean up download hashes 2016-12-16 22:39:22 +01:00
uboot-zynq uboot-zynq: use a file to modify the default environment 2018-09-10 08:54:41 +02:00
yamonenv yamonenv: Remove dead URLs 2018-08-22 11:22:17 +02:00