From patchwork Tue Apr 9 21:41:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunter, Jon" X-Patchwork-Id: 235251 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C87F92C00C8 for ; Wed, 10 Apr 2013 07:42:41 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7BA154A08A; Tue, 9 Apr 2013 23:42:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yTP2N+sH2lDQ; Tue, 9 Apr 2013 23:42:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DE1C4A08B; Tue, 9 Apr 2013 23:41:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 07FB14A08E for ; Tue, 9 Apr 2013 23:41:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8t8wwP92DTdb for ; Tue, 9 Apr 2013 23:41:46 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by theia.denx.de (Postfix) with ESMTPS id CE56B4A058 for ; Tue, 9 Apr 2013 23:41:41 +0200 (CEST) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r39LfeZM018373 for ; Tue, 9 Apr 2013 16:41:40 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r39Lfea6013516 for ; Tue, 9 Apr 2013 16:41:40 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Tue, 9 Apr 2013 16:41:39 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r39Lfe9M016111; Tue, 9 Apr 2013 16:41:40 -0500 Received: from localhost (ula0741266.am.dhcp.ti.com [192.157.144.139]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r39LfdV26813; Tue, 9 Apr 2013 16:41:39 -0500 (CDT) From: Jon Hunter To: Tom Rini Date: Tue, 9 Apr 2013 16:41:31 -0500 Message-ID: <1365543693-5742-4-git-send-email-jon-hunter@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365543693-5742-1-git-send-email-jon-hunter@ti.com> References: <1365543693-5742-1-git-send-email-jon-hunter@ti.com> MIME-Version: 1.0 Cc: u-boot Subject: [U-Boot] [PATCH 3/5] omap5912-osk: Fix device initialisation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de In the current u-boot, the device pin multiplexing and clock initialisation needs to be early during the boot process and before board_init() is called. U-boot is currently crashing on this board because this is not being done early enough. Therefore, add a s_init() function for the omap5912-osk board to do this. Also fix the stack pointer so that it is pointing to the end of the internal RAM and not the beginning as this was also causing the device to crash. Signed-off-by: Jon Hunter --- board/ti/omap5912osk/lowlevel_init.S | 20 ++++++++++++++++++++ board/ti/omap5912osk/omap5912osk.c | 12 ++++++++---- include/configs/omap5912osk.h | 7 +++++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/board/ti/omap5912osk/lowlevel_init.S b/board/ti/omap5912osk/lowlevel_init.S index e60161e..ca7361e 100644 --- a/board/ti/omap5912osk/lowlevel_init.S +++ b/board/ti/omap5912osk/lowlevel_init.S @@ -306,6 +306,23 @@ common_tc: ldr r1, VAL_MPU_CNTL_TIMER str r1, [r0] + /* + * Setup a temporary stack + */ + ldr sp, SRAM_STACK + bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ + + /* + * Save the old lr(passed in ip) and the current lr to stack + */ + push {ip, lr} + + /* + * go setup pll, mux, memory + */ + bl s_init + pop {ip, pc} + /* back to arch calling code */ mov pc, lr @@ -470,6 +487,9 @@ VAL_ARM_IDLECT2: VAL_ARM_IDLECT3: .word 0x00000015 +SRAM_STACK: + .word CONFIG_SYS_INIT_SP_ADDR + /* command values */ .equ CMD_SDRAM_NOP, 0x00000000 .equ CMD_SDRAM_PRECHARGE, 0x00000001 diff --git a/board/ti/omap5912osk/omap5912osk.c b/board/ti/omap5912osk/omap5912osk.c index 9e91c5e..9514071 100644 --- a/board/ti/omap5912osk/omap5912osk.c +++ b/board/ti/omap5912osk/omap5912osk.c @@ -66,6 +66,14 @@ int board_init (void) /* adress of boot parameters */ gd->bd->bi_boot_params = 0x10000100; + flash__init(); + ether__init(); + + return 0; +} + +void s_init(void) +{ /* Configure MUX settings */ set_muxconf_regs (); peripheral_power_enable (); @@ -75,10 +83,6 @@ int board_init (void) * ... rkw ... */ icache_enable (); - - flash__init (); - ether__init (); - return 0; } /****************************** diff --git a/include/configs/omap5912osk.h b/include/configs/omap5912osk.h index 40ca9bb..558e933 100644 --- a/include/configs/omap5912osk.h +++ b/include/configs/omap5912osk.h @@ -183,7 +183,10 @@ #define CONFIG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */ #define CONFIG_ENV_OFFSET 0x20000 /* environment starts here */ -#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 -#define CONFIG_SYS_INIT_SP_ADDR PHYS_SRAM +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_RAM_ADDR PHYS_SRAM +#define CONFIG_SYS_INIT_RAM_SIZE (250 * 1024) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE) #endif /* __CONFIG_H */