| b2284b11 | 17-Jul-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: update FS storage API with user space buffer
Updates the create(), read(), and write() function pointers in struct ts_store_ops to take a user space buffer in addition to the previous core buf
core: update FS storage API with user space buffer
Updates the create(), read(), and write() function pointers in struct ts_store_ops to take a user space buffer in addition to the previous core buffer. Core buffers are normal secure memory while user space buffers should only be accessed using the user_access.h functions.
The different FS storage implementations are updated accordingly.
Note that the RPMB FS storage implementation resorts to using enter_user_access() and exit_user_access() due to internal complexities.
Fixes: 4e154320e47c ("core: Apply finer-grained PAN") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| df913c6d | 02-Aug-2023 |
Alvin Chang <alvinga@andestech.com> |
core: arm: Rename primary_init_intc() to boot_primary_init_intc()
Since interrupt controllers are usually initialized in boot stage, rename primary_init_intc() to boot_primary_init_intc().
Signed-o
core: arm: Rename primary_init_intc() to boot_primary_init_intc()
Since interrupt controllers are usually initialized in boot stage, rename primary_init_intc() to boot_primary_init_intc().
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 8aae4669 | 31-Jul-2023 |
Alvin Chang <alvinga@andestech.com> |
core: arm: Rename main_secondary_init_intc() to boot_secondary_init_intc()
main_secondary_*() is an ambiguous name since it conveys no meaning relative to the purpose of the function. Fix it by rena
core: arm: Rename main_secondary_init_intc() to boot_secondary_init_intc()
main_secondary_*() is an ambiguous name since it conveys no meaning relative to the purpose of the function. Fix it by renameing to boot_secondary_init_intc(), since interrupt controllers are always initialized in boot stage.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 9ef7a09c | 25-May-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: remove cases when CFG_DRIVERS_PINCTRL is disabled
Removes implementation when CFG_DRIVERS_PINCTRL is disables as stm32mp1 platform configuration enforces the switch is enabled.
drivers: stm32_i2c: remove cases when CFG_DRIVERS_PINCTRL is disabled
Removes implementation when CFG_DRIVERS_PINCTRL is disables as stm32mp1 platform configuration enforces the switch is enabled.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 6d6aeba1 | 25-May-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
plat-stm32mp1: conf: enable CFG_DRIVERS_PINCTRL
Changes platform stm32mp1 configuration to always enable CFG_DRIVERS_PINCTRL. The platform requires pinctrl_apply_state() to be unpaged has it can be
plat-stm32mp1: conf: enable CFG_DRIVERS_PINCTRL
Changes platform stm32mp1 configuration to always enable CFG_DRIVERS_PINCTRL. The platform requires pinctrl_apply_state() to be unpaged has it can be used during PM suspend and resume sequences.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 73ba32eb | 23-May-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: support CFG_DRIVERS_PINCTRL
Updates stm32_i2c driver for when CFG_DRIVERS_PINCTRL is enabled making I2C driver to get pin control configuration using the generic pin control fram
drivers: stm32_i2c: support CFG_DRIVERS_PINCTRL
Updates stm32_i2c driver for when CFG_DRIVERS_PINCTRL is enabled making I2C driver to get pin control configuration using the generic pin control framework. When enabled, stm32_i2c driver get the active and sleep pin control configuration from the device tree. Sleep pinctrl configuration is optional.
SE050 and STM32MP1 PMIC drivers that use the stm32_i2c bus are both updated accordingly.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 7b59789f | 25-May-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
plat-stm32mp1: shared_resources: support CFG_DRIVERS_PINCTRL
Adds shared resources helper functions stm32mp_register_secure_pinctrl() and stm32mp_register_non_secure_pinctrl() for when a platform dr
plat-stm32mp1: shared_resources: support CFG_DRIVERS_PINCTRL
Adds shared resources helper functions stm32mp_register_secure_pinctrl() and stm32mp_register_non_secure_pinctrl() for when a platform driver registers pins from a pin control state with secure or non-secure attribute. These function are required when CFG_DRIVERS_PINCTRL is enabled.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| a61bc392 | 12-Nov-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: riscv: introduce primary_init_intc() and secondary_init_intc()
Rename interrupt controller initialization functions to primary_init_intc() and secondary_init_intc(). To be called by platform b
core: riscv: introduce primary_init_intc() and secondary_init_intc()
Rename interrupt controller initialization functions to primary_init_intc() and secondary_init_intc(). To be called by platform boot code to initialize interrupt controller on boot hart and secondary harts, respectively.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| ef50391e | 19-Jul-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: rename interrupt controller functions
This commit renames interrupt controller function names to be more generic: - Rename main_init_gic() to primary_init_intc() - Rename secondary_init_gic()
core: rename interrupt controller functions
This commit renames interrupt controller function names to be more generic: - Rename main_init_gic() to primary_init_intc() - Rename secondary_init_gic() to secondary_init_intc()
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| f7e4fc1e | 12-Jun-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: mm: initial implementation of memory management routines
An initial working implementation of mm for RISC-V MMU-enabled harts. The default MMU mode is set to Sv39 for RV64 with 3 page table l
riscv: mm: initial implementation of memory management routines
An initial working implementation of mm for RISC-V MMU-enabled harts. The default MMU mode is set to Sv39 for RV64 with 3 page table levels.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d843ed62 | 12-Jun-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: kernel: asm-defines.c: add defines for struct core_mmu_config
Add CORE_MMU_CONFIG_SIZE and CORE_MMU_CONFIG_SATP defines to asm-defines.c
Signed-off-by: Marouene Boubakri <marouene.boubakri@n
riscv: kernel: asm-defines.c: add defines for struct core_mmu_config
Add CORE_MMU_CONFIG_SIZE and CORE_MMU_CONFIG_SATP defines to asm-defines.c
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9af8810c | 12-Jun-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: mm: core_mmu_arch.h: define translation levels parameters
This commits modify core_mmu_arch.h to: - Set CORE_MMU_PGDIR_LEVEL to zero, since the deepest translation level is always zero. - Set
riscv: mm: core_mmu_arch.h: define translation levels parameters
This commits modify core_mmu_arch.h to: - Set CORE_MMU_PGDIR_LEVEL to zero, since the deepest translation level is always zero. - Set CORE_MMU_BASE_TABLE_LEVEL to (RISCV_PGLEVELS - 1) which the first translation level depending on the MMU mode. - Set RISCV_MMU_ASID_WIDTH to number of bits used to represent ASID.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3579408c | 06-Jul-2023 |
Xiaoxu Zeng <zengxiaoxu@huawei.com> |
core: arm64: add dsb_osh()
Implement the use of osh data barrier to ensure that all data access and modifications have been completed before executing subsequent instructions.
Signed-off-by: Xiaoxu
core: arm64: add dsb_osh()
Implement the use of osh data barrier to ensure that all data access and modifications have been completed before executing subsequent instructions.
Signed-off-by: Xiaoxu Zeng <zengxiaoxu@huawei.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9f007225 | 12-Dec-2022 |
Patrick Delaunay <patrick.delaunay@foss.st.com> |
drivers: stm32_bsec: add support for bits property in the DT
Adds the possibility to specify the number of managed bit in the NVMEM cell device tree description, using the optional bits property and
drivers: stm32_bsec: add support for bits property in the DT
Adds the possibility to specify the number of managed bit in the NVMEM cell device tree description, using the optional bits property and removes restriction on aligned NVMEM cell on 32-bit word by supporting bit offset in stm32_bsec_find_otp_in_nvmem_layout().
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
show more ...
|
| c120d282 | 05-Jul-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Add external DT initialization and updating
Initialize the external DT which is provided by early boot stage. The external DT is updated by adding reserved-memory node for secure RAM.
core: riscv: Add external DT initialization and updating
Initialize the external DT which is provided by early boot stage. The external DT is updated by adding reserved-memory node for secure RAM.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| adb103f3 | 05-Jul-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Get external device tree provided by early boot stage
Early boot stage (i.e., M-mode firmware) can provide external device tree via register a1. Implement code that OP-TEE gets device t
core: riscv: Get external device tree provided by early boot stage
Early boot stage (i.e., M-mode firmware) can provide external device tree via register a1. Implement code that OP-TEE gets device tree from a1 and saves the value into s1 for future use. Platform can also define CFG_DT_ADDR to forcely set the physical address of the device tree.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| e6027f48 | 05-Jul-2023 |
Alvin Chang <alvinga@andestech.com> |
core: arm: Move some DT functions to common kernel
Some existed functions for device tree in ARM could be also used for other architectures. This commit moves most of functions from ARM architecture
core: arm: Move some DT functions to common kernel
Some existed functions for device tree in ARM could be also used for other architectures. This commit moves most of functions from ARM architecture into "core/kernel/dt.c", including external DT descriptor, DT overlay, external DT initialization, API for adding DT child nodes and reserved-memory nodes. Since "core/kernel/dt.c" is dependent with CFG_DT, other functions which are independent with CFG_DT are put into new file "core/kernel/boot.c".
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| a4803751 | 04-Jul-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: spmc: simplify using {high,low}32_from_64()
Simplify spmc_sp_handle_mem_share() using high32_from_64() and low32_from_64() instead of reg_pair_from_64().
Signed-off-by: Jens Wiklander <jens.w
core: spmc: simplify using {high,low}32_from_64()
Simplify spmc_sp_handle_mem_share() using high32_from_64() and low32_from_64() instead of reg_pair_from_64().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 4e154320 | 29-May-2023 |
Seonghyun Park <seonghp@amazon.com> |
core: Apply finer-grained PAN
Prior to this commit, the PAN was disabled for most of the time, within the thread scall handler. After resolving all outstanding missing unprivileged access functions,
core: Apply finer-grained PAN
Prior to this commit, the PAN was disabled for most of the time, within the thread scall handler. After resolving all outstanding missing unprivileged access functions, we can now enable finer- grained PAN, where the unprivileged access is only allowed inside handful of special user-access functions.
There are some exceptions where we toggle PAN to allow the OP-TEE core to access user memory, instead of using user-access functions or bounce buffers. Those are crypto services and ldelf syscall handlers. Those are chosen to avoid potential large bounce buffer allocations.
Signed-off-by: Seonghyun Park <seonghp@amazon.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 124bf090 | 21-Jun-2023 |
Seonghyun Park <seonghp@amazon.com> |
core: use GET_USER_SCALAR() to save TA panic regs
Use GET_USER_SCALAR() macro to retrieve register values from the user stack upon TA panic.
Signed-off-by: Seonghyun Park <seonghp@amazon.com> Revie
core: use GET_USER_SCALAR() to save TA panic regs
Use GET_USER_SCALAR() macro to retrieve register values from the user stack upon TA panic.
Signed-off-by: Seonghyun Park <seonghp@amazon.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 6fa59c9a | 12-May-2023 |
Seonghyun Park <seonghp@amazon.com> |
arm64: Introduce permissive PAN implementation
Privileged Access Never (PAN) is a part of ARMv8.1 extension that restricts accesses to unprivileged memory from privileged mode in order to prevent un
arm64: Introduce permissive PAN implementation
Privileged Access Never (PAN) is a part of ARMv8.1 extension that restricts accesses to unprivileged memory from privileged mode in order to prevent unintended accesses to potentially malicious memory.
This introduces configuration of PAN and helper functions enter_user_access() and exit_user_access() that toggles PSTATE.PAN that controls the behavior of PAN.
Current OP-TEE impelmentation is not ready to apply strict PAN policy due to missing user-access function uses, etc.
Hence, this patch takes a very permissive approach (yet better than nothing), where PAN is deactivated in the entire lifetime of thread_svc_handler (i.e., system call).
Signed-off-by: Seonghyun Park <seonghp@amazon.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| f1fc3324 | 22-Jun-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
plat-stm32mp1: stub stm32mp13 regulators
Implements stubs for SCMI regulators that are to be exposed by STM32MP13 SCMI server but are not implemented yet in OP-TEE core. The drivers for these regula
plat-stm32mp1: stub stm32mp13 regulators
Implements stubs for SCMI regulators that are to be exposed by STM32MP13 SCMI server but are not implemented yet in OP-TEE core. The drivers for these regulators (IOD SDMMC1/2 and VREFBUF) will be implemented once there is a regulator framework in OP-TEE. In the meantime, stubbing those allows to use the platform.
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 98c094e4 | 29-Jun-2023 |
Thomas Bourgoin <thomas.bourgoin@foss.st.com> |
plat-stm32mp1: change log level in SCMI server
The SCMI server prints debug messages when handling some SCMI services. At runtime this leads to a lot of traces and debug log level is too verbose. Th
plat-stm32mp1: change log level in SCMI server
The SCMI server prints debug messages when handling some SCMI services. At runtime this leads to a lot of traces and debug log level is too verbose. Therefore change all debug traces to flow level for that source file.
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com>
show more ...
|
| 92166431 | 27-Jun-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
qemu_armv8a: fix build with CFG_USER_TA_TARGETS=ta_arm32
The proper way to build in-tree TAs in 64-bit mode by default is to set supported-ta-targets to "ta_arm64 ta_arm32". Indeed, the default targ
qemu_armv8a: fix build with CFG_USER_TA_TARGETS=ta_arm32
The proper way to build in-tree TAs in 64-bit mode by default is to set supported-ta-targets to "ta_arm64 ta_arm32". Indeed, the default target is always defined as the first entry in supported-ta-targets, as documented in mk/config.mk.
Fixes the following build error:
$ make CFG_USER_TA_TARGETS=ta_arm32 PLATFORM=vexpress-qemu_armv8a bash: -W: invalid option ...
default-user-ta-target is not to be used by the platform configuration files. It is meant to be set by the main Makefile. For this reason, replace the conditional assignment (?=) with $(call force, ...) in order to catch inconsistencies in a more friendly way.
Fixes: 07031b23de23 ("qemu_armv8a: set default-user-ta-target ?= ta_arm64") Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e4992be7 | 16-Jun-2023 |
Alvin Chang <alvinga@andestech.com> |
core: riscv: Add TLB operation related to virtual address and ASID
Add TLB invalidate function which is corresponding to virtual address and ASID. The commit also adds missing declaration of tlbi_va
core: riscv: Add TLB operation related to virtual address and ASID
Add TLB invalidate function which is corresponding to virtual address and ASID. The commit also adds missing declaration of tlbi_va_allasid().
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|