From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Wed, 12 Feb 2014 09:56:21 -0800 Subject: [U-Boot] [PATCH] driver/mxc_i2c: Move static data structure to global_data In-Reply-To: <20140212144347.GD15819@bill-the-cat> References: <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> <52FAA233.6090403@freescale.com> <20140212142758.94723380601@gemini.denx.de> <20140212144347.GD15819@bill-the-cat> Message-ID: <52FBB5C5.5000204@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/12/2014 06:43 AM, Tom Rini wrote: > On Wed, Feb 12, 2014 at 03:27:58PM +0100, Wolfgang Denk wrote: >> Dear York, >> >> In message <52FAA233.6090403@freescale.com> you wrote: >>> >>>> 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 don't say I think this is a good change. I just tried to explain to >> you that the SRAM will be unused after relocation completed. Tom >> probably has the same problem as I: I cannot understand why you are >> changing the code. If it's been working as is before, then why would >> it stop now? > > I think I see it. We had been concerned with the SPL case, and the > current driver work-around is how we do it (as to not litter gd->arch > with lots of things just for drivers we need so very very early in SPL). > York now has a different setup where this i2c block is being reused, > where SRAM is big enough (apparently) to load the whole of U-Boot into > and start execution from, but we still want to relocate into DDR. This > is a problem over in TI-land we've avoided by simply saying "lets keep > using SPL anyhow". > A minor correction, I am not putting u-boot in SRAM. I am reusing this mxc_i2c driver. It has been working, but my situation is different. I am not using SPL. U-boot runs in flash when the driver is called. I have SRAM to host stack and GD. This driver requires writable memory. Obviously I have only three options, use stack, GD, or make a special treatment to use SRAM. As we discussed and I tried, using linker script to link it to SRAM is messy and the relocation result is bad. I can't find a good way to use stack either. That leaves me the best option is to use GD. York