xilinx: zynqmp: Initialize usb and scsi via preboot
authorMichal Simek <michal.simek@xilinx.com>
Thu, 29 Jul 2021 12:22:05 +0000 (14:22 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 26 Aug 2021 06:08:11 +0000 (08:08 +0200)
commit18bfe9cf5a590210485e442e1af7a1dff5ae87f4
treebf672ba4bc504c886714c8705482de456427a1c1
parent055dfdc257c99b2195e22493d986dd3b45939f80
xilinx: zynqmp: Initialize usb and scsi via preboot

Based on thread
https://lists.denx.de/pipermail/u-boot/2021-June/451828.html
especially
"Overall we have a deficiency in the UEFI implementation in that we
cannot deal with block devices added or removed after initialization."
there is a need to deal with removable media as usb/scsi/sata.

That's why bridge this gap in EFI implementation by resetting usb and
scsi resets to get all disks before efi_init_obj_list() is called.

In our standard boot flow, where we use distro boot, order is fixed as
"jtag mmc0 mmc1 qspi0 nand0 usb0 usb1 scsi0 pxe dhcp" with prioritizing
boot device added by commit 2882b39d564b ("arm64: zynqmp: Setup the first
boot_target at run time").
When device has ESP partition all devices should be detected because then
efi_disk_register() in efi_init_obj_list() is called only once.

The first such a device is sd/emmc(mmc0/mmc1) and then disks on usb/sata
are not handled at all.

The commit 6bb577dbb30f ("arm64: zynqmp: Disable
EFI_CAPSULE_ON_DISK_EARLY") also pointed out on this issue but detection of
removable media wasn't solved that's why do it now via preboot command.

I have tested cases without usb and scsi and there is no problem with
calling resets without devices itself.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
configs/xilinx_zynqmp_virt_defconfig