commit 787f04bb6a - imx: add USB2_BOOT type

Peng Fan peng.fan at oss.nxp.com
Fri Oct 14 02:55:54 CEST 2022


Hi Rasmus

On 10/7/2022 4:08 PM, Rasmus Villemoes wrote:
> Hi Peng
> 
> It seems that commit 787f04bb6a (imx: add USB2_BOOT type) broke our
> board logic which relies on whether get_boot_device() returns USB_BOOT
> or not. Instrumenting get_boot_device() shows that on our imx8mp board,
> boot_instance is 3 when we're booting over USB, so boot_dev becomes 20
> instead of 17 aka USB_BOOT.
> 
> I assume that for the boards/socs you mentioned in the commit message,
> boot_instance could be 0 or 1. However, I don't see anywhere that uses
> that USB2_BOOT define.
> 
> Short-term, I'll probably just revert 787f04bb6a locally. A bit longer
> term, I'm thinking I should be doing rom_api_query_boot_infor() and
> "decoding" the return value myself.
> 
> Is there any chance you could make some information on that ROM API
> public so it's possible for outsiders to understand what's going on?

Could you please try below changes to check whether it fixes your issue?

diff --git a/arch/arm/mach-imx/romapi.c b/arch/arm/mach-imx/romapi.c
index c8accdb04db..ad7f8640401 100644
--- a/arch/arm/mach-imx/romapi.c
+++ b/arch/arm/mach-imx/romapi.c
@@ -67,6 +67,8 @@ enum boot_device get_boot_device(void)
                 boot_dev = QSPI_BOOT;
                 break;
         case BT_DEV_TYPE_USB:
+               if (!is_imx8ulp() && !is_imx9())
+                       boot_instance = 0;
                 boot_dev = boot_instance + USB_BOOT;
                 break;
         default:

Thanks,
Peng.
> 
> Rasmus


More information about the U-Boot mailing list