nxp-layerscape.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. NXP SoCs - Overview
  2. =====================
  3. .. section-numbering::
  4. :suffix: .
  5. The QorIQ family of ARM based SoCs that are supported on TF-A are:
  6. 1. LX2160A
  7. - SoC Overview:
  8. The LX2160A multicore processor, the highest-performance member of the
  9. Layerscape family, combines FinFET process technology's low power and
  10. sixteen Arm® Cortex®-A72 cores with datapath acceleration optimized for
  11. L2/3 packet processing, together with security offload, robust traffic
  12. management and quality of service.
  13. Details about LX2160A can be found at `lx2160a`_.
  14. - LX2160ARDB Board:
  15. The LX2160A reference design board provides a comprehensive platform
  16. that enables design and evaluation of the LX2160A or LX2162A processors. It
  17. comes preloaded with a board support package (BSP) based on a standard Linux
  18. kernel.
  19. Board details can be fetched from the link: `lx2160ardb`_.
  20. 2. LS1028A
  21. - SoC Overview:
  22. The Layerscape LS1028A applications processor for industrial and
  23. automotive includes a time-sensitive networking (TSN) -enabled Ethernet
  24. switch and Ethernet controllers to support converged IT and OT networks.
  25. Two powerful 64-bit Arm®v8 cores support real-time processing for
  26. industrial control and virtual machines for edge computing in the IoT.
  27. The integrated GPU and LCD controller enable Human-Machine Interface
  28. (HMI) systems with next-generation interfaces.
  29. Details about LS1028A can be found at `ls1028a`_.
  30. - LS1028ARDB Board:
  31. The LS1028A reference design board (RDB) is a computing, evaluation,
  32. and development platform that supports industrial IoT applications, human
  33. machine interface solutions, and industrial networking.
  34. Details about LS1028A RDB board can be found at `ls1028ardb`_.
  35. 3. LS1043A
  36. - SoC Overview:
  37. The Layerscape LS1043A processor is NXP's first quad-core, 64-bit Arm®-based
  38. processor for embedded networking. The LS1023A (two core version) and the
  39. LS1043A (four core version) deliver greater than 10 Gbps of performance
  40. in a flexible I/O package supporting fanless designs. This SoC is a
  41. purpose-built solution for small-form-factor networking and industrial
  42. applications with BOM optimizations for economic low layer PCB, lower cost
  43. power supply and single clock design. The new 0.9V versions of the LS1043A
  44. and LS1023A deliver addition power savings for applications such as Wireless
  45. LAN and to Power over Ethernet systems.
  46. Details about LS1043A can be found at `ls1043a`_.
  47. - LS1043ARDB Board:
  48. The LS1043A reference design board (RDB) is a computing, evaluation, and
  49. development platform that supports the Layerscape LS1043A architecture
  50. processor. The LS1043A-RDB can help shorten your time to market by providing
  51. the following features:
  52. Memory subsystem:
  53. * 2GByte DDR4 SDRAM (32bit bus)
  54. * 128 Mbyte NOR flash single-chip memory
  55. * 512 Mbyte NAND flash
  56. * 16 Mbyte high-speed SPI flash
  57. * SD connector to interface with the SD memory card
  58. Ethernet:
  59. * XFI 10G port
  60. * QSGMII with 4x 1G ports
  61. * Two RGMII ports
  62. PCIe:
  63. * PCIe2 (Lanes C) to mini-PCIe slot
  64. * PCIe3 (Lanes D) to PCIe slot
  65. USB 3.0: two super speed USB 3.0 type A ports
  66. UART: supports two UARTs up to 115200 bps for console
  67. Details about LS1043A RDB board can be found at `ls1043ardb`_.
  68. 4. LS1046A
  69. - SoC Overview:
  70. The LS1046A is a cost-effective, power-efficient, and highly integrated
  71. system-on-chip (SoC) design that extends the reach of the NXP value-performance
  72. line of QorIQ communications processors. Featuring power-efficient 64-bit
  73. Arm Cortex-A72 cores with ECC-protected L1 and L2 cache memories for high
  74. reliability, running up to 1.8 GHz.
  75. Details about LS1046A can be found at `ls1046a`_.
  76. - LS1046ARDB Board:
  77. The LS1046A reference design board (RDB) is a high-performance computing,
  78. evaluation, and development platform that supports the Layerscape LS1046A
  79. architecture processor. The LS1046ARDB board supports the Layerscape LS1046A
  80. processor and is optimized to support the DDR4 memory and a full complement
  81. of high-speed SerDes ports.
  82. Details about LS1046A RDB board can be found at `ls1046ardb`_.
  83. - LS1046AFRWY Board:
  84. The LS1046A Freeway board (FRWY) is a high-performance computing, evaluation,
  85. and development platform that supports the LS1046A architecture processor
  86. capable of support more than 32,000 CoreMark performance. The FRWY-LS1046A
  87. board supports the LS1046A processor, onboard DDR4 memory, multiple Gigabit
  88. Ethernet, USB3.0 and M2_Type_E interfaces for Wi-Fi, FRWY-LS1046A-AC includes
  89. the Wi-Fi card.
  90. Details about LS1046A FRWY board can be found at `ls1046afrwy`_.
  91. 5. LS1088A
  92. - SoC Overview:
  93. The LS1088A family of multicore communications processors combines up to and eight
  94. Arm Cortex-A53 cores with the advanced, high-performance data path and network
  95. peripheral interfaces required for wireless access points, networking infrastructure,
  96. intelligent edge access, including virtual customer premise equipment (vCPE) and
  97. high-performance industrial applications.
  98. Details about LS1088A can be found at `ls1088a`_.
  99. - LS1088ARDB Board:
  100. The LS1088A reference design board provides a comprehensive platform that
  101. enables design and evaluation of the product (LS1088A processor). This RDB
  102. comes pre-loaded with a board support package (BSP) based on a standard
  103. Linux kernel.
  104. Details about LS1088A RDB board can be found at `ls1088ardb`_.
  105. Table of supported boot-modes by each platform & platform that needs FIP-DDR:
  106. -----------------------------------------------------------------------------
  107. +---------------------+---------------------------------------------------------------------+-----------------+
  108. | | BOOT_MODE | |
  109. | PLAT +-------+--------+-------+-------+-------+-------------+--------------+ fip_ddr_needed |
  110. | | sd | qspi | nor | nand | emmc | flexspi_nor | flexspi_nand | |
  111. +=====================+=======+========+=======+=======+=======+=============+==============+=================+
  112. | lx2160ardb | yes | | | | yes | yes | | yes |
  113. +---------------------+-------+--------+-------+-------+-------+-------------+--------------+-----------------+
  114. | ls1028ardb | yes | | | | yes | yes | | no |
  115. +---------------------+-------+--------+-------+-------+-------+-------------+--------------+-----------------+
  116. | ls1043ardb | yes | | yes | yes | | | | no |
  117. +---------------------+-------+--------+-------+-------+-------+-------------+--------------+-----------------+
  118. | ls1046ardb | yes | yes | | | yes | | | no |
  119. +---------------------+-------+--------+-------+-------+-------+-------------+--------------+-----------------+
  120. | ls1046afrwy | yes | yes | | | | | | no |
  121. +---------------------+-------+--------+-------+-------+-------+-------------+--------------+-----------------+
  122. | ls1088ardb | yes | yes | | | | | | no |
  123. +---------------------+-------+--------+-------+-------+-------+-------------+--------------+-----------------+
  124. Boot Sequence
  125. -------------
  126. ::
  127. + Secure World | Normal World
  128. + EL0 |
  129. + |
  130. + EL1 BL32(Tee OS) | kernel
  131. + ^ | | ^
  132. + | | | |
  133. + EL2 | | | BL33(u-boot)
  134. + | | | ^
  135. + | v | /
  136. + EL3 BootROM --> BL2 --> BL31 ---------------/
  137. +
  138. Boot Sequence with FIP-DDR
  139. --------------------------
  140. ::
  141. + Secure World | Normal World
  142. + EL0 |
  143. + |
  144. + EL1 fip-ddr BL32(Tee OS) | kernel
  145. + ^ | ^ | | ^
  146. + | | | | | |
  147. + EL2 | | | | | BL33(u-boot)
  148. + | | | | | ^
  149. + | v | v | /
  150. + EL3 BootROM --> BL2 -----> BL31 ---------------/
  151. +
  152. DDR Memory Layout
  153. --------------------------
  154. NXP Platforms divide DRAM into banks:
  155. - DRAM0 Bank: Maximum size of this bank is fixed to 2GB, DRAM0 size is defined in platform_def.h if it is less than 2GB.
  156. - DRAM1 ~ DRAMn Bank: Greater than 2GB belongs to DRAM1 and following banks, and size of DRAMn Bank varies for one platform to others.
  157. The following diagram is default DRAM0 memory layout in which secure memory is at top of DRAM0.
  158. ::
  159. high +---------------------------------------------+
  160. | |
  161. | Secure EL1 Payload Shared Memory (2 MB) |
  162. | |
  163. +---------------------------------------------+
  164. | |
  165. | Secure Memory (64 MB) |
  166. | |
  167. +---------------------------------------------+
  168. | |
  169. | Non Secure Memory |
  170. | |
  171. low +---------------------------------------------+
  172. How to build
  173. =============
  174. Code Locations
  175. --------------
  176. - OP-TEE:
  177. `link <https://source.codeaurora.org/external/qoriq/qoriq-components/optee_os>`__
  178. - U-Boot:
  179. `link <https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot>`__
  180. - RCW:
  181. `link <https://source.codeaurora.org/external/qoriq/qoriq-components/rcw>`__
  182. - ddr-phy-binary: Required by platforms that need fip-ddr.
  183. `link <https:://github.com/NXP/ddr-phy-binary>`__
  184. - cst: Required for TBBR.
  185. `link <https:://source.codeaurora.org/external/qoriq/qoriq-components/cst>`__
  186. Build Procedure
  187. ---------------
  188. - Fetch all the above repositories into local host.
  189. - Prepare AARCH64 toolchain and set the environment variable "CROSS_COMPILE".
  190. .. code:: shell
  191. export CROSS_COMPILE=.../bin/aarch64-linux-gnu-
  192. - Build RCW. Refer README from the respective cloned folder for more details.
  193. - Build u-boot and OPTee firstly, and get binary images: u-boot.bin and tee.bin.
  194. For u-boot you can use the <platform>_tfa_defconfig for build.
  195. - Copy/clone the repo "ddr-phy-binary" to the tfa directory for platform needing ddr-fip.
  196. - Below are the steps to build TF-A images for the supported platforms.
  197. Compilation steps without BL32
  198. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199. BUILD BL2:
  200. -To compile
  201. .. code:: shell
  202. make PLAT=$PLAT \
  203. BOOT_MODE=<platform_supported_boot_mode> \
  204. RCW=$RCW_BIN \
  205. pbl
  206. BUILD FIP:
  207. .. code:: shell
  208. make PLAT=$PLAT \
  209. BOOT_MODE=<platform_supported_boot_mode> \
  210. RCW=$RCW_BIN \
  211. BL33=$UBOOT_SECURE_BIN \
  212. pbl \
  213. fip
  214. Compilation steps with BL32
  215. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  216. BUILD BL2:
  217. -To compile
  218. .. code:: shell
  219. make PLAT=$PLAT \
  220. BOOT_MODE=<platform_supported_boot_mode> \
  221. RCW=$RCW_BIN \
  222. BL32=$TEE_BIN SPD=opteed\
  223. pbl
  224. BUILD FIP:
  225. .. code:: shell
  226. make PLAT=$PLAT \
  227. BOOT_MODE=<platform_supported_boot_mode> \
  228. RCW=$RCW_BIN \
  229. BL32=$TEE_BIN SPD=opteed\
  230. BL33=$UBOOT_SECURE_BIN \
  231. pbl \
  232. fip
  233. BUILD fip-ddr (Mandatory for certain platforms, refer table above):
  234. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  235. -To compile additional fip-ddr for selected platforms(Refer above table if the platform needs fip-ddr).
  236. .. code:: shell
  237. make PLAT=<platform_name> fip-ddr
  238. Deploy ATF Images
  239. =================
  240. Note: The size in the standard uboot commands for copy to nor, qspi, nand or sd
  241. should be modified based on the binary size of the image to be copied.
  242. - Deploy ATF images on flexspi-Nor or QSPI flash Alt Bank from U-Boot prompt.
  243. -- Commands to flash images for bl2_xxx.pbl and fip.bin
  244. Notes: ls1028ardb has no flexspi-Nor Alt Bank, so use "sf probe 0:0" for current bank.
  245. .. code:: shell
  246. tftp 82000000 $path/bl2_xxx.pbl;
  247. i2c mw 66 50 20;sf probe 0:1; sf erase 0 +$filesize; sf write 0x82000000 0x0 $filesize;
  248. tftp 82000000 $path/fip.bin;
  249. i2c mw 66 50 20;sf probe 0:1; sf erase 0x100000 +$filesize; sf write 0x82000000 0x100000 $filesize;
  250. -- Next step is valid for platform where FIP-DDR is needed.
  251. .. code:: shell
  252. tftp 82000000 $path/ddr_fip.bin;
  253. i2c mw 66 50 20;sf probe 0:1; sf erase 0x800000 +$filesize; sf write 0x82000000 0x800000 $filesize;
  254. -- Then reset to alternate bank to boot up ATF.
  255. Command for lx2160a, ls1088a and ls1028a platforms:
  256. .. code:: shell
  257. qixisreset altbank;
  258. Command for ls1046a platforms:
  259. .. code:: shell
  260. cpld reset altbank;
  261. - Deploy ATF images on SD/eMMC from U-Boot prompt.
  262. -- file_size_in_block_sizeof_512 = (Size_of_bytes_tftp / 512)
  263. .. code:: shell
  264. mmc dev <idx>; (idx = 1 for eMMC; idx = 0 for SD)
  265. tftp 82000000 $path/bl2_<sd>_or_<emmc>.pbl;
  266. mmc write 82000000 8 <file_size_in_block_sizeof_512>;
  267. tftp 82000000 $path/fip.bin;
  268. mmc write 82000000 0x800 <file_size_in_block_sizeof_512>;
  269. -- Next step is valid for platform that needs FIP-DDR.
  270. .. code:: shell
  271. tftp 82000000 $path/ddr_fip.bin;
  272. mmc write 82000000 0x4000 <file_size_in_block_sizeof_512>;
  273. -- Then reset to sd/emmc to boot up ATF from sd/emmc as boot-source.
  274. Command for lx2160A, ls1088a and ls1028a platforms:
  275. .. code:: shell
  276. qixisreset <sd or emmc>;
  277. Command for ls1043a and ls1046a platform:
  278. .. code:: shell
  279. cpld reset <sd or emmc>;
  280. - Deploy ATF images on IFC nor flash from U-Boot prompt.
  281. .. code:: shell
  282. tftp 82000000 $path/bl2_nor.pbl;
  283. protect off 64000000 +$filesize; erase 64000000 +$filesize; cp.b 82000000 64000000 $filesize;
  284. tftp 82000000 $path/fip.bin;
  285. protect off 64100000 +$filesize; erase 64100000 +$filesize; cp.b 82000000 64100000 $filesize;
  286. -- Then reset to alternate bank to boot up ATF.
  287. Command for ls1043a platform:
  288. .. code:: shell
  289. cpld reset altbank;
  290. - Deploy ATF images on IFC nand flash from U-Boot prompt.
  291. .. code:: shell
  292. tftp 82000000 $path/bl2_nand.pbl;
  293. nand erase 0x0 $filesize; nand write 82000000 0x0 $filesize;
  294. tftp 82000000 $path/fip.bin;
  295. nand erase 0x100000 $filesize;nand write 82000000 0x100000 $filesize;
  296. -- Then reset to nand flash to boot up ATF.
  297. Command for ls1043a platform:
  298. .. code:: shell
  299. cpld reset nand;
  300. Trusted Board Boot:
  301. ===================
  302. For TBBR, the binary name changes:
  303. +-------------+--------------------------+---------+-------------------+
  304. | Boot Type | BL2 | FIP | FIP-DDR |
  305. +=============+==========================+=========+===================+
  306. | Normal Boot | bl2_<boot_mode>.pbl | fip.bin | ddr_fip.bin |
  307. +-------------+--------------------------+---------+-------------------+
  308. | TBBR Boot | bl2_<boot_mode>_sec.pbl | fip.bin | ddr_fip_sec.bin |
  309. +-------------+--------------------------+---------+-------------------+
  310. Refer `nxp-ls-tbbr.rst`_ for detailed user steps.
  311. .. _lx2160a: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-lx2160a-lx2120a-lx2080a-processors:LX2160A
  312. .. _lx2160ardb: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-communication-process/layerscape-lx2160a-multicore-communications-processor:LX2160A
  313. .. _ls1028a: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-1028a-applications-processor:LS1028A
  314. .. _ls1028ardb: https://www.nxp.com/design/qoriq-developer-resources/layerscape-ls1028a-reference-design-board:LS1028ARDB
  315. .. _ls1043a: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-1043a-and-1023a-processors:LS1043A
  316. .. _ls1043ardb: https://www.nxp.com/design/qoriq-developer-resources/layerscape-ls1043a-reference-design-board:LS1043A-RDB
  317. .. _ls1046a: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-1046a-and-1026a-processors:LS1046A
  318. .. _ls1046ardb: https://www.nxp.com/design/qoriq-developer-resources/layerscape-ls1046a-reference-design-board:LS1046A-RDB
  319. .. _ls1046afrwy: https://www.nxp.com/design/qoriq-developer-resources/ls1046a-freeway-board:FRWY-LS1046A
  320. .. _ls1088a: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-1088a-and-1048a-processor:LS1088A
  321. .. _ls1088ardb: https://www.nxp.com/design/qoriq-developer-resources/layerscape-ls1088a-reference-design-board:LS1088A-RDB
  322. .. _nxp-ls-tbbr.rst: ./nxp-ls-tbbr.rst