From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Thu, 10 Oct 2013 17:20:07 +0200 Subject: [U-Boot] [PATCH] ARM: mxs: Setup stack in JTAG mode In-Reply-To: <1379633804-7751-1-git-send-email-marex@denx.de> References: <1379633804-7751-1-git-send-email-marex@denx.de> Message-ID: <5256C5A7.8010802@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 On 20/09/2013 01:36, Marek Vasut wrote: > In case the MX23/MX28 is switched into JTAG mode via the BootMode select > switches, the BootROM bypasses the CPU core registers initialization. > This in turn means that the Stack Pointer (SP) register is not set as > it is in every other mode of operation, but instead is only zeroed out. > > To prevent U-Boot SPL from crashing in this obscure JTAG mode, configure > the SP to point at the CONFIG_SYS_INIT_SP_ADDR if the SP is zeroed out. > > Note that in case the SP is already configured, we must preserve that exact > SP value and must not modify it. This is important since in every other mode > but the JTAG mode, the SPL returns into the BootROM and BootROM in turn loads > U-Boot itself. If the SP were to be corrupted, the BootROM won't be able to > continue it's operation after returned from SPL and the system would crash. > > Finally, add the JTAG mode switch identifier, so it's not recognised as > Unknown mode. > > Signed-off-by: Marek Vasut > Cc: Stefano Babic > Cc: Fabio Estevam > Cc: Otavio Salvador > --- Applied to u-boot-imx, -next branch, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================