Ethernet device is not detecting on ubuntu 20.04 LTS on BBG

Use any kernel prior to v5.10.x-ti (v4.19.x/v5.4.x)… TI rewrote the cpsw driver, one of our hacks for BeagleBone needs to be redone, as the board boots it would previously remap the Ethernet to the actually detected mdio address…

Regards,

Can we integrate the fix available in kernel v5.4.x with kernel 5.10.x?

it’s something I’ve been working on… today i’d just use v5.4.x-ti…

PS, one thing that makes this fun to debug…

All day and well into last night:

[   20.926546] cpsw 4a100000.ethernet: phy "/ocp/interconnect@4a000000/segment@0/target-module@100000/ethernet@0/mdio@1000/ethernet-phy@0" not found on slave 0

First thing this morning…

[   21.155704] cpsw-switch 4a100000.switch: starting ndev. mode: dual_mac
[   21.287836] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[   23.362703] cpsw-switch 4a100000.switch eth0: Link is Up - 100Mbps/Full - flow control off
[   23.371138] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Same board, same image… New day, different result.

This bug has always randomly affected small number of boards, so it’s always been fun to debug…

Regards,

Yeah, I agree It’s fun to debug kernel… I enjoy doing this. So just thought of looking into 5.4.x ethernet driver for TI

It would be a great help if you could provide some pointers to debug this issue…

Hi Robert,
Hope you are doing well.
Please share your input on above issue.

Hi @chougulemrudula switch to u-boot: v2021.10 as shown here;

and re-test…

Regards,

Hi Robert, Thank you for your quick reply. I am going to try U-boot v2021.10. I will update you on the same. As I am going through wiki, I observed that Ubuntu 20.04 LTS minimal rootfs is not available, and also the steps earlier I referred to have been removed.
Could you please provide the details? It would be a great help.

Appreciate your input.

Thanks,

Going forward, my plan is to only directly support Debian on armel, armhf, arm64 and riscv64 targets… Ubuntu hasn’t got much love over the last year…

Feel free to build it on your own via:

./RootStock-NG.sh -c eewiki_minfs_ubuntu_focal_armhf.conf

Regards,

All right, Thank you for the information. I would love to try building rootfs for Ubuntu 20.04 LTS using omap image-builder.
Appreciate your help on the same.

Thanks
Mrudula

Hi Robert, I tried building and booting using U-boot 2021.10 version. I observed the same error and Ethernet Interface did not come up.

I verified MLO and u-boot.img file.
Here is my serial log

U-Boot SPL 2021.10-00011-g6988a046 (Mar 08 2022 - 00:19:27 +0530)
Trying to boot from MMC1


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 ...
9462272 bytes read in 597 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 10 ms (99.6 KiB/s)
uboot_overlays: loading /lib/firmware/BB-UART2-00A0.dtbo ...
1022 bytes read in 10 ms (99.6 KiB/s)
uboot_overlays: loading /lib/firmware/BB-UART4-00A0.dtbo ...
1022 bytes read in 30 ms (33.2 KiB/s)
uboot_overlays: loading /lib/firmware/BB-AAIM-LCD-00A1.dtbo ...
4817 bytes read in 31 ms (151.4 KiB/s)
uboot_overlays: loading /lib/firmware/BB-I2C1-00A0.dtbo ...
1102 bytes read in 14 ms (76.2 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 - 0x906200 ]
## 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.625473] l3-aon-clkctrl:0000:0: failed to disable
[    1.674698] omap_voltage_late_init: Voltage driver support not added
[    1.675155] PM: Cannot get wkup_m3_ipc handle
[    1.760237] wkup_m3_rproc 44d00000.cpu: Platform data missing!
[    1.833870] gpiochip_add_data_with_key: GPIOs 0..31 (gpio-0-31) failed to register, -517
[    2.131310] wkup_m3_ipc 44e11324.wkup_m3_ipc: IPC Request for A8->M3 Channel failed! -517
[    2.981182] OF: graph: no port node found in /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[    2.981528] OF: graph: no port node found in /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[    2.983083] tilcdc 4830e000.lcdc: no encoders/connectors found
[    3.043245] mdio_bus 4a101000.mdio: MDIO device at address 0 is missing.
[    3.069227] debugfs: Directory '49000000.dma' with parent 'dmaengine' already present!
[    3.230153] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_13'
[    3.230161] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[    3.237353] PM: Cannot get wkup_m3_ipc handle
[    3.329878] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    3.341452] OF: graph: no port node found in /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[    3.341784] OF: graph: no port node found in /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0
[    3.469933] PM: Cannot get wkup_m3_ipc handle
[    3.477439] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    3.478455] PM: Cannot get wkup_m3_ipc handle
[    3.481513] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    3.507747] PM: Cannot get wkup_m3_ipc handle
[    3.512522] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   19.687466] PM: Cannot get wkup_m3_ipc handle
[   19.699240] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   19.700318] PM: Cannot get wkup_m3_ipc handle
[   19.717477] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   19.718519] PM: Cannot get wkup_m3_ipc handle
[   19.735080] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   24.260185] PM: Cannot get wkup_m3_ipc handle
[   24.287746] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   24.322769] PM: Cannot get wkup_m3_ipc handle
[   24.344376] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   24.363288] PM: Cannot get wkup_m3_ipc handle
[   24.377939] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[   31.125987] PM: Cannot get wkup_m3_ipc handle
[   31.148515] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[FAILED] Failed to start Generic Board Startup.

Ubuntu 20.04 LTS recip ttyS0
[   38.129624] cpsw 4a100000.ethernet: phy "/ocp/interconnect@4a000000/segment@0/target-module@100000/ethernet@0/mdio@1000/ethernet-phy@0" not found on slave 0

Please let me know your feedback on the same.

Thanks,
Mrudula

Yeap, that’s the issue… Right now the best option is to use the v5.4.x-ti branch…

Regards,

1 Like

Hi Robert,

I have been debugging this issue for a long time.

With Ubuntu 16.04 I have integrated phyreg utility to detect Eth PHY failure during boot-up and it reboot beagleboard if PHY detection failed.

Now I have integrated the same utility with Ubuntu 20.04 having kernel (5.10.87-bone-rt-r59), but it is crashing with the below errors.

[ 27.307149] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 43.473107] 8<— cut here —
[ 43.473128] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f40008
[ 43.473146] pgd = 186afde1
[ 43.473158] [b6f40008] *pgd=8a108831, *pte=4a101303, *ppte=4a101a33
[ 52.807127] rc.local[409]: /etc/rc.local: line 20: 442 Bus error sudo phyreg

It seems like memory map is failed or mmap address and calculations are not correct…

Please help me to resolve these errors.

Appreciate your suggestions.

Thanks
Mrudula

Hi,

I have below observations with kernel 5.10.x and 5.4.x kernel where PHY is failed

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

where as with kernel 4.4.27 I found this
$ dmesg | grep mdio
[ 3.646287] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[ 3.646307] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[ 3.646662] davinci_mdio: dt: updated phy_id[0] from phy_mask[fffffffe]
[ 3.647855] libphy: 4a101000.mdio: probed
[ 3.647881] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720

Please provide your views.
Thanks

So this is our old hack/patch that fixes things up… The mainline version of the cpsw was changed in 5.4.x to a new driver… Right now we don’t have a fix for this issue on newer kernel’s…

Regards,

Can we apply the patch available in kernel 4.4.x on kernel 5.4.x directly?
if yes, Please share the patch details…

Thanks

The patch has always been applied…

The am335x device tree’s no longer use that “driver” for the cpsw, instead it uses the new driver…

edit: kernel/git/torvalds/linux.git - Linux kernel source tree

Regards,

Do we need to change kernel configs to fix this? I mean should we enable CONFIG_TI_CPSW_SWITCHDEV?

What can be an easy way to fix this?

Appreciate your valuable input.

Thanks

Already enabled…

edit, with the new driver, we are unable to grab the random register we use to read and re-set the address location of the phy…

Regards,

In the config file of kernel 5.10.89 , CONFIG_TI_CPSW_SWITCHDEV is not set. will try setting and testing the same.

Thank you for your prompt response.

I’m hoping this will fix the problem.

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