Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

U-Boot reboots after "usb start" on x96 mini #4

Open
probonopd opened this issue Apr 28, 2020 · 11 comments
Open

U-Boot reboots after "usb start" on x96 mini #4

probonopd opened this issue Apr 28, 2020 · 11 comments

Comments

@probonopd
Copy link

probonopd commented Apr 28, 2020

Hi @hexdump0815, thanks for pointing me to https://github.com/hexdump0815/imagebuilder/blob/master/boot/boot-amlogic_gx-aarch64/u-boot.bin on IRC.

I can successfully chainload this U-Boot build, but trying to use usb start with a USB storage device attached leads to a reboot on the x96 mini:

gxl_p281_v1#fatload mmc 0 0x01000000 u-boot.ext
(...)
gxl_p281_v1#go 0x01000000
## Starting application at 0x01000000 ...
U-Boot 2019.01 (Mar 26 2019 - 22:16:31 +0100) libretech-cc
DRAM:  1 GiB
MMC:   mmc@72000: 0, mmc@74000: 1
(...)
Hit any key to stop autoboot:  2 
(...)
=> usb start
starting USB...
USB0:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... XHCI timeout on event type 33... cannot recover.
BUG at drivers/usb/host/xhci-ring.c:473/xhci_wait_for_event()!
BUG!
resetting ...
bl31 reboot reason: 0xd
bl31 reboot reason: 0x0
system cmd  1.
GXL:BL1:9ac50e:bb16dc;FEAT:ADFC318C:0;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;

Without a USB storage device attached it works:

=> usb start
starting USB...
USB0:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

If I then attach the USB storage device and usb reset, then I am back to the original issue.

Do you have any idea what may be causing this or how to debug it?

Thank you very much.

@probonopd
Copy link
Author

probonopd commented Apr 28, 2020

Different result when attaching the storage device to the other USB port:

=> usb start
starting USB...
USB0:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... Device not responding to set address.

      USB device not accepting new address (error=80000000)
1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

@hexdump0815
Copy link
Owner

hexdump0815 commented Apr 29, 2020 via email

@probonopd
Copy link
Author

Thanks @hexdump0815

you'll have to adapt the mainline u-boot to be
built with a dts matching your hardware exactly

Do you know where I can learn about how exactly to do that?

@hexdump0815
Copy link
Owner

i think there is no single ressource to learn that from - its a long learning and a lot of trial and error and sometimes its impossible because one does not really know how a certain hardware exactly works ...

@hexdump0815
Copy link
Owner

btw. did you try to run the "usb start" on the legacy u-boot before the chainloading?

@probonopd
Copy link
Author

No, I didn't do that. Will see whether doing this will make a difference.

@probonopd
Copy link
Author

probonopd commented May 1, 2020

Indeed @hexdump0815 it works (as in: recognizes USB mass storage device without crashing) when I run usb start before and after chainloading. Does this mean that some (which?) aspects of the stock U-Boot need to be carried over/compiled into the new one?

@probonopd
Copy link
Author

run usb_boot will not boot an openSUSE aarch64 Live ISO dd'ed to the USB mass storage device though:

gxl_p281_v1#usb start   
(Re)start USB...
USB0:   USB3.0 XHCI init start
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... Device not responding to set address.
Setup ERROR: address device command for slot 1.
retry new usb device
2 USB Device(s) found
       scanning usb for storage devices... init_part() 278: PART_TYPE_DOS
1 Storage Device(s) found
gxl_p281_v1#fatload mmc 0 0x01000000 u-boot.ext
card in
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
reading u-boot.ext
527980 bytes read in 34 ms (14.8 MiB/s)
gxl_p281_v1#go 0x01000000
## Starting application at 0x01000000 ...


U-Boot 2019.01 (Mar 26 2019 - 22:16:31 +0100) libretech-cc

DRAM:  1 GiB
MMC:   mmc@72000: 0, mmc@74000: 1
In:    serial@4c0
Out:   serial@4c0
Err:   serial@4c0
[BL31]: tee size: 0
[BL31]: tee size: 0
Net:   
Warning: ethernet@c9410000 (eth0) using random MAC address - 8a:6b:0d:xx:xx:xx
eth0: ethernet@c9410000
Hit any key to stop autoboot:  0 
=> 
=> run usb_boot
starting USB...
USB0:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

IDE device 0: Vendor: Kingston Rev:  Prod: DataTraveler 3.0
            Type: Removable Hard Disk
            Capacity: 7377.6 MB = 7.2 GB (15109516 x 512)
** Bad device specification usb -bootable **
** Unrecognized filesystem type **

=> fatls usb 0 
** Unrecognized filesystem type **

It seems that this bootloader cannot handle ISO9660 which is needed to boot openSUSE aarch64 Live ISOs?

@hexdump0815
Copy link
Owner

maybe rebuild the chainloaded u-boot with iso fs enabled - i trhink mine was a libretech potato u-boot without any changes built from mainline u-boot

@probonopd
Copy link
Author

Thanks, it looks like https://build.opensuse.org/package/binaries/hardware:boot/u-boot:libretech-cc/openSUSE_Factory_ARM can be used (although it has the same USB mass storage issue).

How did you find out that 0x01000000 must be used instead of ${loadaddr}?

@hexdump0815
Copy link
Owner

if i remember correctly it was either from the amlogic irc or trail and error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants