diff options
| author | Jon Hunter <jon-hunter@ti.com> | 2013-04-09 16:41:31 -0500 | 
|---|---|---|
| committer | Tom Rini <trini@ti.com> | 2013-04-10 16:03:01 -0400 | 
| commit | 2a309f33def4a8f72cb3b2e6f6a93ad487a50189 (patch) | |
| tree | 6df335a53178ad17f8efdda7b6e42ea9ac9c1e15 | |
| parent | 5faba1eac6ebfd769e25727283afa9d7275e9700 (diff) | |
| download | olio-uboot-2014.01-2a309f33def4a8f72cb3b2e6f6a93ad487a50189.tar.xz olio-uboot-2014.01-2a309f33def4a8f72cb3b2e6f6a93ad487a50189.zip | |
omap5912-osk: Fix device initialisation
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 <jon-hunter@ti.com>
| -rw-r--r-- | board/ti/omap5912osk/lowlevel_init.S | 20 | ||||
| -rw-r--r-- | board/ti/omap5912osk/omap5912osk.c | 12 | ||||
| -rw-r--r-- | 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 e60161eba..ca7361e05 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 9e91c5efc..95140719a 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 40ca9bb98..558e933b0 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 */ |