From: Wolfgang Denk Date: Wed, 08 Aug 2012 21:44:54 +0200 Subject: [U-Boot] [PATCH] tegra20: add assembly wrapper for lowlevel_init() In-Reply-To: <1344448286-14144-1-git-send-email-amartin@nvidia.com> References: <1344448286-14144-1-git-send-email-amartin@nvidia.com> Message-ID: <20120808194454.744FF20401B@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 Allen Martin, In message <1344448286-14144-1-git-send-email-amartin@nvidia.com> you wrote: > lowlevel_init() is called before stack is initialized, so it's not > safe to call directly into C code. Copy this wrapper from omap that > saves off the ip register and sets up a temporary stack. This fixes a > hang using CodeSourcery toolchain. ... > + /* > + * Setup a temporary stack > + */ > + ldr sp, =LOW_LEVEL_SRAM_STACK > + > + /* > + * Save the old lr(passed in ip) and the current lr to stack > + */ > + push {ip, lr} Are you sure this provides a valid stack frame? I think there are more requirements to that... BTW: this LOW_LEVEL_SRAM_STACK is really ugly; It is completely undocumented, and breaks naming conventions (it should be CONFIG_SYS_... instead). I know that this was not introduced by this patch, but it should be fixed ASAP - it's mostly TI and Tegra that use that... 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 What is tolerance? -- it is the consequence of humanity. We are all formed of frailty and error; let us pardon reciprocally each other's folly -- that is the first law of nature. - Voltaire