xref: /arm-trusted-firmware/docs/plat/rz-g2.rst (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700SchasingluluRenesas RZ/G
2*91f16700Schasinglulu============
3*91f16700Schasinglulu
4*91f16700SchasingluluThe "RZ/G" Family of high-end 64-bit Arm®-based microprocessors (MPUs)
5*91f16700Schasingluluenables the solutions required for the smart society of the future.
6*91f16700SchasingluluThrough a variety of Arm Cortex®-A53 and A57-based devices, engineers can
7*91f16700Schasinglulueasily implement high-resolution human machine interfaces (HMI), embedded
8*91f16700Schasingluluvision, embedded artificial intelligence (e-AI) and real-time control and
9*91f16700Schasingluluindustrial ethernet connectivity.
10*91f16700Schasinglulu
11*91f16700SchasingluluThe scalable RZ/G hardware platform and flexible software platform
12*91f16700Schasinglulucover the full product range, from the premium class to the entry
13*91f16700Schasinglululevel. Plug-ins are available for multiple open-source software tools.
14*91f16700Schasinglulu
15*91f16700Schasinglulu
16*91f16700SchasingluluRenesas RZ/G2 reference platforms:
17*91f16700Schasinglulu----------------------------------
18*91f16700Schasinglulu
19*91f16700Schasinglulu+--------------+----------------------------------------------------------------------------------+
20*91f16700Schasinglulu| Board        |      Details                                                                     |
21*91f16700Schasinglulu+==============+===============+==================================================================+
22*91f16700Schasinglulu| hihope-rzg2h | "96 boards" compatible board from Hoperun equipped with Renesas RZ/G2H SoC       |
23*91f16700Schasinglulu|              +----------------------------------------------------------------------------------+
24*91f16700Schasinglulu|              | http://hihope.org/product/musashi                                                |
25*91f16700Schasinglulu+--------------+----------------------------------------------------------------------------------+
26*91f16700Schasinglulu| hihope-rzg2m | "96 boards" compatible board from Hoperun equipped with Renesas RZ/G2M SoC       |
27*91f16700Schasinglulu|              +----------------------------------------------------------------------------------+
28*91f16700Schasinglulu|              | http://hihope.org/product/musashi                                                |
29*91f16700Schasinglulu+--------------+----------------------------------------------------------------------------------+
30*91f16700Schasinglulu| hihope-rzg2n | "96 boards" compatible board from Hoperun equipped with Renesas RZ/G2N SoC       |
31*91f16700Schasinglulu|              +----------------------------------------------------------------------------------+
32*91f16700Schasinglulu|              | http://hihope.org/product/musashi                                                |
33*91f16700Schasinglulu+--------------+----------------------------------------------------------------------------------+
34*91f16700Schasinglulu| ek874        | "96 boards" compatible board from Silicon Linux equipped with Renesas RZ/G2E SoC |
35*91f16700Schasinglulu|              +----------------------------------------------------------------------------------+
36*91f16700Schasinglulu|              | https://www.si-linux.co.jp/index.php?CAT%2FCAT874                                |
37*91f16700Schasinglulu+--------------+----------------------------------------------------------------------------------+
38*91f16700Schasinglulu
39*91f16700Schasinglulu`boards info <https://www.renesas.com/us/en/products/rzg-linux-platform/rzg-marcketplace/board-solutions.html#rzg2>`__
40*91f16700Schasinglulu
41*91f16700SchasingluluThe current TF-A port has been tested on the HiHope RZ/G2M
42*91f16700SchasingluluSoC_id r8a774a1 revision ES1.3.
43*91f16700Schasinglulu
44*91f16700Schasinglulu
45*91f16700Schasinglulu::
46*91f16700Schasinglulu
47*91f16700Schasinglulu    ARM CA57 (ARMv8) 1.5 GHz dual core, with NEON/VFPv4, L1$ I/D 48K/32K, L2$ 1MB
48*91f16700Schasinglulu    ARM CA53 (ARMv8) 1.2 GHz quad core, with NEON/VFPv4, L1$ I/D 32K/32K, L2$ 512K
49*91f16700Schasinglulu    Memory controller for LPDDR4-3200 4GB in 2 channels(32-bit bus mode)
50*91f16700Schasinglulu    Two- and three-dimensional graphics engines,
51*91f16700Schasinglulu    Video processing units,
52*91f16700Schasinglulu    Display Output,
53*91f16700Schasinglulu    Video Input,
54*91f16700Schasinglulu    SD card host interface,
55*91f16700Schasinglulu    USB3.0 and USB2.0 interfaces,
56*91f16700Schasinglulu    CAN interfaces,
57*91f16700Schasinglulu    Ethernet AVB,
58*91f16700Schasinglulu    Wi-Fi + BT,
59*91f16700Schasinglulu    PCI Express Interfaces,
60*91f16700Schasinglulu    Memories
61*91f16700Schasinglulu        INTERNAL 384KB SYSTEM RAM
62*91f16700Schasinglulu        DDR 4 GB LPDDR4
63*91f16700Schasinglulu        QSPI FLASH 64MB
64*91f16700Schasinglulu        EMMC 32 GB EMMC (HS400 240 MBYTES/S)
65*91f16700Schasinglulu        MICROSD-CARD SLOT (SDR104 100 MBYTES/S)
66*91f16700Schasinglulu
67*91f16700SchasingluluOverview
68*91f16700Schasinglulu--------
69*91f16700SchasingluluOn RZ/G2 SoCs the BOOTROM starts the cpu at EL3; for this port BL2
70*91f16700Schasingluluwill therefore be entered at this exception level (the Renesas' ATF
71*91f16700Schasinglulureference tree [1] resets into EL1 before entering BL2 - see its
72*91f16700Schasinglulubl2.ld.S)
73*91f16700Schasinglulu
74*91f16700SchasingluluBL2 initializes DDR before determining the boot reason (cold or warm).
75*91f16700Schasinglulu
76*91f16700SchasingluluOnce BL2 boots, it determines the boot reason, writes it to shared
77*91f16700Schasinglulumemory (BOOT_KIND_BASE) together with the BL31 parameters
78*91f16700Schasinglulu(PARAMS_BASE) and jumps to BL31.
79*91f16700Schasinglulu
80*91f16700SchasingluluTo all effects, BL31 is as if it is being entered in reset mode since
81*91f16700Schasingluluit still needs to initialize the rest of the cores; this is the reason
82*91f16700Schasinglulubehind using direct shared memory access to  BOOT_KIND_BASE _and_
83*91f16700SchasingluluPARAMS_BASE instead of using registers to get to those locations (see
84*91f16700Schasingluluel3_common_macros.S and bl31_entrypoint.S for the RESET_TO_BL31 use
85*91f16700Schasinglulucase).
86*91f16700Schasinglulu
87*91f16700Schasinglulu[1] https://github.com/renesas-rz/meta-rzg2/tree/BSP-1.0.5/recipes-bsp/arm-trusted-firmware/files
88*91f16700Schasinglulu
89*91f16700Schasinglulu
90*91f16700SchasingluluHow to build
91*91f16700Schasinglulu------------
92*91f16700Schasinglulu
93*91f16700SchasingluluThe TF-A build options depend on the target board so you will have to
94*91f16700Schasinglulurefer to those specific instructions. What follows is customized to
95*91f16700Schasingluluthe HiHope RZ/G2M development kit used in this port.
96*91f16700Schasinglulu
97*91f16700SchasingluluBuild Tested:
98*91f16700Schasinglulu~~~~~~~~~~~~~
99*91f16700Schasinglulu
100*91f16700Schasinglulu.. code:: bash
101*91f16700Schasinglulu
102*91f16700Schasinglulu       make bl2 bl31 rzg LOG_LEVEL=40 PLAT=rzg LSI=G2M RCAR_DRAM_SPLIT=2\
103*91f16700Schasinglulu       RCAR_LOSSY_ENABLE=1 SPD="none" MBEDTLS_DIR=$mbedtls
104*91f16700Schasinglulu
105*91f16700SchasingluluSystem Tested:
106*91f16700Schasinglulu~~~~~~~~~~~~~~
107*91f16700Schasinglulu* mbed_tls:
108*91f16700Schasinglulu  git@github.com:ARMmbed/mbedtls.git [devel]
109*91f16700Schasinglulu
110*91f16700Schasinglulu|  commit 72ca39737f974db44723760623d1b29980c00a88
111*91f16700Schasinglulu|  Merge: ef94c4fcf dd9ec1c57
112*91f16700Schasinglulu|  Author: Janos Follath <janos.follath@arm.com>
113*91f16700Schasinglulu|  Date:   Wed Oct 7 09:21:01 2020 +0100
114*91f16700Schasinglulu
115*91f16700Schasinglulu* u-boot:
116*91f16700Schasinglulu  The port has beent tested using mainline uboot with HiHope RZ/G2M board
117*91f16700Schasinglulu  specific patches.
118*91f16700Schasinglulu
119*91f16700Schasinglulu|  commit 46ce9e777c1314ccb78906992b94001194eaa87b
120*91f16700Schasinglulu|  Author: Heiko Schocher <hs@denx.de>
121*91f16700Schasinglulu|  Date:   Tue Nov 3 15:22:36 2020 +0100
122*91f16700Schasinglulu
123*91f16700Schasinglulu* linux:
124*91f16700Schasinglulu  The port has beent tested using mainline kernel.
125*91f16700Schasinglulu
126*91f16700Schasinglulu|  commit f8394f232b1eab649ce2df5c5f15b0e528c92091
127*91f16700Schasinglulu|  Author: Linus Torvalds <torvalds@linux-foundation.org>
128*91f16700Schasinglulu|  Date:   Sun Nov 8 16:10:16 2020 -0800
129*91f16700Schasinglulu|  Linux 5.10-rc3
130*91f16700Schasinglulu
131*91f16700SchasingluluTF-A Build Procedure
132*91f16700Schasinglulu~~~~~~~~~~~~~~~~~~~~
133*91f16700Schasinglulu
134*91f16700Schasinglulu-  Fetch all the above 3 repositories.
135*91f16700Schasinglulu
136*91f16700Schasinglulu-  Prepare the AARCH64 toolchain.
137*91f16700Schasinglulu
138*91f16700Schasinglulu-  Build u-boot using hihope_rzg2_defconfig.
139*91f16700Schasinglulu
140*91f16700Schasinglulu   Result: u-boot-elf.srec
141*91f16700Schasinglulu
142*91f16700Schasinglulu.. code:: bash
143*91f16700Schasinglulu
144*91f16700Schasinglulu       make CROSS_COMPILE=aarch64-linux-gnu-
145*91f16700Schasinglulu	  hihope_rzg2_defconfig
146*91f16700Schasinglulu
147*91f16700Schasinglulu       make CROSS_COMPILE=aarch64-linux-gnu-
148*91f16700Schasinglulu
149*91f16700Schasinglulu-  Build TF-A
150*91f16700Schasinglulu
151*91f16700Schasinglulu   Result: bootparam_sa0.srec, cert_header_sa6.srec, bl2.srec, bl31.srec
152*91f16700Schasinglulu
153*91f16700Schasinglulu.. code:: bash
154*91f16700Schasinglulu
155*91f16700Schasinglulu       make bl2 bl31 rzg LOG_LEVEL=40 PLAT=rzg LSI=G2M RCAR_DRAM_SPLIT=2\
156*91f16700Schasinglulu       RCAR_LOSSY_ENABLE=1 SPD="none" MBEDTLS_DIR=$mbedtls
157*91f16700Schasinglulu
158*91f16700Schasinglulu
159*91f16700SchasingluluInstall Procedure
160*91f16700Schasinglulu~~~~~~~~~~~~~~~~~
161*91f16700Schasinglulu
162*91f16700Schasinglulu- Boot the board in Mini-monitor mode and enable access to the
163*91f16700Schasinglulu  QSPI flash.
164*91f16700Schasinglulu
165*91f16700Schasinglulu
166*91f16700Schasinglulu- Use the flash_writer utility[2] to flash all the SREC files.
167*91f16700Schasinglulu
168*91f16700Schasinglulu[2] https://github.com/renesas-rz/rzg2_flash_writer
169*91f16700Schasinglulu
170*91f16700Schasinglulu
171*91f16700SchasingluluBoot trace
172*91f16700Schasinglulu----------
173*91f16700Schasinglulu::
174*91f16700Schasinglulu
175*91f16700Schasinglulu   INFO:    ARM GICv2 driver initialized
176*91f16700Schasinglulu   NOTICE:  BL2: RZ/G2 Initial Program Loader(CA57) Rev.2.0.6
177*91f16700Schasinglulu   NOTICE:  BL2: PRR is RZ/G2M Ver.1.3
178*91f16700Schasinglulu   NOTICE:  BL2: Board is HiHope RZ/G2M Rev.4.0
179*91f16700Schasinglulu   NOTICE:  BL2: Boot device is QSPI Flash(40MHz)
180*91f16700Schasinglulu   NOTICE:  BL2: LCM state is unknown
181*91f16700Schasinglulu   NOTICE:  BL2: DDR3200(rev.0.40)
182*91f16700Schasinglulu   NOTICE:  BL2: [COLD_BOOT]
183*91f16700Schasinglulu   NOTICE:  BL2: DRAM Split is 2ch
184*91f16700Schasinglulu   NOTICE:  BL2: QoS is default setting(rev.0.19)
185*91f16700Schasinglulu   NOTICE:  BL2: DRAM refresh interval 1.95 usec
186*91f16700Schasinglulu   NOTICE:  BL2: Periodic Write DQ Training
187*91f16700Schasinglulu   NOTICE:  BL2: CH0: 400000000 - 47fffffff, 2 GiB
188*91f16700Schasinglulu   NOTICE:  BL2: CH2: 600000000 - 67fffffff, 2 GiB
189*91f16700Schasinglulu   NOTICE:  BL2: Lossy Decomp areas
190*91f16700Schasinglulu   NOTICE:       Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570
191*91f16700Schasinglulu   NOTICE:       Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0
192*91f16700Schasinglulu   NOTICE:       Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0
193*91f16700Schasinglulu   NOTICE:  BL2: FDT at 0xe631db30
194*91f16700Schasinglulu   NOTICE:  BL2: v2.3(release):v2.4-rc0-2-g1433701e5
195*91f16700Schasinglulu   NOTICE:  BL2: Built : 13:45:26, Nov  7 2020
196*91f16700Schasinglulu   NOTICE:  BL2: Normal boot
197*91f16700Schasinglulu   INFO:    BL2: Doing platform setup
198*91f16700Schasinglulu   INFO:    BL2: Loading image id 3
199*91f16700Schasinglulu   NOTICE:  BL2: dst=0xe631d200 src=0x8180000 len=512(0x200)
200*91f16700Schasinglulu   NOTICE:  BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800)
201*91f16700Schasinglulu   WARNING: r-car ignoring the BL31 size from certificate,using RCAR_TRUSTED_SRAM_SIZE instead
202*91f16700Schasinglulu   INFO:    Loading image id=3 at address 0x44000000
203*91f16700Schasinglulu   NOTICE:  rcar_file_len: len: 0x0003e000
204*91f16700Schasinglulu   NOTICE:  BL2: dst=0x44000000 src=0x81c0000 len=253952(0x3e000)
205*91f16700Schasinglulu   INFO:    Image id=3 loaded: 0x44000000 - 0x4403e000
206*91f16700Schasinglulu   INFO:    BL2: Loading image id 5
207*91f16700Schasinglulu   INFO:    Loading image id=5 at address 0x50000000
208*91f16700Schasinglulu   NOTICE:  rcar_file_len: len: 0x00100000
209*91f16700Schasinglulu   NOTICE:  BL2: dst=0x50000000 src=0x8300000 len=1048576(0x100000)
210*91f16700Schasinglulu   INFO:    Image id=5 loaded: 0x50000000 - 0x50100000
211*91f16700Schasinglulu   NOTICE:  BL2: Booting BL31
212*91f16700Schasinglulu   INFO:    Entry point address = 0x44000000
213*91f16700Schasinglulu   INFO:    SPSR = 0x3cd
214*91f16700Schasinglulu
215*91f16700Schasinglulu
216*91f16700Schasinglulu   U-Boot 2021.01-rc1-00244-gac37e14fbd (Nov 04 2020 - 20:03:34 +0000)
217*91f16700Schasinglulu
218*91f16700Schasinglulu   CPU: Renesas Electronics R8A774A1 rev 1.3
219*91f16700Schasinglulu   Model: HopeRun HiHope RZ/G2M with sub board
220*91f16700Schasinglulu   DRAM:  3.9 GiB
221*91f16700Schasinglulu   MMC:   mmc@ee100000: 0, mmc@ee160000: 1
222*91f16700Schasinglulu   Loading Environment from MMC... OK
223*91f16700Schasinglulu   In:    serial@e6e88000
224*91f16700Schasinglulu   Out:   serial@e6e88000
225*91f16700Schasinglulu   Err:   serial@e6e88000
226*91f16700Schasinglulu   Net:   eth0: ethernet@e6800000
227*91f16700Schasinglulu   Hit any key to stop autoboot:  0
228*91f16700Schasinglulu   =>
229