rcar-gen3.rst 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. Renesas R-Car
  2. =============
  3. "R-Car" is the nickname for Renesas' system-on-chip (SoC) family for
  4. car information systems designed for the next-generation of automotive
  5. computing for the age of autonomous vehicles.
  6. The scalable R-Car hardware platform and flexible software platform
  7. cover the full product range, from the premium class to the entry
  8. level. Plug-ins are available for multiple open-source software tools.
  9. Renesas R-Car Gen3 evaluation boards:
  10. -------------------------------------
  11. +------------+-----------------+-----------------------------+
  12. | | Standard | Low Cost Boards (LCB) |
  13. +============+=================+=============================+
  14. | R-Car H3 | - Salvator-X | - R-Car Starter Kit Premier |
  15. | | - Salvator-XS | |
  16. +------------+-----------------+-----------------------------+
  17. | R-Car M3-W | - Salvator-X | |
  18. | | - Salvator-XS | - R-Car Starter Kit Pro |
  19. +------------+-----------------+-----------------------------+
  20. | R-Car M3-N | - Salvator-X | |
  21. | | - Salvator-XS | |
  22. +------------+-----------------+-----------------------------+
  23. | R-Car V3M | - Eagle | - Starter Kit |
  24. +------------+-----------------+-----------------------------+
  25. | R-Car V3H | - Condor | - Starter Kit |
  26. +------------+-----------------+-----------------------------+
  27. | R-Car D3 | - Draak | |
  28. +------------+-----------------+-----------------------------+
  29. `boards info <https://elinux.org/R-Car>`__
  30. The current TF-A port has been tested on the R-Car H3 Salvator-X
  31. Soc_id r8a7795 revision ES1.1 (uses a Secure Payload Dispatcher)
  32. ::
  33. ARM CA57 (ARMv8) 1.5 GHz quad core, with NEON/VFPv4, L1$ I/D
  34. 48K/32K, L2$ 2MB
  35. ARM CA53 (ARMv8) 1.2 GHz quad core, with NEON/VFPv4, L1$ I/D 32K/32K,
  36. L2$ 512K
  37. Memory controller for LPDDR4-3200 4GB in 2 channels, each 64-bit wide
  38. Two- and three-dimensional graphics engines,
  39. Video processing units,
  40. 3 channels Display Output,
  41. 6 channels Video Input,
  42. SD card host interface,
  43. USB3.0 and USB2.0 interfaces,
  44. CAN interfaces
  45. Ethernet AVB
  46. PCI Express Interfaces
  47. Memories
  48. INTERNAL 384KB SYSTEM RAM
  49. DDR 4 GB LPDDR4
  50. HYPERFLASH 64 MB HYPER FLASH (512 MBITS, 160 MHZ, 320 MBYTES/S)
  51. QSPI FLASH 16MB QSPI (128 MBITS,80 MHZ,80 MBYTES/S)1 HEADER QSPI
  52. MODULE
  53. EMMC 32 GB EMMC (HS400 240 MBYTES/S)
  54. MICROSD-CARD SLOT (SDR104 100 MBYTES/S)
  55. Overview
  56. --------
  57. On the rcar-gen3 the BOOTROM starts the cpu at EL3; for this port BL2
  58. will therefore be entered at this exception level (the Renesas' ATF
  59. reference tree [1] resets into EL1 before entering BL2 - see its
  60. bl2.ld.S)
  61. BL2 initializes DDR (and on some platforms i2c to interface to the
  62. PMIC) before determining the boot reason (cold or warm).
  63. During suspend all CPUs are switched off and the DDR is put in backup
  64. mode (some kind of self-refresh mode). This means that BL2 is always
  65. entered in a cold boot scenario.
  66. Once BL2 boots, it determines the boot reason, writes it to shared
  67. memory (BOOT_KIND_BASE) together with the BL31 parameters
  68. (PARAMS_BASE) and jumps to BL31.
  69. To all effects, BL31 is as if it is being entered in reset mode since
  70. it still needs to initialize the rest of the cores; this is the reason
  71. behind using direct shared memory access to BOOT_KIND_BASE _and_
  72. PARAMS_BASE instead of using registers to get to those locations (see
  73. el3_common_macros.S and bl31_entrypoint.S for the RESET_TO_BL31 use
  74. case).
  75. Depending on the boot reason BL31 initializes the rest of the cores:
  76. in case of suspend, it uses a MBOX memory region to recover the
  77. program counters.
  78. [1] https://github.com/renesas-rcar/arm-trusted-firmware
  79. How to build
  80. ------------
  81. The TF-A build options depend on the target board so you will have to
  82. refer to those specific instructions. What follows is customized to
  83. the H3 SiP Salvator-X development system used in this port.
  84. Build Tested:
  85. ~~~~~~~~~~~~~
  86. RCAR_OPT="LSI=H3 RCAR_DRAM_SPLIT=1 RCAR_LOSSY_ENABLE=1"
  87. MBEDTLS_DIR=$mbedtls_src
  88. $ MBEDTLS_DIR=$mbedtls_src_tree make clean bl2 bl31 rcar_layout_tool \
  89. PLAT=rcar ${RCAR_OPT} SPD=opteed
  90. System Tested:
  91. ~~~~~~~~~~~~~~
  92. * mbed_tls:
  93. git@github.com:ARMmbed/mbedtls.git [devel]
  94. commit 552754a6ee82bab25d1bdf28c8261a4518e65e4d
  95. Merge: 68dbc94 f34a4c1
  96. Author: Simon Butcher <simon.butcher@arm.com>
  97. Date: Thu Aug 30 00:57:28 2018 +0100
  98. * optee_os:
  99. https://github.com/BayLibre/optee_os
  100. Until it gets merged into OP-TEE, the port requires Renesas'
  101. Trusted Environment with a modification to support power
  102. management.
  103. commit 80105192cba9e704ebe8df7ab84095edc2922f84
  104. Author: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
  105. Date: Thu Aug 30 16:49:49 2018 +0200
  106. plat-rcar: cpu-suspend: handle the power level
  107. Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
  108. * u-boot:
  109. The port has beent tested using mainline uboot.
  110. commit 4cdeda511f8037015b568396e6dcc3d8fb41e8c0
  111. Author: Fabio Estevam <festevam@gmail.com>
  112. Date: Tue Sep 4 10:23:12 2018 -0300
  113. * linux:
  114. The port has beent tested using mainline kernel.
  115. commit 7876320f88802b22d4e2daf7eb027dd14175a0f8
  116. Author: Linus Torvalds <torvalds@linux-foundation.org>
  117. Date: Sun Sep 16 11:52:37 2018 -0700
  118. Linux 4.19-rc4
  119. TF-A Build Procedure
  120. ~~~~~~~~~~~~~~~~~~~~
  121. - Fetch all the above 4 repositories.
  122. - Prepare the AARCH64 toolchain.
  123. - Build u-boot using r8a7795_salvator-x_defconfig.
  124. Result: u-boot-elf.srec
  125. .. code:: bash
  126. make CROSS_COMPILE=aarch64-linux-gnu-
  127. r8a7795_salvator-x_defconfig
  128. make CROSS_COMPILE=aarch64-linux-gnu-
  129. - Build atf
  130. Result: bootparam_sa0.srec, cert_header_sa6.srec, bl2.srec, bl31.srec
  131. .. code:: bash
  132. RCAR_OPT="LSI=H3 RCAR_DRAM_SPLIT=1 RCAR_LOSSY_ENABLE=1"
  133. MBEDTLS_DIR=$mbedtls_src_tree make clean bl2 bl31 rcar \
  134. PLAT=rcar ${RCAR_OPT} SPD=opteed
  135. - Build optee-os
  136. Result: tee.srec
  137. .. code:: bash
  138. make -j8 PLATFORM="rcar" CFG_ARM64_core=y
  139. Install Procedure
  140. ~~~~~~~~~~~~~~~~~
  141. - Boot the board in Mini-monitor mode and enable access to the
  142. Hyperflash.
  143. - Use the XSL2 Mini-monitor utility to accept all the SREC ascii
  144. transfers over serial.
  145. Boot trace
  146. ----------
  147. Notice that BL31 traces are not accessible via the console and that in
  148. order to verbose the BL2 output you will have to compile TF-A with
  149. LOG_LEVEL=50 and DEBUG=1
  150. ::
  151. Initial Program Loader(CA57) Rev.1.0.22
  152. NOTICE: BL2: PRR is R-Car H3 Ver.1.1
  153. NOTICE: BL2: Board is Salvator-X Rev.1.0
  154. NOTICE: BL2: Boot device is HyperFlash(80MHz)
  155. NOTICE: BL2: LCM state is CM
  156. NOTICE: AVS setting succeeded. DVFS_SetVID=0x53
  157. NOTICE: BL2: DDR1600(rev.0.33)NOTICE: [COLD_BOOT]NOTICE: ..0
  158. NOTICE: BL2: DRAM Split is 4ch
  159. NOTICE: BL2: QoS is default setting(rev.0.37)
  160. NOTICE: BL2: Lossy Decomp areas
  161. NOTICE: Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570
  162. NOTICE: Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0
  163. NOTICE: Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0
  164. NOTICE: BL2: v2.0(release):v2.0-rc0-32-gbcda69a
  165. NOTICE: BL2: Built : 16:41:23, Oct 2 2018
  166. NOTICE: BL2: Normal boot
  167. INFO: BL2: Doing platform setup
  168. INFO: BL2: Loading image id 3
  169. NOTICE: BL2: dst=0xe6322000 src=0x8180000 len=512(0x200)
  170. NOTICE: BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800)
  171. WARNING: r-car ignoring the BL31 size from certificate,using
  172. RCAR_TRUSTED_SRAM_SIZE instead
  173. INFO: Loading image id=3 at address 0x44000000
  174. NOTICE: rcar_file_len: len: 0x0003e000
  175. NOTICE: BL2: dst=0x44000000 src=0x81c0000 len=253952(0x3e000)
  176. INFO: Image id=3 loaded: 0x44000000 - 0x4403e000
  177. INFO: BL2: Loading image id 4
  178. INFO: Loading image id=4 at address 0x44100000
  179. NOTICE: rcar_file_len: len: 0x00100000
  180. NOTICE: BL2: dst=0x44100000 src=0x8200000 len=1048576(0x100000)
  181. INFO: Image id=4 loaded: 0x44100000 - 0x44200000
  182. INFO: BL2: Loading image id 5
  183. INFO: Loading image id=5 at address 0x50000000
  184. NOTICE: rcar_file_len: len: 0x00100000
  185. NOTICE: BL2: dst=0x50000000 src=0x8640000 len=1048576(0x100000)
  186. INFO: Image id=5 loaded: 0x50000000 - 0x50100000
  187. NOTICE: BL2: Booting BL31
  188. INFO: Entry point address = 0x44000000
  189. INFO: SPSR = 0x3cd
  190. VERBOSE: Argument #0 = 0xe6325578
  191. VERBOSE: Argument #1 = 0x0
  192. VERBOSE: Argument #2 = 0x0
  193. VERBOSE: Argument #3 = 0x0
  194. VERBOSE: Argument #4 = 0x0
  195. VERBOSE: Argument #5 = 0x0
  196. VERBOSE: Argument #6 = 0x0
  197. VERBOSE: Argument #7 = 0x0
  198. U-Boot 2018.09-rc3-00028-g3711616 (Sep 27 2018 - 18:50:24 +0200)
  199. CPU: Renesas Electronics R8A7795 rev 1.1
  200. Model: Renesas Salvator-X board based on r8a7795 ES2.0+
  201. DRAM: 3.5 GiB
  202. Flash: 64 MiB
  203. MMC: sd@ee100000: 0, sd@ee140000: 1, sd@ee160000: 2
  204. Loading Environment from MMC... OK
  205. In: serial@e6e88000
  206. Out: serial@e6e88000
  207. Err: serial@e6e88000
  208. Net: eth0: ethernet@e6800000
  209. Hit any key to stop autoboot: 0
  210. =>