Patchwork [U-Boot] arm, am33xx: move s_init to a common place

login
register
mail settings
Submitter Tom Rini
Date June 13, 2013, 3:53 p.m.
Message ID <20130613155337.GC5616@bill-the-cat>
Download mbox | patch
Permalink /patch/251098/
State Changes Requested
Delegated to: Tom Rini
Headers show

Comments

Tom Rini - June 13, 2013, 3:53 p.m.
On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:

> move s_init from every board code to a common place.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Tom Rini <trini@ti.com>
> Cc: Matt Porter <mporter@ti.com>
> Cc: Lars Poeschel <poeschel@lemonage.de>
> Cc: Tom Rini <trini@ti.com>
> Cc: Enric Balletbo i Serra <eballetbo@iseebcn.com>
> 
> ---
> This patch is based on the following patches:
> 
> - [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
>   http://patchwork.ozlabs.org/patch/248908/
> 
> - [U-Boot] arm, am33xx: move uart soft reset code to common place
>   http://patchwork.ozlabs.org/patch/248508/

These two apply best to u-boot-ti, and with them this patch doesn't
apply cleanly.  Please sort that out.

The following adds moving ti814x_evm into the mix and I've sent Matt
some binaries to give a whirl to test on the board:


Please fold into v2

Signed-off-by: Tom Rini <trini@ti.com>
Heiko Schocher - June 14, 2013, 5:59 a.m.
Hello Tom,

Am 13.06.2013 17:53, schrieb Tom Rini:
> On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:
> 
>> move s_init from every board code to a common place.
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> Cc: Tom Rini <trini@ti.com>
>> Cc: Matt Porter <mporter@ti.com>
>> Cc: Lars Poeschel <poeschel@lemonage.de>
>> Cc: Tom Rini <trini@ti.com>
>> Cc: Enric Balletbo i Serra <eballetbo@iseebcn.com>
>>
>> ---
>> This patch is based on the following patches:
>>
>> - [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
>>   http://patchwork.ozlabs.org/patch/248908/
>>
>> - [U-Boot] arm, am33xx: move uart soft reset code to common place
>>   http://patchwork.ozlabs.org/patch/248508/
> 
> These two apply best to u-boot-ti, and with them this patch doesn't
> apply cleanly.  Please sort that out.

I based my patches on u-boot ... I look at this ..

> The following adds moving ti814x_evm into the mix and I've sent Matt
> some binaries to give a whirl to test on the board:
> 
[...]
>  /*
>   * Basic board specific setup.  Pinmux has been handled already.
> 
> Please fold into v2
> 
> Signed-off-by: Tom Rini <trini@ti.com>

Ok, thanks!

BTW:
I just realized that I have on one of the three boards a problem,
that in spl code calling the rtc32k_enable() crashes ... which
votes against moving this to a common place ... I haveno real idea
why ... did you heard from such a behaviour? Is there some am335x
soc, which differs from the others?

bye,
Heiko
Tom Rini - June 14, 2013, 2:58 p.m.
On Fri, Jun 14, 2013 at 07:59:26AM +0200, Heiko Schocher wrote:
> Hello Tom,
> 
> Am 13.06.2013 17:53, schrieb Tom Rini:
> > On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:
> > 
> >> move s_init from every board code to a common place.
> >>
> >> Signed-off-by: Heiko Schocher <hs@denx.de>
> >> Cc: Tom Rini <trini@ti.com>
> >> Cc: Matt Porter <mporter@ti.com>
> >> Cc: Lars Poeschel <poeschel@lemonage.de>
> >> Cc: Tom Rini <trini@ti.com>
> >> Cc: Enric Balletbo i Serra <eballetbo@iseebcn.com>
> >>
> >> ---
> >> This patch is based on the following patches:
> >>
> >> - [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
> >>   http://patchwork.ozlabs.org/patch/248908/
> >>
> >> - [U-Boot] arm, am33xx: move uart soft reset code to common place
> >>   http://patchwork.ozlabs.org/patch/248508/
> > 
> > These two apply best to u-boot-ti, and with them this patch doesn't
> > apply cleanly.  Please sort that out.
> 
> I based my patches on u-boot ... I look at this ..
> 
> > The following adds moving ti814x_evm into the mix and I've sent Matt
> > some binaries to give a whirl to test on the board:
> > 
> [...]
> >  /*
> >   * Basic board specific setup.  Pinmux has been handled already.
> > 
> > Please fold into v2
> > 
> > Signed-off-by: Tom Rini <trini@ti.com>
> 
> Ok, thanks!

There's a minor bug in what I posted, however.  ti814x needs timer_init
called _before_ pll_init() as setting the sata clocks (which are shared
with other periphrals that we do enable right now) needs udelay(50) to
settle as we go along.  That also needs to be commented in the code as I
had to think about it for a bit to recall exactly what was going on.

> BTW:
> I just realized that I have on one of the three boards a problem,
> that in spl code calling the rtc32k_enable() crashes ... which
> votes against moving this to a common place ... I haveno real idea
> why ... did you heard from such a behaviour? Is there some am335x
> soc, which differs from the others?

You aren't using a different clock crystal rate than the reference
platforms, are you?  I know that's a problem that needs solving still.

> 
> bye,
> Heiko
> -- 
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Peter Korsgaard - June 15, 2013, 8:54 p.m.
>>>>> "Tom" == Tom Rini <trini@ti.com> writes:

Hi,

 >> BTW:
 >> I just realized that I have on one of the three boards a problem,
 >> that in spl code calling the rtc32k_enable() crashes ... which
 >> votes against moving this to a common place ... I haveno real idea
 >> why ... did you heard from such a behaviour? Is there some am335x
 >> soc, which differs from the others?

 Tom> You aren't using a different clock crystal rate than the reference
 Tom> platforms, are you?  I know that's a problem that needs solving
 Tom> still.

Really? We have a am335x based board using a 25MHz input clock, and I
haven't noticed any problems.

What are those problems exactly?
Heiko Schocher - June 20, 2013, 3:52 a.m.
Hello Tom,

Am 14.06.2013 16:58, schrieb Tom Rini:
> On Fri, Jun 14, 2013 at 07:59:26AM +0200, Heiko Schocher wrote:
>> Hello Tom,
>>
>> Am 13.06.2013 17:53, schrieb Tom Rini:
>>> On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:
>>>
>>>> move s_init from every board code to a common place.
>>>>
>>>> Signed-off-by: Heiko Schocher <hs@denx.de>
>>>> Cc: Tom Rini <trini@ti.com>
>>>> Cc: Matt Porter <mporter@ti.com>
>>>> Cc: Lars Poeschel <poeschel@lemonage.de>
>>>> Cc: Tom Rini <trini@ti.com>
>>>> Cc: Enric Balletbo i Serra <eballetbo@iseebcn.com>
>>>>
>>>> ---
>>>> This patch is based on the following patches:
>>>>
>>>> - [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
>>>>   http://patchwork.ozlabs.org/patch/248908/
>>>>
>>>> - [U-Boot] arm, am33xx: move uart soft reset code to common place
>>>>   http://patchwork.ozlabs.org/patch/248508/
>>>
>>> These two apply best to u-boot-ti, and with them this patch doesn't
>>> apply cleanly.  Please sort that out.
>>
>> I based my patches on u-boot ... I look at this ..
>>
>>> The following adds moving ti814x_evm into the mix and I've sent Matt
>>> some binaries to give a whirl to test on the board:
>>>
>> [...]
>>>  /*
>>>   * Basic board specific setup.  Pinmux has been handled already.
>>>
>>> Please fold into v2
>>>
>>> Signed-off-by: Tom Rini <trini@ti.com>
>>
>> Ok, thanks!
> 
> There's a minor bug in what I posted, however.  ti814x needs timer_init
> called _before_ pll_init() as setting the sata clocks (which are shared
> with other periphrals that we do enable right now) needs udelay(50) to
> settle as we go along.  That also needs to be commented in the code as I
> had to think about it for a bit to recall exactly what was going on.

Do you have an update here for me?

>> BTW:
>> I just realized that I have on one of the three boards a problem,
>> that in spl code calling the rtc32k_enable() crashes ... which
>> votes against moving this to a common place ... I haveno real idea
>> why ... did you heard from such a behaviour? Is there some am335x
>> soc, which differs from the others?
> 
> You aren't using a different clock crystal rate than the reference
> platforms, are you?  I know that's a problem that needs solving still.

I am prospecting, whats going on here ... but have no real idea,
why it is not possible to write this registers ... if writing this
registers, cpu hang ...

But I want to have a common function here ... maybe it is OK to make
the rtc32k_enable() call configurable through a define?

Saying "CONFIG_SPL_AM33XX_DO_NOT_ENABLE_RTC32K"

and document in the u-boot README this define, and why it is
necessary?

bye,
Heiko
Lokesh Vutla - June 24, 2013, 4:01 a.m.
Hi Heiko,
On Thursday 20 June 2013 09:22 AM, Heiko Schocher wrote:
> Hello Tom,
>
> Am 14.06.2013 16:58, schrieb Tom Rini:
>> On Fri, Jun 14, 2013 at 07:59:26AM +0200, Heiko Schocher wrote:
>>> Hello Tom,
>>>
>>> Am 13.06.2013 17:53, schrieb Tom Rini:
>>>> On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:
>>>>
>>>>> move s_init from every board code to a common place.
>>>>>
>>>>> Signed-off-by: Heiko Schocher <hs@denx.de>
>>>>> Cc: Tom Rini <trini@ti.com>
>>>>> Cc: Matt Porter <mporter@ti.com>
>>>>> Cc: Lars Poeschel <poeschel@lemonage.de>
>>>>> Cc: Tom Rini <trini@ti.com>
>>>>> Cc: Enric Balletbo i Serra <eballetbo@iseebcn.com>
>>>>>
>>>>> ---
>>>>> This patch is based on the following patches:
>>>>>
>>>>> - [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
>>>>>    http://patchwork.ozlabs.org/patch/248908/
>>>>>
>>>>> - [U-Boot] arm, am33xx: move uart soft reset code to common place
>>>>>    http://patchwork.ozlabs.org/patch/248508/
>>>>
>>>> These two apply best to u-boot-ti, and with them this patch doesn't
>>>> apply cleanly.  Please sort that out.
>>>
>>> I based my patches on u-boot ... I look at this ..
>>>
>>>> The following adds moving ti814x_evm into the mix and I've sent Matt
>>>> some binaries to give a whirl to test on the board:
>>>>
>>> [...]
>>>>   /*
>>>>    * Basic board specific setup.  Pinmux has been handled already.
>>>>
>>>> Please fold into v2
>>>>
>>>> Signed-off-by: Tom Rini <trini@ti.com>
>>>
>>> Ok, thanks!
>>
>> There's a minor bug in what I posted, however.  ti814x needs timer_init
>> called _before_ pll_init() as setting the sata clocks (which are shared
>> with other periphrals that we do enable right now) needs udelay(50) to
>> settle as we go along.  That also needs to be commented in the code as I
>> had to think about it for a bit to recall exactly what was going on.
>
> Do you have an update here for me?
We can have a timer_init for am33xx boards also. It doesn't harm.
So keep timer_init in your common s_init
>
>>> BTW:
>>> I just realized that I have on one of the three boards a problem,
>>> that in spl code calling the rtc32k_enable() crashes ... which
>>> votes against moving this to a common place ... I haveno real idea
>>> why ... did you heard from such a behaviour? Is there some am335x
>>> soc, which differs from the others?
On which board it is giving a problem?
Did you make sure clocks for rtc are enabled?
I am making a cleanup series for am33xx boards. If you don't mind can I 
take this
patch as part of my series.

Thanks and regards,
Lokesh
>>
>> You aren't using a different clock crystal rate than the reference
>> platforms, are you?  I know that's a problem that needs solving still.
>
> I am prospecting, whats going on here ... but have no real idea,
> why it is not possible to write this registers ... if writing this
> registers, cpu hang ...
>
> But I want to have a common function here ... maybe it is OK to make
> the rtc32k_enable() call configurable through a define?
>
> Saying "CONFIG_SPL_AM33XX_DO_NOT_ENABLE_RTC32K"
>
> and document in the u-boot README this define, and why it is
> necessary?
>
> bye,
> Heiko
>
Heiko Schocher - June 24, 2013, 4:16 p.m.
Hello Lokesh,

Am 24.06.2013 06:01, schrieb Lokesh Vutla:
> Hi Heiko,
> On Thursday 20 June 2013 09:22 AM, Heiko Schocher wrote:
>> Hello Tom,
>>
>> Am 14.06.2013 16:58, schrieb Tom Rini:
>>> On Fri, Jun 14, 2013 at 07:59:26AM +0200, Heiko Schocher wrote:
>>>> Hello Tom,
>>>>
>>>> Am 13.06.2013 17:53, schrieb Tom Rini:
>>>>> On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:
>>>>>
>>>>>> move s_init from every board code to a common place.
>>>>>>
>>>>>> Signed-off-by: Heiko Schocher <hs@denx.de>
>>>>>> Cc: Tom Rini <trini@ti.com>
>>>>>> Cc: Matt Porter <mporter@ti.com>
>>>>>> Cc: Lars Poeschel <poeschel@lemonage.de>
>>>>>> Cc: Tom Rini <trini@ti.com>
>>>>>> Cc: Enric Balletbo i Serra <eballetbo@iseebcn.com>
>>>>>>
>>>>>> ---
>>>>>> This patch is based on the following patches:
>>>>>>
>>>>>> - [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
>>>>>>    http://patchwork.ozlabs.org/patch/248908/
>>>>>>
>>>>>> - [U-Boot] arm, am33xx: move uart soft reset code to common place
>>>>>>    http://patchwork.ozlabs.org/patch/248508/
>>>>>
>>>>> These two apply best to u-boot-ti, and with them this patch doesn't
>>>>> apply cleanly.  Please sort that out.
>>>>
>>>> I based my patches on u-boot ... I look at this ..
>>>>
>>>>> The following adds moving ti814x_evm into the mix and I've sent Matt
>>>>> some binaries to give a whirl to test on the board:
>>>>>
>>>> [...]
>>>>>   /*
>>>>>    * Basic board specific setup.  Pinmux has been handled already.
>>>>>
>>>>> Please fold into v2
>>>>>
>>>>> Signed-off-by: Tom Rini <trini@ti.com>
>>>>
>>>> Ok, thanks!
>>>
>>> There's a minor bug in what I posted, however.  ti814x needs timer_init
>>> called _before_ pll_init() as setting the sata clocks (which are shared
>>> with other periphrals that we do enable right now) needs udelay(50) to
>>> settle as we go along.  That also needs to be commented in the code as I
>>> had to think about it for a bit to recall exactly what was going on.
>>
>> Do you have an update here for me?
> We can have a timer_init for am33xx boards also. It doesn't harm.
> So keep timer_init in your common s_init

Ok, fine.

>>>> BTW:
>>>> I just realized that I have on one of the three boards a problem,
>>>> that in spl code calling the rtc32k_enable() crashes ... which
>>>> votes against moving this to a common place ... I haveno real idea
>>>> why ... did you heard from such a behaviour? Is there some am335x
>>>> soc, which differs from the others?
> On which board it is giving a problem?

Not in mainline yet, posting soon ...

> Did you make sure clocks for rtc are enabled?

Yes.

I have 3 boards with an am335x, two works with the
rtc32k_enable() call without problems ... the third board
hang when accessing rtc registers ... no idea why ...
Code on all three boards is at this point identical, all
use 24MHz ...

> I am making a cleanup series for am33xx boards. If you don't mind can I 
> take this
> patch as part of my series.

I am fine with that ... but what do we do with my
probem with rtc23k_enable?


> Thanks and regards,
> Lokesh
>>>
>>> You aren't using a different clock crystal rate than the reference
>>> platforms, are you?  I know that's a problem that needs solving still.
>>
>> I am prospecting, whats going on here ... but have no real idea,
>> why it is not possible to write this registers ... if writing this
>> registers, cpu hang ...
>>
>> But I want to have a common function here ... maybe it is OK to make
>> the rtc32k_enable() call configurable through a define?
>>
>> Saying "CONFIG_SPL_AM33XX_DO_NOT_ENABLE_RTC32K"
>>
>> and document in the u-boot README this define, and why it is
>> necessary?

Would this be acceptable?

bye,
Heiko
Lokesh Vutla - June 24, 2013, 5:25 p.m.
Hi Heiko,
On Monday 24 June 2013 09:46 PM, Heiko Schocher wrote:
> Hello Lokesh,
>
> Am 24.06.2013 06:01, schrieb Lokesh Vutla:
>> Hi Heiko,
>> On Thursday 20 June 2013 09:22 AM, Heiko Schocher wrote:
>>> Hello Tom,
>>>
>>> Am 14.06.2013 16:58, schrieb Tom Rini:
>>>> On Fri, Jun 14, 2013 at 07:59:26AM +0200, Heiko Schocher wrote:
>>>>> Hello Tom,
>>>>>
>>>>> Am 13.06.2013 17:53, schrieb Tom Rini:
>>>>>> On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:
>>>>>>
>>>>>>> move s_init from every board code to a common place.
>>>>>>>
>>>>>>> Signed-off-by: Heiko Schocher <hs@denx.de>
>>>>>>> Cc: Tom Rini <trini@ti.com>
>>>>>>> Cc: Matt Porter <mporter@ti.com>
>>>>>>> Cc: Lars Poeschel <poeschel@lemonage.de>
>>>>>>> Cc: Tom Rini <trini@ti.com>
>>>>>>> Cc: Enric Balletbo i Serra <eballetbo@iseebcn.com>
>>>>>>>
>>>>>>> ---
>>>>>>> This patch is based on the following patches:
>>>>>>>
>>>>>>> - [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
>>>>>>>     http://patchwork.ozlabs.org/patch/248908/
>>>>>>>
>>>>>>> - [U-Boot] arm, am33xx: move uart soft reset code to common place
>>>>>>>     http://patchwork.ozlabs.org/patch/248508/
>>>>>>
>>>>>> These two apply best to u-boot-ti, and with them this patch doesn't
>>>>>> apply cleanly.  Please sort that out.
>>>>>
>>>>> I based my patches on u-boot ... I look at this ..
>>>>>
>>>>>> The following adds moving ti814x_evm into the mix and I've sent Matt
>>>>>> some binaries to give a whirl to test on the board:
>>>>>>
>>>>> [...]
>>>>>>    /*
>>>>>>     * Basic board specific setup.  Pinmux has been handled already.
>>>>>>
>>>>>> Please fold into v2
>>>>>>
>>>>>> Signed-off-by: Tom Rini <trini@ti.com>
>>>>>
>>>>> Ok, thanks!
>>>>
>>>> There's a minor bug in what I posted, however.  ti814x needs timer_init
>>>> called _before_ pll_init() as setting the sata clocks (which are shared
>>>> with other periphrals that we do enable right now) needs udelay(50) to
>>>> settle as we go along.  That also needs to be commented in the code as I
>>>> had to think about it for a bit to recall exactly what was going on.
>>>
>>> Do you have an update here for me?
>> We can have a timer_init for am33xx boards also. It doesn't harm.
>> So keep timer_init in your common s_init
>
> Ok, fine.
>
>>>>> BTW:
>>>>> I just realized that I have on one of the three boards a problem,
>>>>> that in spl code calling the rtc32k_enable() crashes ... which
>>>>> votes against moving this to a common place ... I haveno real idea
>>>>> why ... did you heard from such a behaviour? Is there some am335x
>>>>> soc, which differs from the others?
>> On which board it is giving a problem?
>
> Not in mainline yet, posting soon ...
>
>> Did you make sure clocks for rtc are enabled?
>
> Yes.
I posted a clean up series for am33xx today
"[PATCH 0/4] ARM: AM33xx: Cleanup clocks and hwinit"
Can you please try with this series on your board.
Check the SPL log for any clock failure. If no error, then
ideally registers should be accessible. (Please make sure
register offsets that you are using are correct).

If not there is something really bad.

Thanks and regards,
Lokesh
>
> I have 3 boards with an am335x, two works with the
> rtc32k_enable() call without problems ... the third board
> hang when accessing rtc registers ... no idea why ...
> Code on all three boards is at this point identical, all
> use 24MHz ...
>
>> I am making a cleanup series for am33xx boards. If you don't mind can I
>> take this
>> patch as part of my series.
>
> I am fine with that ... but what do we do with my
> probem with rtc23k_enable?
>
>
>> Thanks and regards,
>> Lokesh
>>>>
>>>> You aren't using a different clock crystal rate than the reference
>>>> platforms, are you?  I know that's a problem that needs solving still.
>>>
>>> I am prospecting, whats going on here ... but have no real idea,
>>> why it is not possible to write this registers ... if writing this
>>> registers, cpu hang ...
>>>
>>> But I want to have a common function here ... maybe it is OK to make
>>> the rtc32k_enable() call configurable through a define?
>>>
>>> Saying "CONFIG_SPL_AM33XX_DO_NOT_ENABLE_RTC32K"
>>>
>>> and document in the u-boot README this define, and why it is
>>> necessary?
>
> Would this be acceptable?
>
> bye,
> Heiko
>

Patch

diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c
index 80b65fb..13b086a 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -151,6 +151,8 @@  int arch_misc_init(void)
 }
 
 #ifdef CONFIG_SPL_BUILD
+static struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
+
 void rtc32k_enable(void)
 {
 	struct rtc_regs *rtc = (struct rtc_regs *)RTC_BASE;
@@ -190,9 +192,6 @@  void uart_soft_reset(void)
 }
 #endif
 
-#ifndef CONFIG_TI81XX
-static struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
-
 void s_init(void)
 {
 	/*
@@ -202,7 +201,9 @@  void s_init(void)
 	 */
 	save_omap_boot_params();
 
-	/* WDT1 is already running when the bootloader gets control
+#ifdef CONFIG_SPL_BUILD
+	/*
+	 * WDT1 is already running when the bootloader gets control
 	 * Disable it to avoid "random" resets
 	 */
 	writel(0xAAAA, &wdtimer->wdtwspr);
@@ -212,7 +213,6 @@  void s_init(void)
 	while (readl(&wdtimer->wdtwwps) != 0x0)
 		;
 
-#ifdef CONFIG_SPL_BUILD
 	/* Setup the PLLs and the clocks for the peripherals */
 	pll_init();
 
@@ -231,4 +231,3 @@  void s_init(void)
 	sdram_init();
 #endif
 }
-#endif
diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c
index 6ad3dd8..08daee4 100644
--- a/board/ti/ti814x/evm.c
+++ b/board/ti/ti814x/evm.c
@@ -35,30 +35,10 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_SPL_BUILD
-static struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
-#endif
-
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
 /* UART Defines */
 #ifdef CONFIG_SPL_BUILD
-static void uart_enable(void)
-{
-	/* UART softreset */
-	uart_soft_reset();
-}
-
-static void wdt_disable(void)
-{
-	writel(0xAAAA, &wdtimer->wdtwspr);
-	while (readl(&wdtimer->wdtwwps) != 0x0)
-		;
-	writel(0x5555, &wdtimer->wdtwspr);
-	while (readl(&wdtimer->wdtwwps) != 0x0)
-		;
-}
-
 static const struct cmd_control evm_ddr2_cctrl_data = {
 	.cmd0csratio	= 0x80,
 	.cmd0dldiff	= 0x04,
@@ -108,37 +88,12 @@  static const struct ddr_data evm_ddr2_data = {
 	.datauserank0delay	= 1,
 	.datadldiff0		= 0x4,
 };
-#endif
 
 /*
  * early system init of muxing and clocks.
  */
-void s_init(void)
+void board_enable_early_pinmux(void)
 {
-#ifdef CONFIG_SPL_BUILD
-	/*
-	 * Save the boot parameters passed from romcode.
-	 * We cannot delay the saving further than this,
-	 * to prevent overwrites.
-	 */
-#ifdef CONFIG_SPL_BUILD
-	save_omap_boot_params();
-#endif
-
-	/* WDT1 is already running when the bootloader gets control
-	 * Disable it to avoid "random" resets
-	 */
-	wdt_disable();
-
-	/* Enable timer */
-	timer_init();
-
-	/* Setup the PLLs and the clocks for the peripherals */
-	pll_init();
-
-	/* Enable RTC32K clock */
-	rtc32k_enable();
-
 	/* Set UART pins */
 	enable_uart0_pin_mux();
 
@@ -147,22 +102,18 @@  void s_init(void)
 
 	/* Set Ethernet pins */
 	enable_enet_pin_mux();
+}
 
-	/* Enable UART */
-	uart_enable();
-
-	gd = &gdata;
-
-	preloader_console_init();
-
+void sdram_init(void)
+{
 	config_dmm(&evm_lisa_map_regs);
 
 	config_ddr(0, 0, &evm_ddr2_data, &evm_ddr2_cctrl_data,
 		   &evm_ddr2_emif0_regs, 0);
 	config_ddr(0, 0, &evm_ddr2_data, &evm_ddr2_cctrl_data,
 		   &evm_ddr2_emif1_regs, 1);
-#endif
 }
+#endif
 
 /*
  * Basic board specific setup.  Pinmux has been handled already.