Please follow the following steps to setup operation modes and enable Ethernet of SP7021 (Plus1) demo boards.
1. Enable Sunplus Ethernet device
Go to kernel folder, run ‘make menuconfig’Run make kconfig in project top directory. When “Linux/arm Kernel Configuration” menu pops up, use arrow and Enter key to select <Device Drivers> → <Network device support> → <Ethernet driver support> and then enable <Sunplus Ethernet devices>. Refer to screenshot below:
...
<Sunplus Ethernet devices> is enabled.
2. Setup operating mode of Ethernet device
Modify node l2sw in device-tree source file to set up operating mode of Ethernet device. For example, if you are using SP7021 demo board V3 and you need dual network interfaces, please modify the device-tree source file, linux/kernel/arch/arm/boot/dts/sp7021-demov3.dts, as shown below:
...
If “dual NIC” mode is set, you will have two Ethernet interfaces, eth0 and eth1, in Linux. Otherwise, you will have one Ethernet interface, eth0, in Linux.
3. Build Linux image
Go to top folder. Run make all to build Linux image.
4. Boot Linux
Boot Linux with the built image.
5. Dynamic switch operating mode
Besides selecting mode in device-tree source file, Sunplus Ethernet driver also supports dynamic (run-time) mode-switching. To enable dynamic mode-switching, please enable “Support Dynamic Mode-switching by sysfs“ in “Linux/arm Kernel Configuration” menu. Refer to screenshot below:
...
/ # cat /sys/devices/platform/soc@B/9c108000.l2sw/mode
6. Appendix
Sunplus Ethernet driver supports 3 operation modes:
...