On my Raspberry Pi 4B board, I'm trying to load file from USB during my boot.scr script, but when I call USB start or USB reset command, I get following error:
starting USB...
Bus xhci_pci: pci_hose_bus_to_phys: invalid physical address
xhci-pci init cannot map PCI mem bar
probe failed, error -5
No working controllers found
My Yocto image is based on core-image with meta-raspberrypi and meta-swupdate layers. I have tried to check rpi_4_32b_defconfig file and generated .config file, but I wasn't able to find any relevant option not being set. But I'm not exactly sure, what options are actually relevant and should be set in order to USB work.
My second idea is, that there is some issue with device tree, invalid USB controller address or something like that. But device trees are still complete woodoo for me. I'm not even sure, if it's used by uboot or not. I'm loading it from somewhere, because original swupdate boot.scr did it, but I'm not sure, if it's important for uboot, or for booting kernel or both.
Do you have any idea, what should I try?
EDIT: I'm working on it all day long and still without succes. I have tried to use newer version of u-boot, 2024.7 instead 2023.1, but without success.
It complains it can't map PCI mem bar, so my idea was, there is some issue with PCI. But if I use pci command, It list 2 devices, exactly the same like I can see in running linux in /sys/bus/pci.
BusDevFun VendorId DeviceId Device Class Sub-Class
_____________________________________________________________
00.00.00 0x14e4 0x2711 Bridge device 0x04
01.00.00 0x1106 0x3483 Serial bus controller 0x03
If I run command pci bar 1.0.0, which should correspond to USB controller, I get following. Maybe there should be more bars? Maybe not type of MEM? Just guessing.
ID Base Size Width Type
----------------------------------------------------------
0 0xfffffffffffff000 0x0000000000001000 64 MEM
If I run the same command on 0.0.0, I get empty table. Is this the problem? This device has in linux pcieport driver, so I don't think this is necessary.
ID Base Size Width Type
----------------------------------------------------------
Honestly, I'm completely lost in this problematic and I don't know where to find relevant information. It seems nobody never needed to use USB on RPi 4 with u-boot, or just never had a single problem with it.