Rename teesmc_st.h to teesmc_optee.h

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU virt platform)
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Travis: checkpatch: do not warn on file addition/removal

Signed-off-by: Pascal Brand <pascal.brand@st.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
uart: add baudrate and clock freqency to uart_init

Adds baudrate and clock frequency as agruments to uart_init().

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
plat-vexpress: add juno flavor

Adds support for ARM Versatile Express V2M-Juno by adding flavor juno.

UART3 (SoC UART1) is used as console uart instead of UART1 (FPGA UART1)
which is used by TSP in ARM Trusted Firmware. UART3 is used for OP-TEE
since that uart is easily accessible on the Juno board, while UART0 and
UART1 only are accessible via headers on the motherboard.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Juno and FVP)
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Add script for setting up QEMU and OP-TEE

The script will clone and download all needed gits to run OP-TEE
using a QEMU with TrustZone patches.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (Ubuntu 14.01 64-bit)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Linux Mint 17 64-bit)
Add crypto provider internal API

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>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
Add support for $(lib-use-ld) and $(lib-ldflags)

When building a static library, set lib-use-ld := y to use $(LD) instead of
$(AR). Link flags may be passed in $(lib-ldflags).

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>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
Add support for $(cflags-lib-y)

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>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
Import libcrypto source code from OpenSSL 1.0.1i

$ md5sum openssl-1.0.1i.tar.gz
c8dc151a671b9b92ff3e4c118b174972  openssl-1.0.1i.tar.gz

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
openssl: AES-XTS: allow updates with partial buffers

This commit modifies CRYPTO_xts128_encrypt() so that tweak information
is saved in the context for the next call. As a result, EVP_EncryptUpdate()
or EVP_DecryptUpdate() can be called multiple times with partial buffers.
libutils, kernel: add standard functions needed by OpenSSL

Prepare for building OpenSSL libcrypto.
1. Add the following to libutils:
- isdigit(), isspace(), isalpha(), isalnum(), isxdigit(), isupper(),
  islower(), toupper(), tolower(): basic ASCII-only implementation
- atoi(), sscanf() (stub!), strtoul(), strncmp(), strcpy(), strncpy(),
  strchr(), strcat()
2. Add abort() and time() to core/kernel.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Implement OpenSSL crypto provider (WITH_CRYPTO=openssl)

Set the WITH_CRYPTO build option to 'openssl' to use the OpenSSL libcrypto
library for cryptographic services. When WITH_CRYPTO is not set, or set to
'tomcrypt', LibTomCrypt is used.

Usage example:
  $ make CROSS_COMPILE=arm-linux-gnueabihf- \
         PLATFORM=vexpress PLATFORM_FLAVOR=fvp \
         WITH_CRYPTO=openssl

Tested with xtest (e7cda93) on Foundation_v8 (PLATFORM_FLAVOR=fvp) and QEMU
(PLATFORM_FLAVOR=qemu_virt).

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Travis: add build command with OpenSSL crypto enabled

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>