diff mbox

[U-Boot] arm: exynos7420: remove custome low level init function

Message ID 1479302356-3236-1-git-send-email-ta.omasab@gmail.com
State Accepted
Commit 95e74a3df75bf01eaf69f5c28f9aa2db6568e901
Delegated to: York Sun
Headers show

Commit Message

Thomas Abraham Nov. 16, 2016, 1:19 p.m. UTC
From: Thomas Abraham <thomas.ab@samsung.com>

Remove the custom low-level initialization function and reuse the
default low-level initialization function. But this requires the
ARMV8_MULTIENTRY config option to be enabled for Exynos7420.

On Exynos7420, the boot CPU belongs to the second cluster and so
with ARMV8_MULTIENTRY config option enabled, the 'branch_if_master'
macro fails to detect the CPU as boot CPU. As a temporary workaround
the CPU_RELEASE_ADDR is set to point to '_main'.

Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Alison Wang <alison.wang@nxp.com>
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
---
 arch/arm/mach-exynos/Kconfig        |    1 +
 arch/arm/mach-exynos/soc.c          |   18 ++++++++++--------
 include/configs/exynos7420-common.h |    1 +
 3 files changed, 12 insertions(+), 8 deletions(-)

Comments

Alison Wang Nov. 17, 2016, 1:44 a.m. UTC | #1
> From: Thomas Abraham <thomas.ab@samsung.com>
> 
> Remove the custom low-level initialization function and reuse the
> default low-level initialization function. But this requires the
> ARMV8_MULTIENTRY config option to be enabled for Exynos7420.
> 
> On Exynos7420, the boot CPU belongs to the second cluster and so
> with ARMV8_MULTIENTRY config option enabled, the 'branch_if_master'
> macro fails to detect the CPU as boot CPU. As a temporary workaround
> the CPU_RELEASE_ADDR is set to point to '_main'.
> 
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> Cc: Alison Wang <alison.wang@nxp.com>
> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> ---
>  arch/arm/mach-exynos/Kconfig        |    1 +
>  arch/arm/mach-exynos/soc.c          |   18 ++++++++++--------
>  include/configs/exynos7420-common.h |    1 +
>  3 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-
> exynos/Kconfig
> index ce2a16f..07118fc 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -126,6 +126,7 @@ choice
>  config  TARGET_ESPRESSO7420
>  	bool "ESPRESSO7420 board"
>  	select ARM64
> +	select ARMV8_MULTIENTRY
>  	select SUPPORT_SPL
>  	select OF_CONTROL
>  	select SPL_DISABLE_OF_CONTROL
> diff --git a/arch/arm/mach-exynos/soc.c b/arch/arm/mach-exynos/soc.c
> index f9c7468..cf149ad 100644
> --- a/arch/arm/mach-exynos/soc.c
> +++ b/arch/arm/mach-exynos/soc.c
> @@ -9,6 +9,16 @@
>  #include <asm/io.h>
>  #include <asm/system.h>
> 
> +#ifdef CONFIG_TARGET_ESPRESSO7420
> +/*
> + * Exynos7420 uses CPU0 of Cluster-1 as boot CPU. Due to this,
> branch_if_master
> + * fails to identify as the boot CPU as the master CPU. As temporary
> workaround,
> + * setup the slave CPU boot address as "_main".
> + */
> +extern void _main(void);
> +void *secondary_boot_addr = (void *)_main;
> +#endif /* CONFIG_TARGET_ESPRESSO7420 */
> +
>  void reset_cpu(ulong addr)
>  {
>  #ifdef CONFIG_CPU_V7
> @@ -23,11 +33,3 @@ void enable_caches(void)
>  	dcache_enable();
>  }
>  #endif
> -
> -#ifdef CONFIG_ARM64
> -void lowlevel_init(void)
> -{
> -	armv8_switch_to_el2();
> -	armv8_switch_to_el1();
> -}
> -#endif
> diff --git a/include/configs/exynos7420-common.h
> b/include/configs/exynos7420-common.h
> index f7c4709..1cea74e 100644
> --- a/include/configs/exynos7420-common.h
> +++ b/include/configs/exynos7420-common.h
> @@ -47,6 +47,7 @@
>  #define CONFIG_IRAM_BASE		0x02100000
>  #define CONFIG_IRAM_SIZE		0x58000
>  #define CONFIG_IRAM_END			(CONFIG_IRAM_BASE +
> CONFIG_IRAM_SIZE)
> +#define CPU_RELEASE_ADDR		secondary_boot_addr
> 
>  /* Number of CPUs available */
>  #define CONFIG_CORE_COUNT		0x8
>

Reviewed-by: Alison Wang <alison.wang@nxp.com>

Thanks.


Best Regards,
Alison Wang
York Sun Nov. 22, 2016, 7:42 p.m. UTC | #2
On 11/16/2016 05:44 PM, Alison Wang wrote:
>> From: Thomas Abraham <thomas.ab@samsung.com>
>>

> Reviewed-by: Alison Wang <alison.wang@nxp.com>
>

I will merge this patch.

York
York Sun Nov. 23, 2016, 12:58 a.m. UTC | #3
On 11/16/2016 05:44 PM, Alison Wang wrote:
>> From: Thomas Abraham <thomas.ab@samsung.com>
>>
>> Remove the custom low-level initialization function and reuse the
>> default low-level initialization function. But this requires the
>> ARMV8_MULTIENTRY config option to be enabled for Exynos7420.
>>
>> On Exynos7420, the boot CPU belongs to the second cluster and so
>> with ARMV8_MULTIENTRY config option enabled, the 'branch_if_master'
>> macro fails to detect the CPU as boot CPU. As a temporary workaround
>> the CPU_RELEASE_ADDR is set to point to '_main'.
>>
>> Cc: Minkyu Kang <mk7.kang@samsung.com>
>> Cc: Alison Wang <alison.wang@nxp.com>
>> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
>> ---


Applied to fsl-qoriq, awaiting upstream. Thanks.

York
diff mbox

Patch

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index ce2a16f..07118fc 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -126,6 +126,7 @@  choice
 config  TARGET_ESPRESSO7420
 	bool "ESPRESSO7420 board"
 	select ARM64
+	select ARMV8_MULTIENTRY
 	select SUPPORT_SPL
 	select OF_CONTROL
 	select SPL_DISABLE_OF_CONTROL
diff --git a/arch/arm/mach-exynos/soc.c b/arch/arm/mach-exynos/soc.c
index f9c7468..cf149ad 100644
--- a/arch/arm/mach-exynos/soc.c
+++ b/arch/arm/mach-exynos/soc.c
@@ -9,6 +9,16 @@ 
 #include <asm/io.h>
 #include <asm/system.h>
 
+#ifdef CONFIG_TARGET_ESPRESSO7420
+/*
+ * Exynos7420 uses CPU0 of Cluster-1 as boot CPU. Due to this, branch_if_master
+ * fails to identify as the boot CPU as the master CPU. As temporary workaround,
+ * setup the slave CPU boot address as "_main".
+ */
+extern void _main(void);
+void *secondary_boot_addr = (void *)_main;
+#endif /* CONFIG_TARGET_ESPRESSO7420 */
+
 void reset_cpu(ulong addr)
 {
 #ifdef CONFIG_CPU_V7
@@ -23,11 +33,3 @@  void enable_caches(void)
 	dcache_enable();
 }
 #endif
-
-#ifdef CONFIG_ARM64
-void lowlevel_init(void)
-{
-	armv8_switch_to_el2();
-	armv8_switch_to_el1();
-}
-#endif
diff --git a/include/configs/exynos7420-common.h b/include/configs/exynos7420-common.h
index f7c4709..1cea74e 100644
--- a/include/configs/exynos7420-common.h
+++ b/include/configs/exynos7420-common.h
@@ -47,6 +47,7 @@ 
 #define CONFIG_IRAM_BASE		0x02100000
 #define CONFIG_IRAM_SIZE		0x58000
 #define CONFIG_IRAM_END			(CONFIG_IRAM_BASE + CONFIG_IRAM_SIZE)
+#define CPU_RELEASE_ADDR		secondary_boot_addr
 
 /* Number of CPUs available */
 #define CONFIG_CORE_COUNT		0x8