diff mbox series

[U-Boot,v2,04/13] sunxi: change ATF position for H6

Message ID 20180721082032.39980-5-icenowy@aosc.io
State Accepted
Commit 0a21fdd62be117ea781d37805ec569037f2fa6c3
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series Allwinner H6 support (w/ SPL) | expand

Commit Message

Icenowy Zheng July 21, 2018, 8:20 a.m. UTC
H6 has different SRAM A2 address, so the ATF load address is also
different.

Add judgment code to sunxi 64-bit FIT generation script. It will judge
the SoC by the device tree's name.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v2:
- Use CONFIG_MACH_SUN50I_H6 rather than DT prefix to judge H6.

 board/sunxi/mksunxi_fit_atf.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Andre Przywara July 24, 2018, 8:26 a.m. UTC | #1
Hi,

On 21/07/18 09:20, Icenowy Zheng wrote:
> H6 has different SRAM A2 address, so the ATF load address is also
> different.
> 
> Add judgment code to sunxi 64-bit FIT generation script. It will judge
> the SoC by the device tree's name.

This might need to become more flexible in the future, where the ATF
might need to reside somewhere else, even for the existing SoCs, but
it's good enough for now.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Thanks,
Andre.

> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> Changes in v2:
> - Use CONFIG_MACH_SUN50I_H6 rather than DT prefix to judge H6.
> 
>  board/sunxi/mksunxi_fit_atf.sh | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/board/sunxi/mksunxi_fit_atf.sh b/board/sunxi/mksunxi_fit_atf.sh
> index 36abe9efed..88ad719747 100755
> --- a/board/sunxi/mksunxi_fit_atf.sh
> +++ b/board/sunxi/mksunxi_fit_atf.sh
> @@ -13,6 +13,12 @@ if [ ! -f $BL31 ]; then
>  	BL31=/dev/null
>  fi
>  
> +if grep -q "^CONFIG_MACH_SUN50I_H6=y" .config; then
> +	BL31_ADDR=0x104000
> +else
> +	BL31_ADDR=0x44000
> +fi
> +
>  cat << __HEADER_EOF
>  /dts-v1/;
>  
> @@ -35,8 +41,8 @@ cat << __HEADER_EOF
>  			type = "firmware";
>  			arch = "arm64";
>  			compression = "none";
> -			load = <0x44000>;
> -			entry = <0x44000>;
> +			load = <$BL31_ADDR>;
> +			entry = <$BL31_ADDR>;
>  		};
>  __HEADER_EOF
>  
>
Maxime Ripard July 24, 2018, 8:32 a.m. UTC | #2
On Sat, Jul 21, 2018 at 04:20:23PM +0800, Icenowy Zheng wrote:
> H6 has different SRAM A2 address, so the ATF load address is also
> different.
> 
> Add judgment code to sunxi 64-bit FIT generation script. It will judge
> the SoC by the device tree's name.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>

Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Maxime
diff mbox series

Patch

diff --git a/board/sunxi/mksunxi_fit_atf.sh b/board/sunxi/mksunxi_fit_atf.sh
index 36abe9efed..88ad719747 100755
--- a/board/sunxi/mksunxi_fit_atf.sh
+++ b/board/sunxi/mksunxi_fit_atf.sh
@@ -13,6 +13,12 @@  if [ ! -f $BL31 ]; then
 	BL31=/dev/null
 fi
 
+if grep -q "^CONFIG_MACH_SUN50I_H6=y" .config; then
+	BL31_ADDR=0x104000
+else
+	BL31_ADDR=0x44000
+fi
+
 cat << __HEADER_EOF
 /dts-v1/;
 
@@ -35,8 +41,8 @@  cat << __HEADER_EOF
 			type = "firmware";
 			arch = "arm64";
 			compression = "none";
-			load = <0x44000>;
-			entry = <0x44000>;
+			load = <$BL31_ADDR>;
+			entry = <$BL31_ADDR>;
 		};
 __HEADER_EOF