sa6.c 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /*
  2. * Copyright (c) 2020, Renesas Electronics Corporation. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <stdint.h>
  7. #define RCAR_SA6_TYPE_QSPIFLASH (0)
  8. #define RCAR_SA6_TYPE_EMMC (1)
  9. #if (RCAR_SA6_TYPE == RCAR_SA6_TYPE_QSPIFLASH)
  10. /* Number of content cert for Non-secure Target Program(BL33x) */
  11. #define RCAR_IMAGE_NUM (0x00000001U)
  12. /* Source address on flash for BL31 */
  13. #define RCAR_BL31SRC_ADDRESS (0x001C0000U)
  14. /* Reserved */
  15. #define RCAR_BL31_PARTITION (0x00000000U)
  16. /* Source address on flash for BL32 */
  17. #define RCAR_BL32SRC_ADDRESS (0x00200000U)
  18. /* Reserved */
  19. #define RCAR_BL32_PARTITION (0x00000000U)
  20. /* Source address on flash for BL33 */
  21. #define RCAR_BL33SRC_ADDRESS (0x00300000U)
  22. /* Reserved */
  23. #define RCAR_BL33_PARTITION (0x00000000U)
  24. #define RCAR_BL332SRC_ADDRESS (0x00000000U)
  25. /* Reserved */
  26. #define RCAR_BL332_PARTITION (0x00000000U)
  27. #define RCAR_BL333SRC_ADDRESS (0x00000000U)
  28. /* Reserved */
  29. #define RCAR_BL333_PARTITION (0x00000000U)
  30. #define RCAR_BL334SRC_ADDRESS (0x00000000U)
  31. /* Reserved */
  32. #define RCAR_BL334_PARTITION (0x00000000U)
  33. #define RCAR_BL335SRC_ADDRESS (0x00000000U)
  34. /* Reserved */
  35. #define RCAR_BL335_PARTITION (0x00000000U)
  36. #define RCAR_BL336SRC_ADDRESS (0x00000000U)
  37. /* Reserved */
  38. #define RCAR_BL336_PARTITION (0x00000000U)
  39. #define RCAR_BL337SRC_ADDRESS (0x00000000U)
  40. /* Reserved */
  41. #define RCAR_BL337_PARTITION (0x00000000U)
  42. #define RCAR_BL338SRC_ADDRESS (0x00000000U)
  43. /* Reserved */
  44. #define RCAR_BL338_PARTITION (0x00000000U)
  45. #else /* RCAR_SA6_TYPE == RCAR_SA6_TYPE_EMMC */
  46. /* Number of content cert for Non-secure Target Program(BL33x) */
  47. #define RCAR_IMAGE_NUM (0x00000001U)
  48. /* Source address on eMMC for BL31 */
  49. #define RCAR_BL31SRC_ADDRESS (0x00040000U)
  50. /* Source partition on eMMC for BL31 */
  51. #define RCAR_BL31_PARTITION (0x00000001U)
  52. /* Source address on eMMC for BL32 */
  53. #define RCAR_BL32SRC_ADDRESS (0x00200000U)
  54. /* Source partition on eMMC for BL32 */
  55. #define RCAR_BL32_PARTITION (0x00000001U)
  56. /* Source address on eMMC for BL33 */
  57. #define RCAR_BL33SRC_ADDRESS (0x00000000U)
  58. /* Source partition on eMMC for BL33 */
  59. #define RCAR_BL33_PARTITION (0x00000002U)
  60. /* Reserved */
  61. #define RCAR_BL332SRC_ADDRESS (0x00000000U)
  62. #define RCAR_BL332_PARTITION (0x00000000U)
  63. /* Reserved */
  64. #define RCAR_BL333SRC_ADDRESS (0x00000000U)
  65. #define RCAR_BL333_PARTITION (0x00000000U)
  66. /* Reserved */
  67. #define RCAR_BL334SRC_ADDRESS (0x00000000U)
  68. #define RCAR_BL334_PARTITION (0x00000000U)
  69. /* Reserved */
  70. #define RCAR_BL335SRC_ADDRESS (0x00000000U)
  71. #define RCAR_BL335_PARTITION (0x00000000U)
  72. /* Reserved */
  73. #define RCAR_BL336SRC_ADDRESS (0x00000000U)
  74. #define RCAR_BL336_PARTITION (0x00000000U)
  75. /* Reserved */
  76. #define RCAR_BL337SRC_ADDRESS (0x00000000U)
  77. #define RCAR_BL337_PARTITION (0x00000000U)
  78. /* Reserved */
  79. #define RCAR_BL338SRC_ADDRESS (0x00000000U)
  80. #define RCAR_BL338_PARTITION (0x00000000U)
  81. #endif /* RCAR_SA6_TYPE == RCAR_SA6_TYPE_QSPIFLASH */
  82. /* Destination address for BL31 */
  83. #define RCAR_BL31DST_ADDRESS (0x44000000U)
  84. #define RCAR_BL31DST_ADDRESSH (0x00000000U)
  85. /* Destination size for BL31 */
  86. #define RCAR_BL31DST_SIZE (0x00004000U)
  87. /* Destination address for BL32 */
  88. #define RCAR_BL32DST_ADDRESS (0x44100000U)
  89. #define RCAR_BL32DST_ADDRESSH (0x00000000U)
  90. /* Destination size for BL32 */
  91. #define RCAR_BL32DST_SIZE (0x00040000U)
  92. /* Destination address for BL33 */
  93. #define RCAR_BL33DST_ADDRESS (0x50000000U)
  94. #define RCAR_BL33DST_ADDRESSH (0x00000000U)
  95. /* Destination size for BL33 */
  96. #define RCAR_BL33DST_SIZE (0x00040000U)
  97. /* Reserved */
  98. #define RCAR_BL332DST_ADDRESS (0x00000000U)
  99. #define RCAR_BL332DST_ADDRESSH (0x00000000U)
  100. #define RCAR_BL332DST_SIZE (0x00000000U)
  101. /* Reserved */
  102. #define RCAR_BL333DST_ADDRESS (0x00000000U)
  103. #define RCAR_BL333DST_ADDRESSH (0x00000000U)
  104. #define RCAR_BL333DST_SIZE (0x00000000U)
  105. /* Reserved */
  106. #define RCAR_BL334DST_ADDRESS (0x00000000U)
  107. #define RCAR_BL334DST_ADDRESSH (0x00000000U)
  108. #define RCAR_BL334DST_SIZE (0x00000000U)
  109. /* Reserved */
  110. #define RCAR_BL335DST_ADDRESS (0x00000000U)
  111. #define RCAR_BL335DST_ADDRESSH (0x00000000U)
  112. #define RCAR_BL335DST_SIZE (0x00000000U)
  113. /* Reserved */
  114. #define RCAR_BL336DST_ADDRESS (0x00000000U)
  115. #define RCAR_BL336DST_ADDRESSH (0x00000000U)
  116. #define RCAR_BL336DST_SIZE (0x00000000U)
  117. /* Reserved */
  118. #define RCAR_BL337DST_ADDRESS (0x00000000U)
  119. #define RCAR_BL337DST_ADDRESSH (0x00000000U)
  120. #define RCAR_BL337DST_SIZE (0x00000000U)
  121. /* Reserved */
  122. #define RCAR_BL338DST_ADDRESS (0x00000000U)
  123. #define RCAR_BL338DST_ADDRESSH (0x00000000U)
  124. #define RCAR_BL338DST_SIZE (0x00000000U)
  125. /* SA6 */
  126. const uint64_t __attribute__ ((section(".sa6_image_num")))
  127. image_num = RCAR_IMAGE_NUM;
  128. const uint64_t __attribute__ ((section(".sa6_bl31src_addr")))
  129. bl31src_addr = RCAR_BL31SRC_ADDRESS;
  130. const uint64_t __attribute__ ((section(".sa6_bl31partition")))
  131. bl31partition = RCAR_BL31_PARTITION;
  132. const uint64_t __attribute__ ((section(".sa6_bl32src_addr")))
  133. bl32src_addr = RCAR_BL32SRC_ADDRESS;
  134. const uint64_t __attribute__ ((section(".sa6_bl32partition")))
  135. bl32partition = RCAR_BL32_PARTITION;
  136. const uint64_t __attribute__ ((section(".sa6_bl33src_addr")))
  137. bl33src_addr = RCAR_BL33SRC_ADDRESS;
  138. const uint64_t __attribute__ ((section(".sa6_bl33partition")))
  139. bl33partition = RCAR_BL33_PARTITION;
  140. const uint64_t __attribute__ ((section(".sa6_bl332src_addr")))
  141. bl332src_addr = RCAR_BL332SRC_ADDRESS;
  142. const uint64_t __attribute__ ((section(".sa6_bl332partition")))
  143. bl332partition = RCAR_BL332_PARTITION;
  144. const uint64_t __attribute__ ((section(".sa6_bl333src_addr")))
  145. bl333src_addr = RCAR_BL333SRC_ADDRESS;
  146. const uint64_t __attribute__ ((section(".sa6_bl333partition")))
  147. bl333partition = RCAR_BL333_PARTITION;
  148. const uint64_t __attribute__ ((section(".sa6_bl334src_addr")))
  149. bl334src_addr = RCAR_BL334SRC_ADDRESS;
  150. const uint64_t __attribute__ ((section(".sa6_bl334partition")))
  151. bl334partition = RCAR_BL334_PARTITION;
  152. const uint64_t __attribute__ ((section(".sa6_bl335src_addr")))
  153. bl335src_addr = RCAR_BL335SRC_ADDRESS;
  154. const uint64_t __attribute__ ((section(".sa6_bl335partition")))
  155. bl335partition = RCAR_BL335_PARTITION;
  156. const uint64_t __attribute__ ((section(".sa6_bl336src_addr")))
  157. bl336src_addr = RCAR_BL336SRC_ADDRESS;
  158. const uint64_t __attribute__ ((section(".sa6_bl336partition")))
  159. bl336partition = RCAR_BL336_PARTITION;
  160. const uint64_t __attribute__ ((section(".sa6_bl337src_addr")))
  161. bl337src_addr = RCAR_BL337SRC_ADDRESS;
  162. const uint64_t __attribute__ ((section(".sa6_bl337partition")))
  163. bl337partition = RCAR_BL337_PARTITION;
  164. const uint64_t __attribute__ ((section(".sa6_bl338src_addr")))
  165. bl338src_addr = RCAR_BL338SRC_ADDRESS;
  166. const uint64_t __attribute__ ((section(".sa6_bl338partition")))
  167. bl338partition = RCAR_BL338_PARTITION;
  168. const uint32_t __attribute__ ((section(".sa6_bl31dst_addr")))
  169. bl31dst_addr = RCAR_BL31DST_ADDRESS;
  170. const uint32_t __attribute__ ((section(".sa6_bl31dst_addrh")))
  171. bl31dst_addrh = RCAR_BL31DST_ADDRESSH;
  172. const uint32_t __attribute__ ((section(".sa6_bl31dst_size")))
  173. bl31dst_size = RCAR_BL31DST_SIZE;
  174. const uint32_t __attribute__ ((section(".sa6_bl32dst_addr")))
  175. bl32dst_addr = RCAR_BL32DST_ADDRESS;
  176. const uint32_t __attribute__ ((section(".sa6_bl32dst_addrh")))
  177. bl32dst_addrh = RCAR_BL32DST_ADDRESSH;
  178. const uint32_t __attribute__ ((section(".sa6_bl32dst_size")))
  179. bl32dst_size = RCAR_BL32DST_SIZE;
  180. const uint32_t __attribute__ ((section(".sa6_bl33dst_addr")))
  181. bl33dst_addr = RCAR_BL33DST_ADDRESS;
  182. const uint32_t __attribute__ ((section(".sa6_bl33dst_addrh")))
  183. bl33dst_addrh = RCAR_BL33DST_ADDRESSH;
  184. const uint32_t __attribute__ ((section(".sa6_bl33dst_size")))
  185. bl33dst_size = RCAR_BL33DST_SIZE;
  186. const uint32_t __attribute__ ((section(".sa6_bl332dst_addr")))
  187. bl332dst_addr = RCAR_BL332DST_ADDRESS;
  188. const uint32_t __attribute__ ((section(".sa6_bl332dst_addrh")))
  189. bl332dst_addrh = RCAR_BL332DST_ADDRESSH;
  190. const uint32_t __attribute__ ((section(".sa6_bl332dst_size")))
  191. bl332dst_size = RCAR_BL332DST_SIZE;
  192. const uint32_t __attribute__ ((section(".sa6_bl333dst_addr")))
  193. bl333dst_addr = RCAR_BL333DST_ADDRESS;
  194. const uint32_t __attribute__ ((section(".sa6_bl333dst_addrh")))
  195. bl333dst_addrh = RCAR_BL333DST_ADDRESSH;
  196. const uint32_t __attribute__ ((section(".sa6_bl333dst_size")))
  197. bl333dst_size = RCAR_BL333DST_SIZE;
  198. const uint32_t __attribute__ ((section(".sa6_bl334dst_addr")))
  199. bl334dst_addr = RCAR_BL334DST_ADDRESS;
  200. const uint32_t __attribute__ ((section(".sa6_bl334dst_addrh")))
  201. bl334dst_addrh = RCAR_BL334DST_ADDRESSH;
  202. const uint32_t __attribute__ ((section(".sa6_bl334dst_size")))
  203. bl334dst_size = RCAR_BL334DST_SIZE;
  204. const uint32_t __attribute__ ((section(".sa6_bl335dst_addr")))
  205. bl335dst_addr = RCAR_BL335DST_ADDRESS;
  206. const uint32_t __attribute__ ((section(".sa6_bl335dst_addrh")))
  207. bl335dst_addrh = RCAR_BL335DST_ADDRESSH;
  208. const uint32_t __attribute__ ((section(".sa6_bl335dst_size")))
  209. bl335dst_size = RCAR_BL335DST_SIZE;
  210. const uint32_t __attribute__ ((section(".sa6_bl336dst_addr")))
  211. bl336dst_addr = RCAR_BL336DST_ADDRESS;
  212. const uint32_t __attribute__ ((section(".sa6_bl336dst_addrh")))
  213. bl336dst_addrh = RCAR_BL336DST_ADDRESSH;
  214. const uint32_t __attribute__ ((section(".sa6_bl336dst_size")))
  215. bl336dst_size = RCAR_BL336DST_SIZE;
  216. const uint32_t __attribute__ ((section(".sa6_bl337dst_addr")))
  217. bl337dst_addr = RCAR_BL337DST_ADDRESS;
  218. const uint32_t __attribute__ ((section(".sa6_bl337dst_addrh")))
  219. bl337dst_addrh = RCAR_BL337DST_ADDRESSH;
  220. const uint32_t __attribute__ ((section(".sa6_bl337dst_size")))
  221. bl337dst_size = RCAR_BL337DST_SIZE;
  222. const uint32_t __attribute__ ((section(".sa6_bl338dst_addr")))
  223. bl338dst_addr = RCAR_BL338DST_ADDRESS;
  224. const uint32_t __attribute__ ((section(".sa6_bl338dst_addrh")))
  225. bl338dst_addrh = RCAR_BL338DST_ADDRESSH;
  226. const uint32_t __attribute__ ((section(".sa6_bl338dst_size")))
  227. bl338dst_size = RCAR_BL338DST_SIZE;