From: Marek Vasut <marex@denx.de>
Date: Sat, 10 Dec 2022 01:29:52 +0000 (+0100)
Subject: ARM: imx: Reinstate decode ECSPI env location from i.MX8M ROMAPI tables
X-Git-Tag: v2025.01-rc5-pxa1908~1126^2~59
X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-logo.png?a=commitdiff_plain;h=d51b38762dc679ba5a0bc8a69750d0a9ce6072fb;p=u-boot.git

ARM: imx: Reinstate decode ECSPI env location from i.MX8M ROMAPI tables

Decode ECSPI boot device in env_get_location() from i.MX8M ROMAPI tables.
This is necessary to correctly identify env is in SPI NOR when the system
boots from SPI NOR attached to ECSPI.

This reinstates change from commit:
e26d0152d61 ("ARM: imx: Decode ECSPI env location from i.MX8M ROMAPI tables")
which has been dropped in commit:
b0a284a7c94 ("imx: move get_boot_device to common file")

Fixes: b0a284a7c94 ("imx: move get_boot_device to common file")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
---

diff --git a/arch/arm/mach-imx/romapi.c b/arch/arm/mach-imx/romapi.c
index c8accdb04d..b49e7f80a2 100644
--- a/arch/arm/mach-imx/romapi.c
+++ b/arch/arm/mach-imx/romapi.c
@@ -66,6 +66,9 @@ enum boot_device get_boot_device(void)
 	case BT_DEV_TYPE_FLEXSPINOR:
 		boot_dev = QSPI_BOOT;
 		break;
+	case BT_DEV_TYPE_SPI_NOR:
+		boot_dev = SPI_NOR_BOOT;
+		break;
 	case BT_DEV_TYPE_USB:
 		boot_dev = boot_instance + USB_BOOT;
 		break;