
On 02/11/2014 11:59 AM, Wolfgang Denk wrote:
Dear York Sun,
In message 52FA7DFD.5060406@freescale.com you wrote:
Thanks for the insight. I am not using SPL either. I need this driver to run before u-boot relocates to DDR. Everything is in flash. I need to find a writable location for the variable srdata. I can put this section in linker script
.data.sram : { drivers/i2c/built-in.o (.data) } > sram
}
Please do not invent totally new ways to have writable data before relocation. Use the existing machanisms. While running from flash, we have but what little memory we can find in on-chip memory or SRAM or data chace; we use this for the stack and global data (which should be kept as small as possible, to allow for a as much stack as possible).
So ideally keep this data on the stack, and if there is no way around it, in the global data structure.
Agreed. I tried to use global data at first, which upsets Tom. Tom suggested to use linker script. I guess he was under the impression I was using SPL. Let me try harder to use stack.
York