Table of Contents
BananaPi R4
Hardware
- MediaTek MT7988A (Filogic 880)
- MT7530 switch builtin (1 cpu-port with 4GBit/s + 1Gbit/s user-ports)
- 4G RAM
- 8GB eMMC flash
- 128MB SPI-NAND Flash
- either 2x SFP+ (10GBit/s USXGMII) or 1SFP+ and 2g5 rj45 with PoE (link)
- Wifi7 with additional module connected to the 2 PCIe slots at bottom of board
- MediaTek MT7996 + MT7995 + MT7977A + MT7977B
- powersupply 12V/5A required when using wifi card,2A (like on other BPi Routers) is not enough
Network
GMAC1 (4GBit/s) is connected internally to mt7530 switch variant where the 4 user-Ports are exposed as rj45 on board (1xWan,3xLan).
The SFP(+) cages are connected to SerDes lanes of GMAC2 and GMAC3, and those can be switched between SGMII/1000Base-X/2500Base-X mode for 10M/100M/1000M/2500M (via mtk-pcs-lynxi, just like on MT7622 and MT7986) and USXGMII/10GBase-KR for 5000M and 10000M. Hence it should be possible to support both, SFP modules with 1000M and 2500M, as well as SFP+ modules with 5000M and 10000M.
waiting for bpi-team to verify the mode-switch.
Wifi
wifi is realized with daughter board (Network Interface Card) in the 2 mPCIe-Slots at bottom of the board.
PCIE
2x1Lane (M.2 slots) and 2x2lane. the 2x2lane is for wifi (mPCIe slots).
USB
Bootswitch
A | B | |
---|---|---|
nand | 0 | 1 |
eMMC | 1 | 0 |
SD | 1 | 1 |
uboot/ATF
currently use modified versions of:
- official ATF: https://github.com/frank-w/u-boot/tree/mtk-atf-r4_2
and bootup "my" kernel like this:
MT7988> setenv fit 6.5.0-rc1-mt7988.itb MT7988> setenv kaddr 0x48000000 MT7988> fatload mmc 0:5 ${kaddr} ${fit} 4970220 bytes read in 417 ms (11.4 MiB/s) MT7988> bootm ${kaddr}
kaddr 0x46000000 works too, if uncompressed kernelimage is smaller than 32M (fit size of 14M was too large)
in newer u-boot i have set kaddr to 0x46000000 (fit loadaddr 0x44000000, rdaddr 0x48000000)
swiotlb errors (in ethernet-driver) can be fixed with limiting ram in uboot/cmdline to 3G (32bit border)
tftp
BPI-R4> setenv bootfile 6.5.0-rc1-mt7988-r4.itb BPI-R4> run bootnetfit
linux
https://www.kernel.org/doc/html/v6.1/admin-guide/kernel-parameters.html
Currently we need to limit ram to 3G because of swiotlb buffer full issues in ethernet driver
mem=3G
in cmdline (bootopts in my uboot uEnv.txt)
kernel
debug
# mount -t debugfs none /sys/kernel/debug/ # cat /sys/kernel/debug/gpio # cat /sys/kernel/debug/pinctrl/pinctrl-handles # cat /sys/kernel/debug/regulator/regulator_summary # cat /sys/kernel/debug/clk/clk_summary
interface config
ip link set lan0 up ip a a 192.168.0.19/24 dev lan0 ip r a default via 192.168.0.10 date -s "2023-08-23 19:37 CEST" #stats ip -s link show dev eth2 ethtool -S eth2
DNS needs to be set in /etc/resolv.conf or in systemd like this:
mkdir -p /etc/systemd/resolved.conf.d/ cp /etc/systemd/resolved.conf /etc/systemd/resolved.conf.d/TEST.conf echo "DNS = 192.168.0.10" >> /etc/systemd/resolved.conf.d/TEST.conf systemctl restart systemd-resolved.service
openwrt
- clone openwrt master
- add this to feeds.conf.default: “src-git mtksdk https://git01.mediatek.com/openwrt/feeds/mtk-openwrt-feeds”
- scripts/feeds update -f mtksdk
- make menuconfig:
- Target System (MediaTek Ralink ARM)
- Subtarget (Filogic 8×0 (MT798x))
- Target Profile (MediaTek MT7988a nand rfb) #here i see no sd-variant
adding additional options:
CONFIG_PACKAGE_f2fs-tools=y CONFIG_PACKAGE_e2fsprogs=y CONFIG_PACKAGE_dosfstools=y CONFIG_PACKAGE_resize2fs=y CONFIG_PACKAGE_nano=y CONFIG_PACKAGE_iperf3=y #CONFIG_PACKAGE_netcat CONFIG_PACKAGE_tcpdump=y CONFIG_BUSYBOX_CUSTOM=y CONFIG_BUSYBOX_CONFIG_TELNET=y
*-initramfs-kernel.bin is not the production image we’re using. We only use it for testing purpose since it contains rootfs and won’t read the flash.
*-sysupgrade.bin is the actual production image. It’s a tar ball for nand/emmc/sd boards. It contains separate kernel and rootfs that will be written to ubi volume for nand, or the partitions defined for sd/emmc.
tar -xf bin/targets/mediatek/filogic/openwrt-mediatek-filogic-mediatek_mt7988a-rfb-nand-squashfs-sysupgrade.bin sysupgrade-mediatek_mt7988a-rfb-nand/kernel dumpimage -l sysupgrade-mediatek_mt7988a-rfb-nand/kernel