From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Tue, 20 Dec 2011 06:43:28 +0100 Subject: [U-Boot] [PATCH] overo: add SPL support In-Reply-To: References: <201112151534.31626.schnitzeltony@gmx.de> <201112152212.59968.schnitzeltony@gmx.de> <201112200203.01529.schnitzeltony@gmx.de> Message-ID: <20111220054329.327111EDB42@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Tom Rini, In message you wrote: > > > 'i2c_base' is correctly located in SRAM but 'current_bus' and 'bus_initialized' > > are located in CS0 SDRAM which is at the time of call not yet initalized. This > > fits to the crash behaviour: Accessing 'i2c_base' does not cause trouble. > > How can I move 'current_bus' and 'bus_initialized' to SRAM? I guess you really, really must use i2c before relocation? If possible, this should be avoided in the first place. > Ah-ha! Good work. If you initialize them to a non-zero value, > statically (and make sure the code doesn't assume they're 0 by > default), this will change. No, this is justy hiding the problem, and the next one who believes the value doesn't fit and changes it back to 0 runs into the issue again. Rather use an explicit int foo __attribute__ ((section(".data"))) = 0; so everybody sees the real intention. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Ein weiser Herrscher kann in einem gro?en Land mehr Gutes bewirken als in einem kleinen - ein dummer Herrscher aber auch viel mehr Un- fug. Da weise Herrscher seltener sind als dumme, war ich schon immer gegen gro?e Reiche skeptisch. - Herbert Rosendorfer