All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] uboot build and deploy added to juno board
@ 2016-04-20 17:47 Joao Pinto
  2016-04-20 20:02 ` Thomas Petazzoni
  2016-04-21 20:55 ` Arnout Vandecappelle
  0 siblings, 2 replies; 7+ messages in thread
From: Joao Pinto @ 2016-04-20 17:47 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Joao Pinto <jpinto@synopsys.com>
---
 board/arm/juno/readme.txt  | 48 +++++++++++++++++++++++++++++++++++++++++-----
 configs/arm_juno_defconfig |  6 ++++++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/board/arm/juno/readme.txt b/board/arm/juno/readme.txt
index 52fabf9..e9c0bfe 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, 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.
diff --git a/configs/arm_juno_defconfig b/configs/arm_juno_defconfig
index 87b6374..9ed4258 100644
--- a/configs/arm_juno_defconfig
+++ b/configs/arm_juno_defconfig
@@ -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"
-- 
1.8.1.5

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

* [Buildroot] [PATCH] uboot build and deploy added to juno board
  2016-04-20 17:47 [Buildroot] [PATCH] uboot build and deploy added to juno board Joao Pinto
@ 2016-04-20 20:02 ` Thomas Petazzoni
  2016-04-21 10:34   ` Joao Pinto
  2016-04-21 20:55 ` Arnout Vandecappelle
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-04-20 20:02 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 20 Apr 2016 18:47:04 +0100, Joao Pinto wrote:
> 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!

> +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

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.

> +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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] uboot build and deploy added to juno board
  2016-04-20 20:02 ` Thomas Petazzoni
@ 2016-04-21 10:34   ` Joao Pinto
  2016-04-21 11:26     ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Joao Pinto @ 2016-04-21 10:34 UTC (permalink / raw)
  To: buildroot

Hello,

On 4/20/2016 9:02 PM, Thomas Petazzoni wrote:
> Hello,
> 
> On Wed, 20 Apr 2016 18:47:04 +0100, Joao Pinto wrote:
>> 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!
> 
>> +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
> 
> 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.

> 
>> +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!

> 
> Thanks!
> 
> Thomas
> 

Thanks,
Joao

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

* [Buildroot] [PATCH] uboot build and deploy added to juno board
  2016-04-21 10:34   ` Joao Pinto
@ 2016-04-21 11:26     ` Thomas Petazzoni
  2016-04-21 16:35       ` Joao Pinto
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-04-21 11:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 21 Apr 2016 11:34:02 +0100, Joao Pinto wrote:

> > 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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] uboot build and deploy added to juno board
  2016-04-21 11:26     ` Thomas Petazzoni
@ 2016-04-21 16:35       ` Joao Pinto
  2016-04-21 19:28         ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Joao Pinto @ 2016-04-21 16:35 UTC (permalink / raw)
  To: buildroot

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


On 4/21/2016 12:26 PM, Thomas Petazzoni wrote:
> Hello,
> 
> On Thu, 21 Apr 2016 11:34:02 +0100, Joao Pinto wrote:
> 
>>> 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
> 

-------------- 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>

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

* [Buildroot] [PATCH] uboot build and deploy added to juno board
  2016-04-21 16:35       ` Joao Pinto
@ 2016-04-21 19:28         ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2016-04-21 19:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 21 Apr 2016 17:35:54 +0100, Joao Pinto wrote:

> 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.

> 
> 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.

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

Yes, it should obviously go in the Bootloaders menu.

Thanks!

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

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

* [Buildroot] [PATCH] uboot build and deploy added to juno board
  2016-04-20 17:47 [Buildroot] [PATCH] uboot build and deploy added to juno board Joao Pinto
  2016-04-20 20:02 ` Thomas Petazzoni
@ 2016-04-21 20:55 ` Arnout Vandecappelle
  1 sibling, 0 replies; 7+ messages in thread
From: Arnout Vandecappelle @ 2016-04-21 20:55 UTC (permalink / raw)
  To: buildroot

On 04/20/16 19:47, Joao Pinto wrote:
> 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.
>
> Signed-off-by: Joao Pinto <jpinto@synopsys.com>
> ---
[snip]
> diff --git a/configs/arm_juno_defconfig b/configs/arm_juno_defconfig
> index 87b6374..9ed4258 100644
> --- a/configs/arm_juno_defconfig
> +++ b/configs/arm_juno_defconfig
> @@ -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



-- 
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

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

end of thread, other threads:[~2016-04-21 20:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 17:47 [Buildroot] [PATCH] uboot build and deploy added to juno board Joao Pinto
2016-04-20 20:02 ` Thomas Petazzoni
2016-04-21 10:34   ` Joao Pinto
2016-04-21 11:26     ` Thomas Petazzoni
2016-04-21 16:35       ` Joao Pinto
2016-04-21 19:28         ` Thomas Petazzoni
2016-04-21 20:55 ` Arnout Vandecappelle

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.