I bought a realtek r8125 mini-PCIe 2.5Gb NIC for testing.
First of all, changes SW4 to OFF.
I tested the NIC by inserting it into two mini-PCIe slots and got the following results.
When I plug it into the upper slot and turn on the BPI-R4, the following error message appears in a loop until Kernel Crash.
When I plug it into the lower slot and turn on the BPI-R4, it looks OK.
Then after I loaded the r8125 module, the eth3 network interface appeared.
ethtool show:
Speed Test:
It looks OK, no watchdog timeout, no nic crash, network speed is also stable.
How to build r8125 module?
First, I build frank-w linux kernel and install it.
Second, I use those kernel source to set and build r8125 module.
The following is the compilation process.
-
Install Debian 12
-
Install packages:
apt -y install git gcc g++ make libncurses5-dev build-essential sudo gcc-aarch64-linux-gnu flex bison ccache u-boot-tools bc libssl-dev libc6-dev
apt -y install debhelper-compat libelf-dev:native libssl-dev rsync bzip2 -
Download and decompress frank-w kernel source
Now release: CI-BUILD-6.14-main-6.14.0-2025-04-24_2059, Download Source code (tar.gz)
-
Modify build.conf in the kernel source directory
Change board=bpi-r4
-
Import default config & custom config
./build.sh importconfig
./build.sh config
If we want to use the default values, we can just click “Exit” and “Save”.
For the steps here, we refer to the Usage section of BPI-Router-Linux
- Build Kernel
./build.sh
At the end of the compilation, we select 1 to generate compressed archives of the kernel image and kernel modules.
-
Download and decompress r8125 kernel module source
Download r8125 from Realtek PCIe 1G / 2.5G / 5G / 10G Ethernet Family Controller Software
Here we choose 2.5G Ethernet LINUX driver r8125 for kernel up to 6.12 to download.
-
Build it
cd r8125-9.015.00/src make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j5 all
-
Install kernel image & kernel modules & r8125.ko to BPI-R4
Decompress bpi-r4_6.14.0.tar.gz

Copy(or Move) BPI-BOOT/* /boot/
Copy(or Move) BPI-ROOT/lib/modules/6.14.0-bpi-r4 to /lib/modules/
Copy(or Move BPI-ROOT/etc/modprobe.d to /etc/
Copy(or Move BPI-ROOT/etc/modules-load.d to /etc/
Copy r8125.ko to /lib/modules/6.14.0-bpi-r4/kernel/drivers/net/
-
Use new kernel to boot
Check Kernel version and Build Date & Time.
reboot
uname -a
-
insmod r8125.ko to testing
Looks good.
-
We add r8125.ko to modprobe
Modify /lib/modules/6.14.0-bpi-r4/modules.dep
Add “kernel/drivers/net/r8125.ko:” to the end.
Execute “depmod -a”
- Use modprobe to load r8125
modprobe r8125
lsmod
PS:
When we build r8125 module, if we got error message:
This is because when compiling r8125 module, the compiled file of the Kernel could not be found.
When we compile the kernel using frank-w kernel’s build.sh, it will create a build folder in the home directory (here is /home/ycfu/build).
All kernel compiled files are in this directory.
Therefore, when compiling r8125, make sure that the specified Kernel source is this directory.