ARM: imx: Fix bmode detection from grp10

imx6_is_bmode_from_gpr9 always returns false, because
IMX6_SRC_GPR10_BMODE is 1<<28 and gets casted to u8 on return.

This moves the function body into imx6_src_get_boot_mode, since that is the
only one using it and it is on the same abstraction level (accessing
registers directly).

Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
Claudius Heine 2019-10-29 13:08:43 +01:00 committed by Stefano Babic
parent 7f8a6a66af
commit e01c8cfe57
2 changed files with 1 additions and 6 deletions

View file

@ -99,11 +99,6 @@ enum imx6_bmode {
IMX6_BMODE_NAND_MAX = 0xf,
};
static inline u8 imx6_is_bmode_from_gpr9(void)
{
return readl(&src_base->gpr10) & IMX6_SRC_GPR10_BMODE;
}
u32 imx6_src_get_boot_mode(void);
void gpr_init(void);

View file

@ -118,7 +118,7 @@ void boot_mode_apply(unsigned cfg_val)
#if defined(CONFIG_MX6)
u32 imx6_src_get_boot_mode(void)
{
if (imx6_is_bmode_from_gpr9())
if (readl(&src_base->gpr10) & IMX6_SRC_GPR10_BMODE)
return readl(&src_base->gpr9);
else
return readl(&src_base->sbmr1);