[efi] Disconnect USB gadget on fastboot stop
gbl_efi_fastboot_transport.c:stop() previously ran `usb reset` after
g_dnl_unregister(), resetting and scanning XHCI host ports (~3.2 s) on
every exit from GBL fastboot because dwc_pcd_ops omitted .pullup and
usb_gadget_unregister_driver() skipped driver->disconnect(). In
addition, start() overwrote out_req->buf with rx_buffer_a without
restoring the original buffer before unbind, which would free
rx_buffer_a inside fastboot_disable() once disconnect() runs.
Wire f_dwc_otg_pullup() into dwc_pcd_ops.pullup, keep DCTL.sftdiscon
asserted during f_dwc_core_init(), and initialize the PCD before
driver->bind() so usb_gadget_connect() enables pull-up only after the
PHY and DWC2 core are ready. In usb_gadget_unregister_driver(), call
usb_gadget_disconnect() and driver->disconnect() before unbind(). In
stop(), dequeue and restore out_req->buf before g_dnl_unregister() and
drop `usb reset`.
Test: Built kvim3_zircon, flashed VIM3, and verified fastboot continue
and fastboot boot trigger immediate host USB disconnect (~1 ms),
cut stop() from 3.18 s to 8 ms, and boot Fuchsia cleanly.
Change-Id: I979c1dbb8fbe619429bf208c1ded7e0847f1f1a9
Reviewed-on: https://turquoise-internal-review.googlesource.com/c/third_party/u-boot/+/1855781
Lint: android-build-ayeaye@system.gserviceaccount.com <android-build-ayeaye@system.gserviceaccount.com>
Commit-Queue: Dov Shlachter <dovs@google.com>
Reviewed-by: David Pursell <dpursell@google.com>
GitOrigin-RevId: b960472dbe7246c34bf0e6734b2436162912068c
This is a version of u-boot, modified to support Fuchsia on the Khadas vim3
To build the vim3 bootloader for Fuchsia:
CIPD access. All build tools are downloaded to cipd_deps.
Run the build script from repo root
./fuchsia_build.py
Options:
--clean-cipd option can be used to make sure CIPD checkout is clean. It will remove cipd_deps directory and download dependencies again.--gbl-path <path> option specifies a path to a local GBL (gbl.efi) binary. If provided, CIPD GBL is not used; otherwise, the script downloads GBL from CIPD and uses gbl_aarch64_dev.efi.You now have a build/u-boot.bin.unsigned that you can flash to a target using fastboot.
go/fuchsia-firmware-licensing-publishing