From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] ARM: AM33xx: Move s_init to a common place
Date: Mon, 24 Jun 2013 21:17:41 +0200 [thread overview]
Message-ID: <51C89B55.9020106@denx.de> (raw)
In-Reply-To: <1372079722-19486-4-git-send-email-lokeshvutla@ti.com>
Hello Lokesh,
Am 24.06.2013 15:15, schrieb Lokesh Vutla:
> From: Heiko Schocher <hs@denx.de>
>
> s_init has the same outline for all the AM33xx based
> board. So making it generic.
> This also helps in addition of new Soc with minimal changes.
>
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Signed-off-by: Tom Rini <trini@ti.com>
> ---
> arch/arm/cpu/armv7/am33xx/board.c | 46 +++++++++++++--
> arch/arm/cpu/armv7/am33xx/clock_ti814x.c | 6 ++
> arch/arm/cpu/armv7/am33xx/emif4.c | 6 +-
> arch/arm/include/asm/arch-am33xx/clocks_am33xx.h | 6 +-
> arch/arm/include/asm/arch-am33xx/sys_proto.h | 5 +-
> board/isee/igep0033/board.c | 49 +++-------------
> board/phytec/pcm051/board.c | 48 +++-------------
> board/ti/am335x/board.c | 52 +++--------------
> board/ti/ti814x/evm.c | 67 +++-------------------
> 9 files changed, 90 insertions(+), 195 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c
> index 1d743d6..3d08673 100644
> --- a/arch/arm/cpu/armv7/am33xx/board.c
> +++ b/arch/arm/cpu/armv7/am33xx/board.c
> @@ -145,7 +145,7 @@ int arch_misc_init(void)
> }
>
> #ifdef CONFIG_SPL_BUILD
> -void rtc32k_enable(void)
> +static void rtc32k_enable(void)
> {
> struct rtc_regs *rtc = (struct rtc_regs *)RTC_BASE;
>
> @@ -161,11 +161,7 @@ void rtc32k_enable(void)
> writel((1 << 3) | (1 << 6), &rtc->osc);
> }
>
> -#define UART_RESET (0x1 << 1)
> -#define UART_CLK_RUNNING_MASK 0x1
> -#define UART_SMART_IDLE_EN (0x1 << 0x3)
> -
> -void uart_soft_reset(void)
> +static void uart_soft_reset(void)
> {
> struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;
> u32 regval;
> @@ -182,4 +178,42 @@ void uart_soft_reset(void)
> regval |= UART_SMART_IDLE_EN;
> writel(regval, &uart_base->uartsyscfg);
> }
> +
> +static void watchdog_disable(void)
> +{
> + struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
> +
> + writel(0xAAAA, &wdtimer->wdtwspr);
> + while (readl(&wdtimer->wdtwwps) != 0x0)
> + ;
> + writel(0x5555, &wdtimer->wdtwspr);
> + while (readl(&wdtimer->wdtwwps) != 0x0)
> + ;
> +}
> #endif
> +
> +void s_init(void)
> +{
> + /*
> + * 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();
> + watchdog_disable();
> + timer_init();
> + set_uart_mux_conf();
> + setup_clocks_for_console();
> + uart_soft_reset();
> +
> + gd = &gdata;
> + preloader_console_init();
> +
> + prcm_init();
> + set_mux_conf_regs();
> + /* Enable RTC32K clock */
> + rtc32k_enable();
I tried your patches on my three boards. The board with the
rtc32k_enable() problem, did not work with them too :-(
Maybe we make rtc32k_enable() weak in common code, and so
I can make a board specific (dummy) function?
[...]
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2013-06-24 19:17 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 13:15 [U-Boot] [PATCH 0/4] ARM: AM33xx: Cleanup clocks and hwinit Lokesh Vutla
2013-06-24 13:15 ` [U-Boot] [PATCH 1/4] ARM: AM33xx: Cleanup dplls data Lokesh Vutla
2013-06-24 19:12 ` Heiko Schocher
2013-06-25 3:48 ` Lokesh Vutla
2013-06-25 4:54 ` Heiko Schocher
2013-06-25 5:39 ` Lokesh Vutla
2013-06-25 7:05 ` Heiko Schocher
2013-06-25 8:17 ` Lokesh Vutla
2013-06-25 14:09 ` Heiko Schocher
2013-06-25 14:53 ` Tom Rini
2013-06-26 4:39 ` Heiko Schocher
2013-06-26 4:40 ` Heiko Schocher
2013-06-24 13:15 ` [U-Boot] [PATCH 2/4] ARM: AM33xx: Cleanup clocks layer Lokesh Vutla
2013-06-26 4:42 ` Heiko Schocher
2013-06-24 13:15 ` [U-Boot] [PATCH 3/4] ARM: AM33xx: Move s_init to a common place Lokesh Vutla
2013-06-24 19:17 ` Heiko Schocher [this message]
2013-06-24 19:31 ` Tom Rini
2013-06-24 19:44 ` Heiko Schocher
2013-06-25 5:09 ` Sumit Gemini
2013-06-25 5:19 ` Heiko Schocher
2013-06-24 13:15 ` [U-Boot] [PATCH 4/4] musb: Disable extra prints Lokesh Vutla
2013-06-24 19:33 ` Heiko Schocher
2013-06-26 4:24 ` [U-Boot] [PATCH 0/4] ARM: AM33xx: Cleanup clocks and hwinit Lokesh Vutla
2013-06-26 12:09 ` Tom Rini
2013-06-26 12:49 ` Lokesh Vutla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51C89B55.9020106@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox