[3/4] boot/arm-trusted-firmware: add support for rockchip rk3399
diff mbox series

Message ID 1581573151-18943-4-git-send-email-sunil@amarulasolutions.com
State Superseded
Headers show
Series
  • Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board
Related show

Commit Message

Suniel Mahesh Feb. 13, 2020, 5:52 a.m. UTC
From: Suniel Mahesh <sunil@amarulasolutions.com>

Add support for TF-A image builds for Rockchip rk3399 chip.

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Sergey Matyukevich Feb. 14, 2020, 8:25 a.m. UTC | #1
> Add support for TF-A image builds for Rockchip rk3399 chip.
> 
> Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
> ---
>  boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> index 3473701..cc757b5 100644
> --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> @@ -90,6 +90,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)
>  ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
>  endif
>  
> +ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)),rk3399)
> +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain
> +endif
> +

As per explanation by Thomas and Jagan, RK3399 ATF needs 32bit ARM
toolchain. Taking into account that different vendors may re-use
the same hardware blocks, it probably makes sense to describe this
dependency in a more generic way, not specific to RK3399 chip.

Following the existing patterns in ATF package mk file, new ATF
config option can be introduced:

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 34737018aa..160884e0ff 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -75,6 +75,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UB
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
 endif
 
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_32BIT_ARM_REQUIRED),y)
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain
+endif
+
 ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y)

This option BR2_TARGET_ARM_TRUSTED_FIRMWARE_32BIT_ARM_REQUIRED then
can be specified in a defconfig for specific board.

Thoughts ? Comments ?

Regards,
Sergey
Suniel Mahesh Feb. 14, 2020, 9:35 a.m. UTC | #2
On Fri, Feb 14, 2020 at 1:55 PM Sergey Matyukevich <geomatsi@gmail.com> wrote:
>
> > Add support for TF-A image builds for Rockchip rk3399 chip.
> >
> > Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
> > ---
> >  boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > index 3473701..cc757b5 100644
> > --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > @@ -90,6 +90,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)
> >  ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
> >  endif
> >
> > +ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)),rk3399)
> > +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain
> > +endif
> > +
>
> As per explanation by Thomas and Jagan, RK3399 ATF needs 32bit ARM
> toolchain. Taking into account that different vendors may re-use
> the same hardware blocks, it probably makes sense to describe this
> dependency in a more generic way, not specific to RK3399 chip.
>
> Following the existing patterns in ATF package mk file, new ATF
> config option can be introduced:
>
> diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> index 34737018aa..160884e0ff 100644
> --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> @@ -75,6 +75,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UB
>  ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
>  endif
>
> +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_32BIT_ARM_REQUIRED),y)
> +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain
> +endif
> +
>  ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y)
>
> This option BR2_TARGET_ARM_TRUSTED_FIRMWARE_32BIT_ARM_REQUIRED then
> can be specified in a defconfig for specific board.
>
> Thoughts ? Comments ?

This will add an extra config option per board (which has such
requirement). Is it an appropriate solution ?
Suniel
>
> Regards,
> Sergey

Patch
diff mbox series

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 3473701..cc757b5 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -90,6 +90,10 @@  ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
 endif
 
+ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)),rk3399)
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain
+endif
+
 ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
 
 ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)