aboutsummaryrefslogtreecommitdiff
path: root/core/arch
AgeCommit message (Collapse)Author
2019-04-15plat-imx: mx6: add support for the TZC380 to MX6QRouven Czerwinski
Use the generic RAM layout to configure the TZC380 according to the device configuration. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Peng Fan <peng.fan@nxp.com>
2019-04-11plat-rpi3: Use generic memory layoutYing-Chun Liu (PaulLiu)
plat-rpi3 have quite standard memory layout, so there is no sense to maintain separate configuration if it possible to use generic one. Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2019-04-11stm32mp1: shres: set GPIO secure hardeningEtienne Carriere
Set secure hardening for the GPIOZ pins according to their peripheral registration. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-11stm32mp1: shres: configure ETZPC protectionEtienne Carriere
With this change, platform configures the ETZPC firewall according to shared peripheral being assigned to either the secure or the non-secure world. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-11stm32mp1: shres: check RCC secure hardeningEtienne Carriere
This change add a platform consistency test between shared resource registering and SoC RCC hardening. When secure resources are registered, RCC secure hardening must be enabled unless what secure world cannot guaranty the resource reliability. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-11stm32mp1: shres: secure clock parentsEtienne Carriere
Add API function stm32mp_register_clock_parents_secure(). The function registers as secure the parent clock(s) of the target clock reference. This API is used by shared_resources.c when a clock is registered as secure so that its dependencies are also registered as secure. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-11stm32mp1: shres: registering shared resourcesEtienne Carriere
This change implements a driver for the stm32mp1 resources that may be assigned to either secure or non-secure worlds upon the platform configuration. Other drivers shall register their resources (when applicable) using the API functions stm32mp_register_{secure|non_secure}_periph*(): - stm32mp_register_*_periph() registers a resource from its platform ID. - stm32mp_register_*_periph_iomem() registers a resource from its IOMEM base address. - stm32mp_register_*_periph_gpio() registers a resource from its GPIO reference, bank and position. Shared resource driver exports some APIs to query a resource registration state, stm32mp_periph_is_*(), stm32mp_gpio_bank_is_*(), stm32mp_clock_is_*(). The driver saves the peripheral assignation. The API does not allow peripherals to change state at runtime. Moverover, to prevent testing a resource status before it is registered, the first query on a resource state locks further registering. Later attempt to register a peripheral will panic the core. Resources are either secure on non-secure but clock that maybe shared in which case it will be assigned to the secure world but a platform service will allow non-secure to access the resource (i.e. enable/disable the clock). Note such service is out of the scope of this change, yet this explains API stm32mp_clock_is_shared(). Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-04stm32mp1: fix ordering in IOMEM mapping registeringEtienne Carriere
Swap RCC_BASE and PWR_BASE mapping registering for a nice alpha ordering of the mapping definitions. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-04stm32mp1: prefer vaddr_t to uintptr_tEtienne Carriere
Use vaddr_t and paddr_t instead of uintptr_t where applicable. This change also simplifies some platform get-base-address functions to use io_pa_or_va(). Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-04stm32mp1: make all local variables be initializedEtienne Carriere
Update platform to conform with OP-TEE directive about local variables initialization. Also rename variable labels excep into exceptions as more explicit. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-04stm32mp1: embed stm32_rng driverEtienne Carriere
Platform embeds RNG driver and maps the RNG1 interface registers. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-04-04stm32mp1: util for shared resources refcountEtienne Carriere
Implement {incr|decr}_shrefcnt(refcount, secure_flag) to provide reference counting for secure, non secure and resources used both from secure and non secure world. Functions {incr|decr}_refcnt(refcount) is a secure refcount only reference counting. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-03-28core: arm: link tee.elf with lib archivesJens Wiklander
Links tee.elf with the library archives instead of -llibname in order to detect multiply defined symbols in several libraries. Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-03-20core: user_ta: implement ASLR for TAsJerome Forissier
Introduces CFG_TA_ASLR to enable Address Space Layout Randomization of Trusted Applications. ASLR makes the exploitation of memory corruption vulnerabilities harder. The feature is disabled by default except for the configurations I could test (QEMU and HiKey960). When CFG_TA_ASLR=y, the stack and subsequent ELF file(s) needed by the TA are mapped into the user VA space with a random offset comprised between CFG_TA_ASLR_MIN_OFFSET_PAGES and CFG_TA_ASLR_MAX_OFFSET_PAGES pages (that is between 0 and 128 pages by default). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU, HiKey960) Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-03-20core: user_ta: use consistent formatting for addresses in TA dumpJerome Forissier
Improve the layout of the TA dump message by using fixed width for physical and virtual addresses: 0x + 8 or 16 characters, depending on the address size (32 or 64 bits). This makes the output more consistent, more readable, and nicer overall. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-03-15generic_boot: reserve optee_tzdram memoryRouven Czerwinski
Aside from reserving the shared memory, also reserve the TZDRAM OP-TEE memory. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
2019-03-15generic_boot: retrieve address-cells and size-cells from rootRouven Czerwinski
If the reserved-memory subnode does not exist, retrieve address-cells and size-cells from the root node. The linux kernel checks whether these properties match between the root and reserved-memory nodes and discards non-matching nodes. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
2019-03-15generic_boot: rename shared reserved memory nodeRouven Czerwinski
Rename the shared reserved memory node from "optee" to "optee_shm". This should avoid confusion when we introduce the "optee_core" reserved memory node in later commits. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
2019-03-14zynqmp: fix UART1 base for zcu102, zc1751_dc1, zc1751_dc2 flavorsMichael Grand
Fix UART1 base address for zcu102, zc1751_dc1, zc1751_dc2 flavors. More information provided p226 of UG1085 [1]. Link: [1] https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf Signed-off-by: Michael Grand <michael.grand.mg@gmail.com> [jf: move URL to a Link: tag] Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-03-09Add support for ultra96 ZynqMP boardMichael Grand
Add flavor 'ultra96' to platform 'zynqmp'. Redirect TEE console output to UART1. Signed-off-by: Michael Grand <michael.grand.mg@gmail.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-03-05core: better align output of TA dump with many or big regionsJerome Forissier
With the introduction of shared libutee/libutils/libmbedtls etc., it is not uncommon for a TA to have more than 10 memory regions. When this happens, the crash dump output is not properly aligned. Similarly, since there is no width specifier when we print the region size, misalignments can occur. This commit makes the output look good for up to 100 regions of up to 16 MiB in size. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2019-03-05core: elf_load: R_ARM_ABS32/R_AARCH64_ABS64 relocations against undefined symbolJerome Forissier
The symbol referenced by a R_ARM_ABS32 or R_AARCH64_ABS64 relocation may very well be external to the binary being relocated (for example, defined in a shared library). In this case, the section table index for the symbol is SHN_UNDEF and we need to perform process-wide symbol resolution. This fixes an issue I found when linking a TA against a shared version of libutee (this configuration is introduced in a later commit). In this case, ta_head::entry is set to __utee_entry which is in libutee.so, hence undefined in the TA binary. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-03-01core: cleanup generic tracesEtienne Carriere
Remove useless newline character in few generic debug traces. Remove argument __func__ from a FMSG trace since already output by macro FMSG(). Remove error trace from syscall_storage_obj_read() that, prior this change, output failing error code from storage read() handler. This is useless and not done for other storage handlers return code. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-03-01core/generic_boot: consistent DTB info tracesEtienne Carriere
Use IMSG() traces when external and embedded DTB are tested. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-03-01core/generic_boot: tone down trace for missing external DTBEtienne Carriere
Change trace message indicating absence of external DTB from error level to debug level. Implementation and comment clearly state the configuration is fully legitimate. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-02-28Compile user TAs with -fpic rather than -fpieJerome Forissier
TA source files are compiled with the -fpie GCC flag in order to generate a Position Independent Executable. This is not suitable to produce a shared library as introduced by commit f8896d1301fc ("TA dev kit: add support for creating shared libraries"). -fpic should be used instead. Here is what the GCC man page has to say on these flags: -fpic Generate position-independent code (PIC) suitable for use in a shared library [...] -fpie -fPIE These options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables. So, it is quite clear that -fpie is wrong for a shared library. It is not very clear however if -fpic can be used when generating code for an executable. I think it can, and there is a bug report against the GCC documentation that would confirm this [1]. Therefore we can simply use -fpic in all cases. This is quite convenient because we currently make no difference in the compile flags when we are building an executable, a static library or a shared library. The difference between -fpie and -fpic has to do with the kinds of relocations that the compiler is allowed to emit. I stumbled upon this issue when experimenting with shared libraries and the code proposed by Jens to share read-only pages between TAs [2]. In my test case, a shared library already loaded by one TA, is used by another TA. During the load phase of the second TA, the TEE core crashed with a data-abort (write permission fault) when trying to apply an R_ARM_REL32 relocation to some literal pool data in the .text section of the library. The whole .text being mapped read-only, there should be no relocation to do here. And indeed the cause was the wrong flag (-fpie) used when compiling the shared library. Link: [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70419 Link: [2] https://github.com/OP-TEE/optee_os/pull/2801 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> CC: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960 32 & 64-bit TA) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (stm32mp1 Armv7)
2019-02-25core: use PTA as acronym for pseudo TAEtienne Carriere
Make inline comments and trace messages more consistent by using PTA as acronym for pseudo TA, rather than using pTA, PTA and pta at various places. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-25core: pta/gprof.c: remove redundant access checkJerome Forissier
There is no need to call tee_mmu_check_access_rights() to check the parameters of gprof_start_pc_sampling(), because they have been checked already by utee_param_to_param() in core/tee/tee_svc.c. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
2019-02-25core: REE FS TAs: add option to verify signature before processingJerome Forissier
Adds configuration flag CFG_REE_FS_TA_BUFFERED, default enabled. A new TA store is introduced which depends on the TEE FS TA store to load the whole binary into a temporary buffer in secure DDR and authenticate it before being processed further. This reduces the attack surface of the TEE core in case of a vulnerability in the ELF loader, at the expense of increased memory usage at load time. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> [3.6] Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
2019-02-25libutils: remove buf_compare_ct()Jerome Forissier
Now that we have consttime_memcmp(), buf_compare_ct() is redundant. Every time buf_compare_ct() is used, consttime_memcmp() may be used instead. This commit removes buf_compare_ct(). A compatibility wrapper is kept in <string_ext.h> to avoid knowingly breaking the build of any TA that may use it. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-25core: get_elf_segments(): use memmove on overlapping memoryJerome Forissier
get_elf_segments() final stage aggregates ELF segments. In the while loop, the logic to remove the current index is to use memcpy() to shift down everything beyond that point. This is incorrect; memmove() should be used instead. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> [2.8] Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
2019-02-25core: load_elf_from_store(): check stack sizeJerome Forissier
Inside load_elf_from_store(), the ta_head structure is retrieved from un-authenticated area, and contains the stack size. The stack size could either already be 0, or could be large enough so it becomes 0 when rounded up to STACK_ALIGNMENT. This could result in vm_map() returning a virtual address for a 0-size memory block or other issues. Check the rounded-up stack_size value before using it. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> [2.7] Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
2019-02-25core: add overflow check in mobj_reg_shm_alloc()Jerome Forissier
In function mobj_reg_shm_alloc(), the macro MOBJ_REG_SHM_SIZE() could overflow depending on 'nr_pages'. In such case, the mobj_reg_shm memory would be a small memory block, while num_pages would be large, which could lead to a generous memcpy() when copying the pages in internal memory, the outcome of this depends on memory mapping. Note: no attack path are identified to exploit this overflow, however it is error prone and could lead to a future vulnerability. This commit replaces the MOBJ_REG_SHM_SIZE() macro with a static function that performs the same computation, but returns 0 in case of integer overflow. The call site is updated to return an error status should this situation happen. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> [2.3] Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
2019-02-25core: do not use virtual addresses as session identifierJerome Forissier
Session context virtual address is returned to the REE in entry_open_session(); it is then used back in entry_close_session() and entry_invoke_command(). Sharing virtual addresses with the REE leads to virtual memory addresses disclosure that could be leveraged to defeat ASLR (if/when implemented) and/or mount an attack. Similarly, syscall_open_ta_session() returns a session ID directly derived from the session virtual address to the caller TA. This commit introduces a 32-bit identifier field in struct tee_ta_session. The ID is generated when the session is created, starting from the id of the last session in the queue, and counting up until a number that is not used in the session queue is found. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> [2.1] Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
2019-02-25core: ELF relocation: use ADD_OVERFLOW()Jerome Forissier
The ELF relocation functions e32_process_rel() and e64_process_rel() can experience integer overflows which could result in invalid memory access. Use ADD_OVERFLOW() to prevent these. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> [1.8] Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-25core: elf_load_body(): use MUL_OVERFLOW() to get size of section headersJerome Forissier
At the end of elf_load_body(), section headers are copied in a system heap memory block, associated to state->shdr. As the computed size is the result of an uncontrolled multiplication (ehdr.e_shnum * ehdr.e_shentsize), it could have overflowed and result in allocating a small memory block. Use an overflow checking macro to prevent this case. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> [1.7] Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
2019-02-25core: umap_add_region(): add overflow checkJerome Forissier
Use ADD_OVERFLOW() to be more resilient to very large values potentially passed to umap_add_region(). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> [1.3] Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
2019-02-25core: entry_std.c: clean memory type inline commentsEtienne Carriere
This change modifies inline comments. Replace "non sec" and "nonsecure" with "non-secure". Fixup "Rerefence" into "reference". Clarify contiguous shared memory comment. Minor rephrasing for consistency. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> [jf: minor edit to commit subject] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-02-25stm32mp1: embed BSEC driverEtienne Carriere
Embed BSEC driver in platform stm32mp1. The platform implements stm32mp_get_bsec_static_cfg() to provide BSEC static configuration. Add BSEC node in stm32mp157c.dtsi. Add BSEC node with some BSEC word definition and assignment (non-secure and/or secure) for board stm32mp157c-ed1 and stm32mp157c-ev1. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-25stm32_bsec: OTP driver for stm32mp platformsEtienne Carriere
BSEC is a one time programmable (OTP) memory interface for stm32mp SoCs. OTPs are grouped into 32bit words identified by a incremental ID starting from 0. Shadowed OTPs are loaded in a volatile memory yet used as OTP values by the software. The platform shall implement stm32mp_get_bsec_static_cfg() to provide BSEC driver some information as the BSEC memory size and its lower/upper threshold ID that split non-secure from secure OTPs. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Signed-off-by: Christophe Montaud <christophe.montaud@st.com> Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Mathieu Belou <mathieu.belou@st.com> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com> Signed-off-by: Yann Gautier <yann.gautier@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-25plat-ls: updated conf.mk to set CFG_USER_TA_TARGETSPankaj Gupta
from R3.4.0 onwards, CFG_USER_TA_TARGETS = "ta_arm32 ta_arm64" is set by default, if the CFG_USER_TA_TARGETS is not set. Updating the conf.mk for plat-ls devices to set the default value to CFG_USER_TA_TARGETS as per platform. Value to CFG_USER_TA_TARGETS can be overridden using the make cmd. Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-02-22drivers: GICv3: Configure native secure interruptSandeep Tripathy
OP-TEE dispatcher registers with TF-A to handle EL1S interrupts by design. OP-TEE should own the G1S interrupts in GICv3. -gic_it_add() should result in configuring a given interrupt to G1S instead of G0 for GICv3. -G1S interrupts to be enabled at distributor interface. -system interface register ICC_IGRPEN1_EL1 to be used to enable G1S interrupts. Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com> Reviewed-by: Soby Mathew <soby.mathew@arm.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-22Add support for Hisilicon Hi3519AV100 DEMO boardZeng Tao
Hi3519AV100 is a high-performance and low-power 4K Smart IP Camera SoC designed for IP cameras, action cameras, panoramic cameras, rear view mirrors, and UAVs. Hi3519A V100 introduces H.265/H.264 encoding and decoding, with performance up to 4K x 2K@60 fps and 1080p@240 fps. For more information: http://www.hisilicon.com/en/Products/ProductList/Surveillance This patch has been tested using the following step, 1. Patch the uboot and Linux kernel with OP-TEE support if required 2. build step: (1) make CROSS_COMPILE=arm-himix200-linux- PLATFORM=hisilicon PLATFORM_FLAVOR=hi3519av100_demo (OPTEE-OS build) (2) make CROSS_COMPILE_HOST=arm-himix200-linux- (OPTEE_CLIENT build) (3) cross_compile openssl and replace optee_test/host/libopenssl (4) make CROSS_COMPILE_HOST=arm-himix200-linux- CROSS_COMPILE_TA=arm-himix200-linux- TA_DEV_KIT_DIR=../optee_os/out/arm-plat-hisilicon/export-ta_arm32 COMPILE_NS_USER=32 (OPTEE_TEST build) 3. mkimage -A arm -T kernel -O tee -C none -d tee.bin uTee.optee 4. Boot setting in uboot: nand read 0x22007fc0 0x100000 0x400000; /* load kernel */ tftp 0x30000000 uTee.optee;bootm 0x30000000; 5. after Linux startup, run daemon tee-supplicant 6. run xtest Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
2019-02-21core: mm: simplify overlap checkPeng Fan
Overlap region check could be simplified as below: "(StartA <= EndB) and (StartB <= EndA)" Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
2019-02-15Revert "core_mmu: phys_to_virt_io(): warn if PA has both S and NS mappings"Jerome Forissier
This reverts commit 53c1131c3dee546d6d618a0f7f20586598ca032c. The original change breaks platforms that map their console UART in both security domains [1]. In this case, the platform won't boot because the error message causes infinite recursion. Since add_phys_mem() warns about overlaps already, there is really no need for more checks. Link: [1] https://github.com/OP-TEE/optee_os/issues/2821 Reported-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-14plat-rcar: add support for H3 module with 8GB memoryVolodymyr Babchuk
Renesas calls this flavor "salvator-h3-4x2g", in OP-TEE flavor will be named "salvator_h3_4x2g". Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Acked-by: Joakim Bech <joakim.bech@linaro.org>
2019-02-14plat-rcar: virtualization port for RCAR platformVolodymyr Babchuk
Put platform information into nexus sections, so they are available at all times. Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-02-14mmu_lpae: flush TLBs when switching partitionsVolodymyr Babchuk
Missed TLB flush caused random page faults on Renesas HW. Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2019-02-14stm32mp1: fix missing ETZPC mappingEtienne Carriere
Fixes commit 1095cc2ec739 ("stm32mp1: platform enables STM32 ETZPC driver") that did not define ETZPC interface registers mapping. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-02-14zynq7k: upgrade from write32() to io_write32() and friendsEtienne Carriere
Replace use of readX() and writeX() with io_readX() and io_writeX(). The former are about to be deprecated in favor to the later. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>