lede/target/linux/mediatek/base-files/etc/uci-defaults/99_fwenv-store-ethaddr.sh
Daniel Golle 08aaf074b9 mediatek: add support for BananaPi BPI-R4 board
Hardware
--------
SOC:    MediaTek MT7988A (4x Cortex-A73)
RAM:    4 GiB DDR4
Flash:  128 MiB Winbond SPI-NAND
MMC:    8 GiB eMMC *or* microSD (cannot be used both)
ETH:    4x 1GE (1x WAN, 3x LAN)
        2x SFP+ (10G, 5G, 2.5G, 1G)
USB:    on-board USB 3.2 4-port hub
        1x USB 3.2 port (type A connector)
        1x M.2 for 4G/5G modem
        2x mPCIe for additional modems
WiFi:   optional MediaTek MT7996 Wi-Fi 7 module
        (using 2x PCIe gen3 x2 on the mPCIe slots and 12V power)

Installation
------------
1. Decompress and write the sdcard image to a micro SD card and use that
to boot the R4 (both dip switches in upper position).

2. Use the bootloader menu accessible via the serial console to install
to SPI-NAND.

3. Switch to boot from SPI-NAND and install to eMMC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-07-01 13:36:10 +08:00

23 lines
567 B
Bash

[ ! -e /etc/fw_env.config ] && exit 0
. /lib/functions/system.sh
case "$(board_name)" in
bananapi,bpi-r2|\
bananapi,bpi-r64|\
unielec,u7623-02)
[ -z "$(fw_printenv -n ethaddr 2>/dev/null)" ] &&
fw_setenv ethaddr "$(cat /sys/class/net/eth0/address)"
;;
bananapi,bpi-r3|\
bananapi,bpi-r4|\
bananapi,bpi-r4-poe)
[ -z "$(fw_printenv -n ethaddr 2>/dev/null)" ] &&
fw_setenv ethaddr "$(cat /sys/class/net/eth0/address)"
[ -z "$(fw_printenv -n eth1addr 2>/dev/null)" ] &&
fw_setenv eth1addr "$(macaddr_add $(cat /sys/class/net/eth0/address) 1)"
;;
esac
exit 0