mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 07:33:01 +02:00
Add board support for the BananaPi BPI-R4 router board, based on the MediaTek MT7988A (Filogic 880) SoC with quad-core Cortex-A73 CPU. The BPI-R4 is the successor to the BPI-R3 but uses entirely different silicon: the internal switch runs at 2.5 GbE per port, the two SFP+ uplinks use native USXGMII at up to 10 Gbps, and WiFi is provided by a MediaTek MT7996E PCIe module supporting tri-band WiFi 7 (2.4/5/6 GHz). Two board variants, BPI-R4-2g5 and BPI-R4P, replace one SFP+ cage with a 2.5 GbE RJ45 port (using the MT7988A internal 2.5G PHY); the R4P adds an optional PoE daughterboard on that port. Both use the upstream mt7988a-bananapi-bpi-r4-2g5 device tree. Interfaces: - Standard R4: eth1 (gmac1/sfp2 LAN cage) → sfp2, eth2 (gmac2/sfp1 WAN cage) → sfp1 - R4-2g5/R4P: eth1 (2.5G PHY) → wan, eth2 (gmac2/sfp1 WAN cage) → sfp1 Factory reset / WPS button (GPIO14, active-low): detected by U-Boot at boot for factory reset; reused by Linux as KEY_WPS_BUTTON at runtime. eMMC install note: the MT7988A eMMC (pins 38-49) and SD card (pins 32-37) use separate physical pads so there is no electrical bus sharing, unlike some BPi-R3 configurations. However, a single MMC controller (mmc@11230000) handles both, so only one is active per boot session. The eMMC install procedure therefore still requires an intermediate SPI NAND bootloader step until a Linux-side install path is tested. SD card build (bpi_r4_sd_boot_defconfig) now uses the new mt7988a_bpir4_sd U-Boot defconfig with cap-sd-highspeed enabled, giving 50 MHz SD transfers instead of the previous 25 MHz legacy mode. Also adds MT7988/MT7996 firmware support to the buildroot linux-firmware package, for 2.5 GbE port PHY and WiFi7 extension board, and updates the aarch64_defconfig, aarch64_minimal_defconfig, the arch README, CI boot/image workflows, mkimage.sh, and the ChangeLog. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
75 lines
2.2 KiB
Bash
75 lines
2.2 KiB
Bash
setenv dev_mode no
|
|
setenv factory_reset no
|
|
|
|
echo -n "dev-mode: "
|
|
run ixbtn-devmode
|
|
echo -n "factory-reset: "
|
|
run ixbtn-factory
|
|
|
|
setenv valid_media no
|
|
setenv ixmenu_n 0
|
|
|
|
for tgt in "${boot_targets}"; do
|
|
if test "${tgt}" = "mmc0"; then
|
|
setenv devtype "mmc"
|
|
setenv devnum 0
|
|
mmc dev 0
|
|
elif test "${tgt}" = "mmc1"; then
|
|
setenv devtype "mmc"
|
|
setenv devnum 1
|
|
mmc dev 1
|
|
else
|
|
setenv devtype "${tgt}"
|
|
setenv devnum 0
|
|
fi
|
|
|
|
if part number ${devtype} ${devnum} aux auxpart; then
|
|
setenv "boot_${tgt}_primary" "setenv devtype ${devtype}; setenv devnum ${devnum}; setenv slot primary; run ixbootslot"
|
|
setenv "bootmenu_${ixmenu_n}" "Boot primary ${tgt} partition=run boot_${tgt}_primary"
|
|
setexpr ixmenu_n ${ixmenu_n} + 1
|
|
|
|
setenv "boot_${tgt}_secondary" "setenv devtype ${devtype}; setenv devnum ${devnum}; setenv slot secondary; run ixbootslot"
|
|
setenv "bootmenu_${ixmenu_n}" "Boot secondary ${tgt} partition=run boot_${tgt}_secondary"
|
|
setexpr ixmenu_n ${ixmenu_n} + 1
|
|
|
|
if load ${devtype} ${devnum}:${auxpart} ${loadaddr} /uboot.env; then
|
|
env import -b ${loadaddr} ${filesize} BOOT_ORDER DEBUG ethact BOARD_VARIANT
|
|
run ixvariant
|
|
fi
|
|
|
|
if test -n "${DEBUG}"; then
|
|
setenv bootargs_log "debug"
|
|
else
|
|
setenv bootargs_log "loglevel=4"
|
|
fi
|
|
|
|
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "primary secondary net"
|
|
echo "Valid boot device found on ${tgt} (order: ${BOOT_ORDER})"
|
|
|
|
for slot in "${BOOT_ORDER}"; do
|
|
if test "${slot}" = "primary"; then
|
|
setenv ixbootorder "${ixbootorder}run boot_${tgt}_primary; "
|
|
elif test "${slot}" = "secondary"; then
|
|
setenv ixbootorder "${ixbootorder}run boot_${tgt}_secondary; "
|
|
elif test "${slot}" = "net"; then
|
|
setenv ixbootorder "${ixbootorder}run boot_net; "
|
|
fi
|
|
done
|
|
|
|
setenv valid_media yes
|
|
fi
|
|
done
|
|
|
|
setenv "boot_net" "setenv slot net; run ixbootslot"
|
|
setenv "bootmenu_${ixmenu_n}" "Boot over network=run boot_net"
|
|
setexpr ixmenu_n ${ixmenu_n} + 1
|
|
|
|
setenv "bootmenu_${ixmenu_n}" "Factory reset=run ixfactory; echo; pause; bootmenu"
|
|
setexpr ixmenu_n ${ixmenu_n} + 1
|
|
|
|
if test "${valid_media}" = "no"; then
|
|
echo "NO BOOTABLE MEDIA FOUND, falling back to netboot"
|
|
setenv bootargs_log "debug"
|
|
setenv ixbootorder "run boot_net"
|
|
fi
|