arm, am33xx: move s_init to a common place
PATCH 1/1 arm, am33xx: move s_init to a common place
move s_init from every board code to a common place.
---
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/
- ./MAKEALL -s am33xx compiles without errors
arch/arm/cpu/armv7/am33xx/board.c | 43 ++++++++++++++++++++++++++ arch/arm/include/asm/arch-am33xx/sys_proto.h | 3 ++ board/isee/igep0033/board.c | 42 +++----------------------- board/phytec/pcm051/board.c | 45 ++++------------------------ board/ti/am335x/board.c | 43 ++++----------------------
5 Dateien ge?ndert, 60 Zeilen hinzugef?gt(+), 116 Zeilen entfernt(-)
arch/arm/cpu/armv7/am33xx/board.c +43 -0
@@ -189,3 +189,46 @@ void uart_soft_reset(void) writel(regval, &uart_base->uartsyscfg); }#endif + +#ifndef CONFIG_TI81XX +static struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE ; + +void s_init (void ) +{ +/* +* Save the boot parameters passed from romcode. +* We cannot delay the saving further than this, +* to prevent overwrites. +*/ +save_omap_boot_params (); + +/* WDT1 is already running when the bootloader gets control +* Disable it to avoid "random" resets +*/ +writel (0xAAAA , &wdtimer->wdtwspr); +while (readl (&wdtimer->wdtwwps) !=0x0 ) + ; +writel (0x5555 , &wdtimer->wdtwspr); +while (readl (&wdtimer->wdtwwps) !=0x0 ) + ; + +#ifdef CONFIG_SPL_BUILD +/* Setup the PLLs and the clocks for the peripherals */ +pll_init (); + +/* Enable RTC32K clock */ +rtc32k_enable (); + +/* early pinmux settings */ +board_enable_early_pinmux (); + +uart_soft_reset (); + + gd = &gdata; + +preloader_console_init (); + +sdram_init (); +#endif +} +#endif
arch/arm/include/asm/arch-am33xx/sys_proto.h +3 -0
@@ -45,4 +45,7 @@ void omap_nand_switch_ecc(uint32_t, uint32_t);void rtc32k_enable (void );void uart_soft_reset (void ); +void board_enable_early_pinmux (void ); +void sdram_init (void ); +#endif
board/isee/igep0033/board.c +4 -38
66 lines not on this page · raw message
board/phytec/pcm051/board.c +5 -40
71 lines not on this page · raw message
board/ti/am335x/board.c +5 -38
73 lines not on this page · raw message
Signature · 1 line
1.7.11.7
PATCH 1/1 arm, am33xx: move s_init to a common place
Quoted 9 lines · Heiko Schocher
move
s_initfrom every board code to a common place.Signed-off-by Heiko Schocher <[email protected]>Cc Tom Rini <[email protected]>Cc Matt Porter <[email protected]>Cc Lars Poeschel <[email protected]>Cc Tom Rini <[email protected]>Cc Enric Balletbo i Serra <[email protected]>
Quoted 8 lines
---
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:
arch/arm/cpu/armv7/am33xx/board.c +5 -6
@@ -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
board/ti/ti814x/evm.c +5 -54
94 lines not on this page · raw message
Please fold into v2
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130613/e395b50f/attachment.pgp>
PATCH 1/1 arm, am33xx: move s_init to a common place
Hello Tom,
Am 13.06.2013 17:53, schrieb Tom Rini:
Quoted 14 lines · Heiko Schocher
Quoted 13 lines
move
s_initfrom every board code to a common place.Signed-off-by Heiko Schocher <[email protected]>Cc Tom Rini <[email protected]>Cc Matt Porter <[email protected]>Cc Lars Poeschel <[email protected]>Cc Tom Rini <[email protected]>Cc Enric Balletbo i Serra <[email protected]>---
This patch is based on the following patches:
Quoted 8 lines
Quoted 5 lines
- [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 ..
Quoted 3 lines
The following adds moving
ti814x_evminto the mix and I've sent Matt some binaries to give a whirl to test on the board:
[...]
Quoted 6 lines
/*
* Basic board specific setup. Pinmux has been handled already.Please fold into v2
Signed-off-by Tom Rini <[email protected]>
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
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 arm, am33xx: move s_init to a common place
Quoted 32 lines · Heiko Schocher
Hello Tom,
Am 13.06.2013 17:53, schrieb Tom Rini:
Quoted 14 lines · Heiko Schocher
Quoted 13 lines
move
s_initfrom every board code to a common place.Signed-off-by Heiko Schocher <[email protected]>Cc Tom Rini <[email protected]>Cc Matt Porter <[email protected]>Cc Lars Poeschel <[email protected]>Cc Tom Rini <[email protected]>Cc Enric Balletbo i Serra <[email protected]>---
This patch is based on the following patches:Quoted 8 lines
Quoted 5 lines
- [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 ..
Quoted 3 lines
The following adds moving
ti814x_evminto the mix and I've sent Matt some binaries to give a whirl to test on the board:[...]
Quoted 8 lines
Quoted 6 lines
/*
* Basic board specific setup. Pinmux has been handled already.Please fold into v2
Signed-off-by Tom Rini <[email protected]>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.
Quoted 6 lines
BTW:
I just realized that I have on one of the three boards a problem, that in spl code calling thertc32k_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.
Quoted 10 lines
bye,
HeikoSignature · 6 lines
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 at lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130614/b0d31e19/attachment.pgp>
PATCH 1/1 arm, am33xx: move s_init to a common place
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Tom" == Tom Rini <[email protected]> writes:
Hi,
Quoted 6 lines
Quoted 6 lines
BTW:
I just realized that I have on one of the three boards a problem, that in spl code calling thertc32k_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?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 arm, am33xx: move s_init to a common place
In reply to Tom RiniHello Tom,
Am 14.06.2013 16:58, schrieb Tom Rini:
Quoted 40 lines · Heiko Schocher
Quoted 39 lines
Hello Tom,
Am 13.06.2013 17:53, schrieb Tom Rini:
Quoted 14 lines · Heiko Schocher
Quoted 13 lines
move
s_initfrom every board code to a common place.Signed-off-by Heiko Schocher <[email protected]>Cc Tom Rini <[email protected]>Cc Matt Porter <[email protected]>Cc Lars Poeschel <[email protected]>Cc Tom Rini <[email protected]>Cc Enric Balletbo i Serra <[email protected]>---
This patch is based on the following patches:Quoted 8 lines
Quoted 5 lines
- [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 ..
Quoted 3 lines
The following adds moving
ti814x_evminto the mix and I've sent Matt some binaries to give a whirl to test on the board:[...]
Quoted 6 lines
/*
* Basic board specific setup. Pinmux has been handled already.Please fold into v2
Signed-off-by Tom Rini <[email protected]>
Quoted 7 lines
Quoted 1 line
Ok, thanks!
There's a minor bug in what I posted, however. ti814x needs
timer_initcalled _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?
Quoted 9 lines
Quoted 6 lines
BTW:
I just realized that I have on one of the three boards a problem, that in spl code calling thertc32k_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
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 arm, am33xx: move s_init to a common place
Hi Heiko,
Quoted 45 lines · Heiko Schocher
Hello Tom,
Am 14.06.2013 16:58, schrieb Tom Rini:
Quoted 42 lines · Heiko Schocher
Quoted 40 lines
Hello Tom,
Am 13.06.2013 17:53, schrieb Tom Rini:
Quoted 14 lines · Heiko Schocher
Quoted 13 lines
move
s_initfrom every board code to a common place.Signed-off-by Heiko Schocher <[email protected]>Cc Tom Rini <[email protected]>Cc Matt Porter <[email protected]>Cc Lars Poeschel <[email protected]>Cc Tom Rini <[email protected]>Cc Enric Balletbo i Serra <[email protected]>---
This patch is based on the following patches:Quoted 8 lines
Quoted 5 lines
- [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 ..
Quoted 3 lines
The following adds moving
ti814x_evminto the mix and I've sent Matt some binaries to give a whirl to test on the board:[...]
Quoted 6 lines
/*
* Basic board specific setup. Pinmux has been handled already.Please fold into v2
Signed-off-by Tom Rini <[email protected]>Ok, thanks!
Quoted 7 lines
Quoted 5 lines
There's a minor bug in what I posted, however. ti814x needs
timer_initcalled _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
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
BTW:
I just realized that I have on one of the three boards a problem, that in spl code calling thertc32k_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
Quoted 19 lines
Quoted 3 lines
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
PATCH 1/1 arm, am33xx: move s_init to a common place
Hello Lokesh,
Am 24.06.2013 06:01, schrieb Lokesh Vutla:
Quoted 53 lines
Hi Heiko,
Quoted 51 lines · Heiko Schocher
Hello Tom,
Am 14.06.2013 16:58, schrieb Tom Rini:
Quoted 47 lines · Heiko Schocher
Quoted 32 lines
Hello Tom,
Am 13.06.2013 17:53, schrieb Tom Rini:
Quoted 14 lines · Heiko Schocher
Quoted 13 lines
move
s_initfrom every board code to a common place.Signed-off-by Heiko Schocher <[email protected]>Cc Tom Rini <[email protected]>Cc Matt Porter <[email protected]>Cc Lars Poeschel <[email protected]>Cc Tom Rini <[email protected]>Cc Enric Balletbo i Serra <[email protected]>---
This patch is based on the following patches:Quoted 8 lines
Quoted 5 lines
- [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 ..
Quoted 3 lines
The following adds moving
ti814x_evminto the mix and I've sent Matt some binaries to give a whirl to test on the board:[...]
Quoted 8 lines
Quoted 6 lines
/*
* Basic board specific setup. Pinmux has been handled already.Please fold into v2
Signed-off-by Tom Rini <[email protected]>Ok, thanks!
There's a minor bug in what I posted, however. ti814x needs
timer_initcalled _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.
Quoted 3 lines
Quoted 1 line
Do you have an update here for me?
We can have a
timer_initfor am33xx boards also. It doesn't harm. So keeptimer_initin your commons_init
Ok, fine.
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
BTW:
I just realized that I have on one of the three boards a problem, that in spl code calling thertc32k_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 ...
Quoted 1 line
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 ...
Quoted 3 lines
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?
Quoted 17 lines
Thanks and regards,
LokeshQuoted 15 lines
Quoted 3 lines
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
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 arm, am33xx: move s_init to a common place
Hi Heiko,
Quoted 68 lines · Heiko Schocher
Hello Lokesh,
Am 24.06.2013 06:01, schrieb Lokesh Vutla:
Quoted 53 lines
Hi Heiko,
Quoted 51 lines · Heiko Schocher
Hello Tom,
Am 14.06.2013 16:58, schrieb Tom Rini:
Quoted 47 lines · Heiko Schocher
Quoted 32 lines
Hello Tom,
Am 13.06.2013 17:53, schrieb Tom Rini:
Quoted 14 lines · Heiko Schocher
Quoted 13 lines
move
s_initfrom every board code to a common place.Signed-off-by Heiko Schocher <[email protected]>Cc Tom Rini <[email protected]>Cc Matt Porter <[email protected]>Cc Lars Poeschel <[email protected]>Cc Tom Rini <[email protected]>Cc Enric Balletbo i Serra <[email protected]>---
This patch is based on the following patches:Quoted 8 lines
Quoted 5 lines
- [U-Boot,v2] arm, am33xx: move
rtc32k_enable()to common placehttp://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 ..
Quoted 3 lines
The following adds moving
ti814x_evminto the mix and I've sent Matt some binaries to give a whirl to test on the board:[...]
Quoted 8 lines
Quoted 6 lines
/*
* Basic board specific setup. Pinmux has been handled already.Please fold into v2
Signed-off-by Tom Rini <[email protected]>Ok, thanks!
There's a minor bug in what I posted, however. ti814x needs
timer_initcalled _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.Quoted 3 lines
Quoted 1 line
Do you have an update here for me?
We can have a
timer_initfor am33xx boards also. It doesn't harm. So keeptimer_initin your commons_initOk, fine.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
BTW:
I just realized that I have on one of the three boards a problem, that in spl code calling thertc32k_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?
Quoted 7 lines
Quoted 1 line
On which board it is giving a problem?
Not in mainline yet, posting soon ...
Quoted 1 line
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
Quoted 38 lines
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 ...Quoted 3 lines
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?Quoted 17 lines
Thanks and regards,
LokeshQuoted 15 lines
Quoted 3 lines
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