diff mbox series

[v4,10/10] doc: renesas: add Renesas board docs

Message ID 20230308202653.1926303-11-ralph.siemsen@linaro.org
State New
Headers show
Series Renesas RZ/N1 SoC initial support | expand

Commit Message

Ralph Siemsen March 8, 2023, 8:26 p.m. UTC
Collect the list of currerently supported Renesas boards.

For the RZ/N1 board, add details about booting and flashing.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
---

(no changes since v1)

 doc/board/renesas/index.rst   |   9 +++
 doc/board/renesas/renesas.rst | 115 ++++++++++++++++++++++++++++++++++
 2 files changed, 124 insertions(+)
 create mode 100644 doc/board/renesas/index.rst
 create mode 100644 doc/board/renesas/renesas.rst

Comments

Marek Vasut April 17, 2023, 5:28 p.m. UTC | #1
On 3/8/23 21:26, Ralph Siemsen wrote:
> Collect the list of currerently

Typo, curr... .

> supported Renesas boards.
> 
> For the RZ/N1 board, add details about booting and flashing.

[...]

> +Renesas boards
> +--------------
> +
> +Renesas is a SoC solutions provider for industrial applications.

Automotive too.

> +U-boot supports several Renesas SoC families:

U-Boot .

> +* rcar gen1/gen2 (32-bit)

R-Car Gen2 (they are all Gen2 as far as I can tell)

> +    - Blanche board
> +    - Gose board
> +    - Koelsch board
> +    - Lager board
> +    - Silk board
> +    - Porter board
> +    - Stout board
> +* rcar gen3 (64-bit)

R-Car Gen3

> +    - Condor board
> +    - Draak board
> +    - Eagle board
> +    - Ebisu board
> +    - Falcon board

This one is in fact R-Car Gen4, as is Spider and Whitehawk (which are 
missing here)

> +    - Salvator-x board

Salvator-X and Salvator-XS boards

> +    - Ulcb board

ULCB (that's an abbreviation) .

> +    - Beacon-rzg2 board
> +    - Hihope-rzg2 board
> +    - ek874 board

Those three are RZ/G

> +* rza1 (32-bit)

RZ/A1

> +    - GR-PEACH board
> +* rzn1 (32-bit)

RZ/N1

> +    - Schneider rzn1-snarc board
> +
> +Building
> +--------
> +
> +NOTE: the following information is for the rzn1 board only.

Maybe this should be in a separate document , some rzn1 specific .rst file ?

> +U-Boot
> +^^^^^^
> +
> +Clone the u-boot repository and build it as follows:
> +
> +.. code-block:: bash
> +
> +        git clone --depth 1 https://source.denx.de/u-boot/u-boot.git
> +        cd u-boot
> +        make rzn1_snarc_defconfig
> +        make CROSS_COMPILE=arm-linux-gnu-
> +
> +This produces `u-boot` which is an ELF executable, suitable for use with `gdb`
> +and JTAG debugging tools.
> +
> +It also produceds `u-boot.bin` which is a raw binary.
> +
> +SPKG image
> +^^^^^^^^^^
> +
> +The BootROM in the RZ/N1 SoC expects to find the boot image in SPKG format.
> +This format is documented in Chapter 7.4 of the RZ/N1 User Manual.
> +
> +The raw u-boot binary can be wrapped into SPKG format as follows:
> +
> +.. code-block:: bash
> +
> +    tools/mkimage -n board/schneider/rzn1-snarc/spkgimage.cfg \
> +            -T spkgimage -a 0x20040000 -e 0x20040000 \
> +            -d u-boot.bin u-boot.bin.spkg

Shouldn't binman do this for you ? That should be the primary option.

> +This produces `u-boot.bin.spkg` which can be flashed into QSPI, NAND, or loaded
> +via USB-DFU mode.
> +
> +Take note of the load and execution address, which are encoded into the SPKG
> +headers. For development convenience, mkimage computes the execution offset
> +(part of the SPKG header) by subtracting the supplied load address from the
> +supplied execution address.
> +
> +Also note there are other parameters, notably ECC configuration in the case of
> +boot from NAND, specified in the `spkgimage.cfg` configuration file.
> +
> +Binman
> +^^^^^^
> +
> +Alternatively `binman` may be used to generate the SPKG format for booting.
> +This tool and its pre-requisites must be installed as per
> +:doc:`../../../tools/binman/binman.rst``
> +
> +.. code-block:: bash
> +
> +    binman -d arch/arm/dts/r9a06g032-rzn1-snarc.dtb -o <OUT>
> +
> +This will produce `u-boot.bin.spkg` in the specified <OUT> directory.
> +
> +Flashing
> +--------
> +
> +The RZ/N1 is able to boot from QSPI, NAND, or via USB (DFU). In all cases the
> +on-board BootROM expects for the binary to be wrapped with a "SPKG" header.
> +This format is detailed in the RZ/N1 User Manual, and can be produced using
> +the u-boot `mkimage` utility.
> +
> +It is possible to recover a bricked unit by using the USB (DFU) boot mode. This
> +allows uploading u-boot into the internal RAM. Thereafter u-boot can be used to
> +program the QSPI and/or NAND, making use of u-boot dfu mode.
> +
> +Otherwise the only other option for recovery is via JTAG.
Ralph Siemsen April 17, 2023, 8:29 p.m. UTC | #2
On Mon, Apr 17, 2023 at 07:28:05PM +0200, Marek Vasut wrote:
>On 3/8/23 21:26, Ralph Siemsen wrote:
>RZ/N1
>
>>+    - Schneider rzn1-snarc board
>>+
>>+Building
>>+--------
>>+
>>+NOTE: the following information is for the rzn1 board only.
>
>Maybe this should be in a separate document , some rzn1 specific .rst file ?

Originally I did just document the RZ/N1 stuff, since I really have no 
experience or knowledge of the other ones. But it felt wrong to create 
"doc/board/renesas" containing only RZ/N1 information. So I tried to at 
least collect the names of the other Renesas boards from U-Boot sources.

I'll make the fixes you suggested, and will move the RZ/N1 details into 
their own file.

>>+    tools/mkimage -n board/schneider/rzn1-snarc/spkgimage.cfg \
>>+            -T spkgimage -a 0x20040000 -e 0x20040000 \
>>+            -d u-boot.bin u-boot.bin.spkg
>
>Shouldn't binman do this for you ? That should be the primary option.

Indeed it does, see below. I did however want to document how to call 
mkimage manually, since it took me a while to work out the right 
arguments (especially using -n for the config file).

>>+Binman
>>+^^^^^^
>>+
>>+Alternatively `binman` may be used to generate the SPKG format for booting.
>>+This tool and its pre-requisites must be installed as per
>>+:doc:`../../../tools/binman/binman.rst``
>>+
>>+.. code-block:: bash
>>+
>>+    binman -d arch/arm/dts/r9a06g032-rzn1-snarc.dtb -o <OUT>
>>+
>>+This will produce `u-boot.bin.spkg` in the specified <OUT> directory.

Ralph
Marek Vasut April 17, 2023, 8:34 p.m. UTC | #3
On 4/17/23 22:29, Ralph Siemsen wrote:
> On Mon, Apr 17, 2023 at 07:28:05PM +0200, Marek Vasut wrote:
>> On 3/8/23 21:26, Ralph Siemsen wrote:
>> RZ/N1
>>
>>> +    - Schneider rzn1-snarc board
>>> +
>>> +Building
>>> +--------
>>> +
>>> +NOTE: the following information is for the rzn1 board only.
>>
>> Maybe this should be in a separate document , some rzn1 specific .rst 
>> file ?
> 
> Originally I did just document the RZ/N1 stuff, since I really have no 
> experience or knowledge of the other ones. But it felt wrong to create 
> "doc/board/renesas" containing only RZ/N1 information. So I tried to at 
> least collect the names of the other Renesas boards from U-Boot sources.
> 
> I'll make the fixes you suggested, and will move the RZ/N1 details into 
> their own file.
> 
>>> +    tools/mkimage -n board/schneider/rzn1-snarc/spkgimage.cfg \
>>> +            -T spkgimage -a 0x20040000 -e 0x20040000 \
>>> +            -d u-boot.bin u-boot.bin.spkg
>>
>> Shouldn't binman do this for you ? That should be the primary option.
> 
> Indeed it does, see below. I did however want to document how to call 
> mkimage manually, since it took me a while to work out the right 
> arguments (especially using -n for the config file).

Then maybe just swap the binman and mkimage chapters and be done with it ?
Ralph Siemsen April 17, 2023, 8:50 p.m. UTC | #4
On Mon, Apr 17, 2023 at 10:34:08PM +0200, Marek Vasut wrote:
>On 4/17/23 22:29, Ralph Siemsen wrote:
>>Indeed it does, see below. I did however want to document how to call 
>>mkimage manually, since it took me a while to work out the right 
>>arguments (especially using -n for the config file).
>
>Then maybe just swap the binman and mkimage chapters and be done with it ?

You mean put binman info first? Sure, I can do that ;-)

Ralph
diff mbox series

Patch

diff --git a/doc/board/renesas/index.rst b/doc/board/renesas/index.rst
new file mode 100644
index 0000000000..3244c9d45e
--- /dev/null
+++ b/doc/board/renesas/index.rst
@@ -0,0 +1,9 @@ 
+.. SPDX-License-Identifier: GPL-2.0+
+
+Renesas
+=======
+
+.. toctree::
+   :maxdepth: 2
+
+   renesas
diff --git a/doc/board/renesas/renesas.rst b/doc/board/renesas/renesas.rst
new file mode 100644
index 0000000000..5ae84004cf
--- /dev/null
+++ b/doc/board/renesas/renesas.rst
@@ -0,0 +1,115 @@ 
+.. SPDX-License-Identifier: GPL-2.0+
+
+Renesas
+=======
+
+About this
+----------
+
+This document describes the information about Renesas supported boards
+and their usage steps.
+
+Renesas boards
+--------------
+
+Renesas is a SoC solutions provider for industrial applications.
+
+U-boot supports several Renesas SoC families:
+
+* rcar gen1/gen2 (32-bit)
+    - Blanche board
+    - Gose board
+    - Koelsch board
+    - Lager board
+    - Silk board
+    - Porter board
+    - Stout board
+* rcar gen3 (64-bit)
+    - Condor board
+    - Draak board
+    - Eagle board
+    - Ebisu board
+    - Falcon board
+    - Salvator-x board
+    - Ulcb board
+    - Beacon-rzg2 board
+    - Hihope-rzg2 board
+    - ek874 board
+* rza1 (32-bit)
+    - GR-PEACH board
+* rzn1 (32-bit)
+    - Schneider rzn1-snarc board
+
+Building
+--------
+
+NOTE: the following information is for the rzn1 board only.
+
+U-Boot
+^^^^^^
+
+Clone the u-boot repository and build it as follows:
+
+.. code-block:: bash
+
+        git clone --depth 1 https://source.denx.de/u-boot/u-boot.git
+        cd u-boot
+        make rzn1_snarc_defconfig
+        make CROSS_COMPILE=arm-linux-gnu-
+
+This produces `u-boot` which is an ELF executable, suitable for use with `gdb`
+and JTAG debugging tools.
+
+It also produceds `u-boot.bin` which is a raw binary.
+
+SPKG image
+^^^^^^^^^^
+
+The BootROM in the RZ/N1 SoC expects to find the boot image in SPKG format.
+This format is documented in Chapter 7.4 of the RZ/N1 User Manual.
+
+The raw u-boot binary can be wrapped into SPKG format as follows:
+
+.. code-block:: bash
+
+    tools/mkimage -n board/schneider/rzn1-snarc/spkgimage.cfg \
+            -T spkgimage -a 0x20040000 -e 0x20040000 \
+            -d u-boot.bin u-boot.bin.spkg
+
+This produces `u-boot.bin.spkg` which can be flashed into QSPI, NAND, or loaded
+via USB-DFU mode.
+
+Take note of the load and execution address, which are encoded into the SPKG
+headers. For development convenience, mkimage computes the execution offset
+(part of the SPKG header) by subtracting the supplied load address from the
+supplied execution address.
+
+Also note there are other parameters, notably ECC configuration in the case of
+boot from NAND, specified in the `spkgimage.cfg` configuration file.
+
+Binman
+^^^^^^
+
+Alternatively `binman` may be used to generate the SPKG format for booting.
+This tool and its pre-requisites must be installed as per
+:doc:`../../../tools/binman/binman.rst``
+
+.. code-block:: bash
+
+    binman -d arch/arm/dts/r9a06g032-rzn1-snarc.dtb -o <OUT>
+
+This will produce `u-boot.bin.spkg` in the specified <OUT> directory.
+
+Flashing
+--------
+
+The RZ/N1 is able to boot from QSPI, NAND, or via USB (DFU). In all cases the
+on-board BootROM expects for the binary to be wrapped with a "SPKG" header.
+This format is detailed in the RZ/N1 User Manual, and can be produced using
+the u-boot `mkimage` utility.
+
+It is possible to recover a bricked unit by using the USB (DFU) boot mode. This
+allows uploading u-boot into the internal RAM. Thereafter u-boot can be used to
+program the QSPI and/or NAND, making use of u-boot dfu mode.
+
+Otherwise the only other option for recovery is via JTAG.