aboutsummaryrefslogtreecommitdiff
path: root/core/arch/arm/plat-zynq7k
AgeCommit message (Collapse)Author
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>
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-02plat-zynq7k: move some CFG_'s from platform_config.h to conf.mkEtienne Carriere
Legacy zyn7k does not allow reconfiguring the memory layout, hence internal labels used are local: discard CFG_DDR_TEETZ_RESERVED_START CFG_DDR_TEETZ_RESERVED_SIZE, CFG_CORE_TZSRAM_EMUL_START in favor of hardcoded addresses. Discard local CFG_PUB_RAM_SIZE in favor to TEE_SHMEM_START/SIZE. Remove useless DRAM0_BASE/_SIZE, DDR_PHYS_START, DDR_SIZE and CFG_DDR_START/_SIZE. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Yan Yan <yan.yan@windriver.com>
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-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-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-08-22core: default enable CFG_ENABLE_SCTLR_RR for some ARMv7 coresEtienne Carriere
Some platforms could benefit from CFG_ENABLE_SCTLR_RR according to their current implementation. Updated platforms are stm-(cannes2|b2260), several mx6-*sabre* mx6-(qsabrelite|qsabresd|dlsabresd) (CFG_MX6Q/_MX6D/_MX6DL/_MX6S) and zynq-zc702. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2017-05-30core: remove __early_bssJerome Forissier
Initialize the .bss section early from assembler before entering C code. As a result, the __early_bss qualifier is not needed anymore. Remove it, as well as the related symbols (__early_bss_start and __early_bss_end). This makes the code simpler hence easier to maintain, at the expense of initialization time, since .bss is cleared before CPU caches are turned on (and doing it later would mean some C function have been called already). Here are some performance numbers measured on HiKey. The "memset" column measures the time it takes to clear .bss in C, without this patch. The "assembly" column reports the time taken by the clear_bss loop in this patch. Timings were performed using CNTPCT. Worst case is a ~1 ms overhead in boot time. memset(): | assembly: ms (bytes) | ms (bytes) --------------+-------------- Aarch64 0.30 (72824) | 0.08 (73528) Aarch32 0.27 (65016) | 1.24 (65408) Aarch32/pager 0.03 (11328) | 0.23 (11736) Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 32/64) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey/pager) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-05-29core: factorize cpu supportEtienne Carriere
Create core/arch/arm/cpu/<cpu-name>.mk to store CPU generic configurations settings. Update supported platforms to rely on the generic CPU support. Platform shall still specify whether they support or not the NEON extension. Cortex-A53 and Cortex-A57 are all ARMv8.0 compliant. For ARMv8 core, we will use ARMv8-A architecture minor version configuration files. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2017-03-17core: add common implementation for console_putc() and console_flush()Jerome Forissier
Since most platforms now use the same console_putc() and console_flush(), move them to core/kernel/console.c. Make them __weak so that platforms may still provide their own. The common code expects the platforms to initialize whatever serial device from console_init() and call register_console(). 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>
2017-03-17drivers: convert cdns_uart driver to use struct serial_chipJerome Forissier
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>
2017-03-14plat-zynq7k: fix NSACR initializationEtienne Carriere
Bits #9..#0 of CPU register NSACR are specified by ARM as SBZP ("Set Bit to Zero or Preserve on write"). This change fixes plat-zynq7k to conform with the specs. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-03-14core: use mov_imm instead of movw/movtEtienne Carriere
Suggested-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-03-14plat-zynq7k: fix cpu power control register initEtienne Carriere
Before this change, a reserved bit was set in the PCR instead of enabling the clock gating support, as configured in other supported Cortex-A9 platforms. Reported-by: Yves Lefloch <YvesMarie_Lefloch@sigmadesigns.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-02-28Rename the secure and non-secure interruptsDavid Wang
Currently, the secure interrupts are named as FIQ and the non-secure interrupts are named as IRQ. In GICv3 mode, the FIQ and IRQ have different definitions. * Secure Group 0 interrupts: Handled by EL3 and triggered by FIQ when running at Secure EL0/1. * Secure Group 1 interrupts: Handled by optee_os and triggered by IRQ when running at Secure EL0/1. * Non-secure Group1 interrupts: Handled by the rich os and triggered by FIQ when running at Secure EL0/1. The "Secure Group 1" interrupts are the "native" interrupts handled by optee_os. They are same as the "secure" interrupts used in optee_os for now. But they are triggered by FIQ in GICv2 mode while by IRQ in GICv3 mode. The "Secure Group 0" and "Non-secure Group1" interrupts are the "foreign" interrupts that will cause the exiting of optee_os. (e.g. switch back to normal world) The "Non-secure Group1" interrupts are same as the "non-secure"interrupts used in optee_os for now. But they are triggered by IRQ in GICv2 mode while by FIQ in GICv3 mode. This patch renames these interrupts to the generic names - "Foreign interrupts" and "Native interrupts". For the support of GICv3 mode in the future, we can redefine the macros of "native interrupt" and "foreign interrupt" to IRQ and FIQ. Signed-off-by: David Wang <david.wang@arm.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260)
2017-01-18cruft: remove unreferenced HEAP_SIZEAndy Green
There are no consumers of this and it just confuses the issue of how to set the heap size. Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> [Wrap commit description. Rebase on top of master.] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2016-12-12core: arm: support Xilinx ZYNQ7000 ZC702 (plat-zynq7k)yanyan-wrs
Signed-off-by: Yan Yan <yan.yan@windriver.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>