diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-04-16 12:31:50 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-04-17 09:13:06 +0200 |
commit | c6aaff8b752801945286153cc3e539705a7062c3 (patch) | |
tree | fdbb2a3098270d25ee2484867d234487ccffda1f /arch | |
parent | 779ca14034e7b04c1314fbd2515edc5fbaee56a8 (diff) | |
download | barebox-c6aaff8b752801945286153cc3e539705a7062c3.tar.gz barebox-c6aaff8b752801945286153cc3e539705a7062c3.tar.xz |
ARM: i.MX: boot: Share code to detect NAND as a boot source
Share code to detect NAND as a boot source between i.MX53 and i.MX6
which behave the same in that aspect.
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 | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c index 1a03367e16..b5b901dce7 100644 --- a/arch/arm/mach-imx/boot.c +++ b/arch/arm/mach-imx/boot.c @@ -248,6 +248,11 @@ static int imx53_bootsource_internal(uint32_t r) return FIELD_GET(BOOT_CFG1(7, 4), r); } +static bool imx53_bootsource_nand(uint32_t r) +{ + return FIELD_GET(BOOT_CFG1_7, r); +} + void imx53_get_boot_source(enum bootsource *src, int *instance) { void __iomem *src_base = IOMEM(MX53_SRC_BASE_ADDR); @@ -279,7 +284,7 @@ void imx53_get_boot_source(enum bootsource *src, int *instance) break; } - if (cfg1 & (1 << 7)) + if (imx53_bootsource_nand(cfg1)) *src = BOOTSOURCE_NAND; @@ -374,8 +379,7 @@ void imx6_get_boot_source(enum bootsource *src, int *instance) break; } - /* BOOT_CFG1[7:0] */ - if (sbmr1 & (1 << 7)) + if (imx53_bootsource_nand(sbmr1)) *src = BOOTSOURCE_NAND; } |