aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdison Ai <edison.ai@arm.com>2020-07-01 18:35:17 +0800
committerKen Liu <ken.liu@arm.com>2020-10-21 08:24:06 +0000
commitf4b611388a323690748ea88e6893edb77bba447f (patch)
tree68ecbe89bdebe3a77fc1a6857663f5bb52639cee
parent5b186e63bfb0581f50736b34f45fcffd17bcaf72 (diff)
downloadtrusted-firmware-m-f4b611388a323690748ea88e6893edb77bba447f.tar.gz
Docs: Design of the TF-M log HAL
Add the TF-M LOG HAL API design. Change-Id: I498243d6d6a960e93252fd474a208e747f15701e Signed-off-by: Edison Ai <edison.ai@arm.com> Co-Authored-by Kevin Peng <kevin.peng@arm.com>
-rw-r--r--docs/design_documents/hardware_abstraction_layer.rst69
1 files changed, 69 insertions, 0 deletions
diff --git a/docs/design_documents/hardware_abstraction_layer.rst b/docs/design_documents/hardware_abstraction_layer.rst
index 90985c9af1..6f862ef626 100644
--- a/docs/design_documents/hardware_abstraction_layer.rst
+++ b/docs/design_documents/hardware_abstraction_layer.rst
@@ -180,6 +180,75 @@ TFM_HAL_ERROR_MEM_FAULT
-----------------------
Status code to indicate that the memory check failed.
+***************************
+API Definition for TF-M SPM
+***************************
+This section describes the APIs defined for :term:`TF-M` :term:`SPM`.
+
+Log API
+=======
+The log API is used by the :term:`TF-M` :doc:`log system <tfm_log_system_design_document>`.
+The log device could be uart, memory, usb, etc.
+
+APIs
+----
+tfm_hal_output_partition_log()
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**Prototype**
+
+.. code-block:: c
+
+ int32_t tfm_hal_output_partition_log(const unsigned char *str, uint32_t len)
+
+**Description**
+
+This API is called by Secure Partition to output logs.
+
+**Parameter**
+
+- ``str`` - The string to output.
+- ``len`` - Length of the string in bytes.
+
+**Return Values**
+
+- Positive values - Number of bytes output.
+- ``TFM_HAL_ERROR_NOT_INIT`` - The log device has not been initialized.
+- ``TFM_HAL_ERROR_INVALID_INPUT`` - Invalid inputs when ``str`` is ``NULL`` or
+ ``len`` is zero.
+
+**Note**
+
+None.
+
+tfm_hal_output_spm_log()
+^^^^^^^^^^^^^^^^^^^^^^^^
+**Prototype**
+
+.. code-block:: c
+
+ int32_t tfm_hal_output_spm_log(const unsigned char *str, uint32_t len)
+
+**Description**
+
+This API is called by :term:`SPM` to output logs.
+
+**Parameter**
+
+- ``str`` - The string to output.
+- ``len`` - Length of the string in bytes.
+
+**Return Values**
+
+- Positive numbers - Number of bytes output.
+- ``TFM_HAL_ERROR_NOT_INIT`` - The log device has not been initialized.
+- ``TFM_HAL_ERROR_INVALID_INPUT`` - Invalid inputs when ``str`` is ``NULL``
+ or ``len`` is zero.
+
+**Note**
+
+Please check :doc:`TF-M log system <tfm_log_system_design_document>` for more
+information.
+
--------------
*Copyright (c) 2020, Arm Limited. All rights reserved.*