[U-Boot-Users] arm925t - allow any stack size (was: Re: [PATCH] Add board voiceblue)
Ladislav Michl
ladis at linux-mips.org
Wed Apr 6 22:20:39 CEST 2005
On Wed, Apr 06, 2005 at 03:37:37PM +0200, Wolfgang Denk wrote:
> Dear Ladislav,
>
> in message <20050405175018.GA16363 at orphique> you wrote:
> >
> > this patch adds support for OMAP5910 based board Voiceblue. Small flash
> > configuration will not work in tree because it needs small patch to
> > cpu/arm925t/start.S which I sent on 12 Jan 2005 under subject "Lowering
>
> The code does not compile at all:
Dear Wolfgang,
here is patch which would make it compile. It allows to configure any
size of malloc pool and any stack size. Patch is probably not ready for
inclusion since I'm not certain if it is safe to use r1 register in
abort handlers. If anyone knows, please comment patch.
Thanks in advance,
ladis
Index: cpu/arm925t/start.S
===================================================================
RCS file: /cvsroot/u-boot/u-boot/cpu/arm925t/start.S,v
retrieving revision 1.9
diff -u -r1.9 start.S
--- cpu/arm925t/start.S 4 Apr 2005 12:44:15 -0000 1.9
+++ cpu/arm925t/start.S 6 Apr 2005 19:56:47 -0000
@@ -83,6 +83,10 @@
_TEXT_BASE:
.word TEXT_BASE
+_STACK_OFS:
+ .word CFG_MALLOC_LEN + CFG_GBL_DATA_SIZE
+_BAD_STACK_OFS:
+ .word CFG_MALLOC_LEN + CFG_GBL_DATA_SIZE + CONFIG_STACKSIZE + 8
.globl _armboot_start
_armboot_start:
@@ -190,8 +194,8 @@
/* Set up the stack */
stack_setup:
ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */
- sub r0, r0, #CFG_MALLOC_LEN /* malloc area */
- sub r0, r0, #CFG_GBL_DATA_SIZE /* bdinfo */
+ ldr r1, _STACK_OFS
+ sub r0, r0, r1 /* malloc area and bdinfo */
#ifdef CONFIG_USE_IRQ
sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
#endif
@@ -295,8 +299,8 @@
stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12
ldr r2, _armboot_start
- sub r2, r2, #(CONFIG_STACKSIZE+CFG_MALLOC_LEN)
- sub r2, r2, #(CFG_GBL_DATA_SIZE+8) @ set base 2 words into abort stack
+ ldr r1, _BAD_STACK_OFS
+ sub r2, r2, r1
ldmia r2, {r2 - r3} @ get values for "aborted" pc and cpsr (into parm regs)
add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
@@ -328,8 +332,8 @@
.macro get_bad_stack
ldr r13, _armboot_start @ setup our mode stack
- sub r13, r13, #(CONFIG_STACKSIZE+CFG_MALLOC_LEN)
- sub r13, r13, #(CFG_GBL_DATA_SIZE+8) @ reserved a couple spots in abort stack
+ ldr r1, _BAD_STACK_OFS
+ sub r13, r13, r1
str lr, [r13] @ save caller lr in position 0 of saved stack
mrs lr, spsr @ get the spsr
More information about the U-Boot
mailing list