1 Commits

Author SHA1 Message Date
Tianling Shen
14e2410bbf
mediatek: add support for Bananapi BPi-R3 Mini support
Hardware specification:
  SoC: MediaTek MT7986A 4x A53
  Flash: 128MB SPI-NAND, 8GB eMMC
  RAM: 2GB DDR4
  Ethernet: 2x 2.5GbE
  WiFi: MediaTek MT7976C 2x2 2.4G + 3x3 5G
  Interface: M.2 B-Key, M.2 M-Key, USB 2.0
  LED: Power, Status, WLAN2G, WLAN5G, LTE, SSD
  Button: Reset, Boot switch
  Power: 12V Type-C PD

eMMC Flash instructions:
1. SSH to BPi-R3 Mini, and upload all necessary firmware.
2. Write new GPT table:
   dd if=immortalwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin of=/dev/mmcblk0 bs=512 seek=0 count=34 conv=fsync
3. Erase and write new BL2:
   echo 0 > /sys/block/mmcblk0boot0/force_ro
   dd if=/dev/zero of=/dev/mmcblk0boot0 bs=512 count=8192 conv=fsync
   dd if=immortalwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0 bs=512 conv=fsync
4. Erase and write new FIP:
   dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=13312 count=8192 conv=fsync
   dd if=immortalwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync
5. Set static IP on your PC:
   IP 192.168.1.254, GW 192.168.1.1
6. Serve ImmortalWrt initramfs image using TFTP server.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After ImmortalWrt has booted, perform sysupgrade.
9. Additionally, if you want to have eMMC recovery boot feature:
     (Don't worry! You will always have TFTP recovery boot feature.)
   dd if=immortalwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4 bs=512 conv=fsync

NAND Flash instructions:
1. SSH to BPi-R3 Mini, and upload all necessary firmware.
2. Erase and write new BL2:
   opkg install kmod-mtd-rw
   mtd erase BL2
   mtd write immortalwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloader.bin BL2
3. Erase and write new FIP:
   mtd erase FIP
   mtd write immortalwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-bl31-uboot.fip FIP
4. Set static IP on your PC:
   IP 192.168.1.254, GW 192.168.1.1
5. Serve ImmortalWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. After ImmortalWrt has booted, erase UBI volumes:
   umount /mnt/ubi0*
   ubidetach -p /dev/mtd4
   ubiformat -y /dev/mtd4
   ubiattach -p /dev/mtd4
8. Create new ubootenv volumes:
   ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
   ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
9. Additionally, if you want to have NAND recovery boot feature:
     (Don't worry! You will always have TFTP recovery boot feature.)
   ubimkvol /dev/ubi0 -n 2 -N recovery -s 20MiB
   ubiupdatevol /dev/ubi0_2 immortalwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb
10. Perform sysupgrade.

Thank you Banana Pi for providing this board.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-10-27 13:12:56 +08:00