From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Date: Tue, 26 Jun 2018 11:56:18 +0100 Subject: [U-Boot] [linux-sunxi] [PATCH 04/13] sunxi: change ATF position for H6 In-Reply-To: <20180625103723.24760-5-icenowy@aosc.io> References: <20180625103723.24760-1-icenowy@aosc.io> <20180625103723.24760-5-icenowy@aosc.io> Message-ID: <6237b1ab-e294-0f15-3c95-9249be7e150e@arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 25/06/18 11:37, 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. Mmh, would it be better to check for some config symbol to derive the ATF load address? Like: if grep -q "^CONFIG_MACH_SUN50I_H6=y" .config; then ... Relying on a certain wording of the *first* .dtb name sounds a bit more fragile. Or maybe we could even have an explicit config symbol, which is just used by that script? BL31_ADDR=$(grep "^CONFIG_ATF_LOAD_ADDR=" .config | cut -d= -f2) Cheers, Andre. > Signed-off-by: Icenowy Zheng > --- > 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..8540c3d88e 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 [ "$(basename $1 .dtb | cut -d - -f 1-2)" = "sun50i-h6" ]; 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 > >