Even though it does not look like it does, the BPI-M2 Zero also has a wired ethernet interface. Unfortunately, it is disabled by default in its device tree blob.
But enabling it is easy:
# copy into /root cp /boot/dtb/sun8i-h2-plus-bananapi-m2-zero.dtb . # decompile dtc -I dtb sun8i-h2-plus-bananapi-m2-zero.dtb \ -O dts -o sun8i-h2-plus-bananapi-m2-zero.dts # edit vi sun8i-h2-plus-bananapi-m2-zero.dts # :-) # compile dtc -i dts sun8i-h2-plus-bananapi-m2-zero.dts \ -O dtb -o /boot/custom.dtbHow do you need to edit the DTB file?
In the "ethernet@1c30000" block, you need to apply this "diff":
- status = "disabled";
+ status = "okay";
+ phy-handle = <0x4d>;
+ phy-mode = "mii";
phandle = <0x4b>;
The "phy-handle" value is taken from the "phandle" of the "ethernet-phy@1" block a few lines down. Then another change is adding an alias for ethernet0 to the "aliases" block:
serial0 = "/soc/serial@1c28000";
serial1 = "/soc/serial@1c28400";
+ ethernet0 = "/soc/ethernet@1c30000";
Ethernet will work without that, but we'll need this for setting the MAC address later.
Now reboot and try it out in a temporary way. Either by:
- interrupting u-boot and doing setenv fdtfile custom.dtb (no "saveenv" yet!), then "boot"
- editing the GRUB menu, adding an additional line after "initrd..." that reads devicetree /boot/custom.dtb