ARM: imx: Add support for the primary/secondary bmode to MX53
Subsystems (3)
PATCH 1/1 ARM: imx: Add support for the primary/secondary bmode to MX53
Implement the 'getprisec' subcommand of 'bmode' command for i.MX53 and also the primary/secondary bootmode switching.
Signed-off-by Marek Vasut <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP i.MX U-Boot Team <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
--- arch/arm/mach-imx/mx5/soc.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
arch/arm/mach-imx/mx5/soc.c +20 -1
@@ -87,10 +87,27 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)#endif #ifdef CONFIG_MX53 +#define IMX53_SRTC_LPGR_PERSIST_SECONDARY_BOOT BIT(30) +void boot_mode_apply (unsigned cfg_val) { -writel (cfg_val, &((struct srtc_regs *)SRTC_BASE_ADDR )->lpgr); +void *lpgr = &((struct srtc_regs *)SRTC_BASE_ADDR )->lpgr; + +if (cfg_val ==MAKE_CFGVAL_PRIMARY_BOOT ) +clrbits_le32 (lpgr,IMX53_SRTC_LPGR_PERSIST_SECONDARY_BOOT ); +else if (cfg_val ==MAKE_CFGVAL_SECONDARY_BOOT ) +setbits_le32 (lpgr,IMX53_SRTC_LPGR_PERSIST_SECONDARY_BOOT ); +else +writel (cfg_val, lpgr); +} + +int boot_mode_getprisec (void ) +{ +void *lpgr = &((struct srtc_regs *)SRTC_BASE_ADDR )->lpgr; + +return !!(readl (lpgr) &IMX53_SRTC_LPGR_PERSIST_SECONDARY_BOOT ); } +/* * cfg_val will be used for * Boot_cfg3[7:0]:Boot_cfg2[7:0]:Boot_cfg1[7:0]
@@ -112,6 +129,8 @@ const struct boot_mode soc_boot_modes[] = { {"esdhc2", MAKE_CFGVAL(0x40, 0x20, 0x08, 0x12)}, {"esdhc3", MAKE_CFGVAL(0x40, 0x20, 0x10, 0x12)}, {"esdhc4", MAKE_CFGVAL(0x40, 0x20, 0x18, 0x12)}, + {"primary", MAKE_CFGVAL_PRIMARY_BOOT}, + {"secondary", MAKE_CFGVAL_SECONDARY_BOOT}, {NULL, 0}, }; #endif
Signature · 1 line
2.28.0
PATCH 1/1 ARM: imx: Add support for the primary/secondary bmode to MX53
Quoted 7 lines
Implement the 'getprisec' subcommand of 'bmode' command for i.MX53 and also the primary/secondary bootmode switching.
Signed-off-by Marek Vasut <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP i.MX U-Boot Team <[email protected]>Cc Peng Fan <[email protected]>Cc Stefano Babic <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================