diff mbox series

[v2] xilinx: zynqmp: Initialize usb and scsi via preboot

Message ID 8b096437c41b3aad6ed8bdc9f4141044fe640973.1628682108.git.michal.simek@xilinx.com
State Accepted
Commit 18bfe9cf5a590210485e442e1af7a1dff5ae87f4
Delegated to: Michal Simek
Headers show
Series [v2] xilinx: zynqmp: Initialize usb and scsi via preboot | expand

Commit Message

Michal Simek Aug. 11, 2021, 11:41 a.m. UTC
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>
---

Changes in v2:
- Align scsi with distroboot and use run scsi_init instead of scsi reset
- Also align subject was: "xilinx: zynqmp: Reset usb and scsi via preboot"

 configs/xilinx_zynqmp_virt_defconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Michal Simek Aug. 23, 2021, 6:45 a.m. UTC | #1
st 11. 8. 2021 v 13:41 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> 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>
> ---
>
> Changes in v2:
> - Align scsi with distroboot and use run scsi_init instead of scsi reset
> - Also align subject was: "xilinx: zynqmp: Reset usb and scsi via preboot"
>
>  configs/xilinx_zynqmp_virt_defconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
> index 38b8f8c8b417..348a60396753 100644
> --- a/configs/xilinx_zynqmp_virt_defconfig
> +++ b/configs/xilinx_zynqmp_virt_defconfig
> @@ -22,6 +22,7 @@ CONFIG_FIT_VERBOSE=y
>  CONFIG_SPL_LOAD_FIT=y
>  CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
>  CONFIG_USE_PREBOOT=y
> +CONFIG_PREBOOT="run scsi_init;usb start"
>  # CONFIG_DISPLAY_CPUINFO is not set
>  CONFIG_BOARD_EARLY_INIT_F=y
>  CONFIG_BOARD_EARLY_INIT_R=y
> --
> 2.32.0
>

Applied.
M
diff mbox series

Patch

diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index 38b8f8c8b417..348a60396753 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -22,6 +22,7 @@  CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
 CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="run scsi_init;usb start"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_BOARD_EARLY_INIT_R=y