Ethernet device is not detecting on ubuntu 20.04 LTS on BBG

I enabled CONFIG_TI_CPSW_SWITCHDEV and verified seems like it did not fix the problem. Below is the log.

~$ dmesg | grep mdio
[    3.039021] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    3.039057] libphy: 4a101000.mdio: probed
[    3.039352] mdio_bus 4a101000.mdio: MDIO device at address 0 is missing.

Adding detailed log for reference

U-Boot 2021.10-00011-g6988a046 (Mar 08 2022 - 00:19:27 +0530)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
Reset Source: Global warm SW reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
WDT:   Started with servicing (60s timeout)
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... ** File not found /boot/uboot.env **

** Unable to read "/boot/uboot.env" from mmc0:1 **
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net:   Could not get PHY for ethernet@4a100000: addr 0
eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[BBG1] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
Couldn't find partition 0:2 0x82000000
Can't set block device
Couldn't find partition 0:2 0x82000000
Can't set block device
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Scanning disk mmc@48060000.blk...
Scanning disk mmc@481d8000.blk...
Found 7 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
switch to partitions #0, OK
mmc0 is current device
Checking for: /uEnv.txt ...
934 bytes read in 3 ms (303.7 KiB/s)
Loaded environment from /uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
Running uenvcmd ...
Checking for: /boot/uEnv.txt ...
708 bytes read in 3 ms (230.5 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
Running uname_boot ...
loading /boot/vmlinuz-5.10.87-bone-rt-r59 ...
9515520 bytes read in 602 ms (15.1 MiB/s)
debug: [enable_uboot_overlays=1] ...
debug: [enable_uboot_cape_universal=1] ...
debug: [uboot_base_dtb_univ=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot-univ.dtb ...
loading /boot/dtbs/5.10.87-bone-rt-r59/am335x-boneblack-uboot-univ.dtb ...
215646 bytes read in 19 ms (10.8 MiB/s)
Found 0 extension board(s).
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /boot/dtbs/5.10.87-bone-rt-r59/overlays/M-BB-BBG-00A0.dtbo ...
418 bytes read in 7 ms (57.6 KiB/s)
uboot_overlays: uboot loading of [BB-ADC-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_adc=1]...
uboot_overlays: loading /lib/firmware/BB-UART1-00A0.dtbo ...
1022 bytes read in 33 ms (29.3 KiB/s)
uboot_overlays: loading /lib/firmware/BB-UART2-00A0.dtbo ...
1022 bytes read in 18 ms (54.7 KiB/s)
uboot_overlays: loading /lib/firmware/BB-UART4-00A0.dtbo ...
1022 bytes read in 31 ms (31.3 KiB/s)
uboot_overlays: loading /lib/firmware/BB-AAIM-LCD-00A1.dtbo ...
4817 bytes read in 8 ms (587.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-I2C1-00A0.dtbo ...
1102 bytes read in 18 ms (59.6 KiB/s)
uboot_overlays: uboot loading of [BB-BONE-eMMC1-01-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_emmc=1]...
debug: [console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M quiet] ...
debug: [bootz 0x82000000 - 88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x913200 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Using Device Tree in place at 88000000, end 88098fff

Starting kernel ...

[    1.651096] l3-aon-clkctrl:0000:0: failed to disable
[    1.696397] omap_voltage_late_init: Voltage driver support not added
[    1.696719] PM: Cannot get wkup_m3_ipc handle
[    1.781185] wkup_m3_rproc 44d00000.cpu: Platform data missing!
[    1.853566] gpiochip_add_data_with_key: GPIOs 0..31 (gpio-0-31) failed to register, -517
[    2.144954] wkup_m3_ipc 44e11324.wkup_m3_ipc: IPC Request for A8->M3 Channel failed! -517
[    2.978586] OF: graph: no port node found in /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[    2.978996] OF: graph: no port node found in /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[    2.980426] tilcdc 4830e000.lcdc: no encoders/connectors found
[    3.039352] mdio_bus 4a101000.mdio: MDIO device at address 0 is missing.
[    3.065211] debugfs: Directory '49000000.dma' with parent 'dmaengine' already present!
[    3.226251] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_13'
[    3.226260] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[    3.233155] PM: Cannot get wkup_m3_ipc handle
[    3.319986] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    3.335801] OF: graph: no port node found in /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[    3.336148] OF: graph: no port node found in /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[    3.477086] PM: Cannot get wkup_m3_ipc handle
[    3.478322] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    3.479443] PM: Cannot get wkup_m3_ipc handle
[    3.488233] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    3.499887] PM: Cannot get wkup_m3_ipc handle
[    3.507249] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    3.997714] PM: Cannot get wkup_m3_ipc handle
[    4.005296] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   17.135732] PM: Cannot get wkup_m3_ipc handle
[   17.147240] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   17.148296] PM: Cannot get wkup_m3_ipc handle
[   17.167241] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   17.168324] PM: Cannot get wkup_m3_ipc handle
[   17.175160] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   17.183674] PM: Cannot get wkup_m3_ipc handle
[   17.200869] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   17.687070] PM: Cannot get wkup_m3_ipc handle
[   17.703263] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   24.394535] PM: Cannot get wkup_m3_ipc handle
[   24.433638] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   24.505197] PM: Cannot get wkup_m3_ipc handle
[   24.520172] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   24.525634] PM: Cannot get wkup_m3_ipc handle
[   24.543163] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   45.957802] 8<--- cut here ---
[   45.957823] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f65008
[   45.957841] pgd = 0cd0f528
[   45.957853] [b6f65008] *pgd=8a152831, *pte=4a101303, *ppte=4a101a33
[   55.559690] rc.local[402]: /etc/rc.local: line 20:   449 Bus error               sudo phyreg
[   57.877599] PM: Cannot get wkup_m3_ipc handle
[   57.891292] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   58.089062] PM: Cannot get wkup_m3_ipc handle
[   58.113601] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle

Please provide your suggestions/ input.

Thanks

Correct, that config doesn’t fix it… It’s just the new driver…

Like i said, TI changed the cpsw driver on AM335x…

The work-around patch only works with the older pre TI_CPSW_SWITCHDEV driver…

Right now, your best options are to use v4.19.x or 5.4.x…

Or pick-up a new BBB with a hardware fix. This issue only affects a small percentage of boards.

Regards,

Hi Robert,
I tried v4.19.x and 5.4.x kernels. I observed during bootup phyreg utility is crashing. devmem2 is not working for mdio register map even after the kernel bootup.

Thanks
Mrudula

v4.19.x and v5.4.x have the PHY mask work-around. I’ve never used devmem2 to read the PHY registers, I just dumped the value from the kernel driver…

If v4.19.x doesn’t even work, i’m starting to think there is something else wrong with your board…

Regards,

Hi Robert,

I tried Ubuntu 20.04 LTS filesystem with v4.4.27.x kernel everything works well.
Also if the ethernet interface is up and ip settings are correct then devmem2 is working well on Ubuntu 20.04 with v5.10.x kernel.
I tried below steps:

  1. kernel is up, login using serial console
  2. apply IP settings to eth0 interface using ifconfig commands
  3. Read mdio register address map using devmem2. Works well…!

what could be the issue, when ethernet interface settings are not applied for mdio to fail? Please share your thoughts.

can we add anything in the mdio/cpsw driver to fix the above issue?

Thanks
Mrudula

mdio phy address…

The address physically set by the pull-up resistors, the PHY fails to correctly read at power up…

Regards,

Alright.
I found below the log when ethernet interface settings are not applied…

$ dmesg | grep mdio
[ 3.055041] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[ 3.055073] libphy: 4a101000.mdio: probed
[ 3.057624] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720

After applying ethernet interface settings…
$ sudo ifconfig eth0 1.1.1.2

$ dmesg | grep mdio
[ 3.055041] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[ 3.055073] libphy: 4a101000.mdio: probed
[ 3.057624] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[ 250.277411] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)

As we can see PHY driver is attached after applying interface settings manually and in the earlier log driver was not attached.
can we make it happen during probe/init function call of mdio driver?

Thanks,
Mrudula

^ it came up normally there…

[ 3.646307] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[ 3.646662] davinci_mdio: dt: updated phy_id[0] from phy_mask[fffffffe]

With the workaround, you’ll see ^ above, as the phy_id was wrong…

Regards,

In the first log, we can see probe function is called and mdio device driver is registered. but it is not attached to the PHY device.

Once eth0 interface is up using ifconfig eth0 1.1.1.2. The PHY is attached and mdio address map is available in kernel space. and devmem2 is working fine.

Will there be any updates or patches in the future?

Thanks

Hi Robert,

We have BBG2 and As I am seeing Ethernet PHY detection is failed during boot so frequently. So do we have hardware fix for this issue in BBG2 and later revisions of Beaglebard?
How many revisions of BBG are out in the market? and what is the best revision to use?

If we upgrade HW, will the mdio driver detection issue get fix? if yes, we can plan to upgrade our all devices.

Please provide your suggestions.

Thanks,
Mrudula

For the BeagleBone Green, to date there has only been one design in the market.

First device with the mdio fix is the BeagleBone Black (RevC3)… GitHub - beagleboard/beaglebone-black: Design and Document files for the BeagleBone Black from BeagleBoard.org

Regards,

Thanks, Robert for your quick reply.

Can we apply the same fix to BeagleBone Green? if yes, could you please provide more details regarding the hardware changes?

Appreciate your valuable input.

Thanks,
Mrudula

You can see the fix on page 9… Prior SYS_RESET was connected to nRST on the LAN8710A, the fix was to add a gpio controlled reset option. This allows us to reset the PHY on startup.

BEAGLEBONEBLK_C.pdf (72.4 KB)

beaglebone black_sch_revc3_2104.pdf (204.7 KB)

Regards,