Difference between revisions of "R-Car/Boards/U-Boot-Gen3"

From eLinux.org
Jump to: navigation, search
Line 23: Line 23:
 
|}
 
|}
  
== Prerequisites ==
+
== Building U-Boot manually ==
  
* RCar R8A7795 H3 ES1.x is NOT supported!
+
=== Prerequisites ===
 +
 
 +
* R-Car R8A7795 H3 ES1.x is NOT supported!
 
* Running mainline U-Boot is only supported with IPL/ATF/BL revision 2.23 and newer.
 
* Running mainline U-Boot is only supported with IPL/ATF/BL revision 2.23 and newer.
 
* ARM cross-compiler is mandatory to build U-Boot (OpenEmbedded generates this for you).
 
* ARM cross-compiler is mandatory to build U-Boot (OpenEmbedded generates this for you).
  
== ARM cross-compiler ==
+
=== ARM cross-compiler ===
  
 
If you intend to build both IPL/ATF/BL and U-Boot using OpenEmbedded with meta-renesas layer, you can skip this step.
 
If you intend to build both IPL/ATF/BL and U-Boot using OpenEmbedded with meta-renesas layer, you can skip this step.
Line 39: Line 41:
 
Other distributions likely also provide ARM cross-compilers. Consult distro-specific documentation for details.
 
Other distributions likely also provide ARM cross-compilers. Consult distro-specific documentation for details.
  
== Obtain U-Boot sources ==
+
=== Obtain U-Boot sources ===
  
 
The preferred method of obtaining U-Boot sources is through git VCS, using git protocol:
 
The preferred method of obtaining U-Boot sources is through git VCS, using git protocol:
Line 56: Line 58:
 
U-Boot [http://git.denx.de/?p=u-boot.git;a=summary git hosting] also provides snapshots.
 
U-Boot [http://git.denx.de/?p=u-boot.git;a=summary git hosting] also provides snapshots.
  
== Prepare build environment ==
+
=== Prepare build environment ===
  
Before building U-Boot for RCar Gen3 system, the following environment variables need to be configured:
+
Before building U-Boot for R-Car Gen3 system, the following environment variables need to be configured:
  
 
  export ARCH=arm64
 
  export ARCH=arm64
Line 65: Line 67:
 
The later variable must match the prefix of the Aarch64 cross-toolchain installed on your system, the example above is valid for Debian and Ubuntu,
 
The later variable must match the prefix of the Aarch64 cross-toolchain installed on your system, the example above is valid for Debian and Ubuntu,
  
== Build U-Boot ==
+
=== Build U-Boot ===
  
 
To produce u-boot-elf.srec file during U-Boot build, a patch [https://raw.githubusercontent.com/marex/meta-renesas/krogoth/meta-rcar-gen3/recipes-bsp/u-boot/files/0001-Makefile-add-u-boot-elf.srec-if-CONFIG_REMAKE_ELF-is.patch|patch] must first be applied:
 
To produce u-boot-elf.srec file during U-Boot build, a patch [https://raw.githubusercontent.com/marex/meta-renesas/krogoth/meta-rcar-gen3/recipes-bsp/u-boot/files/0001-Makefile-add-u-boot-elf.srec-if-CONFIG_REMAKE_ELF-is.patch|patch] must first be applied:
Line 75: Line 77:
 
  patch -Np1 -i 0001-Makefile-add-u-boot-elf.srec-if-CONFIG_REMAKE_ELF-is.patch
 
  patch -Np1 -i 0001-Makefile-add-u-boot-elf.srec-if-CONFIG_REMAKE_ELF-is.patch
  
The U-Boot sources must be configured for a particular supported platform. List of platforms and matching U-Boot defconfigs is available at [[R-Car/Boards/U-Boot-Gen3#Supported_boards|supported boards]].
+
The U-Boot sources must be configured for a particular supported platform. List of supported platforms and matching U-Boot defconfigs is available at [[R-Car/Boards/U-Boot-Gen3#Supported_boards|supported boards]].
  
 
  make r8a779x_y_defconfig
 
  make r8a779x_y_defconfig
Line 90: Line 92:
  
 
  make -j`expr \`nproc\` + 1`
 
  make -j`expr \`nproc\` + 1`
 +
 +
== Flashing U-Boot ==
 +
 +
Each platform has a slightly different process for updating the content of the flash. The [[R-Car/Boards/U-Boot-Gen3#Supported_boards|list of supported boards]] contains links to instructions for updating each supported board.
 +
 +
== Building IPL/ATF/BL and U-Boot using OpenEmbedded ==
 +
 +
Building all the components of the boot process can also be done using OpenEmbedded . By adding two extra patches on top of meta-renesas layer, it is possible to build mainline U-Boot alongside all the other components. The two patches add U-Boot 2018.01-rc1 recipe and switch preferred version of U-Boot to 2018.01% are available from [https://github.com/marex/meta-renesas/commit/978c9a57f29eb1b38c66e722febed00f66f77a3a] [https://github.com/marex/meta-renesas/commit/829d32bf071775ff98e0cba028b09d18a30ab491] and the patched meta-renesas layer is available at [https://github.com/marex/meta-renesas/tree/krogoth] .

Revision as of 08:39, 7 December 2017

Introduction

This is the Wiki for the U-Boot on Renesas R-Car Gen3 SoCs and boards . Refer to the R-Car page for information about Renesas' R-Car SoC family.

Supported boards

As of U-Boot 2018.01-rc1, the following boards are supported:

Supported boards in U-Boot 2018.01-rc1
Board U-Boot defconfig Update procedure
R8A7795 H3 ULCB r8a7795_ulcb_defconfig Flashing firmware
R8A7796 M3 ULCB r8a7796_ulcb_defconfig Flashing firmware
R8A7795 H3 Salvator-X ES2.0+ r8a7795_salvator-x_defconfig N/A
R8A7796 M3 Salvator-X r8a7796_salvator-x_defconfig N/A

Building U-Boot manually

Prerequisites

  • R-Car R8A7795 H3 ES1.x is NOT supported!
  • Running mainline U-Boot is only supported with IPL/ATF/BL revision 2.23 and newer.
  • ARM cross-compiler is mandatory to build U-Boot (OpenEmbedded generates this for you).

ARM cross-compiler

If you intend to build both IPL/ATF/BL and U-Boot using OpenEmbedded with meta-renesas layer, you can skip this step.

Debian and Ubuntu includes an ARM cross-compiler in its standard package feed. You can install it as follows:

apt-get install gcc-aarch64-linux-gnu

Other distributions likely also provide ARM cross-compilers. Consult distro-specific documentation for details.

Obtain U-Boot sources

The preferred method of obtaining U-Boot sources is through git VCS, using git protocol:

git clone git://git.denx.de/u-boot.git

or via HTTP:

git clone http://git.denx.de/u-boot.git

Finally, check out the version of U-Boot that will be used for the build:

cd u-boot
git checkout -b my_working_branch v2018.01-rc1

U-Boot git hosting also provides snapshots.

Prepare build environment

Before building U-Boot for R-Car Gen3 system, the following environment variables need to be configured:

export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-

The later variable must match the prefix of the Aarch64 cross-toolchain installed on your system, the example above is valid for Debian and Ubuntu,

Build U-Boot

To produce u-boot-elf.srec file during U-Boot build, a patch [1] must first be applied:

git am 0001-Makefile-add-u-boot-elf.srec-if-CONFIG_REMAKE_ELF-is.patch

or in case U-Boot snapshot was used:

patch -Np1 -i 0001-Makefile-add-u-boot-elf.srec-if-CONFIG_REMAKE_ELF-is.patch

The U-Boot sources must be configured for a particular supported platform. List of supported platforms and matching U-Boot defconfigs is available at supported boards.

make r8a779x_y_defconfig

for example to configure U-Boot sources for R8A7795 H3 ULCB board:

r8a7795_ulcb_defconfig

Once configured, U-Boot sources can be compiled to produce u-boot.bin and optionally u-boot-elf.srec:

make

To speed up build process, -jN option can be passed to make to start multiple jobs at the same time, this is beneficial especially on SMP systems. The following example starts up to (number of CPUs in a system + 1) jobs, which is the recommended amount:

make -j`expr \`nproc\` + 1`

Flashing U-Boot

Each platform has a slightly different process for updating the content of the flash. The list of supported boards contains links to instructions for updating each supported board.

Building IPL/ATF/BL and U-Boot using OpenEmbedded

Building all the components of the boot process can also be done using OpenEmbedded . By adding two extra patches on top of meta-renesas layer, it is possible to build mainline U-Boot alongside all the other components. The two patches add U-Boot 2018.01-rc1 recipe and switch preferred version of U-Boot to 2018.01% are available from [2] [3] and the patched meta-renesas layer is available at [4] .