diff mbox series

mx6: Use imx6_src_get_boot_mode() to check boot device

Message ID 20211201091147.1056029-1-hws@denx.de
State Accepted
Commit 12f9b4d08628c75a02f68a45eb8193efbe8ebb2f
Delegated to: Stefano Babic
Headers show
Series mx6: Use imx6_src_get_boot_mode() to check boot device | expand

Commit Message

Harald Seiler Dec. 1, 2021, 9:11 a.m. UTC
Use imx6_src_get_boot_mode() instead of manually reading SBMR1.  The
existing function has proper handling for software overrides of the
bootdevice which can happen, for example, when booting from an alternate
source using `bmode`.

Signed-off-by: Harald Seiler <hws@denx.de>
---
 arch/arm/mach-imx/mx6/soc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Fabio Estevam Jan. 15, 2022, 1:54 p.m. UTC | #1
On Wed, Dec 1, 2021 at 6:11 AM Harald Seiler <hws@denx.de> wrote:
>
> Use imx6_src_get_boot_mode() instead of manually reading SBMR1.  The
> existing function has proper handling for software overrides of the
> bootdevice which can happen, for example, when booting from an alternate
> source using `bmode`.
>
> Signed-off-by: Harald Seiler <hws@denx.de>

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Stefano Babic Feb. 5, 2022, 4:42 p.m. UTC | #2
> Use imx6_src_get_boot_mode() instead of manually reading SBMR1.  The
> existing function has proper handling for software overrides of the
> bootdevice which can happen, for example, when booting from an alternate
> source using `bmode`.
> Signed-off-by: Harald Seiler <hws@denx.de>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index aacfc854a2f8..bc56ef2b0b20 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -498,8 +498,7 @@  __weak int board_mmc_get_env_dev(int devno)
 
 static int mmc_get_boot_dev(void)
 {
-	struct src *src_regs = (struct src *)SRC_BASE_ADDR;
-	u32 soc_sbmr = readl(&src_regs->sbmr1);
+	u32 soc_sbmr = imx6_src_get_boot_mode();
 	u32 bootsel;
 	int devno;