From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuyuki Kobayashi Date: Wed, 26 Dec 2012 08:18:45 +0900 Subject: [U-Boot] [PATCH] arm: bugfix: Move vector table before jumping relocated code In-Reply-To: References: <4FE85C59.1010400@kmckk.co.jp> <20120627182306.GB18004@bill-the-cat> <4FEBB316.6010502@kmckk.co.jp> Message-ID: <50DA3455.3020301@kmckk.co.jp> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, Joel (2012/12/22 0:17), Joel A Fernandes wrote: > Hi Tesuyuki and friends, > > I had a question with this patch. > > On Wed, Jun 27, 2012 at 8:27 PM, Tetsuyuki Kobayashi wrote: >>>> This patch moves vector table before jumping relocated code. >>>> >>>> Signed-off-by: Tetsuyuki Kobayashi >>>> --- >>>> arch/arm/cpu/armv7/start.S | 12 ++++++++++++ >>>> 1 file changed, 12 insertions(+) >>>> >>>> diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S >>>> index 52f7f6e..5098f7b 100644 >>>> --- a/arch/arm/cpu/armv7/start.S >>>> +++ b/arch/arm/cpu/armv7/start.S >>>> @@ -277,6 +277,18 @@ jump_2_ram: >>>> mcr p15, 0, r0, c7, c10, 4 @ DSB >>>> mcr p15, 0, r0, c7, c5, 4 @ ISB >>>> #endif >>>> +/* >>>> + * Move vector table >>>> + */ >>>> +#if !defined(CONFIG_TEGRA2) >>>> +#if !(defined(CONFIG_OMAP44XX)&& defined(CONFIG_SPL_BUILD)) >>>> >>>> + /* Set vector address in CP15 VBAR register */ >>>> + ldr r0, =_start >>>> + add r0, r0, r9 >>>> + mcr p15, 0, r0, c12, c0, 0 @Set VBAR >>>> +#endif > > Why is c12 (VBAR) setup only for SPL builds? Because main u-boot does > relocation too, shouldn't we setup c12 to point to new table addr > after relocation? You may mis-understand. ! means NOT.