* [PATCH v3] mx35: Fix boot ROM hang in internal boot mode
@ 2010-08-12 13:10 Hans J. Koch
2010-08-13 9:08 ` Uwe Kleine-König
0 siblings, 1 reply; 3+ messages in thread
From: Hans J. Koch @ 2010-08-12 13:10 UTC (permalink / raw)
To: linux-arm-kernel
If a watchdog reset occurs after booting in internal boot mode, the i.MX35
won't boot anymore. The boot ROM code seems to assume that some clocks are
turned on (they are after a power-on reset). This patch turns on the
necessary clocks.
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
---
arch/arm/mach-mx3/clock-imx35.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index d3af0fd..32adf8d 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -485,10 +485,10 @@ static struct clk_lookup lookups[] = {
int __init mx35_clocks_init()
{
- unsigned int ll = 0;
+ unsigned int cgr2 = 3 << 26, cgr3 = 0;
#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
- ll = (3 << 16);
+ cgr2 |= 3 << 16;
#endif
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
@@ -499,8 +499,20 @@ int __init mx35_clocks_init()
__raw_writel((3 << 18), CCM_BASE + CCM_CGR0);
__raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16),
CCM_BASE + CCM_CGR1);
- __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2);
- __raw_writel(0, CCM_BASE + CCM_CGR3);
+
+ /*
+ * Check if we came up in internal boot mode. If yes, we need some
+ * extra clocks turned on, otherwise the MX35 boot ROM code will
+ * hang after a watchdog reset.
+ */
+ if (!(__raw_readl(CCM_BASE + CCM_RCSR) & (3 << 10))) {
+ /* Additionally turn on UART1, SCC, and IIM clocks */
+ cgr2 |= 3 << 16 | 3 << 4;
+ cgr3 |= 3 << 2;
+ }
+
+ __raw_writel(cgr2, CCM_BASE + CCM_CGR2);
+ __raw_writel(cgr3, CCM_BASE + CCM_CGR3);
mxc_timer_init(&gpt_clk,
MX35_IO_ADDRESS(MX35_GPT1_BASE_ADDR), MX35_INT_GPT);
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH v3] mx35: Fix boot ROM hang in internal boot mode
2010-08-12 13:10 [PATCH v3] mx35: Fix boot ROM hang in internal boot mode Hans J. Koch
@ 2010-08-13 9:08 ` Uwe Kleine-König
2010-08-13 9:14 ` Hans J. Koch
0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2010-08-13 9:08 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Aug 12, 2010 at 03:10:53PM +0200, Hans J. Koch wrote:
> If a watchdog reset occurs after booting in internal boot mode, the i.MX35
> won't boot anymore. The boot ROM code seems to assume that some clocks are
> turned on (they are after a power-on reset). This patch turns on the
> necessary clocks.
>
> Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Even if it should be a bootloader issue and not a ROM problem this fix
is sensible.
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v3] mx35: Fix boot ROM hang in internal boot mode
2010-08-13 9:08 ` Uwe Kleine-König
@ 2010-08-13 9:14 ` Hans J. Koch
0 siblings, 0 replies; 3+ messages in thread
From: Hans J. Koch @ 2010-08-13 9:14 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 13, 2010 at 11:08:49AM +0200, Uwe Kleine-K?nig wrote:
> On Thu, Aug 12, 2010 at 03:10:53PM +0200, Hans J. Koch wrote:
> > If a watchdog reset occurs after booting in internal boot mode, the i.MX35
> > won't boot anymore. The boot ROM code seems to assume that some clocks are
> > turned on (they are after a power-on reset). This patch turns on the
> > necessary clocks.
> >
> > Signed-off-by: Hans J. Koch <hjk@linutronix.de>
> Even if it should be a bootloader issue and not a ROM problem this fix
> is sensible.
>
> Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
We should also add:
Reported-by: John Ogness <jogness@linutronix.de>
I forgot that.
Thanks,
Hans
>
> Thanks
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-K?nig |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-13 9:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-12 13:10 [PATCH v3] mx35: Fix boot ROM hang in internal boot mode Hans J. Koch
2010-08-13 9:08 ` Uwe Kleine-König
2010-08-13 9:14 ` Hans J. Koch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).