index.rst 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Arm FPGA Platform
  2. =================
  3. This platform supports FPGA images used internally in Arm Ltd., for
  4. testing and bringup of new cores. With that focus, peripheral support is
  5. minimal: there is no mass storage or display output, for instance. Also
  6. this port ignores any power management features of the platform.
  7. Some interconnect setup is done internally by the platform, so the TF-A code
  8. just needs to setup UART and GIC.
  9. The FPGA platform requires to pass on a DTB for the non-secure payload
  10. (mostly Linux), so we let TF-A use information from the DTB for dynamic
  11. configuration: the UART and GIC base addresses are read from there.
  12. As a result this port is a fairly generic BL31-only port, which can serve
  13. as a template for a minimal new (and possibly DT-based) platform port.
  14. The aim of this port is to support as many FPGA images as possible with
  15. a single build. Image specific data must be described in the DTB or should
  16. be auto-detected at runtime.
  17. As the number and topology layout of the CPU cores differs significantly
  18. across the various images, this is detected at runtime by BL31.
  19. The /cpus node in the DT will be added and filled accordingly, as long as
  20. it does not exist already.
  21. Platform-specific build options
  22. -------------------------------
  23. - ``SUPPORT_UNKNOWN_MPID`` : Boolean option to allow unknown MPIDR registers.
  24. Normally TF-A panics if it encounters a MPID value not matched to its
  25. internal list, but for new or experimental cores this creates a lot of
  26. churn. With this option, the code will fall back to some basic CPU support
  27. code (only architectural system registers, and no errata).
  28. Default value of this flag is 1.
  29. - ``PRELOADED_BL33_BASE`` : Physical address of the BL33 non-secure payload.
  30. It must have been loaded into DRAM already, typically this is done by
  31. the script that also loads BL31 and the DTB.
  32. It defaults to 0x80080000, which is the traditional load address for an
  33. arm64 Linux kernel.
  34. - ``FPGA_PRELOADED_DTB_BASE`` : Physical address of the flattened device
  35. tree blob (DTB). This DT will be used by TF-A for dynamic configuration,
  36. so it must describe at least the UART and a GICv3 interrupt controller.
  37. The DT gets amended by the code, to potentially add a command line and
  38. fill the CPU topology nodes. It will also be passed on to BL33, by
  39. putting its address into the x0 register before jumping to the entry
  40. point (following the Linux kernel boot protocol).
  41. It defaults to 0x80070000, which is 64KB before the BL33 load address.
  42. - ``FPGA_PRELOADED_CMD_LINE`` : Physical address of the command line to
  43. put into the devicetree blob. Due to the lack of a proper bootloader,
  44. a command line can be put somewhere into memory, so that BL31 will
  45. detect it and copy it into the DTB passed on to BL33.
  46. To avoid random garbage, there needs to be a "CMD:" signature before the
  47. actual command line.
  48. Defaults to 0x1000, which is normally in the "ROM" space of the typical
  49. FPGA image (which can be written by the FPGA payload uploader, but is
  50. read-only to the CPU). The FPGA payload tool should be given a text file
  51. containing the desired command line, prefixed by the "CMD:" signature.
  52. Building the TF-A image
  53. -----------------------
  54. .. code:: shell
  55. make PLAT=arm_fgpa DEBUG=1
  56. This will use the default load addresses as described above. When those
  57. addresses need to differ for a certain setup, they can be passed on the
  58. make command line:
  59. .. code:: shell
  60. make PLAT=arm_fgpa DEBUG=1 PRELOADED_BL33_BASE=0x80200000 FPGA_PRELOADED_DTB_BASE=0x80180000 bl31
  61. Running the TF-A image
  62. ----------------------
  63. After building TF-A, the actual TF-A code will be located in ``bl31.bin`` in
  64. the build directory.
  65. Additionally there is a ``bl31.axf`` ELF file, which contains BL31, as well
  66. as some simple ROM trampoline code (required by the Arm FPGA boot flow) and
  67. a generic DTB to support most of the FPGA images. This can be simply handed
  68. over to the FPGA payload uploader, which will take care of loading the
  69. components at their respective load addresses. In addition to this file
  70. you need at least a BL33 payload (typically a Linux kernel image), optionally
  71. a Linux initrd image file and possibly a command line:
  72. .. code:: shell
  73. fpga-run ... -m bl31.axf -l auto -m Image -l 0x80080000 -m initrd.gz -l 0x84000000 -m cmdline.txt -l 0x1000
  74. --------------
  75. *Copyright (c) 2020, Arm Limited. All rights reserved.*