Skip to contentSkip to conversation

uboot build and deploy added to juno board

PATCH New Joao Pinto 3 participants 7 messages Apr 20, 2016 – Apr 21, 2016

lore
Share & tools
lore

Joao Pinto

author
#0 lore raw

PATCH 1/1 uboot build and deploy added to juno board

This patch has the goal to add to the juno board defconfig the u-boot build configurations. The juno board readme file was also updated with the necessary steps to build the ARM Trusted Firmware (with u-boot in it) and how to deploy it.

---
 board/arm/juno/readme.txt  | 48 +++++++++++++++++++++++++++++++++++++++++-----
 configs/arm_juno_defconfig |  6 ++++++
 2 files changed, 49 insertions(+), 5 deletions(-)
board/arm/juno/readme.txt +43 -5
index 52fabf9..e9c0bfe 100644
@@ -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, a minimal
+root filesystem and a u-boot binary.
 
 How to build it
 ===============
@@ -42,6 +42,7 @@ After building, you should obtain this tree:
     +-- juno.dtb (if Juno r0 is used)
     +-- juno-r1.dtb (if Juno r1 is used)
     +-- Image
+    +-- u-boot.bin
 
 Preparing your rootfs
 ======================
@@ -63,6 +64,42 @@ When completed make sure to unmount the device:
 
 Insert the pen drive in one of the ARM Juno' USB type A connectors.
 
+Building bootloader files bl1.bin and fip.bin
+=============================================
+First clone ARM Trusted Firmware repository
+
+   $ git clone https://github.com/ARM-software/arm-trusted-firmware.git
+
+After clonning, please configure the following environment variables:
+
+  CROSS_COMPILE=<buidlroot_path>/output/host/usr/bin/aarch64-buildroot-linux-gnu-
+  BL33=<buidlroot_path>/output/images/u-boot.bin
+  SCP_BL2=<path_to_scp_firmware>
+
+Finaly execute:
+  make PLAT=juno all fip
+
+After building, you should obtain this tree:
+
+    build/juno/release/
+    +-- bl1.bin
+    +-- bl2/
+    +-- bl2.bin
+    +-- bl2u/
+    +-- bl2u.bin
+    +-- bl31/
+    +-- bl31.bin
+    +-- fip.bin
+
+Useful tip:
+The SCP firmware (typically named scp-fw.bin) can be obtained by unpacking
+the original fip.bin:
+
+    $ fip_create ???unpack fip.bin
+
+The fip_create application is available in the ARM Trusted Firmware Package in
+tools/fip_create/.
+
 Configure *.dtb in the boot configuration for Juno r0
 =====================================================
 
@@ -89,8 +126,8 @@ NOR3LOAD: 00000000               ;Image Load Address
 NOR3ENTRY: 00000000              ;Image Entry Point
 ......
 
-Installing kernel image and DTB
-===============================
+Installing kernel image, DTB and bootloader
+===========================================
 
 1. Connect to the ARM Juno UART0 and execute USB_ON in the terminal
 2. Connect a USB cable between your PC and ARM Juno USB type B connector
@@ -98,7 +135,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 'bl1.bin' and 'fip.bin' files 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.
configs/arm_juno_defconfig +6 -0
index 87b6374..9ed4258 100644
@@ -12,3 +12,9 @@ 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_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY=y
+BR2_TARGET_UBOOT_BOARDNAME="vexpress_aemv8a_juno"
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="http://git.denx.de/u-boot.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="v2016.03"
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 1/1 uboot build and deploy added to juno board

Hello,

Quoted 4 lines · Joao Pinto

This patch has the goal to add to the juno board defconfig the u-boot build configurations. The juno board readme file was also updated with the necessary steps to build the ARM Trusted Firmware (with u-boot in it) and how to deploy it.

Thanks!

Quoted 4 lines
board/arm/juno/readme.txt +4 -0
+Building bootloader files bl1.bin and fip.bin
+=============================================
+First clone ARM Trusted Firmware repository
+

board/arm/juno/readme.txt When completed make sure to unmount the device: · line 80

Quoted 10 lines
board/arm/juno/readme.txt +10 -0
+   $ git clone https://github.com/ARM-software/arm-trusted-firmware.git
+
+After clonning, please configure the following environment variables:
+
+  CROSS_COMPILE=<buidlroot_path>/output/host/usr/bin/aarch64-buildroot-linux-gnu-
+  BL33=<buidlroot_path>/output/images/u-boot.bin
+  SCP_BL2=<path_to_scp_firmware>
+
+Finaly execute:
+  make PLAT=juno all fip

The whole point of Buildroot is to automate the build process, so this should be done by a Buildroot package, rather than manually by the user. So a package for ATF should probably be created.

I also work on an ARM64 platform that uses ATF+U-Boot, so I'll be able to compare and tell you whether what you're proposing is only applicable to Juno, or can be used for other platforms as well.

Quoted 1 line

+BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY=y

Using the legacy build system with a modern U-Boot such as 2016.03 doesn't make much sense. Please use the kconfig based build system, unless there is a real reason not to.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#2 lore raw

PATCH 1/1 uboot build and deploy added to juno board

Hello,

Quoted 29 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Joao Pinto

This patch has the goal to add to the juno board defconfig the u-boot build configurations. The juno board readme file was also updated with the necessary steps to build the ARM Trusted Firmware (with u-boot in it) and how to deploy it.

Thanks!

Quoted 4 lines
board/arm/juno/readme.txt +4 -0
+Building bootloader files bl1.bin and fip.bin
+=============================================
+First clone ARM Trusted Firmware repository
+

board/arm/juno/readme.txt When completed make sure to unmount the device: · line 80

Quoted 10 lines
board/arm/juno/readme.txt +10 -0
+   $ git clone https://github.com/ARM-software/arm-trusted-firmware.git
+
+After clonning, please configure the following environment variables:
+
+  CROSS_COMPILE=<buidlroot_path>/output/host/usr/bin/aarch64-buildroot-linux-gnu-
+  BL33=<buidlroot_path>/output/images/u-boot.bin
+  SCP_BL2=<path_to_scp_firmware>
+
+Finaly execute:
+  make PLAT=juno all fip

The whole point of Buildroot is to automate the build process, so this should be done by a Buildroot package, rather than manually by the user. So a package for ATF should probably be created.

Quoted 3 lines

I also work on an ARM64 platform that uses ATF+U-Boot, so I'll be able to compare and tell you whether what you're proposing is only applicable to Juno, or can be used for other platforms as well.

It would great to do it 100% automatic. I'll be waiting for your feedback regarding your ARM64 platform. If it is the same we could do it together.

Quoted 6 lines
Quoted 2 lines

+BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY=y

Using the legacy build system with a modern U-Boot such as 2016.03 doesn't make much sense. Please use the kconfig based build system, unless there is a real reason not to.

Yes, you are right, made a mistake!

Quoted 5 lines

Thanks!

Thomas

Thanks,
Joao

#3 lore raw

PATCH 1/1 uboot build and deploy added to juno board

Hello,

Quoted 10 lines · Joao Pinto
Quoted 7 lines

The whole point of Buildroot is to automate the build process, so this should be done by a Buildroot package, rather than manually by the user. So a package for ATF should probably be created.

I also work on an ARM64 platform that uses ATF+U-Boot, so I'll be able to compare and tell you whether what you're proposing is only applicable to Juno, or can be used for other platforms as well.

It would great to do it 100% automatic. I'll be waiting for your feedback regarding your ARM64 platform. If it is the same we could do it together.

Well, the build process is quite similar. I build ATF with:

make CROSS_COMPILE=aarch64-linux-gnu- BL33=/path/to/uboot USE_COHERENT_MEM=0 PLAT=<platform> DEBUG=1 LOG_LEVEL=20 all fip

I think DEBUG=1 and LOG_LEVEL=20 are not important, but I think the PLAT= and USE_COHERENT_MEM= variables are important in my case.

So I guess you do do something like:

  make CROSS_COMPILE=$(TARGET_CROSS) \
	BL33=$(call qstrip,$(BR2_BOOT_ATF_PAYLOAD_PATH) \
	$(BR2_BOOT_ATF_ADDITIONAL_VARIABLES) \
	all fip

and that's it. Of course, the location from where you download ATF should be configurable, because I'm not using the ATF from ARM directly, but a vendor-specific fork.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#4 lore raw

PATCH 1/1 uboot build and deploy added to juno board

Hi Thomas,

I developed the atfirmware config and I am having problems in the Makefile. How does the buildroot structure git clones / untar / etc.? I suppose there is a common spot to do these stuff right?

Send in attchment tarball of the new package. I am thinking of adding it to Bootloaders. What do you think?

Thanks.
Joao

Quoted 29 lines · Thomas Petazzoni

Hello,

Quoted 10 lines · Joao Pinto
Quoted 7 lines

The whole point of Buildroot is to automate the build process, so this should be done by a Buildroot package, rather than manually by the user. So a package for ATF should probably be created.

I also work on an ARM64 platform that uses ATF+U-Boot, so I'll be able to compare and tell you whether what you're proposing is only applicable to Juno, or can be used for other platforms as well.

It would great to do it 100% automatic. I'll be waiting for your feedback regarding your ARM64 platform. If it is the same we could do it together.

Well, the build process is quite similar. I build ATF with:

make CROSS_COMPILE=aarch64-linux-gnu- BL33=/path/to/uboot USE_COHERENT_MEM=0 PLAT=<platform> DEBUG=1 LOG_LEVEL=20 all fip

I think DEBUG=1 and LOG_LEVEL=20 are not important, but I think the PLAT= and USE_COHERENT_MEM= variables are important in my case.

So I guess you do do something like:

  make CROSS_COMPILE=$(TARGET_CROSS) \
	BL33=$(call qstrip,$(BR2_BOOT_ATF_PAYLOAD_PATH) \
	$(BR2_BOOT_ATF_ADDITIONAL_VARIABLES) \
	all fip
Quoted 8 lines

and that's it. Of course, the location from where you download ATF should be configurable, because I'm not using the ATF from ARM directly, but a vendor-specific fork.

Thanks!

Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: atfirmware.tar
Type: application/octet-stream
Size: 10240 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160421/805748f2/attachment.obj>

#5 lore raw

PATCH 1/1 uboot build and deploy added to juno board

Hello,

Quoted 3 lines · Joao Pinto

I developed the atfirmware config and I am having problems in the Makefile. How does the buildroot structure git clones / untar / etc.? I suppose there is a common spot to do these stuff right?

Look at how the barebox build is done, boot/barebox/barebox.mk.

Quoted 2 lines

Send in attchment tarball of the new package.

Well, your .mk file has no chance to work, you're not even calling any Buildroot package infrastructure, your build commands are not inside a variable, etc.

Quoted 1 line

I am thinking of adding it to Bootloaders. What do you think?

Yes, it should obviously go in the Bootloaders menu.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 1/1 uboot build and deploy added to juno board

In reply to Joao Pinto
Quoted 7 lines · Joao Pinto

This patch has the goal to add to the juno board defconfig the u-boot build configurations. The juno board readme file was also updated with the necessary steps to build the ARM Trusted Firmware (with u-boot in it) and how to deploy it.

---

[snip]

Quoted 5 lines
configs/arm_juno_defconfig +0 -0
index 87b6374..9ed4258 100644

configs/arm_juno_defconfig BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y · line 20

Quoted 9 lines
configs/arm_juno_defconfig +6 -0
@@ -12,3 +12,9 @@ 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_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY=y
+BR2_TARGET_UBOOT_BOARDNAME="vexpress_aemv8a_juno"
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="http://git.denx.de/u-boot.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="v2016.03"

Is there any reason to use a git clone rather than just downloading the
tarball? I.e., doesn't this work:

BR2_TARGET_UBOOT_CUSTOM_VERSION=y
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.03"

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF