| #
55ab8f06 |
| 27-Feb-2024 |
Alvin Chang <alvinga@andestech.com> |
core: Refactor console_init() and introduce plat_console_init()
Since there are some cross-platform console drivers, we let console_init() be common code to have a chance to initialize those console
core: Refactor console_init() and introduce plat_console_init()
Since there are some cross-platform console drivers, we let console_init() be common code to have a chance to initialize those console drivers (e.g., semihosting console).
If the cross-platform console drivers are not configured to be compiled, plat_console_init() will be invoked to initialize platform-specific console driver.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
651d7537 |
| 07-Jun-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove boot_get_handlers()
struct thread_handlers is used to pass the entry functions for different power management events. In practice only .cpu_on is used and with the default function at t
core: remove boot_get_handlers()
struct thread_handlers is used to pass the entry functions for different power management events. In practice only .cpu_on is used and with the default function at that. In the ARMv7 case where the secure monitor replaces TF-A not even that function entry is used.
Remove struct thread_handlers and boot_get_handlers(). When configured with TF-A initialize thread_*_handler_ptr with __weak default functions.
The __weak default PM functions - thread_cpu_off_handler() - thread_cpu_suspend_handler() - thread_cpu_resume_handler() - thread_system_off_handler() - thread_system_reset_handler() can be overridden by platforms when needed.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
65401337 |
| 07-Jun-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove generic_ from generic_boot
Now that the CFG_GENERIC_BOOT configuration flag has been removed also remove "generic_" prefix from and in the related files.
Acked-by: Etienne Carriere <et
core: remove generic_ from generic_boot
Now that the CFG_GENERIC_BOOT configuration flag has been removed also remove "generic_" prefix from and in the related files.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
e9f46c74 |
| 13-Aug-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: replace thread_nintr_handler_ptr with weak function
Removes registration of platform specific secure interrupt handler in thread_nintr_handler_ptr. Instead a __weak overridable itr_core_handle
core: replace thread_nintr_handler_ptr with weak function
Removes registration of platform specific secure interrupt handler in thread_nintr_handler_ptr. Instead a __weak overridable itr_core_handler() is provided. Platforms which expects to receive secure interrupts must override the default function. The default function calls panic() if called.
With this also nintr is removed from struct thread_handlers and consequently all platforms are updated to stop using that field.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
612791d0 |
| 13-Aug-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: replace thread_fast_smc_handler_ptr with weak function
Removes registration of platform specific fast SMC entry function in thread_fast_smc_handler_ptr. Instead a __weak overridable tee_entry_
core: replace thread_fast_smc_handler_ptr with weak function
Removes registration of platform specific fast SMC entry function in thread_fast_smc_handler_ptr. Instead a __weak overridable tee_entry_fast() is provided. Platforms that need a special tee_entry_fast() (currently on plat-zynq7k) provides their own tee_entry_fast() instead which at the end should call __tee_entry_fast() which does the generic fast call handling.
With this also fast_smc is removed from struct thread_handlers and consequently all platforms are updated to stop using that field.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
2dd2ca5f |
| 13-Aug-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: replace thread_std_smc_handler_ptr with weak function
Removes registration of platform specific standard SMC entry function in thread_std_smc_handler_ptr. Instead a __weak overridable tee_entr
core: replace thread_std_smc_handler_ptr with weak function
Removes registration of platform specific standard SMC entry function in thread_std_smc_handler_ptr. Instead a __weak overridable tee_entry_std() is provided. Platforms that need a special tee_entry_std() (currently on some STM platform) provides their own tee_entry_std() instead which at the end should call __tee_entry_std() which does the generic standard call handling.
With this also std_smc is removed from struct thread_handlers and consequently all platforms are updated to stop using that field.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
a5e82dc7 |
| 11-Feb-2019 |
Jerome Forissier <jerome.forissier@linaro.org> |
core_mmu: do not restrict device memory mapping to PGDIR_SIZE granularity
Device memory registered via register_phys_mem() is currently rounded up/down to CORE_MMU_PGDIR_SIZE (1 MiB, or 2 MiB for LP
core_mmu: do not restrict device memory mapping to PGDIR_SIZE granularity
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>
show more ...
|
| #
b1d7375c |
| 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Remove 'All rights reserved' from Linaro files
The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words
Remove 'All rights reserved' from Linaro files
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>
show more ...
|
| #
78b7c7c7 |
| 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Remove license notice from Linaro files
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.p
Remove license notice from Linaro files
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>
show more ...
|
| #
1bb92983 |
| 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add SPDX license identifiers
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] wa
Add SPDX license identifiers
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>
show more ...
|
| #
23660121 |
| 08-Mar-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: remove __early_bss
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 symb
core: remove __early_bss
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>
show more ...
|
| #
756aea59 |
| 17-Feb-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: add common implementation for console_putc() and console_flush()
Since most platforms now use the same console_putc() and console_flush(), move them to core/kernel/console.c. Make them __weak
core: add common implementation for console_putc() and console_flush()
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>
show more ...
|
| #
ed7617df |
| 17-Feb-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
drivers: convert hi16xx_uart driver to use struct serial_chip
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etien
drivers: convert hi16xx_uart driver to use struct serial_chip
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>
show more ...
|
| #
5acb1bc6 |
| 12-Dec-2016 |
David Wang <david.wang@arm.com> |
Rename the secure and non-secure interrupts
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 definitio
Rename the secure and non-secure interrupts
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)
show more ...
|
| #
ccfa173b |
| 14-Jun-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for Hisilicon D02 (PLATFORM=d02)
D02 is a server-class development board equipped with a Hisilicon Phosphor V660 processor (also called PV660, P660 or hip05). The chip has 16 Cortex-A57
Add support for Hisilicon D02 (PLATFORM=d02)
D02 is a server-class development board equipped with a Hisilicon Phosphor V660 processor (also called PV660, P660 or hip05). The chip has 16 Cortex-A57 cores @ 2.1 GHz.
Note: '-mcpu=cortex-a57' causes the following warning, which doesn't seem to have any adverse effect on OP-TEE and is registered as a compiler bug [1]:
CC out/arm-plat-d02/core/lib/libtomcrypt/src/encauth/ccm/ccm_add_nonce.o {standard input}: Assembler messages: {standard input}:634: IT blocks containing 32-bit Thumb instructions are deprecated in ARMv8
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67591
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: David Brown <david.brown@linaro.org>
show more ...
|