Jump to content

GPIO PI16 claimed by kernel


Go to solution Solved by going,

Recommended Posts

I want to use GPIO Pi16 on the 13 pin expansion header of the board.

This pin is claimed by the kernel for the ethernet MAC.

According to the SOC Datasheet this pin has the option to provide a 25 MHz clock signal for the ethernet MAC,

which is not relevant for this board.

 

Thanks to this Topic https://forum.armbian.com/topic/30274-armbian-build-how-to-modify-dts-file-to-change-gpio-mapping/

and the device tree source files https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts,

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi and

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi

i managed to create an overlay named sun50i-h616-fix-emac-pin.dts to release the GPIO pin from the ethernet MAC/kernel.

 

/dts-v1/;
/plugin/;

/ {
        compatible = "allwinner,sun50i-h616";
        fragment@0 {
          target=<&pio>;
          __overlay__{
                ext_rgmii_pins: rgmii-pins {
                        pins = "PI0", "PI1", "PI2", "PI3", "PI4",
                               "PI5", "PI7", "PI8", "PI9", "PI10",
                               "PI11", "PI12", "PI13", "PI14", "PI15";
                                function = "emac0";
                                drive-strength = <40>;
                        };
                };
        };
        fragment@1 {
                target = <&emac0>;
                __overlay__ {
                        pinctrl-0 = <&ext_rgmii_pins>;
                        };
                };
        };

 

sudo armbian-add-overlay /boot/sun50i-h616-fix-emac-pin.dts

 

Even though I don't really understand how to write device tree overlays, surprisingly I could compile and apply the overlay to the kernel with the command above and it did its job.

The GPIO is available now and the ethernet connection still works.

 

Can someone who actually understands this subject review my code and include this change in the right form at the right spot?

Link to comment
Share on other sites

19 часов назад, ARM_Bruzzler сказал:

i managed to create an overlay named sun50i-h616-fix-emac-pin.dts to release the GPIO pin from the ethernet MAC/kernel.

Unfortunately, you did not write which version of the kernel you wrote the overlay for.
I checked it out. For the EDGE kernel (v6.11.2), this is present.
No overlay is required.

Link to comment
Share on other sites

Posted (edited)

Thank you very much for checking.

 

I use the Debian (minimal/iot) image from https://www.armbian.com/orange-pi-zero-3/.

At the moment I have the kernel version 6.6.44.

I ran sudo apt update && sudo apt upgrade and verified the overlay is still required after the latest update.

So will the correction eventually be distributed over apt in a couple of days or weeks?

Edited by ARM_Bruzzler
Link to comment
Share on other sites

  • Solution
15 часов назад, ARM_Bruzzler сказал:

So will the correction eventually be distributed over apt in a couple of days or weeks?

Just stay tuned.
Will be included in the kernel version v6.6.54 or later

Link to comment
Share on other sites

08.10.2024 в 23:58, ARM_Bruzzler сказал:

I want to use GPIO Pi16 on the 13 pin expansion header of the board.

This pin is claimed by the kernel for the ethernet MAC.

According to the SOC Datasheet this pin has the option to provide a 25 MHz clock signal for the ethernet MAC,

which is not relevant for this board.

I think I've misled you.
For some reason I thought you wanted to add the whole node.
But you want to replace it with the same one but without the PI16 pin.
It's not in my power.
I don't have this board to check.

 

I apologize.

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