diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2015-04-20 12:54:59 +0200 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2015-04-20 12:54:59 +0200 |
commit | 8e1eeb4337d575cf5f7b28842dc84361e35592dd (patch) | |
tree | 78097e4979526d691c2162ebb8756d91b85ed856 /arch/arm/cpu | |
parent | 495f0b538b8e35f560d613a80fbccdd57cf622d3 (diff) |
ARM: vf610: add bmode for Vybrid SoC
Implement boot mode for Vybrid SoC. Boot mode selection works much
like the i.MX6 implementation. Provide a standard set of boot modes
for the two eSDHC instances and use the reserved mode to jump into
SoC's recovery mechanism, the serial downloader.
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/armv7/vf610/generic.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c index 1bb9b8ed1d0..1b17fdf74d0 100644 --- a/arch/arm/cpu/armv7/vf610/generic.c +++ b/arch/arm/cpu/armv7/vf610/generic.c @@ -9,6 +9,7 @@ #include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> #include <asm/arch/crm_regs.h> +#include <asm/imx-common/boot_mode.h> #include <netdev.h> #ifdef CONFIG_FSL_ESDHC #include <fsl_esdhc.h> @@ -304,6 +305,35 @@ int arch_cpu_init(void) return 0; } +void boot_mode_apply(unsigned cfg_val) +{ + unsigned reg; + struct src *psrc = (struct src *)SRC_BASE_ADDR; + writel(cfg_val, &psrc->hab3); + reg = readl(&psrc->hab4); + if (cfg_val) + reg |= 1 << 28; + else + reg &= ~(1 << 28); + writel(reg, &psrc->hab4); +} + +/* + * cfg_val will be used for + * Boot_cfg4[7:0]:Boot_cfg3[7:0]:Boot_cfg2[7:0]:Boot_cfg1[7:0] + * After reset, if GPR10[28] is 1, ROM will use GPR9[25:0] + * instead of SBMR1 to determine the boot device. + */ +const struct boot_mode soc_boot_modes[] = { + {"normal", MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)}, + /* reserved value should start ROM's serial loader */ + {"ser", MAKE_CFGVAL(0x40, 0x00, 0x00, 0x00)}, + /* 4 bit bus width */ + {"esdhc0", MAKE_CFGVAL(0x60, 0x20, 0x00, 0x00)}, + {"esdhc1", MAKE_CFGVAL(0x60, 0x28, 0x00, 0x00)}, + {NULL, 0}, +}; + #ifdef CONFIG_ARCH_MISC_INIT int arch_misc_init(void) { |