
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.
Best regards,
Wolfgang Denk