On 05.03.21 21:03, Phil Sutter wrote:
With the recent fixes in pci_mvebu and xhci-pci drivers, the two rear
USB3 ports are finally usable and accessing them no longer hangs the
system. Moreover, if Linux is booted without a prior call to 'pci enum'
and 'usb start', the HCD is detected but attached devices are not
usable:

| xhci_hcd 0000:02:00.0: xHCI Host Controller
| xhci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 2
| xhci_hcd 0000:02:00.0: hcc params 0x040040a5 hci version 0x100 quirks 
0x0000000000080490
| usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
| usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
| usb usb2: Product: xHCI Host Controller
| usb usb2: Manufacturer: Linux 5.4.92-1 xhci-hcd
| usb usb2: SerialNumber: 0000:02:00.0
| hub 2-0:1.0: USB hub found
| ata1: SATA link down (SStatus 0 SControl 300)
| hub 2-0:1.0: 2 ports detected
| xhci_hcd 0000:02:00.0: xHCI Host Controller
| xhci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 3
| xhci_hcd 0000:02:00.0: Host supports USB 3.0 SuperSpeed
| usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
| usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.04
| usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
| usb usb3: Product: xHCI Host Controller
| usb usb3: Manufacturer: Linux 5.4.92-1 xhci-hcd
| usb usb3: SerialNumber: 0000:02:00.0
| hub 3-0:1.0: USB hub found
| hub 3-0:1.0: 2 ports detected
[...]
| xhci_hcd 0000:02:00.0: Error while assigning device slot ID
| xhci_hcd 0000:02:00.0: Max number of devices this xHCI host supports is 64.
| usb usb2-port2: couldn't allocate usb_device

To avoid this problem, enumerate PCI (and USB) from PREBOOT.

Signed-off-by: Phil Sutter <p...@nwl.cc>
---
Changes since v1:
- Have to enable XHCI_HCD as well to fulfill Kconfig dependency.
- Explicitly disable XHCI_MARVELL which defaults to enabled.
- Prefix PREBOOT with 'pci enum'.
- Update commit message accordingly.

Hmmm, in general is should not be necessary to configure / setup any of
the devices in the bootloader so that it works correctly in Linux. It's
best practice, that Linux does not rely on any bootloader setup. If a
device, like PCI and/or USB does not work in Linux without this U-Boot
setup, then it should be fixed in Linux instead.

Especially calling "usb start" adds a quite big delay to the bootup
time. I would really like to not add such changes. Perhaps you could
check with the maintainer(s) of the Linux PCI driver and/or the USB
PCI controller driver about this issue instead?

Thanks,
Stefan

---
  configs/ds414_defconfig | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/configs/ds414_defconfig b/configs/ds414_defconfig
index 3e6dcec3edde3..24466d81dffdb 100644
--- a/configs/ds414_defconfig
+++ b/configs/ds414_defconfig
@@ -22,7 +22,7 @@ CONFIG_BOOTDELAY=3
  CONFIG_USE_BOOTARGS=y
  CONFIG_BOOTARGS="console=ttyS0,115200"
  CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="usb start; sf probe"
+CONFIG_PREBOOT="pci enum; usb start; sf probe"
  # CONFIG_DISPLAY_BOARDINFO is not set
  CONFIG_DISPLAY_BOARDINFO_LATE=y
  CONFIG_SPL_I2C_SUPPORT=y
@@ -65,5 +65,8 @@ CONFIG_SYS_NS16550=y
  CONFIG_KIRKWOOD_SPI=y
  CONFIG_USB=y
  CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+# CONFIG_USB_XHCI_MVEBU is not set
+CONFIG_USB_XHCI_PCI=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_STORAGE=y



Viele Grüße,
Stefan

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: s...@denx.de

Reply via email to