Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RESEND] [PATCH v3 0/3] new packages: atfirmware and scpfirmware
@ 2016-10-11 12:56 Joao Pinto
  2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 1/3] new package: atfirmware Joao Pinto
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joao Pinto @ 2016-10-11 12:56 UTC (permalink / raw)
  To: buildroot

This patch adds to buildroot an important package for ARM64 based development 
boards: The ARM Trusted Firmware (atfirmware).
It also adds the scpfirmware which is a hidden package to get the System Control
Processor (SCP) binary to be included in the bootloader (fip image), which is
a requirement for ARM Juno's board. With this 2 packages, Juno gets fully 
supported in the Buildroot.

Tested-by: Liviu Dudau <Liviu.Dudau@arm.com>

Joao Pinto (3):
  new package: atfirmware
  new package: scpfirmware
  configs: add u-boot and atfirmware options to juno

 board/arm/juno/readme.txt       | 21 ++++++++--
 boot/Config.in                  |  2 +
 boot/atfirmware/Config.in       | 70 +++++++++++++++++++++++++++++++++
 boot/atfirmware/atfirmware.hash |  5 +++
 boot/atfirmware/atfirmware.mk   | 85 +++++++++++++++++++++++++++++++++++++++++
 boot/scpfirmware/Config.in      | 23 +++++++++++
 boot/scpfirmware/scpfirmware.mk | 18 +++++++++
 configs/arm_juno_defconfig      |  9 +++++
 8 files changed, 230 insertions(+), 3 deletions(-)
 create mode 100644 boot/atfirmware/Config.in
 create mode 100644 boot/atfirmware/atfirmware.hash
 create mode 100644 boot/atfirmware/atfirmware.mk
 create mode 100644 boot/scpfirmware/Config.in
 create mode 100644 boot/scpfirmware/scpfirmware.mk

-- 
1.8.1.5

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

* [Buildroot] [RESEND] [PATCH v3 1/3] new package: atfirmware
  2016-10-11 12:56 [Buildroot] [RESEND] [PATCH v3 0/3] new packages: atfirmware and scpfirmware Joao Pinto
@ 2016-10-11 12:56 ` Joao Pinto
  2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 2/3] new package: scpfirmware Joao Pinto
  2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 3/3] configs: add u-boot and atfirmware options to juno Joao Pinto
  2 siblings, 0 replies; 4+ messages in thread
From: Joao Pinto @ 2016-10-11 12:56 UTC (permalink / raw)
  To: buildroot

This patch adds a new package to buildroot: atfirmware.
It is used to generate the necessary bootlader binaries for ARM64 boards.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
---
Changes v2->v3:
- atfirmware and scpfirmware were broken into 2 patches
Changes v1->v2:
- Nothing changed (just to keep up with patch set version).

 boot/Config.in                  |  1 +
 boot/atfirmware/Config.in       | 70 +++++++++++++++++++++++++++++++++
 boot/atfirmware/atfirmware.hash |  5 +++
 boot/atfirmware/atfirmware.mk   | 85 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 161 insertions(+)
 create mode 100644 boot/atfirmware/Config.in
 create mode 100644 boot/atfirmware/atfirmware.hash
 create mode 100644 boot/atfirmware/atfirmware.mk

diff --git a/boot/Config.in b/boot/Config.in
index 54760b9..ce0b50a 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -3,6 +3,7 @@ menu "Bootloaders"
 source "boot/at91bootstrap/Config.in"
 source "boot/at91bootstrap3/Config.in"
 source "boot/at91dataflashboot/Config.in"
+source "boot/atfirmware/Config.in"
 source "boot/barebox/Config.in"
 source "boot/boot-wrapper-aarch64/Config.in"
 source "boot/grub/Config.in"
diff --git a/boot/atfirmware/Config.in b/boot/atfirmware/Config.in
new file mode 100644
index 0000000..b116144
--- /dev/null
+++ b/boot/atfirmware/Config.in
@@ -0,0 +1,70 @@
+config BR2_TARGET_ATFIRMWARE
+	bool "ARM Trusted Firmware (ATF)"
+	depends on BR2_aarch64 && BR2_TARGET_UBOOT
+	select BR2_TARGET_SCPFIRMWARE if BR2_TARGET_ATFIRMWARE_PLATFORM='juno'
+	help
+	  Enable this option if you want to build the ATF for your ARM based
+	  embedded device.
+
+if BR2_TARGET_ATFIRMWARE
+choice
+	prompt "version"
+	help
+	  Select the specific ATF version you want to use
+
+config BR2_TARGET_ATFIRMWARE_LATEST_VERSION
+	bool "v1.2"
+
+config BR2_TARGET_ATFIRMWARE_CUSTOM_TARBALL
+	bool "Custom tarball"
+
+config BR2_TARGET_ATFIRMWARE_CUSTOM_GIT
+	bool "Custom Git repository"
+
+endchoice
+
+if BR2_TARGET_ATFIRMWARE_CUSTOM_TARBALL
+
+config BR2_TARGET_ATFIRMWARE_CUSTOM_TARBALL_LOCATION
+	string "URL of custom ARM Trusted Firmware tarball"
+
+endif
+
+config BR2_TARGET_ATFIRMWARE_VERSION
+	string
+	default "v1.2"	if BR2_TARGET_ATFIRMWARE_LATEST_VERSION
+	default "custom"	if BR2_TARGET_ATFIRMWARE_CUSTOM_TARBALL
+	default BR2_TARGET_ATFIRMWARE_CUSTOM_GIT_VERSION if BR2_TARGET_ATFIRMWARE_CUSTOM_GIT
+
+config BR2_TARGET_ATFIRMWARE_CUSTOM_PATCH_DIR
+	string "Custom patch dir"
+	help
+	  If your ATF requires custom patches, add the path to the
+	  directory containing the patches here.
+
+if BR2_TARGET_ATFIRMWARE_CUSTOM_GIT
+
+config BR2_TARGET_ATFIRMWARE_CUSTOM_GIT_REPO_URL
+	string "URL of custom Git repository"
+
+config BR2_TARGET_ATFIRMWARE_CUSTOM_GIT_VERSION
+	string "Custom Git version"
+	help
+	  Revision to use in the typical format used by Git
+	  E.G. a sha id, a tag, ..
+
+endif
+
+config BR2_TARGET_ATFIRMWARE_PLATFORM
+	string "Name of ATF platform to build for"
+	help
+	  Target plaform to build for.
+	  E.G. If using ARM Juno, please type 'juno'
+
+config BR2_TARGET_ATFIRMWARE_ADDITIONAL_VARIABLES
+	string "Additional ATF build variables"
+	help
+	  Additional parameters for the ATF build
+	  E.G. 'DEBUG=1 LOG_LEVEL=20'
+
+endif
diff --git a/boot/atfirmware/atfirmware.hash b/boot/atfirmware/atfirmware.hash
new file mode 100644
index 0000000..05a90c7
--- /dev/null
+++ b/boot/atfirmware/atfirmware.hash
@@ -0,0 +1,5 @@
+# From https://github.com/ARM-software/arm-trusted-firmware/archive/v1.2.tar.gz
+# Locally calculated
+sha256 fac2c08bd74337fec2e14a98fc9f748f atfirmware-v1.2.tar.gz
+md5 fac2c08bd74337fec2e14a98fc9f748f atfirmware-v1.2.tar.gz
+
diff --git a/boot/atfirmware/atfirmware.mk b/boot/atfirmware/atfirmware.mk
new file mode 100644
index 0000000..e2744c0
--- /dev/null
+++ b/boot/atfirmware/atfirmware.mk
@@ -0,0 +1,85 @@
+################################################################################
+#
+# ARM Trusted Firmware
+#
+################################################################################
+
+ATFIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ATFIRMWARE_VERSION))
+
+#package dependencies
+ATFIRMWARE_DEPENDENCIES += uboot
+
+ifeq ($(ATFIRMWARE_VERSION),custom)
+# Handle custom ATF tarballs as specified by the configuration
+ATFIRMWARE_TARBALL = $(call qstrip,$(BR2_TARGET_ATFIRMWARE_CUSTOM_TARBALL_LOCATION))
+ATFIRMWARE_SITE = $(patsubst %/,%,$(dir $(ATFIRMWARE_TARBALL)))
+ATFIRMWARE_SOURCE = $(notdir $(ATFIRMWARE_TARBALL))
+BR_NO_CHECK_HASH_FOR += $(ATFIRMWARE_SOURCE)
+else ifeq ($(BR2_TARGET_ATFIRMWARE_CUSTOM_GIT),y)
+ATFIRMWARE_SITE = $(call qstrip,$(BR2_TARGET_ATFIRMWARE_CUSTOM_GIT_REPO_URL))
+ATFIRMWARE_SITE_METHOD = git
+endif
+
+ifneq ($(call qstrip,$(BR2_TARGET_ATFIRMWARE_CUSTOM_PATCH_DIR)),)
+define ATFIRMWARE_APPLY_CUSTOM_PATCHES
+	$(APPLY_PATCHES) $(@D) \
+		$(BR2_TARGET_ATFIRMWARE_CUSTOM_PATCH_DIR) \*.patch
+endef
+
+ATFIRMWARE_POST_PATCH_HOOKS += ATFIRMWARE_APPLY_CUSTOM_PATCHES
+endif
+
+ATFIRMWARE_INSTALL_IMAGES = YES
+
+# Automatically find the U-Boot binary
+ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME)),)
+ATFIRMWARE_PAYLOAD_PATH = $(BINARIES_DIR)/"u-boot.bin"
+else
+ATFIRMWARE_PAYLOAD_PATH = $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME))
+endif
+
+ATFIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ATFIRMWARE_PLATFORM))
+
+#if juno target is selected, then lets configured the expected SCP firmware binary
+ifeq ($(ATFIRMWARE_PLATFORM),juno)
+ATFIRMWARE_SCP_FIRMWARE="SCP_BL2=$(BINARIES_DIR)/scp-fw.bin"
+#configure the dependencie of scpfirmware package
+ATFIRMWARE_DEPENDENCIES += scpfirmware
+endif
+
+ATFIRMWARE_MAKE_OPTS += \
+	CROSS_COMPILE="$(TARGET_CROSS)" \
+	BL33=$(call qstrip,$(ATFIRMWARE_PAYLOAD_PATH)) \
+	$(call qstrip,$(BR2_TARGET_ATFIRMWARE_ADDITIONAL_VARIABLES)) \
+	$(ATFIRMWARE_SCP_FIRMWARE) \
+	PLAT=$(ATFIRMWARE_PLATFORM) \
+	all fip
+
+define ATFIRMWARE_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) \
+	$(MAKE) -C $(@D) $(ATFIRMWARE_MAKE_OPTS) \
+	$(ATFIRMWARE_MAKE_TARGET)
+endef
+
+define ATFIRMWARE_INSTALL_IMAGES_CMDS
+	cp -dpf $(@D)/build/$(ATFIRMWARE_PLATFORM)/release/*.bin $(BINARIES_DIR)/ ;
+endef
+
+# Configuration ckeck
+ifeq ($(BR2_TARGET_ATFIRMWARE)$(BR_BUILDING),yy)
+
+ifeq ($(ATFIRMWARE_VERSION),custom)
+ifeq ($(call qstrip,$(BR2_TARGET_ATFIRMWARE_CUSTOM_TARBALL_LOCATION))),)
+$(error No tarball location specified. Please check BR2_TARGET_ATFIRMWARE_CUSTOM_TARBALL_LOCATION))
+endif
+endif
+
+ifeq ($(BR2_TARGET_ATFIRMWARE_CUSTOM_GIT),y)
+ifeq ($(call qstrip,$(BR2_TARGET_ATFIRMWARE_CUSTOM_GIT_REPO_URL)),)
+$(error No repository specified. Please check BR2_TARGET_ATFIRMWARE_CUSTOM_GIT_REPO_URL)
+endif
+endif
+
+endif
+
+$(eval $(generic-package))
-- 
1.8.1.5

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

* [Buildroot] [RESEND] [PATCH v3 2/3] new package: scpfirmware
  2016-10-11 12:56 [Buildroot] [RESEND] [PATCH v3 0/3] new packages: atfirmware and scpfirmware Joao Pinto
  2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 1/3] new package: atfirmware Joao Pinto
@ 2016-10-11 12:56 ` Joao Pinto
  2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 3/3] configs: add u-boot and atfirmware options to juno Joao Pinto
  2 siblings, 0 replies; 4+ messages in thread
From: Joao Pinto @ 2016-10-11 12:56 UTC (permalink / raw)
  To: buildroot

This patch adds a new package to buildroot: scpfirmware.
It is a hidden package that only serves to get the scp binary
from Linaro repository to be used by ATFirmware (Juno requirement).

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
---
Changes v2->v3:
- atfirmware and scpfirmware were broken into 2 patches
Changes v1->v2:
- Nothing changed (just to keep up with patch set version).

 boot/Config.in                  |  1 +
 boot/scpfirmware/Config.in      | 23 +++++++++++++++++++++++
 boot/scpfirmware/scpfirmware.mk | 18 ++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 boot/scpfirmware/Config.in
 create mode 100644 boot/scpfirmware/scpfirmware.mk

diff --git a/boot/Config.in b/boot/Config.in
index ce0b50a..246d6a1 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -12,6 +12,7 @@ source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
 source "boot/mxs-bootlets/Config.in"
 source "boot/syslinux/Config.in"
+source "boot/scpfirmware/Config.in"
 source "boot/uboot/Config.in"
 source "boot/xloader/Config.in"
 
diff --git a/boot/scpfirmware/Config.in b/boot/scpfirmware/Config.in
new file mode 100644
index 0000000..f2acc24
--- /dev/null
+++ b/boot/scpfirmware/Config.in
@@ -0,0 +1,23 @@
+config BR2_TARGET_SCPFIRMWARE
+	bool
+	depends on BR2_aarch64
+
+if BR2_TARGET_SCPFIRMWARE
+
+config BR2_TARGET_SCPFIRMWARE_VERSION
+	string
+	default BR2_TARGET_SCPFIRMWARE_CUSTOM_GIT_VERSION
+
+config BR2_TARGET_SCPFIRMWARE_CUSTOM_GIT
+	bool
+	default "y"
+
+config BR2_TARGET_SCPFIRMWARE_CUSTOM_GIT_REPO_URL
+	string
+	default "https://git.linaro.org/arm/vexpress-firmware.git"
+
+config BR2_TARGET_SCPFIRMWARE_CUSTOM_GIT_VERSION
+	string
+	default "901f81977c3b367a2e0bf3d6444be302822d97a3"
+
+endif
diff --git a/boot/scpfirmware/scpfirmware.mk b/boot/scpfirmware/scpfirmware.mk
new file mode 100644
index 0000000..0508a21
--- /dev/null
+++ b/boot/scpfirmware/scpfirmware.mk
@@ -0,0 +1,18 @@
+################################################################################
+#
+# System Control Processor (SCP) Firmware
+#
+################################################################################
+
+SCPFIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_SCPFIRMWARE_VERSION))
+SCPFIRMWARE_SITE = $(call qstrip,$(BR2_TARGET_SCPFIRMWARE_CUSTOM_GIT_REPO_URL))
+SCPFIRMWARE_SITE_METHOD = git
+
+SCPFIRMWARE_INSTALL_IMAGES = YES
+
+define SCPFIRMWARE_INSTALL_IMAGES_CMDS
+	mv $(@D)/SOFTWARE/bl30.bin $(@D)/SOFTWARE/scp-fw.bin ;	\
+	cp -dpf $(@D)/SOFTWARE/scp-fw.bin $(BINARIES_DIR)/ ;
+endef
+
+$(eval $(generic-package))
-- 
1.8.1.5

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

* [Buildroot] [RESEND] [PATCH v3 3/3] configs: add u-boot and atfirmware options to juno
  2016-10-11 12:56 [Buildroot] [RESEND] [PATCH v3 0/3] new packages: atfirmware and scpfirmware Joao Pinto
  2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 1/3] new package: atfirmware Joao Pinto
  2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 2/3] new package: scpfirmware Joao Pinto
@ 2016-10-11 12:56 ` Joao Pinto
  2 siblings, 0 replies; 4+ messages in thread
From: Joao Pinto @ 2016-10-11 12:56 UTC (permalink / raw)
  To: buildroot

This patch adds the necessary U-Boot and ATFirmware configurations to the
Juno's defconfig and updates the readme.txt file regarding the new output
binaries.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
---
Changes v2->v3:
- Nothing changed (just to keep up with patch set version)
Changes v1->v2:
- Changed BR2_TARGET_UBOOT_DEFCONFIG to BR2_TARGET_UBOOT_BOARDNAME
- Fixed a typo in the e-mail subject

 board/arm/juno/readme.txt  | 21 ++++++++++++++++++---
 configs/arm_juno_defconfig |  9 +++++++++
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/board/arm/juno/readme.txt b/board/arm/juno/readme.txt
index 52fabf9..2a2af55 100644
--- a/board/arm/juno/readme.txt
+++ b/board/arm/juno/readme.txt
@@ -7,8 +7,8 @@ These instructions apply to all models of the ARM Juno:
   - Juno r0 (does not support PCIe)
   - Juno r1 (supports PCIe)
 
-Buildroot will generate the kernel image, device tree blob and a
-minimal root filesystem.
+Buildroot will generate the kernel image, device tree blob, bootloader binaries
+and a minimal root filesystem.
 
 How to build it
 ===============
@@ -42,6 +42,20 @@ After building, you should obtain this tree:
     +-- juno.dtb (if Juno r0 is used)
     +-- juno-r1.dtb (if Juno r1 is used)
     +-- Image
+    +-- bl1.bin
+    +-- bl2.bin
+    +-- bl2u.bin
+    +-- bl31.bin
+    +-- fip.bin
+    +-- scp-fw.bin
+    +-- u-boot.bin
+
+Preparing your rootfs
+======================
+
+Format your pen drive as a ext3 filesystem by executing:
+
+   $ mkfs.ext3 /dev/<your device>
 
 Preparing your rootfs
 ======================
@@ -98,7 +112,8 @@ Installing kernel image and DTB
 3. Open the software/ folder
 4. Copy the 'Image' file to software/
 5. Copy the 'juno-r1.dtb' (r1) or the 'juno.dtb' (r0) file to software/
-6. Press the red button in the front pannel of ARM Juno
+6. Copy the bootloader binaries (bl1.bin and fip.bin) to software/
+7. Press the red button in the front pannel of ARM Juno
 
 At this time, the board will erase the Flash entry for each new item and
 replace it with the lastest ones.
diff --git a/configs/arm_juno_defconfig b/configs/arm_juno_defconfig
index 87b6374..778661e 100644
--- a/configs/arm_juno_defconfig
+++ b/configs/arm_juno_defconfig
@@ -12,3 +12,12 @@ BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/arm/juno/linux-juno-defconfig"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="arm/juno arm/juno-r1"
+BR2_TARGET_ATFIRMWARE=y
+BR2_TARGET_ATFIRMWARE_CUSTOM_GIT=y
+BR2_TARGET_ATFIRMWARE_CUSTOM_GIT_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
+BR2_TARGET_ATFIRMWARE_CUSTOM_GIT_VERSION="v1.2"
+BR2_TARGET_ATFIRMWARE_PLATFORM="juno"
+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"
-- 
1.8.1.5

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

end of thread, other threads:[~2016-10-11 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 12:56 [Buildroot] [RESEND] [PATCH v3 0/3] new packages: atfirmware and scpfirmware Joao Pinto
2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 1/3] new package: atfirmware Joao Pinto
2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 2/3] new package: scpfirmware Joao Pinto
2016-10-11 12:56 ` [Buildroot] [RESEND] [PATCH v3 3/3] configs: add u-boot and atfirmware options to juno Joao Pinto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox