aboutsummaryrefslogtreecommitdiff
path: root/documentation
diff options
context:
space:
mode:
authorSummer Qin <summer.qin@arm.com>2017-04-18 13:59:03 +0100
committerJérôme Forissier <jerome.forissier@linaro.org>2017-06-28 19:00:56 +0200
commitac3cc6cffeae7a36b68335384502aa33d575163f (patch)
tree841b72c800f7eb1d5fa56094040fe2e0c1932041 /documentation
parent3520324d033e10e95f4662c44f77765fd9a754c1 (diff)
Generate binaries for loaders supporting separate binary loading
Generate three binaries tee-header_v2.bin, tee-pager_v2.bin and tee-pageable_v2.bin for loaders supporting separate binary loading. This kind of loader loads and parses header binary first and then loads rest two binaries under specified manners header information implies. Generic loaders who don't support separate binary loading just ignore these binaries; and this change will not affect all existing design. Signed-off-by: Summer Qin <summer.qin@arm.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/optee_design.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/documentation/optee_design.md b/documentation/optee_design.md
index cb0a5afa..cfc5e19c 100644
--- a/documentation/optee_design.md
+++ b/documentation/optee_design.md
@@ -451,6 +451,56 @@ OP-TEE to be able to initialize at all. The loader supplies in `r0/x0` the
address of the first byte following what was not copied and jumps to the load
address to start OP-TEE.
+In addition to overall binary with partitions inside described as above, extra
+three binaries are generated simultaneously during build process for loaders
+who support loading separate binaries:
+```
++----------+
+| Header |
++----------+
+
++----------+
+| Init |
++----------+
+| Hashes |
++----------+
+
++----------+
+| Pageable |
++----------+
+```
+In this case, loaders load header binary first to get image list and information
+of each image; and then load each of them into specific load address assigned
+in structure. These binaries are named with v2 suffix to distinguish from the
+existing binaries. Header format is updated to help loaders loading binaries
+efficiently:
+```c
+#define OPTEE_IMAGE_ID_PAGER 0
+#define OPTEE_IMAGE_ID_PAGED 1
+
+struct optee_image {
+ uint32_t load_addr_hi;
+ uint32_t load_addr_lo;
+ uint32_t image_id;
+ uint32_t size;
+};
+
+struct optee_header_v2 {
+ uint32_t magic;
+ uint8_t version;
+ uint8_t arch;
+ uint16_t flags;
+ uint32_t nb_images;
+ struct optee_image optee_image[];
+};
+```
+
+Magic number and architecture are identical as original. Version is increased
+to 2. `load_addr_hi` and `load_addr_lo` may be 0xFFFFFFFF for pageable binary
+since pageable part may get loaded by loader into dynamic available position.
+`image_id` indicates how loader handles current binary.
+Loaders who don't support separate loading just ignore all v2 binaries.
+
## Initializing the pager
The pager is initialized as early as possible during boot in order to minimize
the "init" area. The global variable `tee_mm_vcore` describes the virtual memory