Jump to content

activation of eth0 on Banana PI M2 Zero, how to do best


bontango

Recommended Posts

Hello

I'm quite new with armbian and Banana Pi, but have some experience with Raspberry PI.

I started with Banana PI M2 Zero and armbian because of current unavailibility of Raspberry PI

which is needed for some of my DIY pinball projects https://lisy.dev/

 

With a 5.15.48 Kernel Image I noted that the internal ethernet of M2 Zero is set to disabled, where with a 5.10.60 Kernel from the archive it works.

After some investigation I used the "sun8i-h2-plus-bananapi-m2-zero.dtb" overlay from the 5.10 Kernel with a 5.15.43 Kernel and was happy that eth0 was working again.

 

However as I think it is not advisable to mixing Kernel versions I wrote an user overlay which can activate eth0 on newer kernels (see code below)

 

questions to the experts:

- is my overlay code correct?

- is an user overlay the right method to activate eth0?

- if both answers to these questions is yes, is it worth to include that overlay to the armbian source and how to do that?

 

thanks for your help

 

/dts-v1/;
/plugin/;

/ {
	model = "Banana Pi BPI-M2-Zero";
	compatible = "sinovoip,bpi-m2-zero\0allwinner,sun8i-h2-plus";

	/* 
	 * enable onboard eth0 on Banana PI M2 zero
	 * which is disabled by default
	 * bontango 08.2022
	 *
	 * compile with
	 * dtc -I dts -O dtb -o m2-zero-eth0.dtbo m2-zero-eth0.dts
	 * move m2-zero-eth0.dtbo to /boot/overlay-user
	 * add line "user-overlays=m2-zero-eth0" to /boot/armbianEnv.txt	 
	 */
	fragment@0 {
		target-path = "/aliases";
		__overlay__ {
			ethernet0 = "/soc/ethernet@1c30000";
		};
	};
	
	fragment@1 {
		target = <&emac>;
		__overlay__ {
			status = "okay";
			phy-handle = <&int_mii_phy>;
			phy-mode = "mii";
			allwinner,leds-active-low;
		};
	};
};

 

 

Link to comment
Share on other sites

On 8/28/2022 at 11:49 AM, bontango said:

questions to the experts:

- is my overlay code correct?

- is an user overlay the right method to activate eth0?

- if both answers to these questions is yes, is it worth to include that overlay to the armbian source and how to do that?

 

1. Looks good.

2. Yes

3. https://docs.armbian.com/Process_Contribute/, always add patches to CURRENT (5.15.y) and EDGE (5.19.y). Usually patch can be identical.

 

Look here:

https://github.com/armbian/build/blob/master/patch/kernel/archive/sunxi-5.19/patches.armbian/arm-dts-overlay-sun8i-h3-cpu-clock-add-overclock.patch
https://github.com/armbian/build/blob/master/patch/kernel/archive/sunxi-5.19/patches.armbian/Move-sun50i-h6-pwm-settings-to-its-own-overlay.patch

https://github.com/armbian/build/blob/master/patch/kernel/archive/sunxi-5.19/patches.armbian/arm-dts-overlay-Add-Overlays-for-sunxi.patch

https://github.com/armbian/build/pull/4165

 

It is handy to use ./compile.sh EXPERT=yes CREATE_PATCHES="yes" command line to help make patches.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines