From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Tue, 11 Feb 2014 12:03:17 -0800 Subject: [U-Boot] [PATCH] driver/mxc_i2c: Move static data structure to global_data In-Reply-To: <20140211195918.69BCE38032B@gemini.denx.de> References: <1392069772-24742-1-git-send-email-yorksun@freescale.com> <52F98C18.7020402@freescale.com> <52FA7915.8000307@boundarydevices.com> <52FA7DFD.5060406@freescale.com> <20140211195918.69BCE38032B@gemini.denx.de> Message-ID: <52FA8205.1090206@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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