aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2017-01-20 13:39:10 -0500
committerTony Lindgren <tony@atomide.com>2017-01-20 13:39:10 -0500
commit8dd6666f4937d7cc94781771e1a8fc837fea84fb (patch)
treef5d3c710bc1954e8d341d63dc9f9ae0d44ee8a3b /arch/arm/mach-omap2/omap_hwmod.c
parent7afa44e0e8dbf80e28e4f5aeaecf5ab6e5487f0d (diff)
ARM: OMAP2+: omap_hwmod: Add support for earlycon
Hwmod core tries to reset and idles each IP that is registered with hwmod. In case of earlycon, that specific uart IP cannot be reset or keep it in idle state else earlycon hangs once hwmod resets that uart IP. So add support to not reset uart that is being used as earlycon only if CONFIG_SERIAL_EARLYCON is enabled. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 759e1d45ba25..0ab29097a070 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3249,6 +3249,36 @@ int __init omap_hwmod_setup_one(const char *oh_name)
3249} 3249}
3250 3250
3251/** 3251/**
3252 * omap_hwmod_setup_earlycon_flags - set up flags for early console
3253 *
3254 * Enable DEBUG_OMAPUART_FLAGS for uart hwmod that is being used as
3255 * early concole so that hwmod core doesn't reset and keep it in idle
3256 * that specific uart.
3257 */
3258#ifdef CONFIG_SERIAL_EARLYCON
3259static void __init omap_hwmod_setup_earlycon_flags(void)
3260{
3261 struct device_node *np;
3262 struct omap_hwmod *oh;
3263 const char *uart;
3264
3265 np = of_find_node_by_path("/chosen");
3266 if (np) {
3267 uart = of_get_property(np, "stdout-path", NULL);
3268 if (uart) {
3269 np = of_find_node_by_path(uart);
3270 if (np) {
3271 uart = of_get_property(np, "ti,hwmods", NULL);
3272 oh = omap_hwmod_lookup(uart);
3273 if (oh)
3274 oh->flags |= DEBUG_OMAPUART_FLAGS;
3275 }
3276 }
3277 }
3278}
3279#endif
3280
3281/**
3252 * omap_hwmod_setup_all - set up all registered IP blocks 3282 * omap_hwmod_setup_all - set up all registered IP blocks
3253 * 3283 *
3254 * Initialize and set up all IP blocks registered with the hwmod code. 3284 * Initialize and set up all IP blocks registered with the hwmod code.
@@ -3261,6 +3291,9 @@ static int __init omap_hwmod_setup_all(void)
3261 _ensure_mpu_hwmod_is_setup(NULL); 3291 _ensure_mpu_hwmod_is_setup(NULL);
3262 3292
3263 omap_hwmod_for_each(_init, NULL); 3293 omap_hwmod_for_each(_init, NULL);
3294#ifdef CONFIG_SERIAL_EARLYCON
3295 omap_hwmod_setup_earlycon_flags();
3296#endif
3264 omap_hwmod_for_each(_setup, NULL); 3297 omap_hwmod_for_each(_setup, NULL);
3265 3298
3266 return 0; 3299 return 0;