immortalwrt/target/linux
Daniel Golle b03d3644cf mediatek: filogic: add BananaPi BPi-R3 mini
Hardware specification
----------------------
 SoC: MediaTek MT7986A 4x A53
 Flash: 128MB SPI-NAND, 8GB eMMC
 RAM: 2GB DDR4
 Ethernet: 2x 2.5GbE (Airoha EN8811H)
 WiFi: MediaTek MT7976C 2x2 2.4G + 3x3 5G
 Interfaces:
  * M.2 Key-M: PCIe 2.0 x2 for NVMe SSD
  * M.2 Key-B: USB 3.0 with SIM slot
  * front USB 2.0 port
 LED: Power, Status, WLAN2G, WLAN5G, LTE, SSD
 Button: Reset, internal boot switch
 Fan: PWM-controlled 5V fan
 Power: 12V Type-C PD

Installation instructions for eMMC
----------------------------------
0. Set boot switch to boot from SPI-NAND (assuming stock rom or immortalwrt
   running there).
1. Write GPT partition table to eMMC
   Move openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin to
   the device /tmp using scp and write it to /dev/mmcblk0:
    dd if=/tmp/openwrt-*-r3-mini-emmc-gpt.bin of=/dev/mmcblk0
2. Reboot (to reload partition table)
3. Write bootloader and OpenWrt images
   Move files to the device /tmp using scp:
    - openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin
    - openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
    - openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
    - openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
   Write them to the appropriate partitions:
    echo 0 > /sys/block/mmcblk0boot0/force_ro
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5
    sync

4. Remove the device from power, set boot switch to eMMC and boot into
   OpenWrt. The device will come up with IP 192.168.1.1 and assume the
   Ethernet port closer to the USB-C power connector as LAN port.

5. If you like to have Ethernet support inside U-Boot (eg. to boot via
   TFTP) you also need to write the PHY firmware to /dev/mmcblk0boot1:
    echo 0 > /sys/block/mmcblk0boot1/force_ro
    dd if=/lib/firmware/airoha/EthMD32.dm.bin of=/dev/mmcblk0boot1
    dd if=/lib/firmware/airoha/EthMD32.DSP.bin bs=16384 seek=1 of=/dev/mmcblk0boot1

Installation instructions for NAND
----------------------------------
0. Set boot switch to boot from eMMC (assuming OpenWrt is installed there
   by instructions above. Using stock rom or immortalwrt does NOT work!)

1. Write things to NAND
   Move files to the device /tmp using scp:
    - openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin
    - openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
    - openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
    - openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
   Write them to the appropriate locations:
    mtd write /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
    ubidetach -m 1
    ubiformat /dev/mtd1
    ubiattach -m 1
    volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip)
    ubimkvol /dev/ubi0 -N fip -n 0 -s $volsize -t static
    ubiupdatevol /dev/ubi0_0 /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
    cd /lib/firmware/airoha
    cat EthMD32.dm.bin EthMD32.DSP.bin > /tmp/en8811h-fw.bin
    ubimkvol /dev/ubi0 -N en8811h-firmware -n 1 -s 147456 -t static
    ubiupdatevol /dev/ubi0_1 /tmp/en8811h-fw.bin
    ubimkvol /dev/ubi0 -n 2 -N ubootenv -s 126976
    ubimkvol /dev/ubi0 -n 3 -N ubootenv2 -s 126976
    volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb)
    ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
    ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
    volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb)
    ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
    ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb

3. Remove the device from power, set boot switch to NAND, power up and
   boot into OpenWrt.

Partially based on immortalwrt support for the R3 mini, big thanks for
doing the ground work!

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-15 19:30:08 +00:00
..
airoha
apm821xx apm821xx: convert to nvmem-layout 2023-11-25 22:50:32 +01:00
archs38
armsr kernel: bump 6.1 to 6.1.72 2024-01-19 21:24:44 +01:00
at91
ath25
ath79 kernel: bump 6.1 to 6.1.77 2024-02-08 18:35:42 +01:00
bcm27xx mediatek: switch to pending XFI 10G Ethernet drivers 2024-02-15 19:06:36 +00:00
bcm47xx kernel: bump 5.15 to 5.15.146 2024-01-06 10:53:39 +01:00
bcm53xx kernel: 6.1: backport UBI device model improvements 2024-02-15 19:06:36 +00:00
bcm63xx bcm63xx: convert to new LED color/function format where possible 2024-02-07 14:48:35 +01:00
bcm4908
bmips bmips: dts: move leds dt-bindings include to SoCs 2024-02-08 09:45:26 +01:00
gemini kernel: bump 6.1 to 6.1.71 2024-01-06 12:52:49 +01:00
generic kernel: add driver for Airoha EN8811H PHY as module 2024-02-15 19:30:08 +00:00
imx imx: 6.1: refresh remaining patches 2024-02-02 17:31:43 +01:00
ipq40xx mediatek: switch to pending XFI 10G Ethernet drivers 2024-02-15 19:06:36 +00:00
ipq806x ipq806x: fix dts error in LED color/function conversion 2024-02-08 00:01:22 +01:00
ixp4xx ixp4xx: add Generic subtarget definition 2023-12-09 14:45:50 +01:00
kirkwood kirkwood: convert to new LED color/function format where possible 2024-02-07 14:48:38 +01:00
lantiq lantiq: fix dts error in LED color/function conversion 2024-02-08 00:01:22 +01:00
layerscape kernel: backport phylink changes from mainline Linux 2024-02-15 19:06:36 +00:00
malta malta: Remove kernel 5.15 configuration 2024-02-03 04:35:25 +00:00
mediatek mediatek: filogic: add BananaPi BPi-R3 mini 2024-02-15 19:30:08 +00:00
mpc85xx mpc85xx: convert to new LED color/function format where possible 2024-02-07 14:48:40 +01:00
mvebu kernel: backport phylink changes from mainline Linux 2024-02-15 19:06:36 +00:00
mxs
octeon octeon: convert to new LED color/function format where possible 2024-02-07 14:48:41 +01:00
octeontx kernel: bump 5.15 to 5.15.148 2024-02-01 21:36:00 +01:00
omap omap: drop kernel 5.15 2024-02-13 19:05:48 +01:00
oxnas oxnas: do not use pcie-controller 2024-01-01 02:34:48 +01:00
pistachio
qoriq qoriq: pad rootfs with zeros 2023-12-02 14:06:56 +02:00
qualcommax ipq807x: add support for CMCC RM2-6 2024-02-15 18:44:35 +01:00
ramips mediatek: switch to pending XFI 10G Ethernet drivers 2024-02-15 19:06:36 +00:00
realtek base-files: move uci_set_poe() to uci-defaults.sh 2024-02-12 20:46:51 +01:00
rockchip rockchip: fix boot from non-MMC devices 2024-01-19 21:31:39 +01:00
sifiveu
sunxi sunxi: mark upstreamed patches as such 2023-12-19 16:02:05 +01:00
tegra
uml
x86 Revert "x86: add support for Mellanox Spectrum SN2000 Switches" 2023-12-23 07:52:05 +00:00
zynq
Makefile linux: add dtb makefile target to targets list 2024-02-08 23:04:55 +01:00