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>
plat-vexpress: linking supports pagable tee.bin

* Adds scripts to create a pagable tee.bin
* Updates link script and link.mk to support pagable tee.bin
* Binary format of tee.bin is changed from a raw format to a header
  followed by the binary data as described by the header. This requires
  updates in ARM-TF OP-TEE Dispatcher and QEMU virt bios.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
arm32: paging of TEE Core optionally enabled

plat-vexpress-*:
* Optionally enable paging
* Uses fake SRAM when paging is enabled
* Supports partitioning OP-TEE binary in unpaged, init and pagable areas

arm32:
* Replaces legacy paging support with new paging support

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP, Juno)
New stable commits for the setup cripts

Sets new stable commits for the FVP and QEMU setup scripts

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