da830: fixup ARM relocation support
PATCH 1/1 da830: fixup ARM relocation support
Fixes build breakage in da830evm after commit 97003756249bd790910417eb66f0039bbf06a02c "da8xx: fixup ARM relocation support"
The da8xx fixup commit changed da830/da850 common code to make relocation work in da850, but didn't add the required defines to da830evm_config.h resulting in build failure in the common code.
This patch adds those defines for da830, but makes no sense without also referring to the commit mentioned above.
--- include/configs/da830evm.h | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
include/configs/da830evm.h +9 -2
@@ -48,8 +48,7 @@*/ #define CONFIG_SYS_MALLOC_LEN (0x10000 + 1*1024*1024)/* malloc() len */ #define CONFIG_SYS_GBL_DATA_SIZE 128/* reserved for initial data */ -#define PHYS_SDRAM_1 DAVINCI_DDR_EMIF_DATA_BASE/* DDR Start */ -#define PHYS_SDRAM_1_SIZE (64 << 20)/* SDRAM size 64MB */ +#define PHYS_SDRAM_1 0xc0000000/* SDRAM Start */ #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_1/* memtest start addr */ #define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 16*1024*1024)/* 16MB test */ #define CONFIG_NR_DRAM_BANKS 1/* we have 1 bank of DRAM */
@@ -281,4 +280,12 @@ "mtdparts=davinci_nand.1:" PART_BOOT PART_PARAMS PART_KERNEL PART_REST#endif +#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20)/* max size from SPRS586*/ + +/* additions for new relocation code, must be added to all boards */ +#undef CONFIG_SYS_ARM_WITHOUT_RELOC +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_SDRAM_BASE + 0x1000 - CONFIG_SYS_GBL_DATA_SIZE) +#endif /* __CONFIG_H */
Signature · 1 line
1.7.0.4
PATCH 1/1 da830: fixup ARM relocation support
Quoted 4 lines · Nick Thompson
Fixes build breakage in da830evm after commit
97003756249bd790910417eb66f0039bbf06a02c"da8xx: fixup ARM relocation support"
Quoted 8 lines
The da8xx fixup commit changed da830/da850 common code to make relocation work in da850, but didn't add the required defines to
da830evm_config.hresulting in build failure in the common code.This patch adds those defines for da830, but makes no sense without also referring to the commit mentioned above.
Signed-off-by Nick Thompson <[email protected]>
Sorry that was my fault for not adding the needed changes to the da830 config also when I submitted that patch.
What about removing "#define CONFIG_SKIP_RELOCATE_UBOOT" as in commit ab86f72c354f9b2572340f72b74ca0a258c451bd ?
Best Regards,
Ben Gardiner
---
Nanometrics Inc.
http://www.nanometrics.ca
PATCH 1/1 da830: fixup ARM relocation support
Quoted 9 lines · Ben Gardiner
Quoted 8 lines · Nick Thompson
Fixes build breakage in da830evm after commit
97003756249bd790910417eb66f0039bbf06a02c"da8xx: fixup ARM relocation support"The da8xx fixup commit changed da830/da850 common code to make relocation work in da850, but didn't add the required defines to
da830evm_config.hresulting in build failure in the common code.
Quoted 7 lines
Quoted 4 lines
This patch adds those defines for da830, but makes no sense without also referring to the commit mentioned above.
Signed-off-by Nick Thompson <[email protected]>Sorry that was my fault for not adding the needed changes to the da830 config also when I submitted that patch.
It's not a problem - at least you laid the ground work for a fix that had to be done anyway. I only mentioned it to put the patch in context.
Quoted 2 lines
What about removing "#define
CONFIG_SKIP_RELOCATE_UBOOT" as in commitab86f72c354f9b2572340f72b74ca0a258c451bd?
Hmmm. It wouldn't hurt I guess. The UBL copies the code to the correct address though doesn't it? The copy is not executed and so the code is redundant - or did I miss something?
Nick.
PATCH 1/1 da830: fixup ARM relocation support
Quoted 7 lines · Nick Thompson
Quoted 2 lines · Ben Gardiner
What about removing "#define
CONFIG_SKIP_RELOCATE_UBOOT" as in commitab86f72c354f9b2572340f72b74ca0a258c451bd?Hmmm. It wouldn't hurt I guess. The UBL copies the code to the correct address though doesn't it? The copy is not executed and so the code is redundant - or did I miss something?
Yeah, good point. UBL does copy the code to the correct address -- but I also remember that I needed to remove that define in my testing of Heiko's patches on the da850.
I'll get around to testing -next again soon and I'll try with CONFIG_SKIP_RELOCATE_UBOOT defined.
Best Regards,
Ben Gardiner
---
Nanometrics Inc.
http://www.nanometrics.ca
PATCH 1/1 da830: fixup ARM relocation support
Quoted 9 lines · Ben Gardiner
Quoted 7 lines · Nick Thompson
Quoted 2 lines · Ben Gardiner
What about removing "#define
CONFIG_SKIP_RELOCATE_UBOOT" as in commitab86f72c354f9b2572340f72b74ca0a258c451bd?Hmmm. It wouldn't hurt I guess. The UBL copies the code to the correct address though doesn't it? The copy is not executed and so the code is redundant - or did I miss something?
Quoted 6 lines
Yeah, good point. UBL does copy the code to the correct address -- but I also remember that I needed to remove that define in my testing of Heiko's patches on the da850.
I'll get around to testing -next again soon and I'll try with
CONFIG_SKIP_RELOCATE_UBOOTdefined.
No, don't do that. I just did some testing myself. The relocation address is calculated at run time and includes the size of u-boot itself. I got away with it once in my debugger (I was trying to dodge the extra copy), but it broke once I added more code.
You would have to change the UBL on more or less every build of u-boot to skip the copy, which is clearly impractical.
I have removed CONFIG_SKIP_RELOCATE_UBOOT as you suggested and now everything takes care of itself. I've already sent a v2 patch.
Thanks for pointing me in the right direction.
Nick.
PATCH 1/1 da830: fixup ARM relocation support
Quoted 14 lines · Nick Thompson
Quoted 13 lines · Ben Gardiner
Quoted 7 lines · Nick Thompson
Quoted 2 lines · Ben Gardiner
What about removing "#define
CONFIG_SKIP_RELOCATE_UBOOT" as in commitab86f72c354f9b2572340f72b74ca0a258c451bd?Hmmm. It wouldn't hurt I guess. The UBL copies the code to the correct address though doesn't it? The copy is not executed and so the code is redundant - or did I miss something?
Yeah, good point. UBL does copy the code to the correct address -- but I also remember that I needed to remove that define in my testing of Heiko's patches on the da850.
Quoted 7 lines
Quoted 2 lines
I'll get around to testing -next again soon and I'll try with
CONFIG_SKIP_RELOCATE_UBOOTdefined.No, don't do that. I just did some testing myself. The relocation address is calculated at run time and includes the size of u-boot itself. I got away with it once in my debugger (I was trying to dodge the extra copy), but it broke once I added more code.
Roger. Thanks for saving me the trouble.
Signature · 6 lines
Best Regards, Ben Gardiner --- Nanometrics Inc. http://www.nanometrics.ca