Documentation for cryptographic abstract layer

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Travis: ignore GERRIT_CHANGE_ID

Change-Id: I68bcb455a02982a692fd94db008874097219d157
Signed-off-by: Pascal Brand <pascal.brand@st.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Add MSG() macro for traces

MSG() and MSG_RAW() macros are added.
They are the same as xMSG() and xMSG_RAW() existing macros, but are not
subject to dynamic trace level

Note that when the core trace level is 0, these macros are void.

This patch also fixes an issue with "printf" level.

Change-Id: Ibff6058d7e35d728a46878b345b6e0833c18aec1
Reviewed-on: https://gerrit.st.com/18102
Reviewed-by: Emmanuel MICHEL <emmanuel.michel@st.com>
Signed-off-by: Pascal Brand <pascal.brand@st.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Keep binary compatilities TEECore <--> TA

In case the core is compiled with
    CFG_TEE_TA_LOG_LEVEL=0
then TA cannot be compiled with CFG_TEE_TA_LOG_LEVEL!=0 because of the trace
function.

This patch implements stub trace functions in case of unsufficient trace level.
It also check
- TRACE_LEVEL < 0  instead of TRACE_LEVEL == 0
- TRACE_LEVEL >= 0 instead of TRACE_LEVEL != 0
to take into account negative trae levels

Change-Id: I7b4d2d576c50e103d9cf6f5b22f9f99a1ab96d6a
Signed-off-by: Pascal Brand <pascal.brand@st.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Update documentation/build_system.md

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
libmpa: move some static allocations to stack

Change some large static allocations (in .bss) in mpa_set_str() and
mpa_get_str() to allocate from stack instead.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
merge tee_pager*.c and tee_pager*.h files

* Merges tee_pager_unpg.c and tee_pager.c into pager.c
* Merges tee_pager_unpg.h and tee_pager.h into pager.h

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
arm32: add thread_init_per_cpu()

Adds a thread_init_per_cpu() function that should be called instead of
thread_init_handlers() by the secondary CPUs. The primary CPU should first
call thread_init_handlers() and then thread_init_per_cpu().

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
arm32: split core_init_mmu()

Splits core_init_mmu() into two functions, core_init_mmu_tables() called
by primary CPU to create the translation tables and core_init_mmu_regs()
called by each CPU to initialize MMU register settings.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
arm32: make all TLB invalidations inner sharable

* Makes all TLB invalidations inner sharable
* Removes deprecated TLB invalidations

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
plat-vexpress: clean memory configuration

* Cleans the memory configuration for plat-vexpress to make it easier
  to add fake and real SRAM.
* Uses common functions to check if a buffer intersects or is inside
  a memory area

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
arm32: move call to teecore_init_ta_ram()

Moves call to teecore_init_ta_ram() from init_teecore() to be called
directly from platform initialization routines.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
plat-vexpress: reorganize boot for paging

Reorganizes the boot functions to keep primary and secondary boot path
more separated as a preparation for the pager.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
tee_mm: remove legacy TEE_MM_POOL_PAGED define

Removes the legacy TEE_MM_POOL_PAGED define and unsused code
associated with it.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
arm32: assembly routines in separate sections

Moves some assembly routines into separate sections

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
plat-vexpress: separate sections

Puts functions and data into separate sections

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
provide hash_sha256_check()

Adds hash_sha256_check() to the tee_crypt_provider interface to be
used by pager and early initialization code where the complete crypto
library might not be available.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
separate .rodata sections

Puts each .rodata in a file specific .rodata section

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
arm32: clear junk in UL1 table

Clears junk in UL1 translation table when setting mapping for a TA in
tee_mmu_set_ctx().

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
plat-vexpress: Clean D-cache on reset_primary exit

Cleans and invalidates D-cache when primary CPU has initialized
and is ready to exit to normal world.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>