aboutsummaryrefslogtreecommitdiff
path: root/core/arch/arm/plat-rockchip
AgeCommit message (Collapse)Author
2019-02-14rockchip: 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>
2019-02-13core_mmu: do not restrict device memory mapping to PGDIR_SIZE granularityJerome Forissier
Device memory registered via register_phys_mem() is currently rounded up/down to CORE_MMU_PGDIR_SIZE (1 MiB, or 2 MiB for LPAE). This is not needed and possibly incorrect for SoCs that define I/O memory maps with regions aligned on a small page (4 KiB), because using a larger granularity could result in overlaps between secure and non-secure mappings. This could cause issues depending on the type of memory firewall used by the SoC and its configuration. In any case, memory types other than MEM_AREA_IO_{SEC,NSEC} *can* be mapped with small page granularity using register_phys_mem(), so the situation is a bit inconsistent. This commit removes the rounding by default and provides a new macro: register_phys_mem_pgdir(). Platforms that still need to use PGDIR_SIZE granularity (typically because it consumes less page table space) need to replace register_phys_mem() by register_phys_mem_pgdir(). In order to avoid any functional change in platform code, all calls to register_phys_mem() with device memory are replaced with register_phys_mem_pgdir(). In addition, CORE_MMU_DEVICE_SIZE is removed and replaced with CORE_MMU_PGDIR_SIZE since there is no unique mapping size for device memory anymore. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Zeng Tao <prime.zeng@hisilicon.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-12-18Factor out ta-targets from platform configJerome Forissier
Platforms use the same basic pattern again and again: ta-targets = ta_arm32 ifeq ($(CFG_ARM64_core),y) ta-targets += ta_arm64 endif Let's move this pattern to core/arch/arm/arm.mk, make it the default, and cleanup the platform configuration files. Suggested-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
2018-06-05plat-*/conf.mk: use $(call force, ...) to set CFG_TEE_CORE_NB_COREJerome Forissier
Except for very special cases (such as virtualization), the number of CPU cores that can enter OP-TEE is a fixed number that depends on the hardware configuration and should not be configurable at build time. Therefore, use $(call force,CFG_TEE_CORE_NB_CORE,<value>) to set the value. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-05-03plat-rockchip: move some CFG_'s from platform_config.h to conf.mkEtienne Carriere
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
2018-04-25core: remove CFG_ prefix from CFG_TEE_LOAD_ADDREtienne Carriere
TEE_LOAD_ADDR is now local to source files. It is set to CFG_TEE_LOAD_ADDR value if defined only for the platforms that previously allowed build to override the value. Few platform did hardcod CFG_TEE_LOAD_ADDR, this change preserve these configurations. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-04-25core: remove CFG_ prefix from CFG_SHMEM_START/_SIZEEtienne Carriere
Almost platform currently define these directives from within the source code, through platform_config.h. These values do not need to be configuration directive with the CFG_ prefix. This change renames the CFG_SHMEM_xxx into TEE_SHMEM_xxx so that they do not mess with the platform configuration directives. Yet, the old CFG_SHMEM_START/SIZE directives can still be used by platform_config.h to set TEE_SHMEM_START/SIZE if the platform supports it (i.e plat-stm). Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-04-25core: remove CFG_ prefix from TA_RAM_START/TA_RAM_SIZEEtienne Carriere
Almost platform currently define these directives from within the source code, through platform_config.h. These values do not need to be configuration directive with the CFG_ prefix. This change renames these macros so that they do not mess with the platform configuration directives. Old macro label New macro label CFG_TA_RAM_START TA_RAM_START CFG_TA_RAM_SIZE TA_RAM_SIZE Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-04-25core: remove CFG_ prefix from TEE_RAM_START/VA_SIZE/PH_SIZEEtienne Carriere
Almost platform currently define these directives from within the source code, through platform_config.h. These values do not need to be configuration directive with the CFG_ prefix. This change renames these macros so that they do not mess with the platform configuration directives. Old macro label New macro label CFG_TEE_RAM_START TEE_RAM_START CFG_TEE_RAM_VA_SIZE TEE_RAM_VA_SIZE CFG_TEE_RAM_PH_SIZE TEE_RAM_PH_SIZE Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-03-07core: insert memory barrier after write to ns entry contextJordan Rhee
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Jordan Rhee <jordanrh@microsoft.com> Tested-by: Jordan Rhee <jordanrh@microsoft.com>
2018-03-02core: fix psci_cpu_on() to use context_id parameterJordan Rhee
The PSCI specification requires the context_id parameter to be passed in r0 when the core jumps to normal world. Some OS's require this parameter. Tested on IMX6Quad and IMX7Dual. Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Jordan Rhee <jordanrh@microsoft.com> Tested-by: Jordan Rhee <jordanrh@microsoft.com>
2018-01-10Remove 'All rights reserved' from Linaro filesJerome Forissier
The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words. Therefore, we can safely remove the text from the files that are owned by Linaro. Generated by: spdxify.py --linaro-only --strip-arr optee_os/ Link: [1] https://en.wikipedia.org/wiki/All_rights_reserved Link: [2] https://reuse.software/practices/ Link: [3] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
2018-01-10Remove license notice from Linaro filesJerome Forissier
Now that we have added SPDX identifiers, we can safely remove the verbose license text from the files that are owned by Linaro. Generated by [1]: spdxify.py --linaro-only --strip-license-text optee_os/ Link: [1] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
2018-01-10Add SPDX license identifiersJerome Forissier
Adds one SPDX-License-Identifier line [1] to each source files that contains license text. Generated by [2]: spdxify.py --add-spdx optee_os/ The scancode tool [3] was used to double check the license matching code in the Python script. All the licenses detected by scancode are either detected by spdxify.py, or have no SPDX identifier, or are false matches. Link: [1] https://spdx.org/licenses/ Link: [2] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Link: [3] https://github.com/nexB/scancode-toolkit Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
2017-11-24core: arm32: enable NEON with .fpu directive rather than compile flagJerome Forissier
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU CFG_WITH_VFP=y) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960 AArch32 {,pager}) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-11-24Use -mfpu-neon for assembly files in TEE core onlyJerome Forissier
Some platforms set arm32-platform-aflags += -mfpu-neon, which causes NEON to be selected when building any assembly files. TEE core, user-mode libraries and TAs are all affected by this setting. This is most likely incorrect because user-mode libraries do not use NEON instructions (only some core files do). And, it does not make much sense to set it by default for TAs either. So, core_arm32-platform-aflags should be set instead. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-11-06core: arm: psci: pass nsec ctx to system_suspendZeng Tao
In the commit 732fc43(core: arm: psci: pass nsec ctx to psci), we have done the job, but we forgot to follow it in the later commit 1d40eb8 (core: arm: sm: add PSCI system suspend), fix it in this patch. Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
2017-10-11core: core.mk: make platform specific link.mk optionalAndrew F. Davis
Most platform do not need any special linker targets and so most just link back to the default. Lets just have core.mk use the default when a platform does not have this file. Also remove this from the porting guidelines as it is now optional and only needed for advanced use. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2017-10-11core: link.mk: make platform specific kern.ld.S optionalAndrew F. Davis
Most platform do not need any special linker scripting and so most just link back to the default. Lets just have link.mk use the default when a platform does not have this file. Also remove this from the porting guidelines as it is now optional and only needed for advanced use. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2017-09-18core: introduce get_core_pos_mpidr()Jens Wiklander
Adds size_t get_core_pos_mpidr(uint32_t mpidr); which translates from mpdir to core position, like get_core_pos() does for the calling core. get_core_pos_mpidr() a weak function to allow platforms to override the implementation. get_core_pos() now uses get_core_pos_mpidr() internally to calculate the core position without using any stack. With get_core_pos_mpidr() all the platform specific implementations of get_core_pos() has been replaced with get_core_pos_mpidr() and get_core_pos() is not weak any longer to avoid unexpected runtime errors in out of tree rebased platforms. Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU v8) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-08-21plat-rockchip: rk322x: add PSCI system suspendJoseph Chen
Support gating clks and power down PLLs. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2017-08-21plat-rockchip: rk322x: add PSCI featuresJoseph Chen
Add currently implemented PSCI functions. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2017-08-21plat-rockchip: rk322x: add PSCI versionJoseph Chen
Improve PSCI version to PSCI_VERSION_1_0. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2017-07-25Add plat-rockchip supportJoseph Chen
Initial version support for rockchip SoCs.(RK322X and next SoCs). This patch adds to support the RK322X. It is one of the Rockchip family SoCs, which is a 4*A7 multi-cores ARM SoCs. plat-rockchip support features: 1.Support SMP cpu boot up and power down; 2.Support system reset; 3.Support GIC driver initialization. make PLATFORM=rockchip-rk322x Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>