U-Boot USB functionality broken in u-boot-qoriq_2017.07

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

U-Boot USB functionality broken in u-boot-qoriq_2017.07

Jump to solution
1,046 Views
vladimirboroda
Contributor II

I just updated the U-Boot to the 2017.07 version, and the USB drivers are not enumerating any devices on the USB hub.  This was working properly in 2017.03.  The board is loosely based on P1021RDB, the USB functionality was working consistently in previous versions.   The hub connects a mass storage device (eMMC bridge) and an Ethernet MAC. 

SPI Flash boot...
*** Warning - bad CRC, using default environment

Second program loader running in sram...
Loading second stage boot loader ......................................................................

U-Boot 2017.07+fsl+g503eff0 (Oct 25 2017 - 18:12:21 -0400)

CPU0: P1021, Version: 1.1, (0x80e40111)
Core: e500, Version: 5.1, (0x80212051)
Clock Configuration:
CPU0:800 MHz, CPU1:800 MHz,
CCB:400 MHz,
DDR:333.333 MHz (666.667 MT/s data rate) (Asynchronous), LBC:400 MHz
QE:400 MHz
L1: D-cache 32 KiB enabled
I-cache 32 KiB enabled
Board: VENTNOR-MPS
I2C: ready
SPI: ready
DRAM: Detected UDIMM CT25664BF160BA.C16
1 GiB (DDR3, 32-bit, CL=6, ECC off)
L2: 256 KiB already enabled
NAND: 0 MiB
MMC: FSL_SDHC: 0
SF: Detected n25q32 with page size 256 Bytes, erase size 4 KiB, total 4 MiB
*** Warning - bad CRC, using default environment

EEPROM: LP01 v0
PCIe1: Root Complex of PCIe SLOT 2, no link, regs @ 0xffe0a000
PCIe1: Bus 00 - 00
PCIe2: disabled
In: serial
Out: serial
Err: serial
SF: Detected n25q32 with page size 256 Bytes, erase size 4 KiB, total 4 MiB
Firmware 'Microcode version 0.0.1 for P1021 r1.0' for 1021 V1.0
QE: uploading microcode 'Microcode for P1021 r1.0' version 0.0.1
KOZIO SWITCH [run leds_on;sleep 1;run leds_off;run kdiagboot]
Net: eTSEC2 is in sgmii mode.
bcm54616S SGMII Interface Mode
eTSEC1 [PRIME], eTSEC2, eTSEC3
Hit any key to stop autoboot: 0
=> usb start
starting USB...
USB0: USB EHCI 40.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

=> usb tree
USB device tree:
1 Hub (480 Mb/s, 0mA)
u-boot EHCI Host Controller

=> usb info
1: Hub, USB Revision 2.0
- u-boot EHCI Host Controller
- Class: Hub
- PacketSize: 1 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 1.0
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Setting 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 2048 Interval 255ms

=>

0 Kudos
1 Solution
527 Views
vladimirboroda
Contributor II

The problem was caused by a U-Boot patch "drivers/usb/ehci: Use platform-specific accessors", which was apparently introduced in June 2017.  The patch to drivers/usb/ehci.h intended to use readl() and writel() macros instead of direct register access.  It didn't take into account that on PowerPC and probably all other big-endian platforms these macros already take care of converting from little-endian into platform format.  So the register values ended up double swapped, and read and written incorrectly as a result. 

View solution in original post

0 Kudos
1 Reply
528 Views
vladimirboroda
Contributor II

The problem was caused by a U-Boot patch "drivers/usb/ehci: Use platform-specific accessors", which was apparently introduced in June 2017.  The patch to drivers/usb/ehci.h intended to use readl() and writel() macros instead of direct register access.  It didn't take into account that on PowerPC and probably all other big-endian platforms these macros already take care of converting from little-endian into platform format.  So the register values ended up double swapped, and read and written incorrectly as a result. 

0 Kudos