diff mbox

[U-Boot,v2,18/23] sunxi: A64: enable SPL

Message ID 1480902750-839-19-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
Now that the SPL is ready to be compiled in AArch64 and the DRAM
init code is ready, enable SPL support for the A64 SoC and in the
Pine64 defconfig.
For now we keep the boot0 header in the U-Boot proper, as this allows
to still use boot0 as an SPL replacement without hurting the SPL use
case.
We disable FEL support for now, as the code isn't ready yet.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/mach-sunxi/board.c    | 2 +-
 board/sunxi/Kconfig            | 2 ++
 configs/pine64_plus_defconfig  | 1 +
 include/configs/sunxi-common.h | 2 ++
 4 files changed, 6 insertions(+), 1 deletion(-)

Comments

Simon Glass Dec. 5, 2016, 6:26 a.m. UTC | #1
On 4 December 2016 at 18:52, Andre Przywara <andre.przywara@arm.com> wrote:
> Now that the SPL is ready to be compiled in AArch64 and the DRAM
> init code is ready, enable SPL support for the A64 SoC and in the
> Pine64 defconfig.
> For now we keep the boot0 header in the U-Boot proper, as this allows
> to still use boot0 as an SPL replacement without hurting the SPL use
> case.
> We disable FEL support for now, as the code isn't ready yet.

Where is this done? Is it because you don't enable it?

>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  arch/arm/mach-sunxi/board.c    | 2 +-
>  board/sunxi/Kconfig            | 2 ++
>  configs/pine64_plus_defconfig  | 1 +
>  include/configs/sunxi-common.h | 2 ++
>  4 files changed, 6 insertions(+), 1 deletion(-)

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

>
> diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
> index 0f8ead9..80d4b57 100644
> --- a/arch/arm/mach-sunxi/board.c
> +++ b/arch/arm/mach-sunxi/board.c
> @@ -133,7 +133,7 @@ static int gpio_init(void)
>         return 0;
>  }
>
> -#ifdef CONFIG_SPL_BUILD
> +#if defined(CONFIG_SPL_BOARD_LOAD_IMAGE) && defined(CONFIG_SPL_BUILD)
>  static int spl_board_load_image(struct spl_image_info *spl_image,
>                                 struct spl_boot_device *bootdev)
>  {
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index d477925..b5246df 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -125,6 +125,7 @@ config MACH_SUN50I
>         bool "sun50i (Allwinner A64)"
>         select ARM64
>         select SUNXI_GEN_SUN6I
> +       select SUPPORT_SPL
>
>  endchoice
>
> @@ -187,6 +188,7 @@ config DRAM_ODT_EN
>         bool "sunxi dram odt enable"
>         default n if !MACH_SUN8I_A23
>         default y if MACH_SUN8I_A23
> +       default y if MACH_SUN50I
>         ---help---
>         Select this to enable dram odt (on die termination).
>
> diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig
> index ebc24b8..2374170 100644
> --- a/configs/pine64_plus_defconfig
> +++ b/configs/pine64_plus_defconfig
> @@ -5,6 +5,7 @@ CONFIG_MACH_SUN50I=y
>  CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
>  # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
>  CONFIG_CONSOLE_MUX=y
> +CONFIG_SPL=y
>  # CONFIG_CMD_IMLS is not set
>  # CONFIG_CMD_FLASH is not set
>  # CONFIG_CMD_FPGA is not set
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index e05c318..5279e51 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -183,7 +183,9 @@
>
>  #define CONFIG_SPL_FRAMEWORK
>
> +#ifndef CONFIG_MACH_SUN50I
>  #define CONFIG_SPL_BOARD_LOAD_IMAGE
> +#endif
>
>  #if defined(CONFIG_MACH_SUN9I)
>  #define CONFIG_SPL_TEXT_BASE           0x10040         /* sram start+header */
> --
> 2.8.2
>
Andre Przywara Dec. 16, 2016, 5:40 p.m. UTC | #2
Hi,

On 05/12/16 06:26, Simon Glass wrote:
> On 4 December 2016 at 18:52, Andre Przywara <andre.przywara@arm.com> wrote:
>> Now that the SPL is ready to be compiled in AArch64 and the DRAM
>> init code is ready, enable SPL support for the A64 SoC and in the
>> Pine64 defconfig.
>> For now we keep the boot0 header in the U-Boot proper, as this allows
>> to still use boot0 as an SPL replacement without hurting the SPL use
>> case.
>> We disable FEL support for now, as the code isn't ready yet.
> 
> Where is this done? Is it because you don't enable it?

It is done at two places below ....

>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>>  arch/arm/mach-sunxi/board.c    | 2 +-
>>  board/sunxi/Kconfig            | 2 ++
>>  configs/pine64_plus_defconfig  | 1 +
>>  include/configs/sunxi-common.h | 2 ++
>>  4 files changed, 6 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
>>
>> diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
>> index 0f8ead9..80d4b57 100644
>> --- a/arch/arm/mach-sunxi/board.c
>> +++ b/arch/arm/mach-sunxi/board.c
>> @@ -133,7 +133,7 @@ static int gpio_init(void)
>>         return 0;
>>  }
>>
>> -#ifdef CONFIG_SPL_BUILD
>> +#if defined(CONFIG_SPL_BOARD_LOAD_IMAGE) && defined(CONFIG_SPL_BUILD)

Here we disable FEL support if the board or build does not support it.

...

>>  static int spl_board_load_image(struct spl_image_info *spl_image,
>>                                 struct spl_boot_device *bootdev)
>>  {
>> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
>> index d477925..b5246df 100644
>> --- a/board/sunxi/Kconfig
>> +++ b/board/sunxi/Kconfig
>> @@ -125,6 +125,7 @@ config MACH_SUN50I
>>         bool "sun50i (Allwinner A64)"
>>         select ARM64
>>         select SUNXI_GEN_SUN6I
>> +       select SUPPORT_SPL
>>
>>  endchoice
>>
>> @@ -187,6 +188,7 @@ config DRAM_ODT_EN
>>         bool "sunxi dram odt enable"
>>         default n if !MACH_SUN8I_A23
>>         default y if MACH_SUN8I_A23
>> +       default y if MACH_SUN50I
>>         ---help---
>>         Select this to enable dram odt (on die termination).
>>
>> diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig
>> index ebc24b8..2374170 100644
>> --- a/configs/pine64_plus_defconfig
>> +++ b/configs/pine64_plus_defconfig
>> @@ -5,6 +5,7 @@ CONFIG_MACH_SUN50I=y
>>  CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
>>  # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
>>  CONFIG_CONSOLE_MUX=y
>> +CONFIG_SPL=y
>>  # CONFIG_CMD_IMLS is not set
>>  # CONFIG_CMD_FLASH is not set
>>  # CONFIG_CMD_FPGA is not set
>> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
>> index e05c318..5279e51 100644
>> --- a/include/configs/sunxi-common.h
>> +++ b/include/configs/sunxi-common.h
>> @@ -183,7 +183,9 @@
>>
>>  #define CONFIG_SPL_FRAMEWORK
>>
>> +#ifndef CONFIG_MACH_SUN50I
>>  #define CONFIG_SPL_BOARD_LOAD_IMAGE
>> +#endif

... and this one makes sure that it is not enabled for a 64-bit build.
Actually let me change this into ARM64, which is more generic and
describes the reason better.

Also I guess you'd like to see comments here as well ...

Cheers,
Andre.

>>
>>  #if defined(CONFIG_MACH_SUN9I)
>>  #define CONFIG_SPL_TEXT_BASE           0x10040         /* sram start+header */
>> --
>> 2.8.2
>>
Simon Glass Dec. 17, 2016, 10:48 p.m. UTC | #3
On 16 December 2016 at 10:40, Andre Przywara <andre.przywara@arm.com> wrote:
> Hi,
>
> On 05/12/16 06:26, Simon Glass wrote:
>> On 4 December 2016 at 18:52, Andre Przywara <andre.przywara@arm.com> wrote:
>>> Now that the SPL is ready to be compiled in AArch64 and the DRAM
>>> init code is ready, enable SPL support for the A64 SoC and in the
>>> Pine64 defconfig.
>>> For now we keep the boot0 header in the U-Boot proper, as this allows
>>> to still use boot0 as an SPL replacement without hurting the SPL use
>>> case.
>>> We disable FEL support for now, as the code isn't ready yet.
>>
>> Where is this done? Is it because you don't enable it?
>
> It is done at two places below ....
>
>>>
>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>> ---
>>>  arch/arm/mach-sunxi/board.c    | 2 +-
>>>  board/sunxi/Kconfig            | 2 ++
>>>  configs/pine64_plus_defconfig  | 1 +
>>>  include/configs/sunxi-common.h | 2 ++
>>>  4 files changed, 6 insertions(+), 1 deletion(-)
>>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>
>>>
>>> diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
>>> index 0f8ead9..80d4b57 100644
>>> --- a/arch/arm/mach-sunxi/board.c
>>> +++ b/arch/arm/mach-sunxi/board.c
>>> @@ -133,7 +133,7 @@ static int gpio_init(void)
>>>         return 0;
>>>  }
>>>
>>> -#ifdef CONFIG_SPL_BUILD
>>> +#if defined(CONFIG_SPL_BOARD_LOAD_IMAGE) && defined(CONFIG_SPL_BUILD)
>
> Here we disable FEL support if the board or build does not support it.
>
> ...
>
>>>  static int spl_board_load_image(struct spl_image_info *spl_image,
>>>                                 struct spl_boot_device *bootdev)
>>>  {
>>> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
>>> index d477925..b5246df 100644
>>> --- a/board/sunxi/Kconfig
>>> +++ b/board/sunxi/Kconfig
>>> @@ -125,6 +125,7 @@ config MACH_SUN50I
>>>         bool "sun50i (Allwinner A64)"
>>>         select ARM64
>>>         select SUNXI_GEN_SUN6I
>>> +       select SUPPORT_SPL
>>>
>>>  endchoice
>>>
>>> @@ -187,6 +188,7 @@ config DRAM_ODT_EN
>>>         bool "sunxi dram odt enable"
>>>         default n if !MACH_SUN8I_A23
>>>         default y if MACH_SUN8I_A23
>>> +       default y if MACH_SUN50I
>>>         ---help---
>>>         Select this to enable dram odt (on die termination).
>>>
>>> diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig
>>> index ebc24b8..2374170 100644
>>> --- a/configs/pine64_plus_defconfig
>>> +++ b/configs/pine64_plus_defconfig
>>> @@ -5,6 +5,7 @@ CONFIG_MACH_SUN50I=y
>>>  CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
>>>  # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
>>>  CONFIG_CONSOLE_MUX=y
>>> +CONFIG_SPL=y
>>>  # CONFIG_CMD_IMLS is not set
>>>  # CONFIG_CMD_FLASH is not set
>>>  # CONFIG_CMD_FPGA is not set
>>> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
>>> index e05c318..5279e51 100644
>>> --- a/include/configs/sunxi-common.h
>>> +++ b/include/configs/sunxi-common.h
>>> @@ -183,7 +183,9 @@
>>>
>>>  #define CONFIG_SPL_FRAMEWORK
>>>
>>> +#ifndef CONFIG_MACH_SUN50I
>>>  #define CONFIG_SPL_BOARD_LOAD_IMAGE
>>> +#endif
>
> ... and this one makes sure that it is not enabled for a 64-bit build.
> Actually let me change this into ARM64, which is more generic and
> describes the reason better.
>
> Also I guess you'd like to see comments here as well ...
>

Well you could, but if it is temporary perhaps it isn't that important.

Regards,
Simon
diff mbox

Patch

diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 0f8ead9..80d4b57 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -133,7 +133,7 @@  static int gpio_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BOARD_LOAD_IMAGE) && defined(CONFIG_SPL_BUILD)
 static int spl_board_load_image(struct spl_image_info *spl_image,
 				struct spl_boot_device *bootdev)
 {
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index d477925..b5246df 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -125,6 +125,7 @@  config MACH_SUN50I
 	bool "sun50i (Allwinner A64)"
 	select ARM64
 	select SUNXI_GEN_SUN6I
+	select SUPPORT_SPL
 
 endchoice
 
@@ -187,6 +188,7 @@  config DRAM_ODT_EN
 	bool "sunxi dram odt enable"
 	default n if !MACH_SUN8I_A23
 	default y if MACH_SUN8I_A23
+	default y if MACH_SUN50I
 	---help---
 	Select this to enable dram odt (on die termination).
 
diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig
index ebc24b8..2374170 100644
--- a/configs/pine64_plus_defconfig
+++ b/configs/pine64_plus_defconfig
@@ -5,6 +5,7 @@  CONFIG_MACH_SUN50I=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
+CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index e05c318..5279e51 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -183,7 +183,9 @@ 
 
 #define CONFIG_SPL_FRAMEWORK
 
+#ifndef CONFIG_MACH_SUN50I
 #define CONFIG_SPL_BOARD_LOAD_IMAGE
+#endif
 
 #if defined(CONFIG_MACH_SUN9I)
 #define CONFIG_SPL_TEXT_BASE		0x10040		/* sram start+header */