s32g274a.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. NXP S32G274A
  2. ============
  3. S32G2 is an NXP vehicle network processor combining ASIL D safety, hardware
  4. security, high-performance real-time and application processing and network
  5. acceleration. S32G2 supports the needs of new vehicle architectures:
  6. service-oriented gateways, domain controllers, zonal processors, safety
  7. processors and more. It is equipped with 4 Cortex-A53 cores operating at
  8. 1.0GHz.
  9. The TF-A includes support for one single S32G2-based board called S32G274ARDB2.
  10. The S32G-VNP-RDB2 is a compact, highly optimized and integrated board
  11. engineering for vehicle service-oriented gateway (SoG), domain control
  12. applications, high-performance processing, safety and security applications.
  13. More details about this board can be found at `s32g274ardb2`_.
  14. Boot Flow
  15. ---------
  16. ::
  17. BootROM -> BL2 (SRAM) -> BL31 (SRAM) -> BL33 (DDR - TODO)
  18. .. warning::
  19. This boot flow is a preliminary version that will serve as a foundation for
  20. upcoming S32G2 contributions. The execution will hang after the BL31 stage
  21. due to U-Boot being deployed in SRAM instead of DDR. This issue will be
  22. resolved with the addition of the DDR driver.
  23. Code Locations
  24. --------------
  25. - Downstream TF-A:
  26. `link: <https://github.com/nxp-auto-linux/arm-trusted-firmware>`__
  27. - Downstream U-Boot:
  28. `link <https://github.com/nxp-auto-linux/u-boot>`__
  29. - Downstream Linux:
  30. `link <https://github.com/nxp-auto-linux/linux>`__
  31. How to build
  32. ------------
  33. The port currently available on the S32G274ARDB2 platform is in its initial
  34. stage. This means that important drivers like DDR and storage are not yet
  35. available. Consequently, the boot process depends on BootROM to load all TF-A
  36. stages in SRAM. To create a bootable image, the script below should be used.
  37. This script makes use of the ``mkimage`` tool, which is part of the U-Boot drop
  38. for S32G274A SoCs.
  39. .. code:: bash
  40. #!/bin/bash -xe
  41. TF_A="${TF_A:-`pwd`}"
  42. UBOOT="${UBOOT:-${TF_A}/../u-boot}"
  43. DEBUG="${DEBUG:-1}"
  44. FIP_BASE="0x34100000"
  45. if [ "${DEBUG}" -eq "1" ]; then
  46. BUILD="debug"
  47. else
  48. BUILD="release"
  49. fi
  50. BOOT_IMAGE="build/s32g274ardb2/${BUILD}/BOOT_IMAGE.bin"
  51. BL2_BIN="build/s32g274ardb2/${BUILD}/bl2.bin"
  52. FIP_BIN="build/s32g274ardb2/${BUILD}/fip.bin"
  53. # Generate bl2, bl31 and fip image
  54. make -C "${TF_A}" -j9 'PLAT=s32g274ardb2' \
  55. BL33="${UBOOT}/u-boot-nodtb.bin" DEBUG="${DEBUG}" clean
  56. make -C "${TF_A}" -j9 'PLAT=s32g274ardb2' \
  57. BL33="${UBOOT}/u-boot-nodtb.bin" DEBUG="${DEBUG}" bl2
  58. make -C "${TF_A}" -j9 'PLAT=s32g274ardb2' \
  59. BL33="${UBOOT}/u-boot-nodtb.bin" DEBUG="${DEBUG}" fip
  60. # Extract BL2 entry
  61. BL2_START="0x$(poetry run memory -p s32g274ardb2 -b debug -f | \
  62. grep BL2 | awk -F'|' '{print $3}' | xargs)"
  63. # BL2 bin file size in bytes
  64. BL2_SIZE="$(stat -c "%s" "${BL2_BIN}")"
  65. # Pack bl2.bin and fip.bin by ensuring that the FIP image will start at FIP_BASE
  66. cp -vf "${BL2_BIN}" "${BOOT_IMAGE}"
  67. dd if="${FIP_BIN}" of="${BOOT_IMAGE}" seek="$((FIP_BASE - BL2_START))" bs=1
  68. # Build a bootable image by appending the IVT
  69. "${UBOOT}/tools/mkimage" \
  70. -a "${BL2_START}" \
  71. -e "${BL2_START}" \
  72. -T s32ccimage \
  73. -n "${UBOOT}/u-boot-s32.cfgout" \
  74. -d "${BOOT_IMAGE}" \
  75. fip.s32
  76. SoC Errata Workarounds
  77. ----------------------
  78. The S32G274A port of the TF-A includes compilation flags that can be used to
  79. control the workaround for the SoC. These flags are used similarly to how the
  80. :ref:`arm_cpu_macros_errata_workarounds` are used. The list of workarounds
  81. includes the following switches:
  82. - ``ERRATA_S32_051700``: This applies erratum ERR051700 workaround to
  83. SoCs part of the S32 Common Chassis family, and therefore it needs to
  84. be enabled for the S32G and S32R devices.
  85. .. _s32g2: https://www.nxp.com/products/processors-and-microcontrollers/s32-automotive-platform/s32g-vehicle-network-processors/s32g2-processors-for-vehicle-networking:S32G2
  86. .. _s32g274ardb2: https://www.nxp.com/design/design-center/designs/s32g2-vehicle-networking-reference-design:S32G-VNP-RDB2