From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Tue, 11 Feb 2014 14:20:35 -0800 Subject: [U-Boot] [PATCH] driver/mxc_i2c: Move static data structure to global_data In-Reply-To: <20140211221226.6042538032B@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> <52FA8205.1090206@freescale.com> <20140211205708.A76B0380439@gemini.denx.de> <52FA8FDB.3030808@freescale.com> <20140211221226.6042538032B@gemini.denx.de> Message-ID: <52FAA233.6090403@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 02:12 PM, Wolfgang Denk wrote: > Dear York, > > In message <52FA8FDB.3030808@freescale.com> you wrote: >> >>> well, to do something with the linker script, you need some memory >>> somewhere you can use for this purpose. Your example showed SRAM. so >>> if you do have SRAM on that board - why do you not use it for stack >>> and GD? Where is your steck and GD right now? >> >> The initial stack and GD are in SRAM. Of course they are moved to SDRAM after >> initialization. I intend to spare SRAM for other purpose after relocation. > > Well, after relocation GD has also been relocated, so your SRAM would > be comletely unused. Sounds like you are OK with using GD for this patch. Let's wait to hear from Tom. He nacked this idea. > >> I am scratching my head trying to figure out how to put this variable "srdata" >> in mxc_i2c.c into stack. Please give me some guidance if you have the idea on >> top of your head. > > I have no idea which code you are talking about - sorry. > http://patchwork.ozlabs.org/patch/319073/ -/* - * For SPL boot some boards need i2c before SDRAM is initialized so force - * variables to live in SRAM - */ -static struct sram_data __attribute__((section(".data"))) srdata; - I moved this variable into GD. Is there a alternative way to do it? I tried to use stack but didn't find the solution. York