diff mbox series

imx: fix get_boot_device() for imx8

Message ID 20230424163344.1827612-1-tharvey@gateworks.com
State Accepted
Commit a48a824dbac4a33e4b27b9f568ea28c52b631658
Delegated to: Stefano Babic
Headers show
Series imx: fix get_boot_device() for imx8 | expand

Commit Message

Tim Harvey April 24, 2023, 4:33 p.m. UTC
commit 787f04bb6a0a ("imx: add USB2_BOOT type") broke get_boot_device()
for IMX8 which affects booting from SDP due to boot_instance being
non-zero.

Fix this by only using boot_instance for imx8ulp and imx9.

Fixes: 787f04bb6a0a ("imx: add USB2_BOOT type")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 arch/arm/mach-imx/romapi.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Peng Fan (OSS) April 26, 2023, 1:31 a.m. UTC | #1
On 4/25/2023 12:33 AM, Tim Harvey wrote:
> commit 787f04bb6a0a ("imx: add USB2_BOOT type") broke get_boot_device()
> for IMX8 which affects booting from SDP due to boot_instance being
> non-zero.
> 
> Fix this by only using boot_instance for imx8ulp and imx9.
> 
> Fixes: 787f04bb6a0a ("imx: add USB2_BOOT type")
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> ---
>   arch/arm/mach-imx/romapi.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/romapi.c b/arch/arm/mach-imx/romapi.c
> index b49e7f80a286..ff0522c2d117 100644
> --- a/arch/arm/mach-imx/romapi.c
> +++ b/arch/arm/mach-imx/romapi.c
> @@ -70,6 +70,8 @@ enum boot_device get_boot_device(void)
>   		boot_dev = SPI_NOR_BOOT;
>   		break;
>   	case BT_DEV_TYPE_USB:
> +		if (!is_imx8ulp() && !is_imx9())
> +			boot_instance = 0;
>   		boot_dev = boot_instance + USB_BOOT;
>   		break;
>   	default:
Fabio Estevam April 27, 2023, 6:34 p.m. UTC | #2
Hi Tim,

On Mon, Apr 24, 2023 at 1:33 PM Tim Harvey <tharvey@gateworks.com> wrote:
>
> commit 787f04bb6a0a ("imx: add USB2_BOOT type") broke get_boot_device()
> for IMX8 which affects booting from SDP due to boot_instance being
> non-zero.
>
> Fix this by only using boot_instance for imx8ulp and imx9.
>
> Fixes: 787f04bb6a0a ("imx: add USB2_BOOT type")
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Reviewed-by: Fabio Estevam <festevam@denx.de>
Stefano Babic May 2, 2023, 12:47 p.m. UTC | #3
> commit 787f04bb6a0a ("imx: add USB2_BOOT type") broke get_boot_device()
> for IMX8 which affects booting from SDP due to boot_instance being
> non-zero.
> Fix this by only using boot_instance for imx8ulp and imx9.
> Fixes: 787f04bb6a0a ("imx: add USB2_BOOT type")
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Fabio Estevam <festevam@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

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