diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-04-16 12:31:44 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-04-17 09:13:06 +0200 |
commit | 3a3d7cffa79ada30825bb4dba26b294a43540a72 (patch) | |
tree | 15def15f1fba5538434cc6e4d685d9ead87c76ee /arch | |
parent | 761c6bd4cba4bb3b6ea29a020d7da18534e385a6 (diff) | |
download | barebox-3a3d7cffa79ada30825bb4dba26b294a43540a72.tar.gz barebox-3a3d7cffa79ada30825bb4dba26b294a43540a72.tar.xz |
ARM: i.MX: Account for unprogrammed fuses on i.MX6 and i.MX7
On both i.MX6 and i.MX7 (also true for VFxxx) there's an additional
path that leads mask ROM to switch into serial bootloader mode. Add
code to support it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/boot.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c index 8a17a9975f..279c87a912 100644 --- a/arch/arm/mach-imx/boot.c +++ b/arch/arm/mach-imx/boot.c @@ -283,6 +283,8 @@ void imx53_boot_save_loc(void) #define IMX6_SRC_SBMR2 0x1c #define IMX6_BMOD_SERIAL 0b01 #define IMX6_BMOD_RESERVED 0b11 +#define IMX6_BMOD_FUSES 0b00 +#define BT_FUSE_SEL BIT(4) static bool imx6_bootsource_reserved(uint32_t sbmr2) { @@ -291,7 +293,14 @@ static bool imx6_bootsource_reserved(uint32_t sbmr2) static bool imx6_bootsource_serial(uint32_t sbmr2) { - return imx53_get_bmod(sbmr2) == IMX6_BMOD_SERIAL; + return imx53_get_bmod(sbmr2) == IMX6_BMOD_SERIAL || + /* + * If boot from fuses is selected and fuses are not + * programmed by setting BT_FUSE_SEL, ROM code will + * fallback to serial mode + */ + (imx53_get_bmod(sbmr2) == IMX6_BMOD_FUSES && + !(sbmr2 & BT_FUSE_SEL)); } void imx6_get_boot_source(enum bootsource *src, int *instance) |