aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAntonio Niño Díaz <antonio.ninodiaz@arm.com>2019-04-12 10:40:15 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2019-04-12 10:40:15 +0000
commit72db70ca184c0db10d920923288bc2f1e009e19f (patch)
tree14400d6a6fac2eb96472582adaaac3bbad9b58fc /docs
parent5e2f1ce276e10fbdf54ca9f8db38fe3f3fecd25a (diff)
parent2374ab1799bedae1acc17fde0205d272f8111836 (diff)
downloadplatform_external_arm-trusted-firmware-72db70ca184c0db10d920923288bc2f1e009e19f.tar.gz
platform_external_arm-trusted-firmware-72db70ca184c0db10d920923288bc2f1e009e19f.tar.bz2
platform_external_arm-trusted-firmware-72db70ca184c0db10d920923288bc2f1e009e19f.zip
Merge changes from topic "av/tls-heap" into integration
* changes: Mbed TLS: Remove weak heap implementation sgm: Fix bl2 sources
Diffstat (limited to 'docs')
-rw-r--r--docs/porting-guide.rst50
1 files changed, 27 insertions, 23 deletions
diff --git a/docs/porting-guide.rst b/docs/porting-guide.rst
index 3ea86b04f..6244a6387 100644
--- a/docs/porting-guide.rst
+++ b/docs/porting-guide.rst
@@ -841,6 +841,33 @@ utilize the C runtime environment. For further details about how TF-A
represents the power domain topology and how this relates to the linear CPU
index, please refer `Power Domain Topology Design`_.
+Function : plat_get_mbedtls_heap() [when TRUSTED_BOARD_BOOT == 1]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ Arguments : void **heap_addr, size_t *heap_size
+ Return : int
+
+This function is invoked during Mbed TLS library initialisation to get a heap,
+by means of a starting address and a size. This heap will then be used
+internally by the Mbed TLS library. Hence, each BL stage that utilises Mbed TLS
+must be able to provide a heap to it.
+
+A helper function can be found in `drivers/auth/mbedtls/mbedtls_common.c` in
+which a heap is statically reserved during compile time inside every image
+(i.e. every BL stage) that utilises Mbed TLS. In this default implementation,
+the function simply returns the address and size of this "pre-allocated" heap.
+For a platform to use this default implementation, only a call to the helper
+from inside plat_get_mbedtls_heap() body is enough and nothing else is needed.
+
+However, by writting their own implementation, platforms have the potential to
+optimise memory usage. For example, on some Arm platforms, the Mbed TLS heap is
+shared between BL1 and BL2 stages and, thus, the necessary space is not reserved
+twice.
+
+On success the function should return 0 and a negative error code otherwise.
+
Common optional modifications
-----------------------------
@@ -1054,29 +1081,6 @@ can override the common implementation to define a different prefix string for
the log output. The implementation should be robust to future changes that
increase the number of log levels.
-Function : plat_get_mbedtls_heap()
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-::
-
- Arguments : void **heap_addr, size_t *heap_size
- Return : int
-
-This function is invoked during Mbed TLS library initialisation to get
-a heap, by means of a starting address and a size. This heap will then be used
-internally by the Mbed TLS library. The heap is requested from the current BL
-stage, i.e. the current BL image inside which Mbed TLS is used.
-
-In the default implementation a heap is statically allocated inside every image
-(i.e. every BL stage) that utilises Mbed TLS. So, in this case, the function
-simply returns the address and size of this "pre-allocated" heap. However, by
-overriding the default implementation, platforms have the potential to optimise
-memory usage. For example, on some Arm platforms, the Mbed TLS heap is shared
-between BL1 and BL2 stages and, thus, the necessary space is not reserved
-twice.
-
-On success the function should return 0 and a negative error code otherwise.
-
Modifications specific to a Boot Loader stage
---------------------------------------------