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