From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm, am33xx: move s_init to a common place
Date: Thu, 13 Jun 2013 11:53:37 -0400 [thread overview]
Message-ID: <20130613155337.GC5616@bill-the-cat> (raw)
In-Reply-To: <1371095597-8425-1-git-send-email-hs@denx.de>
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:
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.
Please fold into v2
Signed-off-by: Tom Rini <trini@ti.com>
--
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>
next prev parent reply other threads:[~2013-06-13 15:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 3:53 [U-Boot] [PATCH] arm, am33xx: move s_init to a common place Heiko Schocher
2013-06-13 15:53 ` Tom Rini [this message]
2013-06-14 5:59 ` Heiko Schocher
2013-06-14 14:58 ` Tom Rini
2013-06-15 20:54 ` Peter Korsgaard
2013-06-20 3:52 ` Heiko Schocher
2013-06-24 4:01 ` Lokesh Vutla
2013-06-24 16:16 ` Heiko Schocher
2013-06-24 17:25 ` 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=20130613155337.GC5616@bill-the-cat \
--to=trini@ti.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.