S3C6400/SMDK6400: fix stack_setup in start.S
PATCH 1/1 S3C6400/SMDK6400: fix stack_setup in start.S
Dear Minkyu Kang,
2009/11/2 Minkyu Kang <[email protected]>:
Quoted 16 lines
Dear Seunghyeon Rhee
2009/10/31 "Seunghyeon Rhee (???)" <[email protected]>:
Quoted 13 lines
stack_setupis modified to initialize the stack on the correct address in DRAM accroding to the typical memory configuration described in README and the related CONFIG_* macro definitions. This makes macroCONFIG_MEMORY_UPPER_CODEno longer necessry. This was introduced and used only by this board for some unclear reason. The definition of this macro is removed because it's not referenced elsewhere.Signed-off-by Seunghyeon Rhee <[email protected]>--- cpu/arm1176/start.S | 7 +------ include/configs/smdk6400.h | 2 -- 2 files changed, 1 insertions(+), 8 deletions(-)
Quoted 13 lines
cpu/arm1176/start.S mmu_enable: · line 244
Quoted 13 lines
cpu/arm1176/start.S +1
-4@@ -241,16 +241,11 @@ mmu_enable: skip_hw_init: /* Set up the stack */ stack_setup: -#ifdef CONFIG_MEMORY_UPPER_CODE - ldr sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc) -#else - ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */ + ldr r0, =CONFIG_SYS_UBOOT_BASE /* base of copy in
DRAM */
Quoted 2 lines
this change is unnecessary,
TEXT_BASEandCONFIG_SYS_UBOOT_BASEmust
be same.
That's true for the body of U-Boot but not for SPL, where TEXT_BASE is defined to be '0'.
Please refer to board/samsung/smdk6400/config.mk. On the other hand, CONFIG_SYS_UBOOT_BASE is always dependent on DRAM's base. In SPL, the base of the code should be '0' (the steppingstone memory) and then the stack
is located below '0' - not a valid area. If SPL itself requires no stack, it should be no
problem. But start.S calls nand_boot function right after the stack is badly set up in the air.
My test results are like the following:
with CONFIG_MEMORY_UPPER_CODE defined : OK
with CONFIG_MEMORY_UPPER_CODE undefined :
- SPL bypassed (U-Boot downloaded to DRAM directly by USB monitor
program) : OK
- through SPL : Not OK (seems to fail for SPL downloading the code to DRAM)
I think CONFIG_MEMORY_UPPER_CODE was tested for the case it's defined but not
enough for the case it's not defined. Would you check it again?
Quoted 2 lines
btw, is there need
CONFIG_SYS_UBOOT_BASEdefine?
If you are not sure, why did you use CONFIG_SYS_UBOOT_BASE for the case CONFIG_MEMORY_UPPER_CODE is defined while you use TEXT_BASE otherwise? I think the unnecessary macro definition here is not CONFIG_..._BASE but
CONFIG_..._CODE. TEXT_BASE and CONFIG_..._BASE have their own meanings and so both are necessary.
Best regards,
Seunghyeon
Quoted 49 lines
Quoted 28 lines
cpu/arm1176/start.S +0
-0sub r0, r0, #CONFIG_SYS_MALLOC_LEN /* mallocarea */
sub r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /*bdinfo */
sub sp, r0, #12 /* leave 3 words for abort-stack */cpu/arm1176/start.S +0
-2-#endif - clear_bss: ldr r0, _bss_start /* find start of bss segment */ ldr r1, _bss_end /* stop here */include/configs/smdk6400.h +0
-3@@ -49,8 +49,6 @@#define CONFIG_ENABLE_MMU #endif -#define CONFIG_MEMORY_UPPER_CODE -#define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_CMDLINE_TAG #define CONFIG_INITRD_TAG --1.6.2.5
Quoted 10 lines
--
Seunghyeon Rhee, Ph.D. / Director
LPM Technology Inc.
T +82-70-8255-6007 F +82-2-6442-6462
M +82-10-2790-0657
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootThanks for patch :)
Minkyu Kang
--
from. prom.
www.promsoft.net
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Signature · 4 lines
Seunghyeon Rhee, Ph.D. / Director LPM Technology Inc. T +82-70-8255-6007 F +82-2-6442-6462 M +82-10-2790-0657
PATCH 1/1 S3C6400/SMDK6400: fix stack_setup in start.S
Dear Seunghyeon Rhee,
2009/11/2 "Seunghyeon Rhee (???)" <[email protected]>:
Quoted 124 lines
Dear Minkyu Kang,
2009/11/2 Minkyu Kang <[email protected]>:
Quoted 16 lines
Dear Seunghyeon Rhee
2009/10/31 "Seunghyeon Rhee (???)" <[email protected]>:
Quoted 13 lines
stack_setupis modified to initialize the stack on the correct address in DRAM accroding to the typical memory configuration described in README and the related CONFIG_* macro definitions. This makes macroCONFIG_MEMORY_UPPER_CODEno longer necessry. This was introduced and used only by this board for some unclear reason. The definition of this macro is removed because it's not referenced elsewhere.Signed-off-by Seunghyeon Rhee <[email protected]>---
?cpu/arm1176/start.S ? ? ? ?| ? ?7 +------
?include/configs/smdk6400.h | ? ?2 --
?2 files changed, 1 insertions(+), 8 deletions(-)Quoted 13 lines
cpu/arm1176/start.S
Quoted 13 lines
cpu/arm1176/start.S +0
-0@@ -241,16 +241,11 @@ mmu_enable:?skip_hw_init:
? ? /* Set up the stack ? ? ? ? ? ? ? ? ? ? ? ? ? ?*/ ?stack_setup:cpu/arm1176/start.S +1
-4-#ifdef CONFIG_MEMORY_UPPER_CODE - ? ?ldr ? ?sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc) -#else - ? ?ldr ? ?r0, _TEXT_BASE ? ? ? ?/* upper 128 KiB: relocated uboot ? */ + ? ?ldr ? ?r0, =CONFIG_SYS_UBOOT_BASE ? ?/* base of copy inDRAM ? ? ? ?*/
Quoted 2 lines
this change is unnecessary,
TEXT_BASEandCONFIG_SYS_UBOOT_BASEmustbe same.
That's true for the body of U-Boot but not for SPL, where
TEXT_BASEis defined to be '0'.
Please refer toboard/samsung/smdk6400/config.mk. On the other hand,CONFIG_SYS_UBOOT_BASEis always dependent on DRAM's base. In SPL, the base of the code should be '0' (the steppingstone memory) and then the stack
is located below '0' - not a valid area. If SPL itself requires no stack, it should be no
problem. Butstart.Scallsnand_bootfunction right after the stack is badly set up in the air.My test results are like the following:
withCONFIG_MEMORY_UPPER_CODEdefined : OK
withCONFIG_MEMORY_UPPER_CODEundefined :
?- SPL bypassed (U-Boot downloaded to DRAM directly by USB monitor program) : OK
?- through SPL : Not OK (seems to fail for SPL downloading the code to DRAM)I think
CONFIG_MEMORY_UPPER_CODEwas tested for the case it's defined but not
enough for the case it's not defined. Would you check it again?Quoted 2 lines
btw, is there need
CONFIG_SYS_UBOOT_BASEdefine?If you are not sure, why did you use
CONFIG_SYS_UBOOT_BASEfor the caseCONFIG_MEMORY_UPPER_CODEis defined while you useTEXT_BASEotherwise? I think the unnecessary macro definition here is not CONFIG_..._BASE but
CONFIG_..._CODE.TEXT_BASEand CONFIG_..._BASE have their own meanings and so both are necessary.Best regards,
SeunghyeonQuoted 40 lines
Quoted 28 lines
? ? sub ? ?r0, r0, #CONFIG_SYS_MALLOC_LEN ? ?/* malloc area ? ? ? ? ? ? ? ? ? ? ?*/
? ? sub ? ?r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /*
bdinfo ? ? ? ? ? ? ? ? ? ? ? ?*/
? ? sub ? ?sp, r0, #12 ? ? ? ?/* leave 3 words for abort-stack ? ?*/cpu/arm1176/start.S +0
-2-#endif -?clear_bss:
? ? ldr ? ?r0,_bss_start? ? ? ?/* find start of bss segment ? ? ? ?*/ ? ? ldr ? ?r1,_bss_end? ? ? ?/* stop here ? ? ? ? ? ? ? ? ? ? ? ?*/include/configs/smdk6400.h +0
-0@@ -49,8 +49,6 @@?#define
CONFIG_ENABLE_MMU
?#endifinclude/configs/smdk6400.h +0
-2-#define CONFIG_MEMORY_UPPER_CODE -?#define
CONFIG_SETUP_MEMORY_TAGS
?#defineCONFIG_CMDLINE_TAG
?#defineCONFIG_INITRD_TAG
--
1.6.2.5Quoted 10 lines
--
Seunghyeon Rhee, Ph.D. / Director
LPM Technology Inc.
T +82-70-8255-6007 ?F +82-2-6442-6462
M +82-10-2790-0657
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootThanks for patch :)
Quoted 9 lines
Minkyu Kang
--
from. prom.
www.promsoft.net
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Quoted 10 lines
--
Seunghyeon Rhee, Ph.D. / Director
LPM Technology Inc.
T +82-70-8255-6007 ?F +82-2-6442-6462
M +82-10-2790-0657
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Tested on the NCP board (s3c6410), and It works fine. I'll wait few days more for this patch's review. Thanks!
Minkyu Kang
Signature · 2 lines
from. prom. www.promsoft.net
PATCH 1/1 S3C6400/SMDK6400: fix stack_setup in start.S
Dear Seunghyeon Rhee,
2009/11/10 Minkyu Kang <[email protected]>:
Quoted 142 lines
Dear Seunghyeon Rhee,
2009/11/2 "Seunghyeon Rhee (???)" <[email protected]>:
Quoted 124 lines
Dear Minkyu Kang,
2009/11/2 Minkyu Kang <[email protected]>:
Quoted 16 lines
Dear Seunghyeon Rhee
2009/10/31 "Seunghyeon Rhee (???)" <[email protected]>:
Quoted 13 lines
stack_setupis modified to initialize the stack on the correct address in DRAM accroding to the typical memory configuration described in README and the related CONFIG_* macro definitions. This makes macroCONFIG_MEMORY_UPPER_CODEno longer necessry. This was introduced and used only by this board for some unclear reason. The definition of this macro is removed because it's not referenced elsewhere.Signed-off-by Seunghyeon Rhee <[email protected]>---
?cpu/arm1176/start.S ? ? ? ?| ? ?7 +------
?include/configs/smdk6400.h | ? ?2 --
?2 files changed, 1 insertions(+), 8 deletions(-)Quoted 13 lines
cpu/arm1176/start.S
Quoted 13 lines
cpu/arm1176/start.S +0
-0@@ -241,16 +241,11 @@ mmu_enable:?skip_hw_init:
? ? /* Set up the stack ? ? ? ? ? ? ? ? ? ? ? ? ? ?*/ ?stack_setup:cpu/arm1176/start.S +1
-4-#ifdef CONFIG_MEMORY_UPPER_CODE - ? ?ldr ? ?sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc) -#else - ? ?ldr ? ?r0, _TEXT_BASE ? ? ? ?/* upper 128 KiB: relocated uboot ? */ + ? ?ldr ? ?r0, =CONFIG_SYS_UBOOT_BASE ? ?/* base of copy inDRAM ? ? ? ?*/
Quoted 2 lines
this change is unnecessary,
TEXT_BASEandCONFIG_SYS_UBOOT_BASEmustbe same.
That's true for the body of U-Boot but not for SPL, where
TEXT_BASEis defined to be '0'.
Please refer toboard/samsung/smdk6400/config.mk. On the other hand,CONFIG_SYS_UBOOT_BASEis always dependent on DRAM's base. In SPL, the base of the code should be '0' (the steppingstone memory) and then the stack
is located below '0' - not a valid area. If SPL itself requires no stack, it should be no
problem. Butstart.Scallsnand_bootfunction right after the stack is badly set up in the air.My test results are like the following:
withCONFIG_MEMORY_UPPER_CODEdefined : OK
withCONFIG_MEMORY_UPPER_CODEundefined :
?- SPL bypassed (U-Boot downloaded to DRAM directly by USB monitor program) : OK
?- through SPL : Not OK (seems to fail for SPL downloading the code to DRAM)I think
CONFIG_MEMORY_UPPER_CODEwas tested for the case it's defined but not
enough for the case it's not defined. Would you check it again?Quoted 2 lines
btw, is there need
CONFIG_SYS_UBOOT_BASEdefine?If you are not sure, why did you use
CONFIG_SYS_UBOOT_BASEfor the caseCONFIG_MEMORY_UPPER_CODEis defined while you useTEXT_BASEotherwise? I think the unnecessary macro definition here is not CONFIG_..._BASE but
CONFIG_..._CODE.TEXT_BASEand CONFIG_..._BASE have their own meanings and so both are necessary.Best regards,
SeunghyeonQuoted 40 lines
Quoted 28 lines
? ? sub ? ?r0, r0, #CONFIG_SYS_MALLOC_LEN ? ?/* malloc area ? ? ? ? ? ? ? ? ? ? ?*/
? ? sub ? ?r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /*
bdinfo ? ? ? ? ? ? ? ? ? ? ? ?*/
? ? sub ? ?sp, r0, #12 ? ? ? ?/* leave 3 words for abort-stack ? ?*/cpu/arm1176/start.S +0
-2-#endif -?clear_bss:
? ? ldr ? ?r0,_bss_start? ? ? ?/* find start of bss segment ? ? ? ?*/ ? ? ldr ? ?r1,_bss_end? ? ? ?/* stop here ? ? ? ? ? ? ? ? ? ? ? ?*/include/configs/smdk6400.h +0
-0@@ -49,8 +49,6 @@?#define
CONFIG_ENABLE_MMU
?#endifinclude/configs/smdk6400.h +0
-2-#define CONFIG_MEMORY_UPPER_CODE -?#define
CONFIG_SETUP_MEMORY_TAGS
?#defineCONFIG_CMDLINE_TAG
?#defineCONFIG_INITRD_TAG
--
1.6.2.5Quoted 10 lines
--
Seunghyeon Rhee, Ph.D. / Director
LPM Technology Inc.
T +82-70-8255-6007 ?F +82-2-6442-6462
M +82-10-2790-0657
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootThanks for patch :)
Quoted 9 lines
Minkyu Kang
--
from. prom.
www.promsoft.net
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootQuoted 10 lines
--
Seunghyeon Rhee, Ph.D. / Director
LPM Technology Inc.
T +82-70-8255-6007 ?F +82-2-6442-6462
M +82-10-2790-0657
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootTested on the NCP board (s3c6410), and It works fine. I'll wait few days more for this patch's review. Thanks!
Quoted 7 lines
Tested-by Minkyu Kang <[email protected]>Minkyu Kang
--
from. prom.
www.promsoft.net
your patch is line wrapped and the tabs are stripped out. please resend the patch
Thanks
Minkyu Kang
Signature · 2 lines
from. prom. www.promsoft.net
PATCH 1/1 S3C6400/SMDK6400: fix stack_setup in start.S
Fix stack_setup to place the stack on the correct address in DRAM accroding to U-Boot standard and remove conditional compilation by CONFIG_MEMORY_UPPER_CODE macro that is not necessry. This macro was introduced and used only by this board for some unclear reason.
The definition of this macro is also removed because it's not referenced elsewhere.
--- cpu/arm1176/start.S | 7 +------ include/configs/smdk6400.h | 2 -- 2 files changed, 1 insertions(+), 8 deletions(-)
cpu/arm1176/start.S +1 -6
@@ -241,16 +241,11 @@ mmu_enable: skip_hw_init: /* Set up the stack */ stack_setup: -#ifdef CONFIG_MEMORY_UPPER_CODE - ldr sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc) -#else - ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */ + ldr r0, =CONFIG_SYS_UBOOT_BASE /* base of copy in DRAM */ sub r0, r0, #CONFIG_SYS_MALLOC_LEN /* malloc area */ sub r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /* bdinfo */ sub sp, r0, #12 /* leave 3 words for abort-stack */ -#endif - clear_bss: ldr r0, _bss_start /* find start of bss segment */ ldr r1, _bss_end /* stop here */
include/configs/smdk6400.h +0 -2
@@ -49,8 +49,6 @@#define CONFIG_ENABLE_MMU #endif -#define CONFIG_MEMORY_UPPER_CODE -#define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_CMDLINE_TAG #define CONFIG_INITRD_TAG
Signature · 1 line
1.6.2.5
PATCH 1/1 S3C6400/SMDK6400: fix stack_setup in start.S
Dear Seunghyeon Rhee,
2009/11/13 ??? <[email protected]>:
Quoted 46 lines
Fix
stack_setupto place the stack on the correct address in DRAM accroding to U-Boot standard and remove conditional compilation byCONFIG_MEMORY_UPPER_CODEmacro that is not necessry. This macro was introduced and used only by this board for some unclear reason.The definition of this macro is also removed because it's not referenced elsewhere.
Signed-off-by Seunghyeon Rhee <[email protected]>---
?cpu/arm1176/start.S ? ? ? ?| ? ?7 +------
?include/configs/smdk6400.h | ? ?2 --
?2 files changed, 1 insertions(+), 8 deletions(-)cpu/arm1176/start.S +0
-0@@ -241,16 +241,11 @@ mmu_enable:?skip_hw_init:
? ? ? ?/* Set up the stack ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? */ ?stack_setup:cpu/arm1176/start.S +1
-4-#ifdef CONFIG_MEMORY_UPPER_CODE - ? ? ? ldr ? ? sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc) -#else - ? ? ? ldr ? ? r0, _TEXT_BASE ? ? ? ? ?/* upper 128 KiB: relocated uboot ? */ + ? ? ? ldr ? ? r0, =CONFIG_SYS_UBOOT_BASE ? ? ?/* base of copy in DRAM ? ? */? ? ? ?sub ? ? r0, r0, #CONFIG_SYS_MALLOC_LEN ?/* malloc area ? ? ? ? ? ? ? ? ? ? ?*/ ? ? ? ?sub ? ? r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /* bdinfo ? ? ? ? ? ? ? ? ? ? ? ?*/ ? ? ? ?sub ? ? sp, r0, #12 ? ? ? ? ? ? /* leave 3 words for abort-stack ? ?*/
cpu/arm1176/start.S +0
-2-#endif -?clear_bss:
? ? ? ?ldr ? ? r0,_bss_start? ? ? ? ?/* find start of bss segment ? ? ? ?*/ ? ? ? ?ldr ? ? r1,_bss_end? ? ? ? ? ?/* stop here ? ? ? ? ? ? ? ? ? ? ? ?*/include/configs/smdk6400.h +0
-0@@ -49,8 +49,6 @@?#define
CONFIG_ENABLE_MMU
?#endifinclude/configs/smdk6400.h +0
-2-#define CONFIG_MEMORY_UPPER_CODE -
Quoted 6 lines
?#define
CONFIG_SETUP_MEMORY_TAGS
?#defineCONFIG_CMDLINE_TAG
?#defineCONFIG_INITRD_TAG
--
1.6.2.5
applied to u-boot-samsung
At next time,
if you resend the patch, please send next version patch.
Thanks
Minkyu Kang
Signature · 2 lines
from. prom. www.promsoft.net