devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
This moves CONFIG_SYS_TEXT_BASE one MB after beginning of SD-RAM. Move CONFIG_SYS_SPL_MALLOC_START to have one MB of free space for the u-boot image.
CONFIG_SYS_TEXT_BASE was in the middle of the bss-section. This was the reason for the problems with MMC boot described here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/118711
--- include/configs/devkit8000.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
include/configs/devkit8000.h +3 -2
@@ -37,7 +37,8 @@#define CONFIG_OMAP3430 1/* which is in a 3430 */ #define CONFIG_OMAP3_DEVKIT8000 1/* working with DevKit8000 */ -#define CONFIG_SYS_TEXT_BASE 0x80008000 +/* 1 MB into SD-RAM to leave place for .bss-section */ +#define CONFIG_SYS_TEXT_BASE 0x80100000#define CONFIG_SDRC /* The chip has SDRC controller */
@@ -359,7 +360,7 @@#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000#define CONFIG_SYS_NAND_U_BOOT_SIZE 0x200000 -#define CONFIG_SYS_SPL_MALLOC_START 0x80108000 +#define CONFIG_SYS_SPL_MALLOC_START 0x80200000#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000/* 1 MB */ #endif /* __CONFIG_H */
Signature · 1 line
1.7.4.1
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
This fixes the current mmc booting problems with devkit8000.
I would recommend to include it into the upcoming release.
Regards
Simon
2011/11/30 Simon Schwarz <[email protected]>:
Quoted 41 lines
This moves
CONFIG_SYS_TEXT_BASEone MB after beginning of SD-RAM. MoveCONFIG_SYS_SPL_MALLOC_STARTto have one MB of free space for the u-boot image.
CONFIG_SYS_TEXT_BASEwas in the middle of the bss-section. This was the reason for the problems with MMC boot described here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/118711Signed-off-by Simon Schwarz <[email protected]>Cc s-paulraj at ti.comCc wd at denx.deCc trini at ti.com---
?include/configs/devkit8000.h | ? ?5 +++--
?1 files changed, 3 insertions(+), 2 deletions(-)include/configs/devkit8000.h +0
-0@@ -37,7 +37,8 @@?#define
CONFIG_OMAP3430? ? ? ? ? ? ? ?1 ? ? ? /* which is in a 3430 */ ?#defineCONFIG_OMAP3_DEVKIT8000? ? ? ?1 ? ? ? /* working with DevKit8000 */include/configs/devkit8000.h +2
-1-#define ? ? ? ?CONFIG_SYS_TEXT_BASE ? ?0x80008000 +/* 1 MB into SD-RAM to leave place for .bss-section */ +#define ? ? ? ?CONFIG_SYS_TEXT_BASE ? ?0x80100000?#define
CONFIG_SDRC? ?/* The chip has SDRC controller */include/configs/devkit8000.h +0
-0@@ -359,7 +360,7 @@?#define
CONFIG_SYS_NAND_U_BOOT_OFFS? ?0x80000
?#defineCONFIG_SYS_NAND_U_BOOT_SIZE? ?0x200000include/configs/devkit8000.h +1
-1-#define CONFIG_SYS_SPL_MALLOC_START ? ?0x80108000 +#define CONFIG_SYS_SPL_MALLOC_START ? ?0x80200000?#define
CONFIG_SYS_SPL_MALLOC_SIZE? ?0x100000? ? ? ?/* 1 MB */?#endif /*
__CONFIG_H*/
--
1.7.4.1
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
In reply to Simon SchwarzQuoted 5 lines · Simon Schwarz
This moves
CONFIG_SYS_TEXT_BASEone MB after beginning of SD-RAM. MoveCONFIG_SYS_SPL_MALLOC_STARTto have one MB of free space for the u-boot image.
CONFIG_SYS_TEXT_BASEwas in the middle of the bss-section. This was the reason for the problems with MMC boot described here:
Ah-ha! Good catch. Note that on beagle/evm we do:
/*
* 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
* 64 bytes before this address should be set aside for u-boot.img's
* header. That is 0x800FFFC0--0x80100000 should not be used for any
* other needs.
*/
#define CONFIG_SYS_TEXT_BASE 0x80100000 #define CONFIG_SYS_SPL_MALLOC_START 0x80208000 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
So (a) I like the bigger comment and (b) I guess we don't need quite as much space set aside?
Signature · 1 line
Tom
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
In reply to Simon SchwarzHi Simon,
Quoted 6 lines · Simon Schwarz
This moves
CONFIG_SYS_TEXT_BASEone MB after beginning of SD-RAM. MoveCONFIG_SYS_SPL_MALLOC_STARTto have one MB of free space for the u-boot image.
CONFIG_SYS_TEXT_BASEwas in the middle of the bss-section. This was the reason for the problems with MMC boot described here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/118711
Does this affect only boards having the SPL support? Can you, please, shed some more light on this?
Signature · 2 lines
Regards, Igor.
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
Hi Igor,
this only affects Boards with SPL support - and only devkit8000.
The SPL has its .bss section in SD-RAM while the rest is in SRAM - CONFIG_SYS_TEXT_BASE was in the same area as .bss. This caused trouble as the header of the u-boot.img was written before CONFIG_SYS_TEXT_BASE. In the described case this messed with the pointer to the mcc datastructure - therefore the u-boot.img file failed to be read.
Regards
Simon
2011/12/1 Igor Grinberg <[email protected]>:
Quoted 17 lines
Hi Simon,
Quoted 6 lines · Simon Schwarz
This moves
CONFIG_SYS_TEXT_BASEone MB after beginning of SD-RAM. MoveCONFIG_SYS_SPL_MALLOC_STARTto have one MB of free space for the u-boot image.
CONFIG_SYS_TEXT_BASEwas in the middle of the bss-section. This was the reason for the problems with MMC boot described here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/118711Does this affect only boards having the SPL support? Can you, please, shed some more light on this?
--
Regards,
Igor.
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
Quoted 10 lines · Simon Schwarz
Hi Igor,
this only affects Boards with SPL support - and only devkit8000.
The SPL has its .bss section in SD-RAM while the rest is in SRAM -
CONFIG_SYS_TEXT_BASEwas in the same area as .bss. This caused trouble as the header of the u-boot.img was written beforeCONFIG_SYS_TEXT_BASE. In the described case this messed with the pointer to the mcc datastructure - therefore the u-boot.img file failed to be read.
Thank you very much for the explanation.
So as to my understanding, what happens is:
1) The SPL initializes the SDRAM
2) Copies its .bss section to SDRAM
3) Starts loading the U-Boot image and overwrites the .bss section Is the above correct?
If it is, then why do we need the .bss in SDRAM?
Aren't there enough space in SRAM?
Also, is this what X-Loader did in first place?
Signature · 2 lines
Regards, Igor.
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
Hi Igor,
Quoted 14 lines · Igor Grinberg
Quoted 10 lines · Simon Schwarz
Hi Igor,
this only affects Boards with SPL support - and only devkit8000.
The SPL has its .bss section in SD-RAM while the rest is in SRAM -
CONFIG_SYS_TEXT_BASEwas in the same area as .bss. This caused trouble as the header of the u-boot.img was written beforeCONFIG_SYS_TEXT_BASE. In the described case this messed with the pointer to the mcc datastructure - therefore the u-boot.img file failed to be read.Thank you very much for the explanation.
Quoted 7 lines
So as to my understanding, what happens is:
1) The SPL initializes the SDRAM
2) Copies its .bss section to SDRAM
3) Starts loading the U-Boot image and overwrites the .bss section Is the above correct?If it is, then why do we need the .bss in SDRAM?
U-Boot FAT implementation uses 3 buffers each of size 64 KB.
Quoted 1 line
Aren't there enough space in SRAM?
SRAM doesn't have space for such huge buffers.
Quoted 1 line
Also, is this what X-Loader did in first place?
Yes, x-loader had these buffers in SDRAM too. But instead of putting the .bss in SDRAM, x-loader made these huge arrays into pointer variables that were then made to point to the SDRAM.
br,
Aneesh
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
Quoted 29 lines · Aneesh V
Hi Igor,
Quoted 14 lines · Igor Grinberg
Quoted 10 lines · Simon Schwarz
Hi Igor,
this only affects Boards with SPL support - and only devkit8000.
The SPL has its .bss section in SD-RAM while the rest is in SRAM -
CONFIG_SYS_TEXT_BASEwas in the same area as .bss. This caused trouble as the header of the u-boot.img was written beforeCONFIG_SYS_TEXT_BASE. In the described case this messed with the pointer to the mcc datastructure - therefore the u-boot.img file failed to be read.Thank you very much for the explanation.
Quoted 7 lines
So as to my understanding, what happens is:
1) The SPL initializes the SDRAM
2) Copies its .bss section to SDRAM
3) Starts loading the U-Boot image and overwrites the .bss section Is the above correct?If it is, then why do we need the .bss in SDRAM?
U-Boot FAT implementation uses 3 buffers each of size 64 KB.
Quoted 1 line
Aren't there enough space in SRAM?
Quoted 7 lines
SRAM doesn't have space for such huge buffers.
Quoted 1 line
Also, is this what X-Loader did in first place?
Yes, x-loader had these buffers in SDRAM too. But instead of putting the .bss in SDRAM, x-loader made these huge arrays into pointer variables that were then made to point to the SDRAM.
Ok. Now I get the picture of what's going on there. Never had the time to go through the code to figure this out... Thanks for the explanation, Aneesh.
Signature · 2 lines
Regards, Igor.
PATCH 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
In reply to Simon SchwarzHello Simon,
Quoted 30 lines · Simon Schwarz
This moves
CONFIG_SYS_TEXT_BASEone MB after beginning of SD-RAM. MoveCONFIG_SYS_SPL_MALLOC_STARTto have one MB of free space for the u-boot image.
CONFIG_SYS_TEXT_BASEwas in the middle of the bss-section. This was the reason for the problems with MMC boot described here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/118711Signed-off-by Simon Schwarz <[email protected]>Cc s-paulraj at ti.comCc wd at denx.deCc trini at ti.com--- include/configs/devkit8000.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)include/configs/devkit8000.h +2
-1@@ -37,7 +37,8 @@#define CONFIG_OMAP3430 1/* which is in a 3430 */ #define CONFIG_OMAP3_DEVKIT8000 1/* working with DevKit8000 */ -#define CONFIG_SYS_TEXT_BASE 0x80008000 +/* 1 MB into SD-RAM to leave place for .bss-section */ +#define CONFIG_SYS_TEXT_BASE 0x80100000#define CONFIG_SDRC /* The chip has SDRC controller */
include/configs/devkit8000.h line 366
Quoted 8 lines
include/configs/devkit8000.h +1
-1@@ -359,7 +360,7 @@#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000#define CONFIG_SYS_NAND_U_BOOT_SIZE 0x200000 -#define CONFIG_SYS_SPL_MALLOC_START 0x80108000 +#define CONFIG_SYS_SPL_MALLOC_START 0x80200000#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000/* 1 MB */ #endif /* __CONFIG_H */
boots from NAND and from MMC now, on both Devkit8000 versions (128 MiB and 256 MiB).
Thomas
PATCH v2 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
In reply to Simon SchwarzThis moves CONFIG_SYS_TEXT_BASE one MB after beginning of SD-RAM. Move CONFIG_SYS_SPL_MALLOC_START to have one MB of free space for the u-boot image.
CONFIG_SYS_TEXT_BASE was in the middle of the bss-section. This was the reason for the problems with MMC boot described here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/118711
---
V2 changes:
CHG added a more comprehensive comment on CONFIG_SYS_TEXT_BASE CHG Moved CONFIG_SYS_SPL_MALLOC_START from 0x80200000 to 0x80208000 to be
consistent with beagle board
--- include/configs/devkit8000.h | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
include/configs/devkit8000.h +8 -2
@@ -37,7 +37,13 @@#define CONFIG_OMAP3430 1/* which is in a 3430 */ #define CONFIG_OMAP3_DEVKIT8000 1/* working with DevKit8000 */ -#define CONFIG_SYS_TEXT_BASE 0x80008000 +/* +* 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM +* 64 bytes before this address should be set aside for u-boot.img's +* header. That is 0x800FFFC0--0x80100000 should not be used for any +* other needs. +*/ +#define CONFIG_SYS_TEXT_BASE 0x80100000#define CONFIG_SDRC /* The chip has SDRC controller */
@@ -359,7 +365,7 @@#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000#define CONFIG_SYS_NAND_U_BOOT_SIZE 0x200000 -#define CONFIG_SYS_SPL_MALLOC_START 0x80108000 +#define CONFIG_SYS_SPL_MALLOC_START 0x80208000#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000/* 1 MB */ #endif /* __CONFIG_H */
Signature · 1 line
1.7.4.1
PATCH v2 1/1 devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
Quoted 42 lines · Simon Schwarz
This moves
CONFIG_SYS_TEXT_BASEone MB after beginning of SD-RAM. MoveCONFIG_SYS_SPL_MALLOC_STARTto have one MB of free space for the u-boot image.
CONFIG_SYS_TEXT_BASEwas in the middle of the bss-section. This was the reason for the problems with MMC boot described here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/118711Signed-off-by Simon Schwarz <[email protected]>---
V2 changes:
CHG added a more comprehensive comment onCONFIG_SYS_TEXT_BASECHG MovedCONFIG_SYS_SPL_MALLOC_STARTfrom0x80200000to0x80208000to be
consistent with beagle boardCc s-paulraj at ti.comCc trini at ti.comCc albert.u.boot at aribaud.net--- include/configs/devkit8000.h | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)include/configs/devkit8000.h +7
-1@@ -37,7 +37,13 @@#define CONFIG_OMAP3430 1/* which is in a 3430 */ #define CONFIG_OMAP3_DEVKIT8000 1/* working with DevKit8000 */ -#define CONFIG_SYS_TEXT_BASE 0x80008000 +/* +* 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM +* 64 bytes before this address should be set aside for u-boot.img's +* header. That is 0x800FFFC0--0x80100000 should not be used for any +* other needs. +*/ +#define CONFIG_SYS_TEXT_BASE 0x80100000#define CONFIG_SDRC /* The chip has SDRC controller */
include/configs/devkit8000.h line 371
Quoted 8 lines
include/configs/devkit8000.h +1
-1@@ -359,7 +365,7 @@#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000#define CONFIG_SYS_NAND_U_BOOT_SIZE 0x200000 -#define CONFIG_SYS_SPL_MALLOC_START 0x80108000 +#define CONFIG_SYS_SPL_MALLOC_START 0x80208000#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000/* 1 MB */ #endif /* __CONFIG_H */
Thanks,
Thomas