All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms
@ 2017-12-03 21:48 Thomas Petazzoni
  2017-12-03 21:48 ` [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image Thomas Petazzoni
                   ` (8 more replies)
  0 siblings, 9 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

Hello,

This patch series combines work from Jagan Teki and Sergey Matyukevich
to support more platforms in our ATF (arm-trusted-firmware).

Jagan wants to support Allwinner A64/H5 platforms, which requires a
new build logic between ATF/U-Boot.

So far, the ARM Juno platform that we supported builds U-Boot and then
ATF. ATF encapsulates U-Boot as its BL33. The Allwinner platform takes
a different approach: ATF produces a BL31 binary, which is then
encapsulated by U-Boot. So in one case we have U-Boot then ATF, and in
the other case ATF then U-Boot.

In addition, in the ARM Juno case, we build a FIP image in ATF, while
in the Allwinner case we need to build only a BL31 image.

Jagan made a proposal to solve that, but I was not entirely happy with
the proposal, so here is a different proposal to solve the same
problem.

On top of that, Sergey wanted to support Marvell Armada 7K/8K
platforms. They have the same build logic as ARM Juno, so they require
less changes. However, we need to download the SCP firmware, so a
binaries-marvell package is needed (similar to
boot/vexpress-firmware/), and for some reason the DDR training code is
also shipped separately, so a boot/mv-ddr-marvell/ package is needed.

I have not taken the defconfig additions from Jagan and Sergey in this
series, assumming they would be rebased and reposted once this series
has been merged. Instead, I've added some short test cases for our
testing infrastructure.

Best regards,

Thomas

Jagan Teki (1):
  uboot: add support for bundling ATF BL31 into U-Boot

Sergey Matyukevich (3):
  mv-ddr-marvell: new package
  binaries-marvell: new package
  atf: add support for Marvell Armada SoCs

Thomas Petazzoni (4):
  arm-trusted-firmware: add option to enable/disable building FIP image
  arm-trusted-firmware: add
    BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
  arm-trusted-firmware: allow to generate the BL31 image
  support/testing: add tests for ATF

 DEVELOPERS                                        |  3 +
 boot/Config.in                                    |  2 +
 boot/arm-trusted-firmware/Config.in               | 24 +++++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 30 +++++++--
 boot/binaries-marvell/Config.in                   | 32 +++++++++
 boot/binaries-marvell/binaries-marvell.hash       |  2 +
 boot/binaries-marvell/binaries-marvell.mk         | 22 +++++++
 boot/mv-ddr-marvell/Config.in                     | 10 +++
 boot/mv-ddr-marvell/mv-ddr-marvell.hash           |  2 +
 boot/mv-ddr-marvell/mv-ddr-marvell.mk             | 12 ++++
 boot/uboot/Config.in                              | 10 +++
 boot/uboot/uboot.mk                               |  5 ++
 configs/arm_juno_defconfig                        |  2 +
 support/testing/tests/boot/__init__.py            |  0
 support/testing/tests/boot/test_atf.py            | 79 +++++++++++++++++++++++
 15 files changed, 231 insertions(+), 4 deletions(-)
 create mode 100644 boot/binaries-marvell/Config.in
 create mode 100644 boot/binaries-marvell/binaries-marvell.hash
 create mode 100644 boot/binaries-marvell/binaries-marvell.mk
 create mode 100644 boot/mv-ddr-marvell/Config.in
 create mode 100644 boot/mv-ddr-marvell/mv-ddr-marvell.hash
 create mode 100644 boot/mv-ddr-marvell/mv-ddr-marvell.mk
 create mode 100644 support/testing/tests/boot/__init__.py
 create mode 100644 support/testing/tests/boot/test_atf.py

-- 
2.13.6

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
@ 2017-12-03 21:48 ` Thomas Petazzoni
  2017-12-04 21:10   ` Sergey Matyukevich
                     ` (3 more replies)
  2017-12-03 21:48 ` [Buildroot] [PATCH 2/8] arm-trusted-firmware: add BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 Thomas Petazzoni
                   ` (7 subsequent siblings)
  8 siblings, 4 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

Currently, our arm-trusted-firmware unconditionally builds a FIP
(Firmware Image Package). While this is often needed on platforms
where ATF encapsulates U-Boot, it is not the case on some other
platforms where it's U-Boot that encapsulates parts of ATF.

In order to prepare the support for the later platforms, we make
building the FIP image optional, and update the only defconfig we have
that uses ARM Trusted Firmware.

Note: we considered adding a "default y" here to preserve backward
compatibility, but there really isn't any default that is sane:
whether a FIP image needs to be built or not is purely platform
specific.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 boot/arm-trusted-firmware/Config.in               | 8 ++++++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 8 +++++++-
 configs/arm_juno_defconfig                        | 1 +
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
index 799370cd51..05600461a5 100644
--- a/boot/arm-trusted-firmware/Config.in
+++ b/boot/arm-trusted-firmware/Config.in
@@ -56,6 +56,14 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM
 	help
 	  Target plaform to build for.
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
+	bool "Build FIP image"
+	help
+	  This option enables building the FIP image (Firmware Image
+	  Package). This is typically the image format used by
+	  platforms were ATF encapsulates the second stage bootloader
+	  (such as U-Boot).
+
 config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES
 	string "Additional ATF build variables"
 	help
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 7b1cc6ebb6..bdffb1dbe4 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -39,10 +39,16 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware
 endif
 
+ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
+
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
+ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += fip
+endif
+
 define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) \
 		$(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
-			all fip
+			$(ARM_TRUSTED_FIRMWARE_MAKE_TARGETS)
 endef
 
 define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
diff --git a/configs/arm_juno_defconfig b/configs/arm_juno_defconfig
index 811524ffba..1fb5587488 100644
--- a/configs/arm_juno_defconfig
+++ b/configs/arm_juno_defconfig
@@ -14,6 +14,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.2"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="juno"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="vexpress_aemv8a_juno"
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 2/8] arm-trusted-firmware: add BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
  2017-12-03 21:48 ` [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image Thomas Petazzoni
@ 2017-12-03 21:48 ` Thomas Petazzoni
  2017-12-08 12:35   ` Peter Korsgaard
  2017-12-03 21:48 ` [Buildroot] [PATCH 3/8] arm-trusted-firmware: allow to generate the BL31 image Thomas Petazzoni
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

ATF can be used in different ways:

 - ATF encapsulates U-Boot as the BL33, which is what is done on ARM
   Juno (currently supported in Buildroot) and Marvell platforms (soon
   to be supported)

 - U-Boot encapsulates ATF's BL31, which is what is done on Allwinner
   ARM64 platforms.

Until now we were assumming the former was always the case, but
obviously it isn't. Therefore, this patch adds an option that allows
to explicitly tell ATF that it encapsulates U-Boot as its BL33.

We adapt the only defconfig that uses ATF so that it enables this
option as appropriate.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Another approach that would be more generic, but less user-friendly,
would be to have two options:

 - BR2_TARGET_ARM_TRUSTED_FIRMARE_BL33_PACKAGE, giving the name of the
   Buildroot package that provides the BL33.

 - BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL33_PATH, giving the path to the
   BL33 binary that needs to be encapsulated in ATF.

If this alternative approach is preferred, I can adapt the patches
accordingly. I hesitated between the two approaches, and really
couldn't make up my mind.
---
 boot/arm-trusted-firmware/Config.in               | 9 +++++++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 8 +++++---
 configs/arm_juno_defconfig                        | 1 +
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
index 05600461a5..b8b926982e 100644
--- a/boot/arm-trusted-firmware/Config.in
+++ b/boot/arm-trusted-firmware/Config.in
@@ -64,6 +64,15 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
 	  platforms were ATF encapsulates the second stage bootloader
 	  (such as U-Boot).
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
+	bool "Use U-Boot as BL33"
+	depends on BR2_TARGET_UBOOT
+	help
+	  This option allows to embed u-boot.bin as the BL33 part of
+	  the ARM Trusted Firmware. It ensures that the u-boot package
+	  gets built before ATF, and that the appropriate BL33
+	  variable pointing to u-boot.bin is passed when building ATF.
+
 config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES
 	string "Additional ATF build variables"
 	help
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index bdffb1dbe4..3731829d5d 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -8,8 +8,6 @@ ARM_TRUSTED_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_V
 ARM_TRUSTED_FIRMWARE_LICENSE = BSD-3-Clause
 ARM_TRUSTED_FIRMWARE_LICENSE_FILES = license.rst
 
-ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
-
 ifeq ($(ARM_TRUSTED_FIRMWARE_VERSION),custom)
 # Handle custom ATF tarballs as specified by the configuration
 ARM_TRUSTED_FIRMWARE_TARBALL = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION))
@@ -30,10 +28,14 @@ ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_
 
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	BL33=$(BINARIES_DIR)/u-boot.bin \
 	$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \
 	PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM)
 
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot.bin
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
+endif
+
 ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y)
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware
diff --git a/configs/arm_juno_defconfig b/configs/arm_juno_defconfig
index 1fb5587488..54506d8061 100644
--- a/configs/arm_juno_defconfig
+++ b/configs/arm_juno_defconfig
@@ -15,6 +15,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.2"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="juno"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="vexpress_aemv8a_juno"
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 3/8] arm-trusted-firmware: allow to generate the BL31 image
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
  2017-12-03 21:48 ` [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image Thomas Petazzoni
  2017-12-03 21:48 ` [Buildroot] [PATCH 2/8] arm-trusted-firmware: add BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 Thomas Petazzoni
@ 2017-12-03 21:48 ` Thomas Petazzoni
  2017-12-06 16:28   ` Jagan Teki
  2017-12-08 12:35   ` Peter Korsgaard
  2017-12-03 21:48 ` [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot Thomas Petazzoni
                   ` (5 subsequent siblings)
  8 siblings, 2 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

Some platforms (e.g Allwinner ARM64) don't build a FIP image out of
ATF, but only a BL31 image, which is then encapsulated in U-Boot. This
commit adds an ATF option to build such an image.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 boot/arm-trusted-firmware/Config.in               | 7 +++++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
index b8b926982e..7aef87cb74 100644
--- a/boot/arm-trusted-firmware/Config.in
+++ b/boot/arm-trusted-firmware/Config.in
@@ -64,6 +64,13 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
 	  platforms were ATF encapsulates the second stage bootloader
 	  (such as U-Boot).
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
+	bool "Build BL31 image"
+	help
+	  This option enables building the BL31 image. This is
+	  typically used on platforms where another bootloader (e.g
+	  U-Boot) encapsulates ATF BL31.
+
 config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
 	bool "Use U-Boot as BL33"
 	depends on BR2_TARGET_UBOOT
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 3731829d5d..0aa7c9b492 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -47,6 +47,10 @@ ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
 ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += fip
 endif
 
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31),y)
+ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += bl31
+endif
+
 define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) \
 		$(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2017-12-03 21:48 ` [Buildroot] [PATCH 3/8] arm-trusted-firmware: allow to generate the BL31 image Thomas Petazzoni
@ 2017-12-03 21:48 ` Thomas Petazzoni
  2017-12-06 16:29   ` Jagan Teki
  2017-12-08 12:37   ` Peter Korsgaard
  2017-12-03 21:48 ` [Buildroot] [PATCH 5/8] mv-ddr-marvell: new package Thomas Petazzoni
                   ` (4 subsequent siblings)
  8 siblings, 2 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

From: Jagan Teki <jagannadh.teki@gmail.com>

Some ARM64 platforms (such as Allwinner A64/H5) have a boot process
where U-Boot encapsulates the BL31 part of the ARM trusted
firmware. For such platforms, we need to build ATF before U-Boot, and
pass a BL31 variable pointing to ATF bl31.bin to the U-Boot build
process.

This commit introduces a BR2_TARGET_UBOOT_NEEDS_ATF_BL31 variable to
achieve this.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
[Thomas:
 - Rename option to BR2_TARGET_UBOOT_NEEDS_ATF_BL31
 - Drop changes to arm-trusted-firmware.mk, they are taken care of by
   previous commits.
 - Improve Config.in help text
 - Add missing dependency on arm-trusted-firmware when
   BR2_TARGET_UBOOT_NEEDS_ATF_BL31 is enabled.
 - Use bl31.bin from $(BINARIES_DIR) instead of taking it from ATF's
   build dir.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 boot/uboot/Config.in | 10 ++++++++++
 boot/uboot/uboot.mk  |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 0e109d0977..8fa189f410 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -158,6 +158,16 @@ config BR2_TARGET_UBOOT_NEEDS_OPENSSL
 	  typically the case when the board configuration has
 	  CONFIG_FIT_SIGNATURE enabled.
 
+config BR2_TARGET_UBOOT_NEEDS_ATF_BL31
+	bool "U-Boot needs ATF BL31"
+	depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
+	help
+	  Some specific platforms (such as Allwinner A64/H5)
+	  encapsulate the BL31 part of ATF inside U-Boot. This option
+	  makes sure ATF gets built prior to U-Boot, and that the BL31
+	  variable pointing to ATF's BL31 binary, is passed during the
+	  Buildroot build.
+
 menu "U-Boot binary format"
 
 config BR2_TARGET_UBOOT_FORMAT_AIS
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index a1fac7dcae..39175999ec 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -134,6 +134,11 @@ UBOOT_MAKE_OPTS += \
 	HOSTCC="$(HOSTCC) $(HOST_CFLAGS)" \
 	HOSTLDFLAGS="$(HOST_LDFLAGS)"
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31),y)
+UBOOT_DEPENDENCIES += arm-trusted-firmware
+UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.bin
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
 UBOOT_DEPENDENCIES += host-dtc
 endif
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 5/8] mv-ddr-marvell: new package
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2017-12-03 21:48 ` [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot Thomas Petazzoni
@ 2017-12-03 21:48 ` Thomas Petazzoni
  2017-12-08 12:42   ` Peter Korsgaard
  2017-12-03 21:48 ` [Buildroot] [PATCH 6/8] binaries-marvell: " Thomas Petazzoni
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

From: Sergey Matyukevich <geomatsi@gmail.com>

This package adds Marvell Armada SoC DDR training algorithms.
This code is not built separately, it is needed as dependency
to build ATF firmware for Marvell Armada SoCs.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
[Thomas:
 - Remove MV_DDR_MARVELL_SRC_SYMLINK, ATF will directly pick up the
   mv-ddr-marvell code from where it is.
 - Use "mv-ddr-marvell" as the Config.in prompt, and in the comment
   header of the .mk file.
 - Add upstream URL in Config.in help text
 - Adjust license information.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 DEVELOPERS                              |  1 +
 boot/Config.in                          |  1 +
 boot/mv-ddr-marvell/Config.in           | 10 ++++++++++
 boot/mv-ddr-marvell/mv-ddr-marvell.hash |  2 ++
 boot/mv-ddr-marvell/mv-ddr-marvell.mk   | 12 ++++++++++++
 5 files changed, 26 insertions(+)
 create mode 100644 boot/mv-ddr-marvell/Config.in
 create mode 100644 boot/mv-ddr-marvell/mv-ddr-marvell.hash
 create mode 100644 boot/mv-ddr-marvell/mv-ddr-marvell.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index c44e8aee50..9d114b5a29 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1508,6 +1508,7 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <geomatsi@gmail.com>
+F:	boot/mv-ddr-marvell/
 F:	board/linksprite/pcduino
 F:	board/orangepi/orangepi-zero
 F:	board/orangepi/orangepi-one
diff --git a/boot/Config.in b/boot/Config.in
index 2f46c8546e..3950c49524 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -10,6 +10,7 @@ source "boot/boot-wrapper-aarch64/Config.in"
 source "boot/grub2/Config.in"
 source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
+source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
diff --git a/boot/mv-ddr-marvell/Config.in b/boot/mv-ddr-marvell/Config.in
new file mode 100644
index 0000000000..6cf6eec9ae
--- /dev/null
+++ b/boot/mv-ddr-marvell/Config.in
@@ -0,0 +1,10 @@
+config BR2_TARGET_MV_DDR_MARVELL
+	bool "mv-ddr-marvell"
+	depends on BR2_aarch64
+	help
+	  Marvell keeps algorithms for DDR training in a separate
+	  repository. This code is not built separately, it is needed
+	  as dependency to build ATF firmware for Marvell Armada 7040
+	  and 8040 SoCs.
+
+	  https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/
diff --git a/boot/mv-ddr-marvell/mv-ddr-marvell.hash b/boot/mv-ddr-marvell/mv-ddr-marvell.hash
new file mode 100644
index 0000000000..b96d4d2bc8
--- /dev/null
+++ b/boot/mv-ddr-marvell/mv-ddr-marvell.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 d413546367ffa3b5f4373a777b9efeb32dcc74d6106897c248935ecb79afc454 mv-ddr-marvell-656440a9690f3d07be9e3d2c39d7cf56fd96eb7b.tar.gz
diff --git a/boot/mv-ddr-marvell/mv-ddr-marvell.mk b/boot/mv-ddr-marvell/mv-ddr-marvell.mk
new file mode 100644
index 0000000000..0f98fc2cef
--- /dev/null
+++ b/boot/mv-ddr-marvell/mv-ddr-marvell.mk
@@ -0,0 +1,12 @@
+################################################################################
+#
+# mv-ddr-marvell
+#
+################################################################################
+
+MV_DDR_MARVELL_VERSION = 656440a9690f3d07be9e3d2c39d7cf56fd96eb7b
+MV_DDR_MARVELL_SITE = $(call github,MarvellEmbeddedProcessors,mv-ddr-marvell,$(MV_DDR_MARVELL_VERSION))
+MV_DDR_MARVELL_LICENSE = GPL-2.0+ or LGPL-2.1 with freertos-exception-2.0, BSD-3-Clause, Marvell Commercial
+MV_DDR_MARVELL_LICENSE_FILES = ddr3_init.c
+
+$(eval $(generic-package))
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 6/8] binaries-marvell: new package
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2017-12-03 21:48 ` [Buildroot] [PATCH 5/8] mv-ddr-marvell: new package Thomas Petazzoni
@ 2017-12-03 21:48 ` Thomas Petazzoni
  2017-12-04 20:17   ` Sergey Matyukevich
  2017-12-03 21:48 ` [Buildroot] [PATCH 7/8] atf: add support for Marvell Armada SoCs Thomas Petazzoni
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

From: Sergey Matyukevich <geomatsi@gmail.com>

Some systems, including Marvell Armada 7k/8k SoCs, have a separate
System Control Processor (SCP) for power management, clocks, reset
and system control. ATF Boot Loader stage 2 (BL2) loads optional
SCP_BL2 image into a platform-specific region of secure memory.

This package adds SCP_BL2 firmware for Marvell Armada 7040 and 8040 SoCs.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
[Thomas:
 - Use "binaries-marvell" in the Config.in prompt and in the .mk file
   header.
 - Change the license information.
 - Adjust license information: it is GPL-2.0 with the FreeRTOS
   exception, and therefore can be redistributed.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 DEVELOPERS                                  |  1 +
 boot/Config.in                              |  1 +
 boot/binaries-marvell/Config.in             | 32 +++++++++++++++++++++++++++++
 boot/binaries-marvell/binaries-marvell.hash |  2 ++
 boot/binaries-marvell/binaries-marvell.mk   | 22 ++++++++++++++++++++
 5 files changed, 58 insertions(+)
 create mode 100644 boot/binaries-marvell/Config.in
 create mode 100644 boot/binaries-marvell/binaries-marvell.hash
 create mode 100644 boot/binaries-marvell/binaries-marvell.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 9d114b5a29..9115892d5c 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1508,6 +1508,7 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <geomatsi@gmail.com>
+F:	boot/binaries-marvell/
 F:	boot/mv-ddr-marvell/
 F:	board/linksprite/pcduino
 F:	board/orangepi/orangepi-zero
diff --git a/boot/Config.in b/boot/Config.in
index 3950c49524..3687c41a2c 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -6,6 +6,7 @@ source "boot/at91bootstrap3/Config.in"
 source "boot/at91dataflashboot/Config.in"
 source "boot/arm-trusted-firmware/Config.in"
 source "boot/barebox/Config.in"
+source "boot/binaries-marvell/Config.in"
 source "boot/boot-wrapper-aarch64/Config.in"
 source "boot/grub2/Config.in"
 source "boot/gummiboot/Config.in"
diff --git a/boot/binaries-marvell/Config.in b/boot/binaries-marvell/Config.in
new file mode 100644
index 0000000000..d565e4dbfd
--- /dev/null
+++ b/boot/binaries-marvell/Config.in
@@ -0,0 +1,32 @@
+config BR2_TARGET_BINARIES_MARVELL
+	bool "binaries-marvell"
+	depends on BR2_aarch64
+	help
+	  Some systems, including Marvell Armada SoC, have a separate
+	  System Control Processor (SCP) for power management, clocks,
+	  reset and system control. ATF Boot Loader stage 2 (BL2) loads
+	  optional SCP_BL2 image into a platform-specific region
+	  of secure memory. This package downloads and installs such
+	  firmwares, which are needed to build ATF.
+
+	  https://github.com/MarvellEmbeddedProcessors/binaries-marvell/
+
+if BR2_TARGET_BINARIES_MARVELL
+
+choice
+	prompt "Marvell Armada platform"
+
+config BR2_TARGET_BINARIES_MARVELL_7040
+	bool "7040"
+
+config BR2_TARGET_BINARIES_MARVELL_8040
+	bool "8040"
+
+endchoice
+
+config BR2_TARGET_BINARIES_MARVELL_IMAGE
+	string
+	default "mrvl_scp_bl2_8040.img" if BR2_TARGET_BINARIES_MARVELL_8040
+	default "mrvl_scp_bl2_7040.img" if BR2_TARGET_BINARIES_MARVELL_7040
+
+endif
diff --git a/boot/binaries-marvell/binaries-marvell.hash b/boot/binaries-marvell/binaries-marvell.hash
new file mode 100644
index 0000000000..401584dacd
--- /dev/null
+++ b/boot/binaries-marvell/binaries-marvell.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 22a201542d8f93cf88623065db5f3377822b59cbfdf98a8e60cdee629273d3a0 binaries-marvell-0dabe23b956420b0928d337d635f0cd5646c33d0.tar.gz
diff --git a/boot/binaries-marvell/binaries-marvell.mk b/boot/binaries-marvell/binaries-marvell.mk
new file mode 100644
index 0000000000..e2bd4f2499
--- /dev/null
+++ b/boot/binaries-marvell/binaries-marvell.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# binaries-marvell
+#
+################################################################################
+
+BINARIES_MARVELL_VERSION = 0dabe23b956420b0928d337d635f0cd5646c33d0
+BINARIES_MARVELL_SITE = $(call github,MarvellEmbeddedProcessors,binaries-marvell,$(BINARIES_MARVELL_VERSION))
+
+# The license text is only available in the master branch, which is
+# not used in this package. See
+# https://raw.githubusercontent.com/MarvellEmbeddedProcessors/binaries-marvell/master/README.md.
+BINARIES_MARVELL_LICENSE = GPL-2.0 with freertos-exception-2.0
+
+BINARIES_MARVELL_IMAGE = $(call qstrip,$(BR2_TARGET_BINARIES_MARVELL_IMAGE))
+BINARIES_MARVELL_INSTALL_IMAGES  = YES
+
+define BINARIES_MARVELL_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/$(BINARIES_MARVELL_IMAGE) $(BINARIES_DIR)/scp-fw.bin
+endef
+
+$(eval $(generic-package))
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 7/8] atf: add support for Marvell Armada SoCs
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2017-12-03 21:48 ` [Buildroot] [PATCH 6/8] binaries-marvell: " Thomas Petazzoni
@ 2017-12-03 21:48 ` Thomas Petazzoni
  2017-12-08 17:59   ` Peter Korsgaard
  2017-12-03 21:48 ` [Buildroot] [PATCH 8/8] support/testing: add tests for ATF Thomas Petazzoni
  2017-12-06 16:26 ` [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Jagan Teki
  8 siblings, 1 reply; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

From: Sergey Matyukevich <geomatsi@gmail.com>

Add Marvell Armada 7k/8k SoCs support to arm-trusted-firmware package.
Marvell ATF needs two additional dependencies:
DDR training code and SCP_BL2 image.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
[Thomas: adjust to previous ATF changes.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 DEVELOPERS                                        |  1 +
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 9115892d5c..4a82b6ecfb 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1508,6 +1508,7 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <geomatsi@gmail.com>
+F:	boot/arm-trusted-firmware/
 F:	boot/binaries-marvell/
 F:	boot/mv-ddr-marvell/
 F:	board/linksprite/pcduino
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 0aa7c9b492..e8d1c6205b 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -41,6 +41,16 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware
 endif
 
+ifeq ($(BR2_TARGET_BINARIES_MARVELL),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += binaries-marvell
+endif
+
+ifeq ($(BR2_TARGET_MV_DDR_MARVELL),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
+endif
+
 ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
 
 ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 8/8] support/testing: add tests for ATF
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
                   ` (6 preceding siblings ...)
  2017-12-03 21:48 ` [Buildroot] [PATCH 7/8] atf: add support for Marvell Armada SoCs Thomas Petazzoni
@ 2017-12-03 21:48 ` Thomas Petazzoni
  2017-12-04 20:33   ` Sergey Matyukevich
  2017-12-08 18:02   ` Peter Korsgaard
  2017-12-06 16:26 ` [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Jagan Teki
  8 siblings, 2 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:48 UTC (permalink / raw)
  To: buildroot

These new tests only do build tests, but allow to quickly verify that
the ATF/U-Boot combinations for vexpress, Allwinner and Marvell
platforms all continue to build properly.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 support/testing/tests/boot/__init__.py |  0
 support/testing/tests/boot/test_atf.py | 79 ++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 support/testing/tests/boot/__init__.py
 create mode 100644 support/testing/tests/boot/test_atf.py

diff --git a/support/testing/tests/boot/__init__.py b/support/testing/tests/boot/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/support/testing/tests/boot/test_atf.py b/support/testing/tests/boot/test_atf.py
new file mode 100644
index 0000000000..02f93b9201
--- /dev/null
+++ b/support/testing/tests/boot/test_atf.py
@@ -0,0 +1,79 @@
+import os
+import infra.basetest
+
+class TestATFVexpress(infra.basetest.BRTest):
+    config = \
+    """
+    BR2_aarch64=y
+    BR2_TOOLCHAIN_EXTERNAL=y
+    BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.2"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="juno"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y
+    BR2_TARGET_UBOOT=y
+    BR2_TARGET_UBOOT_BOARDNAME="vexpress_aemv8a_juno"
+    BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+    BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.03"
+    BR2_TARGET_VEXPRESS_FIRMWARE=y
+    """
+
+    def test_run(self):
+        pass
+
+class TestATFAllwinner(infra.basetest.BRTest):
+    config = \
+    """
+    BR2_aarch64=y
+    BR2_TOOLCHAIN_EXTERNAL=y
+    BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/apritzel/arm-trusted-firmware.git"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="sun50iw1p1"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="aa75c8da415158a94b82a430b2b40000778e851f"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
+    BR2_TARGET_UBOOT=y
+    BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+    BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+    BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.09"
+    BR2_TARGET_UBOOT_BOARD_DEFCONFIG="bananapi_m64"
+    BR2_TARGET_UBOOT_NEEDS_DTC=y
+    BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+    BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+    BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
+    BR2_TARGET_UBOOT_SPL=y
+    BR2_TARGET_UBOOT_SPL_NAME="spl/sunxi-spl.bin"
+    """
+
+    def test_run(self):
+        pass
+
+class TestATFMarvell(infra.basetest.BRTest):
+    config = \
+    """
+    BR2_aarch64=y
+    BR2_TOOLCHAIN_EXTERNAL=y
+    BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/MarvellEmbeddedProcessors/atf-marvell.git"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="atf-v1.3-armada-17.10"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="a80x0_mcbin"
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y
+    BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="USE_COHERENT_MEM=0"
+    BR2_TARGET_BINARIES_MARVELL=y
+    BR2_TARGET_BINARIES_MARVELL_8040=y
+    BR2_TARGET_MV_DDR_MARVELL=y
+    BR2_TARGET_UBOOT=y
+    BR2_TARGET_UBOOT_BOARDNAME="mvebu_mcbin-88f8040"
+    BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+    BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.09"
+    """
+
+    def test_run(self):
+        pass
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 6/8] binaries-marvell: new package
  2017-12-03 21:48 ` [Buildroot] [PATCH 6/8] binaries-marvell: " Thomas Petazzoni
@ 2017-12-04 20:17   ` Sergey Matyukevich
  0 siblings, 0 replies; 28+ messages in thread
From: Sergey Matyukevich @ 2017-12-04 20:17 UTC (permalink / raw)
  To: buildroot

> This package adds SCP_BL2 firmware for Marvell Armada 7040 and 8040 SoCs.
> 
> Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
> [Thomas:
>  - Use "binaries-marvell" in the Config.in prompt and in the .mk file
>    header.
>  - Change the license information.
>  - Adjust license information: it is GPL-2.0 with the FreeRTOS

Indeed, it looks like this firmware is based on FreeRTOS. Even
firmware blobs from 17.10 branch contain FreeRTOS strings. However
I would second the approach suggested by Baruch Siach: lets fall
back to a more conservative approach and specify PROPRIETARY until
we have a clarfication from Marvell.

Regards,
Sergey

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 8/8] support/testing: add tests for ATF
  2017-12-03 21:48 ` [Buildroot] [PATCH 8/8] support/testing: add tests for ATF Thomas Petazzoni
@ 2017-12-04 20:33   ` Sergey Matyukevich
  2017-12-08 18:02   ` Peter Korsgaard
  1 sibling, 0 replies; 28+ messages in thread
From: Sergey Matyukevich @ 2017-12-04 20:33 UTC (permalink / raw)
  To: buildroot

On Sun, Dec 03, 2017 at 10:48:11PM +0100, Thomas Petazzoni wrote:
> These new tests only do build tests, but allow to quickly verify that
> the ATF/U-Boot combinations for vexpress, Allwinner and Marvell
> platforms all continue to build properly.

This patch made my day! I utterly missed the fact that
buildroot had gained this 'unit-test' kind of feature.

Regards,
Sergey

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image
  2017-12-03 21:48 ` [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image Thomas Petazzoni
@ 2017-12-04 21:10   ` Sergey Matyukevich
  2017-12-06 16:09   ` Danomi Manchego
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 28+ messages in thread
From: Sergey Matyukevich @ 2017-12-04 21:10 UTC (permalink / raw)
  To: buildroot

On Sun, Dec 03, 2017 at 10:48:04PM +0100, Thomas Petazzoni wrote:
> Currently, our arm-trusted-firmware unconditionally builds a FIP
> (Firmware Image Package). While this is often needed on platforms
> where ATF encapsulates U-Boot, it is not the case on some other
> platforms where it's U-Boot that encapsulates parts of ATF.
> 
> In order to prepare the support for the later platforms, we make
> building the FIP image optional, and update the only defconfig we have
> that uses ARM Trusted Firmware.
> 
> Note: we considered adding a "default y" here to preserve backward
> compatibility, but there really isn't any default that is sane:
> whether a FIP image needs to be built or not is purely platform
> specific.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

For the whole patchset:
Reviewed-by: Sergey Matyukevich <geomatsi@gmail.com>

Regards,
Sergey

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image
  2017-12-03 21:48 ` [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image Thomas Petazzoni
  2017-12-04 21:10   ` Sergey Matyukevich
@ 2017-12-06 16:09   ` Danomi Manchego
  2017-12-08  9:14   ` Peter Korsgaard
  2017-12-08 12:34   ` Peter Korsgaard
  3 siblings, 0 replies; 28+ messages in thread
From: Danomi Manchego @ 2017-12-06 16:09 UTC (permalink / raw)
  To: buildroot

Thomas,

On Sun, Dec 3, 2017 at 4:48 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Currently, our arm-trusted-firmware unconditionally builds a FIP
> (Firmware Image Package). While this is often needed on platforms
> where ATF encapsulates U-Boot, it is not the case on some other
> platforms where it's U-Boot that encapsulates parts of ATF.
>
> In order to prepare the support for the later platforms, we make
> building the FIP image optional, and update the only defconfig we have
> that uses ARM Trusted Firmware.
>
> Note: we considered adding a "default y" here to preserve backward
> compatibility, but there really isn't any default that is sane:
> whether a FIP image needs to be built or not is purely platform
> specific.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  boot/arm-trusted-firmware/Config.in               | 8 ++++++++
>  boot/arm-trusted-firmware/arm-trusted-firmware.mk | 8 +++++++-
>  configs/arm_juno_defconfig                        | 1 +
>  3 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
> index 799370cd51..05600461a5 100644
> --- a/boot/arm-trusted-firmware/Config.in
> +++ b/boot/arm-trusted-firmware/Config.in
> @@ -56,6 +56,14 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM
>         help
>           Target plaform to build for.
>
> +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
> +       bool "Build FIP image"
> +       help
> +         This option enables building the FIP image (Firmware Image
> +         Package). This is typically the image format used by
> +         platforms were ATF encapsulates the second stage bootloader
> +         (such as U-Boot).
> +
>  config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES
>         string "Additional ATF build variables"
>         help
> diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> index 7b1cc6ebb6..bdffb1dbe4 100644
> --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> @@ -39,10 +39,16 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
>  ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware
>  endif
>
> +ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
> +
> +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
> +ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += fip

When ATF v1.4 is used, the "fiptool" build fails if I uninstall
Ubuntu's libssl-dev:

  CC      fiptool.c
fiptool.c:21:25: fatal error: openssl/sha.h: No such file or directory

So I think you need:

ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-openssl

Regards,
Danomi -


> +endif
> +
>  define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
>         $(TARGET_CONFIGURE_OPTS) \
>                 $(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
> -                       all fip
> +                       $(ARM_TRUSTED_FIRMWARE_MAKE_TARGETS)
>  endef
>
>  define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
> diff --git a/configs/arm_juno_defconfig b/configs/arm_juno_defconfig
> index 811524ffba..1fb5587488 100644
> --- a/configs/arm_juno_defconfig
> +++ b/configs/arm_juno_defconfig
> @@ -14,6 +14,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.2"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="juno"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
>  BR2_TARGET_UBOOT=y
>  BR2_TARGET_UBOOT_BOARDNAME="vexpress_aemv8a_juno"
>  BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> --
> 2.13.6
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms
  2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
                   ` (7 preceding siblings ...)
  2017-12-03 21:48 ` [Buildroot] [PATCH 8/8] support/testing: add tests for ATF Thomas Petazzoni
@ 2017-12-06 16:26 ` Jagan Teki
  8 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2017-12-06 16:26 UTC (permalink / raw)
  To: buildroot

On Mon, Dec 4, 2017 at 3:18 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> This patch series combines work from Jagan Teki and Sergey Matyukevich
> to support more platforms in our ATF (arm-trusted-firmware).
>
> Jagan wants to support Allwinner A64/H5 platforms, which requires a
> new build logic between ATF/U-Boot.
>
> So far, the ARM Juno platform that we supported builds U-Boot and then
> ATF. ATF encapsulates U-Boot as its BL33. The Allwinner platform takes
> a different approach: ATF produces a BL31 binary, which is then
> encapsulated by U-Boot. So in one case we have U-Boot then ATF, and in
> the other case ATF then U-Boot.
>
> In addition, in the ARM Juno case, we build a FIP image in ATF, while
> in the Allwinner case we need to build only a BL31 image.
>
> Jagan made a proposal to solve that, but I was not entirely happy with
> the proposal, so here is a different proposal to solve the same
> problem.
>
> On top of that, Sergey wanted to support Marvell Armada 7K/8K
> platforms. They have the same build logic as ARM Juno, so they require
> less changes. However, we need to download the SCP firmware, so a
> binaries-marvell package is needed (similar to
> boot/vexpress-firmware/), and for some reason the DDR training code is
> also shipped separately, so a boot/mv-ddr-marvell/ package is needed.
>
> I have not taken the defconfig additions from Jagan and Sergey in this
> series, assumming they would be rebased and reposted once this series
> has been merged. Instead, I've added some short test cases for our
> testing infrastructure.
>
> Best regards,
>
> Thomas
>
> Jagan Teki (1):
>   uboot: add support for bundling ATF BL31 into U-Boot
>
> Sergey Matyukevich (3):
>   mv-ddr-marvell: new package
>   binaries-marvell: new package
>   atf: add support for Marvell Armada SoCs
>
> Thomas Petazzoni (4):
>   arm-trusted-firmware: add option to enable/disable building FIP image
>   arm-trusted-firmware: add
>     BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
>   arm-trusted-firmware: allow to generate the BL31 image
>   support/testing: add tests for ATF

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

thanks!
-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 3/8] arm-trusted-firmware: allow to generate the BL31 image
  2017-12-03 21:48 ` [Buildroot] [PATCH 3/8] arm-trusted-firmware: allow to generate the BL31 image Thomas Petazzoni
@ 2017-12-06 16:28   ` Jagan Teki
  2017-12-08 12:35   ` Peter Korsgaard
  1 sibling, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2017-12-06 16:28 UTC (permalink / raw)
  To: buildroot

On Mon, Dec 4, 2017 at 3:18 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Some platforms (e.g Allwinner ARM64) don't build a FIP image out of
> ATF, but only a BL31 image, which is then encapsulated in U-Boot. This
> commit adds an ATF option to build such an image.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Tested-by: Jagan Teki <jagan@amarulasolutions.com>

thanks!
-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot
  2017-12-03 21:48 ` [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot Thomas Petazzoni
@ 2017-12-06 16:29   ` Jagan Teki
  2017-12-08 12:37   ` Peter Korsgaard
  1 sibling, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2017-12-06 16:29 UTC (permalink / raw)
  To: buildroot

On Mon, Dec 4, 2017 at 3:18 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> From: Jagan Teki <jagannadh.teki@gmail.com>
>
> Some ARM64 platforms (such as Allwinner A64/H5) have a boot process
> where U-Boot encapsulates the BL31 part of the ARM trusted
> firmware. For such platforms, we need to build ATF before U-Boot, and
> pass a BL31 variable pointing to ATF bl31.bin to the U-Boot build
> process.
>
> This commit introduces a BR2_TARGET_UBOOT_NEEDS_ATF_BL31 variable to
> achieve this.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> [Thomas:
>  - Rename option to BR2_TARGET_UBOOT_NEEDS_ATF_BL31
>  - Drop changes to arm-trusted-firmware.mk, they are taken care of by
>    previous commits.
>  - Improve Config.in help text
>  - Add missing dependency on arm-trusted-firmware when
>    BR2_TARGET_UBOOT_NEEDS_ATF_BL31 is enabled.
>  - Use bl31.bin from $(BINARIES_DIR) instead of taking it from ATF's
>    build dir.]
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---

Tested-by: Jagan Teki <jagan@amarulasolutions.com>

-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image
  2017-12-03 21:48 ` [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image Thomas Petazzoni
  2017-12-04 21:10   ` Sergey Matyukevich
  2017-12-06 16:09   ` Danomi Manchego
@ 2017-12-08  9:14   ` Peter Korsgaard
  2017-12-08 12:34   ` Peter Korsgaard
  3 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-08  9:14 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Currently, our arm-trusted-firmware unconditionally builds a FIP
 > (Firmware Image Package). While this is often needed on platforms
 > where ATF encapsulates U-Boot, it is not the case on some other
 > platforms where it's U-Boot that encapsulates parts of ATF.

 > In order to prepare the support for the later platforms, we make
 > building the FIP image optional, and update the only defconfig we have
 > that uses ARM Trusted Firmware.

 > Note: we considered adding a "default y" here to preserve backward
 > compatibility, but there really isn't any default that is sane:
 > whether a FIP image needs to be built or not is purely platform
 > specific.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 > ---
 >  boot/arm-trusted-firmware/Config.in               | 8 ++++++++
 >  boot/arm-trusted-firmware/arm-trusted-firmware.mk | 8 +++++++-
 >  configs/arm_juno_defconfig                        | 1 +
 >  3 files changed, 16 insertions(+), 1 deletion(-)

 > diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
 > index 799370cd51..05600461a5 100644
 > --- a/boot/arm-trusted-firmware/Config.in
 > +++ b/boot/arm-trusted-firmware/Config.in
 > @@ -56,6 +56,14 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM
 >  	help
 >  	  Target plaform to build for.
 
 > +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
 > +	bool "Build FIP image"
 > +	help
 > +	  This option enables building the FIP image (Firmware Image
 > +	  Package). This is typically the image format used by
 > +	  platforms were ATF encapsulates the second stage bootloader
 > +	  (such as U-Boot).
 > +
 >  config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES
 >  	string "Additional ATF build variables"
 >  	help
 > diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
 > index 7b1cc6ebb6..bdffb1dbe4 100644
 > --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
 > +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
 > @@ -39,10 +39,16 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
 >  ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware
 >  endif
 
 > +ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
 > +

Minor nit: I believe the 'all' target builds unneeded stuff for the
platforms using only bl31.bin.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image
  2017-12-03 21:48 ` [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image Thomas Petazzoni
                     ` (2 preceding siblings ...)
  2017-12-08  9:14   ` Peter Korsgaard
@ 2017-12-08 12:34   ` Peter Korsgaard
  3 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-08 12:34 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Currently, our arm-trusted-firmware unconditionally builds a FIP
 > (Firmware Image Package). While this is often needed on platforms
 > where ATF encapsulates U-Boot, it is not the case on some other
 > platforms where it's U-Boot that encapsulates parts of ATF.

 > In order to prepare the support for the later platforms, we make
 > building the FIP image optional, and update the only defconfig we have
 > that uses ARM Trusted Firmware.

 > Note: we considered adding a "default y" here to preserve backward
 > compatibility, but there really isn't any default that is sane:
 > whether a FIP image needs to be built or not is purely platform
 > specific.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 2/8] arm-trusted-firmware: add BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
  2017-12-03 21:48 ` [Buildroot] [PATCH 2/8] arm-trusted-firmware: add BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 Thomas Petazzoni
@ 2017-12-08 12:35   ` Peter Korsgaard
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-08 12:35 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > ATF can be used in different ways:
 >  - ATF encapsulates U-Boot as the BL33, which is what is done on ARM
 >    Juno (currently supported in Buildroot) and Marvell platforms (soon
 >    to be supported)

 >  - U-Boot encapsulates ATF's BL31, which is what is done on Allwinner
 >    ARM64 platforms.

 > Until now we were assumming the former was always the case, but
 > obviously it isn't. Therefore, this patch adds an option that allows
 > to explicitly tell ATF that it encapsulates U-Boot as its BL33.

 > We adapt the only defconfig that uses ATF so that it enables this
 > option as appropriate.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 3/8] arm-trusted-firmware: allow to generate the BL31 image
  2017-12-03 21:48 ` [Buildroot] [PATCH 3/8] arm-trusted-firmware: allow to generate the BL31 image Thomas Petazzoni
  2017-12-06 16:28   ` Jagan Teki
@ 2017-12-08 12:35   ` Peter Korsgaard
  1 sibling, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-08 12:35 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Some platforms (e.g Allwinner ARM64) don't build a FIP image out of
 > ATF, but only a BL31 image, which is then encapsulated in U-Boot. This
 > commit adds an ATF option to build such an image.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot
  2017-12-03 21:48 ` [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot Thomas Petazzoni
  2017-12-06 16:29   ` Jagan Teki
@ 2017-12-08 12:37   ` Peter Korsgaard
  2017-12-08 12:46     ` Thomas Petazzoni
  1 sibling, 1 reply; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-08 12:37 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > From: Jagan Teki <jagannadh.teki@gmail.com>
 > Some ARM64 platforms (such as Allwinner A64/H5) have a boot process
 > where U-Boot encapsulates the BL31 part of the ARM trusted
 > firmware. For such platforms, we need to build ATF before U-Boot, and
 > pass a BL31 variable pointing to ATF bl31.bin to the U-Boot build
 > process.

 > This commit introduces a BR2_TARGET_UBOOT_NEEDS_ATF_BL31 variable to
 > achieve this.

 > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
 > [Thomas:
 >  - Rename option to BR2_TARGET_UBOOT_NEEDS_ATF_BL31
 >  - Drop changes to arm-trusted-firmware.mk, they are taken care of by
 >    previous commits.
 >  - Improve Config.in help text
 >  - Add missing dependency on arm-trusted-firmware when
 >    BR2_TARGET_UBOOT_NEEDS_ATF_BL31 is enabled.
 >  - Use bl31.bin from $(BINARIES_DIR) instead of taking it from ATF's
 >    build dir.]
 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 > ---
 >  boot/uboot/Config.in | 10 ++++++++++
 >  boot/uboot/uboot.mk  |  5 +++++
 >  2 files changed, 15 insertions(+)

 > diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
 > index 0e109d0977..8fa189f410 100644
 > --- a/boot/uboot/Config.in
 > +++ b/boot/uboot/Config.in
 > @@ -158,6 +158,16 @@ config BR2_TARGET_UBOOT_NEEDS_OPENSSL
 >  	  typically the case when the board configuration has
 >  	  CONFIG_FIT_SIGNATURE enabled.
 
 > +config BR2_TARGET_UBOOT_NEEDS_ATF_BL31
 > +	bool "U-Boot needs ATF BL31"
 > +	depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31

The fact that you need to enable this atf suboption before this option
is even visible isn't very nice. We also need to ensure this option
cannot be selected together with
BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 as that would cause
circular dependencies, so I've changed it to:

	depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE
	depend on !BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
	select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31

And committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 5/8] mv-ddr-marvell: new package
  2017-12-03 21:48 ` [Buildroot] [PATCH 5/8] mv-ddr-marvell: new package Thomas Petazzoni
@ 2017-12-08 12:42   ` Peter Korsgaard
  2017-12-08 13:18     ` Thomas Petazzoni
  0 siblings, 1 reply; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-08 12:42 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > From: Sergey Matyukevich <geomatsi@gmail.com>
 > This package adds Marvell Armada SoC DDR training algorithms.
 > This code is not built separately, it is needed as dependency
 > to build ATF firmware for Marvell Armada SoCs.

 > Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
 > [Thomas:
 >  - Remove MV_DDR_MARVELL_SRC_SYMLINK, ATF will directly pick up the
 >    mv-ddr-marvell code from where it is.
 >  - Use "mv-ddr-marvell" as the Config.in prompt, and in the comment
 >    header of the .mk file.
 >  - Add upstream URL in Config.in help text
 >  - Adjust license information.]
 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 > ---
 >  DEVELOPERS                              |  1 +
 >  boot/Config.in                          |  1 +
 >  boot/mv-ddr-marvell/Config.in           | 10 ++++++++++
 >  boot/mv-ddr-marvell/mv-ddr-marvell.hash |  2 ++
 >  boot/mv-ddr-marvell/mv-ddr-marvell.mk   | 12 ++++++++++++
 >  5 files changed, 26 insertions(+)
 >  create mode 100644 boot/mv-ddr-marvell/Config.in
 >  create mode 100644 boot/mv-ddr-marvell/mv-ddr-marvell.hash
 >  create mode 100644 boot/mv-ddr-marvell/mv-ddr-marvell.mk

 > diff --git a/DEVELOPERS b/DEVELOPERS
 > index c44e8aee50..9d114b5a29 100644
 > --- a/DEVELOPERS
 > +++ b/DEVELOPERS
 > @@ -1508,6 +1508,7 @@ F:	package/lua-resty-http/
 >  F:	package/mpir/
 
 >  N:	Sergey Matyukevich <geomatsi@gmail.com>
 > +F:	boot/mv-ddr-marvell/
 >  F:	board/linksprite/pcduino
 >  F:	board/orangepi/orangepi-zero
 >  F:	board/orangepi/orangepi-one
 > diff --git a/boot/Config.in b/boot/Config.in
 > index 2f46c8546e..3950c49524 100644
 > --- a/boot/Config.in
 > +++ b/boot/Config.in
 > @@ -10,6 +10,7 @@ source "boot/boot-wrapper-aarch64/Config.in"
 >  source "boot/grub2/Config.in"
 >  source "boot/gummiboot/Config.in"
 >  source "boot/lpc32xxcdl/Config.in"
 > +source "boot/mv-ddr-marvell/Config.in"
 >  source "boot/mxs-bootlets/Config.in"
 >  source "boot/s500-bootloader/Config.in"
 >  source "boot/syslinux/Config.in"
 > diff --git a/boot/mv-ddr-marvell/Config.in b/boot/mv-ddr-marvell/Config.in
 > new file mode 100644
 > index 0000000000..6cf6eec9ae
 > --- /dev/null
 > +++ b/boot/mv-ddr-marvell/Config.in
 > @@ -0,0 +1,10 @@
 > +config BR2_TARGET_MV_DDR_MARVELL
 > +	bool "mv-ddr-marvell"
 > +	depends on BR2_aarch64
 > +	help
 > +	  Marvell keeps algorithms for DDR training in a separate
 > +	  repository. This code is not built separately, it is needed
 > +	  as dependency to build ATF firmware for Marvell Armada 7040

s/as/as a/

I wonder if it would make sense to  depend or / select atf, but I've
left it as is for now and committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot
  2017-12-08 12:37   ` Peter Korsgaard
@ 2017-12-08 12:46     ` Thomas Petazzoni
  0 siblings, 0 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-08 12:46 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 08 Dec 2017 13:37:33 +0100, Peter Korsgaard wrote:

>  > +config BR2_TARGET_UBOOT_NEEDS_ATF_BL31
>  > +	bool "U-Boot needs ATF BL31"
>  > +	depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31  
> 
> The fact that you need to enable this atf suboption before this option
> is even visible isn't very nice. We also need to ensure this option
> cannot be selected together with
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 as that would cause
> circular dependencies, so I've changed it to:
> 
> 	depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE
> 	depend on !BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
> 	select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
> 
> And committed, thanks.

Seems OK to me. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 5/8] mv-ddr-marvell: new package
  2017-12-08 12:42   ` Peter Korsgaard
@ 2017-12-08 13:18     ` Thomas Petazzoni
  0 siblings, 0 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-08 13:18 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 08 Dec 2017 13:42:40 +0100, Peter Korsgaard wrote:

> I wonder if it would make sense to  depend or / select atf, but I've
> left it as is for now and committed, thanks.

I don't really have a strong opinion here (though I'm leaning towards
the depends on). However, if you change this, then we should also change
the vexpress-firmware package.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 7/8] atf: add support for Marvell Armada SoCs
  2017-12-03 21:48 ` [Buildroot] [PATCH 7/8] atf: add support for Marvell Armada SoCs Thomas Petazzoni
@ 2017-12-08 17:59   ` Peter Korsgaard
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-08 17:59 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > From: Sergey Matyukevich <geomatsi@gmail.com>
 > Add Marvell Armada 7k/8k SoCs support to arm-trusted-firmware package.
 > Marvell ATF needs two additional dependencies:
 > DDR training code and SCP_BL2 image.

 > Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
 > [Thomas: adjust to previous ATF changes.]
 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 8/8] support/testing: add tests for ATF
  2017-12-03 21:48 ` [Buildroot] [PATCH 8/8] support/testing: add tests for ATF Thomas Petazzoni
  2017-12-04 20:33   ` Sergey Matyukevich
@ 2017-12-08 18:02   ` Peter Korsgaard
  2017-12-11 13:00     ` Thomas Petazzoni
  1 sibling, 1 reply; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-08 18:02 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > These new tests only do build tests, but allow to quickly verify that
 > the ATF/U-Boot combinations for vexpress, Allwinner and Marvell
 > platforms all continue to build properly.

We will presumably soon have defconfigs using each 3 variants, so I
don't know how useful this is - But Ok, we can add it for now.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 8/8] support/testing: add tests for ATF
  2017-12-08 18:02   ` Peter Korsgaard
@ 2017-12-11 13:00     ` Thomas Petazzoni
  2017-12-11 18:59       ` Peter Korsgaard
  0 siblings, 1 reply; 28+ messages in thread
From: Thomas Petazzoni @ 2017-12-11 13:00 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 08 Dec 2017 19:02:27 +0100, Peter Korsgaard wrote:

>  > These new tests only do build tests, but allow to quickly verify that
>  > the ATF/U-Boot combinations for vexpress, Allwinner and Marvell
>  > platforms all continue to build properly.  
> 
> We will presumably soon have defconfigs using each 3 variants, so I
> don't know how useful this is - But Ok, we can add it for now.

Yes, I also thought about this when writing the tests. The main
motivation for writing the tests is that they allowed me to test the
ATF package very quickly, by running 3 tests that are very focused on
building just ATF+U-Boot: they don't build a toolchain, a kernel, etc.
As such, such tests are much more usable for someone doing active
development on the ATF package and who wants to verify that things
continue to build properly.

And since I had them written, I thought I would submit them as well :)

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 8/8] support/testing: add tests for ATF
  2017-12-11 13:00     ` Thomas Petazzoni
@ 2017-12-11 18:59       ` Peter Korsgaard
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2017-12-11 18:59 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Hello,
 > On Fri, 08 Dec 2017 19:02:27 +0100, Peter Korsgaard wrote:

 >> > These new tests only do build tests, but allow to quickly verify that
 >> > the ATF/U-Boot combinations for vexpress, Allwinner and Marvell
 >> > platforms all continue to build properly.  
 >> 
 >> We will presumably soon have defconfigs using each 3 variants, so I
 >> don't know how useful this is - But Ok, we can add it for now.

 > Yes, I also thought about this when writing the tests. The main
 > motivation for writing the tests is that they allowed me to test the
 > ATF package very quickly, by running 3 tests that are very focused on
 > building just ATF+U-Boot: they don't build a toolchain, a kernel, etc.
 > As such, such tests are much more usable for someone doing active
 > development on the ATF package and who wants to verify that things
 > continue to build properly.

 > And since I had them written, I thought I would submit them as well :)

Fair enough.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-12-11 18:59 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-03 21:48 [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Thomas Petazzoni
2017-12-03 21:48 ` [Buildroot] [PATCH 1/8] arm-trusted-firmware: add option to enable/disable building FIP image Thomas Petazzoni
2017-12-04 21:10   ` Sergey Matyukevich
2017-12-06 16:09   ` Danomi Manchego
2017-12-08  9:14   ` Peter Korsgaard
2017-12-08 12:34   ` Peter Korsgaard
2017-12-03 21:48 ` [Buildroot] [PATCH 2/8] arm-trusted-firmware: add BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 Thomas Petazzoni
2017-12-08 12:35   ` Peter Korsgaard
2017-12-03 21:48 ` [Buildroot] [PATCH 3/8] arm-trusted-firmware: allow to generate the BL31 image Thomas Petazzoni
2017-12-06 16:28   ` Jagan Teki
2017-12-08 12:35   ` Peter Korsgaard
2017-12-03 21:48 ` [Buildroot] [PATCH 4/8] uboot: add support for bundling ATF BL31 into U-Boot Thomas Petazzoni
2017-12-06 16:29   ` Jagan Teki
2017-12-08 12:37   ` Peter Korsgaard
2017-12-08 12:46     ` Thomas Petazzoni
2017-12-03 21:48 ` [Buildroot] [PATCH 5/8] mv-ddr-marvell: new package Thomas Petazzoni
2017-12-08 12:42   ` Peter Korsgaard
2017-12-08 13:18     ` Thomas Petazzoni
2017-12-03 21:48 ` [Buildroot] [PATCH 6/8] binaries-marvell: " Thomas Petazzoni
2017-12-04 20:17   ` Sergey Matyukevich
2017-12-03 21:48 ` [Buildroot] [PATCH 7/8] atf: add support for Marvell Armada SoCs Thomas Petazzoni
2017-12-08 17:59   ` Peter Korsgaard
2017-12-03 21:48 ` [Buildroot] [PATCH 8/8] support/testing: add tests for ATF Thomas Petazzoni
2017-12-04 20:33   ` Sergey Matyukevich
2017-12-08 18:02   ` Peter Korsgaard
2017-12-11 13:00     ` Thomas Petazzoni
2017-12-11 18:59       ` Peter Korsgaard
2017-12-06 16:26 ` [Buildroot] [PATCH 0/8] Improve ATF to support additional platforms Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.