Ethernet device is not detecting on ubuntu 20.04 LTS on BBG

yeah gpio numbers are all over the place… looking at:

debian@40-am335x-bbb:~$ uname -r ; cat /sys/kernel/debug/gpio
6.1.46-ti-r18
gpiochip0: GPIOs 0-31, parent: platform/4804c000.gpio, gpio-0-31:
 gpio-0   (P8_25 [mmc1_dat0]   )
 gpio-1   ([mmc1_dat1]         )
 gpio-2   (P8_5 [mmc1_dat2]    )
 gpio-3   (P8_6 [mmc1_dat3]    )
 gpio-4   (P8_23 [mmc1_dat4]   )
 gpio-5   (P8_22 [mmc1_dat5]   )
 gpio-6   (P8_3 [mmc1_dat6]    )
 gpio-7   (P8_4 [mmc1_dat7]    )
 gpio-8   (NC                  |PHY reset           ) out hi ACTIVE LOW
debian@40-am335x-bbb:~$ dmesg | grep gpio
[    3.410918] gpio gpiochip0: (gpio-0-31): not an immutable chip, please consider fixing it!
[    3.526430] gpio gpiochip1: (gpio-32-63): not an immutable chip, please consider fixing it!
[    3.529201] gpio gpiochip2: (gpio-64-95): not an immutable chip, please consider fixing it!
[    3.736478] gpio gpiochip3: (gpio-96-127): not an immutable chip, please consider fixing it!
[    5.497706] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)

So using that, you can grab the io via gpio…

debian@40-am335x-bbb:~$ gpioget gpiochip0 8
0
debian@40-am335x-bbb:~$ gpioget gpiochip0 8
0
debian@40-am335x-bbb:~$ sudo gpioset gpiochip0 8=0
debian@40-am335x-bbb:~$ gpioget gpiochip0 8
0
debian@40-am335x-bbb:~$ sudo gpioset gpiochip0 8=1
debian@40-am335x-bbb:~$ gpioget gpiochip0 8
0
debian@40-am335x-bbb:~$ uname -r ; gpioinfo
6.7.0-rc6-bone6
gpiochip0 - 32 lines:
	line   0: "P8_25 [mmc1_dat0]" unused input active-high 
	line   1: "[mmc1_dat1]" unused input active-high 
	line   2: "P8_5 [mmc1_dat2]" unused input active-high 
	line   3: "P8_6 [mmc1_dat3]" unused input active-high 
	line   4: "P8_23 [mmc1_dat4]" unused input active-high 
	line   5: "P8_22 [mmc1_dat5]" unused input active-high 
	line   6: "P8_3 [mmc1_dat6]" unused input active-high 
	line   7: "P8_4 [mmc1_dat7]" unused input active-high 
	line   8:         "NC"  "PHY reset"  output   active-low [used]

i questioned this before…

On mainline: am335x-bone-common.dtsi « omap « ti « dts « boot « arm « arch - kernel/git/torvalds/linux.git - Linux kernel source tree

&davinci_mdio_sw {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&davinci_mdio_default>;
	pinctrl-1 = <&davinci_mdio_sleep>;

	ethphy0: ethernet-phy@0 {
		reg = <0>;
		/* Support GPIO reset on revision C3 boards */
		reset-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
		reset-assert-us = <300>;
		reset-deassert-us = <6500>;
	};
};

Whereas…mdio.yaml « net « bindings « devicetree « Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree

    davinci_mdio: mdio@5c030000 {
        reg = <0x5c030000 0x1000>;
        #address-cells = <1>;
        #size-cells = <0>;

        reset-gpios = <&gpio2 5 1>;
        reset-delay-us = <2>;

        ethphy0: ethernet-phy@1 {
            reg = <1>;
        };

        ethphy1: ethernet-phy@3 {
            reg = <3>;
        };
    };

Did we screw up?

trying: am335x-bone-common: move reset-gpios under node (7bf56e95) · Commits · BeagleBoard.org / BeagleBoard-DeviceTrees · GitLab

Please try:

git clone -b v6.7.x https://git.beagleboard.org/beagleboard/BeagleBoard-DeviceTrees.git
cd ./BeagleBoard-DeviceTrees/
make
sudo make install_arm
sudo reboot

Regards,