Platform: Add support for MPS3 AN524 FPGA board
Details:
1. Adds AN524 platform support files
2. Adds a new target platform to the build system: "AN524"
3. Updates the docs with details for AN524
Change-Id: I7c192e951253dfc72512d73ee5da3f94023a248f
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/docs/user_guides/tfm_build_instruction.rst b/docs/user_guides/tfm_build_instruction.rst
index fd21f7b..6c89699 100644
--- a/docs/user_guides/tfm_build_instruction.rst
+++ b/docs/user_guides/tfm_build_instruction.rst
@@ -33,6 +33,8 @@
``-DTARGET_PLATFORM=MUSCA_A``
- Musca-B1 test chip board (Cortex-M33 SSE-200 subsystem)
``-DTARGET_PLATFORM=MUSCA_B1``
+ - Cortex-M33 SSE-200 subsystem for MPS3 (AN524)
+ ``-DTARGET_PLATFORM=AN524``
* - -DCOMPILER=<compiler name>
- Specifies the compiler toolchain
diff --git a/docs/user_guides/tfm_integration_guide.rst b/docs/user_guides/tfm_integration_guide.rst
index 30e2771..5d0e80d 100644
--- a/docs/user_guides/tfm_integration_guide.rst
+++ b/docs/user_guides/tfm_integration_guide.rst
@@ -23,6 +23,7 @@
- Cortex-M23 IoT Kit subsystem for MPS2+ (AN519)
- Musca-A test chip board (Cortex-M33 SSE-200 subsystem)
- Musca-B1 test chip board (Cortex-M33 SSE-200 subsystem)
+- CoreLink SSE-200 Subsystem for MPS3 (AN524)
The files related to the supported platforms are contained under the
``platform`` subfolder. The platform specific files are under
@@ -39,6 +40,9 @@
More information about the Musca-B1 test chip board can be found in:
`Musca-B1 homepage <https://www.arm.com/products/development-tools/development-boards/musca-b1-iot>`__
+More information about subsystems supported by the MPS3 board can be found in:
+`MPS3 homepage <https://www.arm.com/products/development-tools/development-boards/mps3>`__
+
Generic drivers and startup/scatter files
=========================================
The addition of a new platform means the creation of a new subfolder inside
diff --git a/docs/user_guides/tfm_secure_boot.rst b/docs/user_guides/tfm_secure_boot.rst
index c1119d7..bea6bda 100644
--- a/docs/user_guides/tfm_secure_boot.rst
+++ b/docs/user_guides/tfm_secure_boot.rst
@@ -175,6 +175,8 @@
+----------+-----------------+---------------+----------+-------------+-----------------+
| Musca-B1 | Yes | No | No | Yes | No |
+----------+-----------------+---------------+----------+-------------+-----------------+
+| AN524 | Yes | No | No | Yes | No |
++----------+-----------------+---------------+----------+-------------+-----------------+
.. [1] To disable BL2, please turn off the ``BL2`` compiler switch in the
top-level configuration file or in the command line
@@ -450,6 +452,26 @@
Running Test Suite PSA protected storage S interface tests (TFM_SST_TEST_2XXX)...
...
+Executing firmware upgrade on CoreLink SSE-200 Subsystem for MPS3 (AN524)
+-------------------------------------------------------------------------
+
+::
+
+ TITLE: Arm MPS3 FPGA prototyping board Images Configuration File
+
+ [IMAGES]
+ TOTALIMAGES: 3 ;Number of Images (Max: 32)
+
+ IMAGE0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
+ IMAGE0ADDRESS: 0x00000000
+ IMAGE0FILE: \SOFTWARE\mcuboot.bin ;BL2 bootloader
+ IMAGE1UPDATE: AUTO
+ IMAGE1ADDRESS: 0x00040000
+ IMAGE1FILE: \SOFTWARE\tfm_sig0.bin ;TF-M example application binary blob
+ IMAGE2UPDATE: AUTO
+ IMAGE2ADDRESS: 0x000C0000
+ IMAGE2FILE: \SOFTWARE\tfm_sig1.bin ;TF-M regression test binary blob
+
RAM loading firmware upgrade
============================
To enable RAM loading, please set ``MCUBOOT_UPGRADE_STRATEGY`` to "RAM_LOADING"
diff --git a/docs/user_guides/tfm_user_guide.rst b/docs/user_guides/tfm_user_guide.rst
index 754a99f..3035400 100644
--- a/docs/user_guides/tfm_user_guide.rst
+++ b/docs/user_guides/tfm_user_guide.rst
@@ -310,6 +310,150 @@
srec_cat app/secure_fw/tfm_s.bin -Binary -offset 0xA000000 app/tfm_ns.bin -Binary -offset 0xA060000 -o tfm.hex -Intel
+********************************************************
+Execute TF-M example and regression tests on MPS3 boards
+********************************************************
+
+To run the example code on CoreLink SSE-200 Subsystem for MPS3 (AN524)
+======================================================================
+FPGA image is available to download `here <https://www.arm.com/products/development-tools/development-boards/mps3>`__
+
+To run BL2 bootloader and TF-M example application and tests in the MPS3 board,
+it is required to have SMM-SSE-200 for MPS3 (AN524) image in the MPS3 board
+SD card. The image should be located in
+``<MPS3 device name>/MB/HBI<BoardNumberBoardrevision>/AN524``
+
+And the current boot memory for AN524 is QSPI flash, so you need to set the
+correct REMAP option in
+``<MPS3 device name>/MB/HBI<BoardNumberBoardrevision>/AN524/an524_v1.txt``
+
+::
+
+ REMAP: QSPI ;REMAP boot device BRAM/QSPI. Must match REMAPVAL below.
+ REMAPVAL: 1 ;REMAP register value e.g. 0-BRAM. 1-QSPI
+
+The MPS3 board tested is HBI0309B.
+
+.. Note::
+ If you change the exe names, MPS3 expects file names in 8.3 format.
+
+Example application
+-------------------
+#. Copy ``mcuboot.bin`` and ``tfm_sign.bin`` files from
+ build dir to ``<MPS3 device name>/SOFTWARE/``
+#. Open ``<MPS3 device name>/MB/HBI0309B/AN524/images.txt``
+#. Update the ``images.txt`` file as follows::
+
+ TITLE: Arm MPS3 FPGA prototyping board Images Configuration File
+
+ [IMAGES]
+ TOTALIMAGES: 2 ;Number of Images (Max: 32)
+
+ IMAGE0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
+ IMAGE0ADDRESS: 0x00000000 ;Please select the required executable program
+ IMAGE0FILE: \SOFTWARE\mcuboot.bin
+ IMAGE1UPDATE: AUTO
+ IMAGE1ADDRESS: 0x00040000
+ IMAGE1FILE: \SOFTWARE\tfm_sign.bin
+
+#. Close ``<MPS3 device name>/MB/HBI0309B/AN524/images.txt``
+#. Unmount/eject the ``<MPS3 device name>`` unit
+#. Reset the board to execute the TF-M example application
+#. After completing the procedure you should be able to visualize on the serial
+ port (baud 115200 8n1) the following messages::
+
+ [INF] Starting bootloader
+ [INF] Image 0: magic= good, copy_done=0xff, image_ok=0xff
+ [INF] Scratch: magic=unset, copy_done=0x43, image_ok=0xff
+ [INF] Boot source: slot 0
+ [INF] Swap type: none
+ [INF] Bootloader chainload address offset: 0x40000
+ [INF] Jumping to the first image slot
+ [Sec Thread] Secure image initializing!
+
+Regression tests
+----------------
+After completing the procedure you should be able to visualize on the serial
+port (baud 115200 8n1) the following messages::
+
+ [INF] Starting bootloader
+ [INF] Image 0: magic= good, copy_done=0xff, image_ok=0xff
+ [INF] Scratch: magic=unset, copy_done=0x9, image_ok=0xff
+ [INF] Boot source: slot 0
+ [INF] Swap type: none
+ [INF] Bootloader chainload address offset: 0x40000
+ [INF] Jumping to the first image slot
+ [Sec Thread] Secure image initializing!
+
+ #### Execute test suites for the Secure area ####
+ Running Test Suite PSA protected storage S interface tests (TFM_SST_TEST_2XXX)...
+ > Executing 'TFM_SST_TEST_2001'
+ Description: 'Set interface'
+ TEST PASSED!
+ > Executing 'TFM_SST_TEST_2002'
+ Description: 'Set interface with create flags'
+ TEST PASSED!
+ > Executing 'TFM_SST_TEST_2003'
+ Description: 'Set interface with NULL data pointer'
+ TEST PASSED!
+ > Executing 'TFM_SST_TEST_2004'
+ Description: 'Set interface with invalid data length'
+ TEST PASSED!
+ ....
+
+.. Note::
+ Some of the attestation tests take a few minutes to run on the MPS3.
+
+Example application without BL2 bootloader
+------------------------------------------
+#. Copy ``tfm_s.bin`` and ``tfm_ns.bin`` files from
+ build dir to ``<MPS3 device name>/SOFTWARE/``
+#. Open ``<MPS3 device name>/MB/HBI0309B/AN524/images.txt``
+#. Update the ``images.txt`` file as follows::
+
+ TITLE: Arm MPS3 FPGA prototyping board Images Configuration File
+
+ [IMAGES]
+ TOTALIMAGES: 2 ;Number of Images (Max: 32)
+
+ IMAGE0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
+ IMAGE0ADDRESS: 0x00000000 ;Please select the required executable program
+ IMAGE0FILE: \SOFTWARE\tfm_s.bin
+ IMAGE1UPDATE: AUTO
+ IMAGE1ADDRESS: 0x00080000
+ IMAGE1FILE: \SOFTWARE\tfm_ns.bin
+
+#. Close ``<MPS3 device name>/MB/HBI0309B/AN521/images.txt``
+#. Unmount/eject the ``<MPS3 device name>`` unit
+#. Reset the board to execute the TF-M example application
+#. After completing the procedure you should be able to visualize on the serial
+ port (baud 115200 8n1) the following messages::
+
+ [Sec Thread] Secure image initializing!
+
+Regression tests without BL2 bootloader
+---------------------------------------
+After completing the procedure you should be able to visualize on the serial
+port (baud 115200 8n1) the following messages::
+
+ [Sec Thread] Secure image initializing!
+
+ #### Execute test suites for the Secure area ####
+ Running Test Suite PSA protected storage S interface tests (TFM_SST_TEST_2XXX)...
+ > Executing 'TFM_SST_TEST_2001'
+ Description: 'Set interface'
+ TEST PASSED!
+ > Executing 'TFM_SST_TEST_2002'
+ Description: 'Set interface with create flags'
+ TEST PASSED!
+ > Executing 'TFM_SST_TEST_2003'
+ Description: 'Set interface with NULL data pointer'
+ TEST PASSED!
+ > Executing 'TFM_SST_TEST_2004'
+ Description: 'Set interface with invalid data length'
+ TEST PASSED!
+ ....
+
Firmware upgrade and image validation with BL2 bootloader
=========================================================
High level operation of BL2 bootloader and instructions for testing firmware