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

From eLinux.org
Jump to: navigation, search
m
 
(12 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
== Supported boards ==
 
== Supported boards ==
  
As of U-Boot 2018.03-rc3, the following boards are supported including DM and DT:
+
As of U-Boot 2019.10, the following boards are supported including DM and DT:
 
{| class="wikitable"
 
{| class="wikitable"
|+ Supported boards in U-Boot 2018.03-rc3
+
|+ Supported boards in U-Boot 2019.10
 
|-
 
|-
! Board !! U-Boot defconfig || Update procedure
+
! Board !! U-Boot defconfig !! Update procedure
 
|-
 
|-
| [[R-Car/Boards/Porter|R8A7791 M2 Porter]] || porter_defconfig || [[R-Car/Boards/U-Boot-Gen2#M2 Porter|Updating U-Boot on M2 Porter]]
+
| [[R-Car/Boards/Stout|R8A7790 H2 Stout]] || stout_defconfig || [[R-Car/Boards/U-Boot-Gen2#Flashing U-Boot|From U-Boot]] or [[R-Car/Boards/JTAG-Gen2|Via JTAG]]
 +
|-
 +
| [[R-Car/Boards/Porter|R8A7791 M2-W Porter]] || porter_defconfig || [[R-Car/Boards/U-Boot-Gen2#Flashing U-Boot|From U-Boot]] or [[R-Car/Boards/JTAG-Gen2|Via JTAG]]
 +
|-
 +
| [[R-Car/Boards/SILK|R8A7794 E2 Silk]] || silk_defconfig || [[R-Car/Boards/U-Boot-Gen2#Flashing U-Boot|From U-Boot]] or [[R-Car/Boards/JTAG-Gen2|Via JTAG]]
 +
|-
 +
| [[R-Car/Boards/Alt|R8A7794 E2 Alt]] || alt_defconfig || [[R-Car/Boards/U-Boot-Gen2#Flashing U-Boot|From U-Boot]] or [[R-Car/Boards/JTAG-Gen2|Via JTAG]]
 
|}
 
|}
  
Line 37: Line 43:
 
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:
  
  git clone git://git.denx.de/u-boot.git
+
  git clone git://gitlab.denx.de/u-boot.git
  
or via HTTP:
+
or via HTTPS:
  
  git clone http://git.denx.de/u-boot.git
+
  git clone https://gitlab.denx.de/u-boot/u-boot.git
  
 
Finally, check out the version of U-Boot that will be used for the build:
 
Finally, check out the version of U-Boot that will be used for the build:
  
 
  cd u-boot
 
  cd u-boot
  git checkout -b my_working_branch v2018.03-rc3
+
  git checkout -b my_working_branch v2019.10
  
U-Boot [http://git.denx.de/?p=u-boot.git;a=summary git hosting] also provides snapshots.
+
U-Boot [https://gitlab.denx.de/u-boot/u-boot/-/tags git tags] also provides snapshots.
  
 
=== Prepare build environment ===
 
=== Prepare build environment ===
Line 65: Line 71:
 
  make y_defconfig
 
  make y_defconfig
  
for example to configure U-Boot sources for R8A7791 M2 Porter board:
+
for example to configure U-Boot sources for R8A7791 M2-W Porter board:
  
 
  make porter_defconfig
 
  make porter_defconfig
  
Once configured, U-Boot sources can be compiled to produce u-boot.img and optionally u-boot-spl.srec:
+
Once configured, U-Boot sources can be compiled to produce u-boot.img and u-boot-spl.srec:
  
 
  make
 
  make
arm-linux-gnueabi-objcopy -O srec spl/u-boot-spl u-boot-spl.srec
 
  
 
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:
 
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:
Line 82: Line 87:
 
Each platform has a slightly different process for updating the content of the flash. The [[R-Car/Boards/U-Boot-Gen2#Supported_boards|list of supported boards]] contains links to instructions for updating each supported board.
 
Each platform has a slightly different process for updating the content of the flash. The [[R-Car/Boards/U-Boot-Gen2#Supported_boards|list of supported boards]] contains links to instructions for updating each supported board.
  
=== M2 Porter ===
+
=== Generic Gen2 platform ===
  
The M2 Porter board uses U-Boot SPL since v2018.03-rc3 due to increase in U-Boot binary size. This changes the flash layout!
+
The H2 Stout, M2-W Porter, E2 Silk boards use U-Boot SPL to replace the SPI LOADER since U-Boot v2018.05-rc. This changes the flash layout!
 +
 
 +
As of U-Boot 2018.05, the flash layout is as follows:
 +
{| class="wikitable"
 +
|+ Flash layout in U-Boot 2018.05
 +
|-
 +
! Offset !! Size !! Usage
 +
|-
 +
| 0x00000 || 0x40000 || U-Boot SPL up to 0x10000 (BootROM size limit), remaining 0x30000 unused (SF erase block is 0x40000 big)
 +
|-
 +
| 0x40000 || 0x40000 || UNUSED, was SPI LOADER metadata
 +
|-
 +
| 0x80000 || 0x40000 || UNUSED
 +
|-
 +
| 0xc0000 || 0x40000 || U-Boot environment
 +
|-
 +
| 0x100000 || 0x40000 || UNUSED
 +
|-
 +
| 0x140000 || 0x80000 || U-Boot uImage
 +
|}
 +
 
 +
1) Build u-boot.img and u-boot-spl.bin as instructed above.
  
1) Build u-boot.img and u-boot-spl.srec as instructed above.
 
 
2) Install u-boot.img to SPI NOR at offset 0x140000, for example from already running U-Boot:
 
2) Install u-boot.img to SPI NOR at offset 0x140000, for example from already running U-Boot:
 
   => tftp 0x50000000 192.168.1.300:u-boot.img
 
   => tftp 0x50000000 192.168.1.300:u-boot.img
Line 92: Line 117:
 
   => sf erase 0x140000 0x80000
 
   => sf erase 0x140000 0x80000
 
   => sf write 0x50000000 0x140000 ${filesize}
 
   => sf write 0x50000000 0x140000 ${filesize}
3) Install u-boot-spl.srec instead of U-Boot using the procedure documented in [[R-Car/Boards/Porter#Updating U-Boot|Updating U-Boot on M2 Porter]]
+
 
 +
3) Install u-boot-spl.bin to SPI NOR at offset 0x0, for example from already running U-Boot:
 +
  => tftp 0x50000000 192.168.1.300:u-boot-spl.bin
 +
  => sf probe
 +
  => sf erase 0x0 0x40000
 +
  => sf write 0x50000000 0x0 ${filesize}
  
 
After power-cycling the board, U-Boot SPL will come up and load U-Boot from SPI NOR.
 
After power-cycling the board, U-Boot SPL will come up and load U-Boot from SPI NOR.
  
Known issues:
+
== Known issues ==
- RSPI driver is slow, to be fixed in 2018.05
+
 
- MicroSD slot is inoperable, to be fixed in 2018.05
+
- NONE

Latest revision as of 04:14, 17 October 2019

Introduction

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

Supported boards

As of U-Boot 2019.10, the following boards are supported including DM and DT:

Supported boards in U-Boot 2019.10
Board U-Boot defconfig Update procedure
R8A7790 H2 Stout stout_defconfig From U-Boot or Via JTAG
R8A7791 M2-W Porter porter_defconfig From U-Boot or Via JTAG
R8A7794 E2 Silk silk_defconfig From U-Boot or Via JTAG
R8A7794 E2 Alt alt_defconfig From U-Boot or Via JTAG

Building U-Boot manually

Building U-Boot can be done manually by using the U-Boot sources.

Prerequisites

  • ARM cross-compiler is mandatory to build U-Boot.

ARM cross-compiler

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

apt-get install gcc-arm-linux-gnueabi

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://gitlab.denx.de/u-boot.git

or via HTTPS:

git clone https://gitlab.denx.de/u-boot/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 v2019.10

U-Boot git tags also provides snapshots.

Prepare build environment

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

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-

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

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 y_defconfig

for example to configure U-Boot sources for R8A7791 M2-W Porter board:

make porter_defconfig

Once configured, U-Boot sources can be compiled to produce u-boot.img and u-boot-spl.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.

Generic Gen2 platform

The H2 Stout, M2-W Porter, E2 Silk boards use U-Boot SPL to replace the SPI LOADER since U-Boot v2018.05-rc. This changes the flash layout!

As of U-Boot 2018.05, the flash layout is as follows:

Flash layout in U-Boot 2018.05
Offset Size Usage
0x00000 0x40000 U-Boot SPL up to 0x10000 (BootROM size limit), remaining 0x30000 unused (SF erase block is 0x40000 big)
0x40000 0x40000 UNUSED, was SPI LOADER metadata
0x80000 0x40000 UNUSED
0xc0000 0x40000 U-Boot environment
0x100000 0x40000 UNUSED
0x140000 0x80000 U-Boot uImage

1) Build u-boot.img and u-boot-spl.bin as instructed above.

2) Install u-boot.img to SPI NOR at offset 0x140000, for example from already running U-Boot:

  => tftp 0x50000000 192.168.1.300:u-boot.img
  => sf probe
  => sf erase 0x140000 0x80000
  => sf write 0x50000000 0x140000 ${filesize}

3) Install u-boot-spl.bin to SPI NOR at offset 0x0, for example from already running U-Boot:

  => tftp 0x50000000 192.168.1.300:u-boot-spl.bin
  => sf probe
  => sf erase 0x0 0x40000
  => sf write 0x50000000 0x0 ${filesize}

After power-cycling the board, U-Boot SPL will come up and load U-Boot from SPI NOR.

Known issues

- NONE