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

Retry when DDR init doesn't work #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

superna9999
Copy link
Owner

For an unknown reason, on AMD platforms the first DDR init load fails, but a rety works, this retries until DDR init works.

Fixes #18

Signed-off-by: Neil Armstrong <[email protected]>
@superna9999
Copy link
Owner Author

CC @dsx724

@dsx724
Copy link

dsx724 commented Sep 22, 2022

Using GX Family boot parameters
Traceback (most recent call last):
  File "/home/dxue/git/pyamlboot/./boot.py", line 132, in <module>
    usb.load_uboot()
  File "/home/dxue/git/pyamlboot/./boot.py", line 86, in load_uboot
    self.init_ddr()
  File "/home/dxue/git/pyamlboot/./boot.py", line 74, in init_ddr
    self.soc_id()
  File "/home/dxue/git/pyamlboot/./boot.py", line 54, in soc_id
    s = self.dev.identify()
  File "/home/dxue/git/pyamlboot/pyamlboot/pyamlboot.py", line 306, in identify
    ret = self.dev.ctrl_transfer(bmRequestType = 0xc0,
  File "/usr/lib/python3/dist-packages/usb/core.py", line 1082, in ctrl_transfer
    ret = self._ctx.backend.ctrl_transfer(
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 893, in ctrl_transfer
    ret = _check(self.lib.libusb_control_transfer(
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 602, in _check
    raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBTimeoutError: [Errno 110] Operation timed out

I think something is fundamentally broken in AMD/asmedia's USB linux hardware/driver.

@superna9999
Copy link
Owner Author

@dsx724 can you try superna9999/aml-usb-load-uboot@dace100 ?

@dsx724
Copy link

dsx724 commented Sep 22, 2022

+ ./update cwr u-boot.bin.usb.bl2 0xd9000000
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Transfer Complete! total size is 49152 Bytes
+ ./update write usbbl2runpara_ddrinit.bin 0xd900c000
..
Transfer Complete! total size is 32 Bytes
+ ./update run 0xd9000000
[update]Run at Addr d9000000
AmlUsbRunBinCode:ram_addr=d9000000
+ sleep 1
++ ./update identify 7
++ awk -F- '{print $4}'
+ proto='
0'
+ echo proto 0
proto 0
+ '[' '
0' -eq 8 ']'
+ sleep 1
+ ./update write u-boot.bin.usb.bl2 0xd9000000
..
Transfer Complete! total size is 49152 Bytes
+ ./update write usbbl2runpara_runfipimg.bin 0xd900c000
..
Transfer Complete! total size is 48 Bytes
+ ./update write u-boot.bin.usb.tpl 0x200c000
usbWriteFile len=4096,ret=-19 error_msg=error submitting URB: No such device
ERR: write data to device failed

The moment you try to send a big payload, it's gone. I know on Windows, AMD is notorious for USB problems.

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

Successfully merging this pull request may close these issues.

GXL fail to boot on AMD platforms
2 participants