diff mbox

[U-Boot,v2,08/23] armv8: move reset branch into boot hook

Message ID 1480902750-839-9-git-send-email-andre.przywara@arm.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Andre Przywara Dec. 5, 2016, 1:52 a.m. UTC
The boot0 hook we have so far is applied _after_ the initial branch
to the "reset" entry point. An upcoming change requires even this
branch to be changed, so we apply the hook macro at the earliest
point, and have the branch in the hook file as well.
This is no functional change at this point, just refactoring to simplify
upcoming patches.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/cpu/armv8/start.S              | 4 ++--
 arch/arm/include/asm/arch-sunxi/boot0.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Simon Glass Dec. 5, 2016, 6:25 a.m. UTC | #1
Hi Andre,

On 4 December 2016 at 18:52, Andre Przywara <andre.przywara@arm.com> wrote:
> The boot0 hook we have so far is applied _after_ the initial branch
> to the "reset" entry point. An upcoming change requires even this
> branch to be changed, so we apply the hook macro at the earliest
> point, and have the branch in the hook file as well.
> This is no functional change at this point, just refactoring to simplify
> upcoming patches.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  arch/arm/cpu/armv8/start.S              | 4 ++--
>  arch/arm/include/asm/arch-sunxi/boot0.h | 1 +
>  2 files changed, 3 insertions(+), 2 deletions(-)

Will this not affect other boards which use ARM_SOC_BOOT0_HOOK?

Regards,
Simon
Andre Przywara Dec. 5, 2016, 1:43 p.m. UTC | #2
Hi,

On 05/12/16 06:25, Simon Glass wrote:
> Hi Andre,
> 
> On 4 December 2016 at 18:52, Andre Przywara <andre.przywara@arm.com> wrote:
>> The boot0 hook we have so far is applied _after_ the initial branch
>> to the "reset" entry point. An upcoming change requires even this
>> branch to be changed, so we apply the hook macro at the earliest
>> point, and have the branch in the hook file as well.
>> This is no functional change at this point, just refactoring to simplify
>> upcoming patches.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>>  arch/arm/cpu/armv8/start.S              | 4 ++--
>>  arch/arm/include/asm/arch-sunxi/boot0.h | 1 +
>>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> Will this not affect other boards which use ARM_SOC_BOOT0_HOOK?

That's a valid question, but the answer is: no.
This roughly same mechanism is used by two Broadcom ARMv7 boards, but
the usage is different there: they include the boot0.h header file only
after the vectors (and not only after the initial branch-to-reset).
So this is already different and not compatible between armv7 and armv8
right now, so it's not a regression or change this patch is introducing.

I agree it's a bit confusing to have the same header and Kconfig name,
but a different behaviour, but I don't see a good solution to unify
this. If you do, I am all ears.

Cheers,
Andre.
Simon Glass Dec. 8, 2016, 10:21 p.m. UTC | #3
On 5 December 2016 at 08:43, Andre Przywara <andre.przywara@arm.com> wrote:
> Hi,
>
> On 05/12/16 06:25, Simon Glass wrote:
>> Hi Andre,
>>
>> On 4 December 2016 at 18:52, Andre Przywara <andre.przywara@arm.com> wrote:
>>> The boot0 hook we have so far is applied _after_ the initial branch
>>> to the "reset" entry point. An upcoming change requires even this
>>> branch to be changed, so we apply the hook macro at the earliest
>>> point, and have the branch in the hook file as well.
>>> This is no functional change at this point, just refactoring to simplify
>>> upcoming patches.
>>>
>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>> ---
>>>  arch/arm/cpu/armv8/start.S              | 4 ++--
>>>  arch/arm/include/asm/arch-sunxi/boot0.h | 1 +
>>>  2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> Will this not affect other boards which use ARM_SOC_BOOT0_HOOK?
>
> That's a valid question, but the answer is: no.
> This roughly same mechanism is used by two Broadcom ARMv7 boards, but
> the usage is different there: they include the boot0.h header file only
> after the vectors (and not only after the initial branch-to-reset).
> So this is already different and not compatible between armv7 and armv8
> right now, so it's not a regression or change this patch is introducing.
>
> I agree it's a bit confusing to have the same header and Kconfig name,
> but a different behaviour, but I don't see a good solution to unify
> this. If you do, I am all ears.

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
index 4f5f6d8..ee393d7 100644
--- a/arch/arm/cpu/armv8/start.S
+++ b/arch/arm/cpu/armv8/start.S
@@ -19,8 +19,6 @@ 
 
 .globl	_start
 _start:
-	b	reset
-
 #ifdef CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK
 /*
  * Various SoCs need something special and SoC-specific up front in
@@ -29,6 +27,8 @@  _start:
  */
 #include <asm/arch/boot0.h>
 ARM_SOC_BOOT0_HOOK
+#else
+	b	reset
 #endif
 
 	.align 3
diff --git a/arch/arm/include/asm/arch-sunxi/boot0.h b/arch/arm/include/asm/arch-sunxi/boot0.h
index ea5675e..6f28d63 100644
--- a/arch/arm/include/asm/arch-sunxi/boot0.h
+++ b/arch/arm/include/asm/arch-sunxi/boot0.h
@@ -9,6 +9,7 @@ 
 
 /* reserve space for BOOT0 header information */
 #define ARM_SOC_BOOT0_HOOK	\
+	b	reset;		\
 	.space	1532
 
 #endif /* __BOOT0_H */