From: Wolfgang Denk Date: Mon, 16 May 2011 17:37:51 +0200 Subject: [U-Boot] [PATCH v2 04/22] omap4: save parameters passed by ROM code to SPL In-Reply-To: <4DD1189D.4050603@ti.com> References: <1298893591-17636-1-git-send-email-aneesh@ti.com> <1305472900-4004-5-git-send-email-aneesh@ti.com> <20110515191430.E61731491B06@gemini.denx.de> <4DD1189D.4050603@ti.com> Message-ID: <20110516153751.932851491B07@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 Aneesh V, In message <4DD1189D.4050603@ti.com> you wrote: > > >> Save this information in SPL so that we can use the same media > >> and mode to bootload u-boot. > >> > >> Signed-off-by: Aneesh V > > ... > >> + /* Store the boot device in omap4_boot_device */ > >> + ldr r2, [r0, #BOOT_DEVICE_OFFSET] @ r1<- value of boot device > >> + and r2, #BOOT_DEVICE_MASK > >> + ldr r3, =omap4_boot_device > >> + str r2, [r3] @ omap4_boot_device<- r1 > > > > Why don't you use stadard global data here? > > SPL has access to .data right from the beginning. Besides this is too > early. global data is not initialized yet. Please keep in mind that this is a special situation then. The code will not work as intended for example when running form NOR flash. 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 Good manners are the settled medium of social, as specie is of commercial, life; returns are equally expected for both. - Lord Chesterfield _Letters to his Son_, 25 December 1753