This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
civilinfrastructureplatform:ciptesting:cipreferencehardware:hihope-rzg2m:hihope-rzg2mbuildinstructions [2019/09/30 13:56] patersonc [Build Output] |
civilinfrastructureplatform:ciptesting:cipreferencehardware:hihope-rzg2m:hihope-rzg2mbuildinstructions [2020/01/20 06:07] (current) kanechikay Update the procedure for RZ/G2 Flash Writer to support v1.01 |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Renesas RZ/G2M hihope-rzg2m build instructions ====== | ====== Renesas RZ/G2M hihope-rzg2m build instructions ====== | ||
+ | |||
+ | This page describes how to build following images/tools for Renesas RZ/G2M hihope-rzg2m. | ||
+ | * the latest CIP kernel | ||
+ | * the full hihope-rzg2m BSP from Renesas (including loader, U-Boot, kernel based on CIP kernel and rootfs) | ||
+ | * SDK (cross compiler, kernel sources, kernel headers and rootfs) | ||
+ | * the RZ/G2 flash writer | ||
===== How to build the latest CIP Kernel for hihope-rzg2m ===== | ===== How to build the latest CIP Kernel for hihope-rzg2m ===== | ||
Line 28: | Line 34: | ||
$ git clone https://gitlab.com/cip-project/cip-kernel/cip-kernel-config.git | $ git clone https://gitlab.com/cip-project/cip-kernel/cip-kernel-config.git | ||
$ cd kernel | $ cd kernel | ||
- | $ cp ../cip-kernel-config/4.19.y-cip/arm64/renesas.config .config | + | $ cp ../cip-kernel-config/4.19.y-cip/arm64/renesas_defconfig arch/arm64/configs/renesas_defconfig |
+ | $ make renesas_defconfig | ||
</code> | </code> | ||
Line 34: | Line 41: | ||
<code> | <code> | ||
$ make | $ make | ||
+ | $ make dtbs | ||
</code> | </code> | ||
Line 39: | Line 47: | ||
==== Build Output ==== | ==== Build Output ==== | ||
Output file locations: | Output file locations: | ||
- | * Kernel: arch/arm64/boot/uImage | + | * Kernel: arch/arm64/boot/Image |
* Device tree: arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m.dtb | * Device tree: arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m.dtb | ||
* Device tree: arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m-ex.dtb (when using expansion board) | * Device tree: arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m-ex.dtb (when using expansion board) | ||
Line 131: | Line 139: | ||
==== Build Output ==== | ==== Build Output ==== | ||
Once the build is completed, the Kernel, device tree and RFS are located in $WORK/build/tmp/deploy/images/hihope-rzg2m. | Once the build is completed, the Kernel, device tree and RFS are located in $WORK/build/tmp/deploy/images/hihope-rzg2m. | ||
+ | |||
+ | ^ # ^ Filename ^ Description ^ Note ^ | ||
+ | | 1 | bootparam_sa0.srec | Loader (Boot parameter) | S-record format | | ||
+ | | 2 | bl2-hihope-rzg2m.srec | Loader (Trusted firmware-A BL2) | S-record format | | ||
+ | | 3 | cert_header_sa6.srec | Loader (Certification) | S-record format | | ||
+ | | 4 | bl31-hihope-rzg2m.srec | Trusted fimrware-A BL31 | S-record format | | ||
+ | | 5 | u-boot-elf-hihope-rzg2m.srec | U-Boot | symbolic link to the latest image, S-record format | | ||
+ | | 6 | Image | Linux kernel image | symbolic link to the latest image | | ||
+ | | 7 | r8a774a1-hihope-rzg2m.dtb | Device tree blob for hihope-rzg2m without the expansion board | symbolic link to the latest dtb | | ||
+ | | 8 | r8a774a1-hihope-rzg2m-ex.dtb | Device tree blob for hihope-rzg2m with the expansion board | symbolic link to the latest dtb | | ||
Line 202: | Line 220: | ||
$ $CC [your source code].c [optional FLAGs etc.] | $ $CC [your source code].c [optional FLAGs etc.] | ||
</code> | </code> | ||
+ | |||
+ | ===== How to build the RZ/G2 flash writer ===== | ||
+ | |||
+ | This chapter describes how to build the RZ/G2 flash writer. | ||
+ | For further build options, please refer to [[https://github.com/renesas-rz/rzg2_flash_writer/blob/master/README.md|README of the RZ/G2 Flash Writer]]: | ||
+ | |||
+ | ==== Prepare the compiler ==== | ||
+ | |||
+ | Get cross compiler from linaro or setup the Yocto SDK. | ||
+ | |||
+ | Linaro toolchain: | ||
+ | |||
+ | <code> | ||
+ | cd ~/ | ||
+ | wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-elf/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-elf.tar.xz | ||
+ | tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-elf.tar.xz | ||
+ | </code> | ||
+ | |||
+ | Yocto SDK: | ||
+ | |||
+ | <code> | ||
+ | source /opt/poky/2.4.3/environment-setup-aarch64-poky-linux | ||
+ | </code> | ||
+ | |||
+ | ==== Prepare the source code ==== | ||
+ | |||
+ | Get the source code of RZ/G2 flash writer. | ||
+ | |||
+ | <code> | ||
+ | cd ~/ | ||
+ | git clone https://github.com/renesas-rz/rzg2_flash_writer.git | ||
+ | cd rzg2_flash_writer | ||
+ | git checkout -b v1.01 v1.01 | ||
+ | </code> | ||
+ | |||
+ | ==== Build the RZ/G2 flash writer ==== | ||
+ | |||
+ | S-record file will be built by the following command. | ||
+ | |||
+ | Linaro toolchain: | ||
+ | |||
+ | <code> | ||
+ | make -f makefile.linaro clean | ||
+ | CROSS_COMPILE=~/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-elf/bin/aarch64-elf- make -f makefile.linaro BOARD=HIHOPE | ||
+ | </code> | ||
+ | |||
+ | Yocto SDK: | ||
+ | |||
+ | <code> | ||
+ | make clean | ||
+ | make BOARD=HIHOPE | ||
+ | </code> | ||
+ | |||
+ | Output image will be available in the following directory. | ||
+ | |||
+ | * ./AArch64_output/AArch64_Flash_writer_SCIF_DUMMY_CERT_E6300400_hihope.mot | ||