| d461c892 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: enable CFG_BOOT_MEM unconditionally
Enable CFG_BOOT_MEM unconditionally and call the boot_mem_*() functions as needed from entry_*.S and boot.c.
The pager will reuse all boot_mem memory
core: arm: enable CFG_BOOT_MEM unconditionally
Enable CFG_BOOT_MEM unconditionally and call the boot_mem_*() functions as needed from entry_*.S and boot.c.
The pager will reuse all boot_mem memory internally when configured. The non-pager configuration will unmap the memory and make it available for TAs if needed.
__FLATMAP_PAGER_TRAILING_SPACE is removed from the link script, collect_mem_ranges() in core/mm/core_mmu.c maps the memory following VCORE_INIT_RO automatically.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 5727b6af | 20-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: add boot_cached_mem_end
Add boot_cached_mem_end in C code, replacing the previous read-only mapped cached_mem_end. This allows updates to boot_cached_mem_end after MMU has been enabled.
core: arm: add boot_cached_mem_end
Add boot_cached_mem_end in C code, replacing the previous read-only mapped cached_mem_end. This allows updates to boot_cached_mem_end after MMU has been enabled.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| fe85eae5 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add CFG_BOOT_MEM and boot_mem_*() functions
Adds CFG_BOOT_MEM to support stack-like memory allocations during boot before a heap has been configured.
Signed-off-by: Jens Wiklander <jens.wikl
core: add CFG_BOOT_MEM and boot_mem_*() functions
Adds CFG_BOOT_MEM to support stack-like memory allocations during boot before a heap has been configured.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| d2e95293 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm,pager: map remaining physical memory
For CFG_WITH_PAGER=y map the remaining memory following the VCORE_INIT_RO memory to make sure that all physical TEE memory is mapped even if VCORE_INIT_
core: mm,pager: map remaining physical memory
For CFG_WITH_PAGER=y map the remaining memory following the VCORE_INIT_RO memory to make sure that all physical TEE memory is mapped even if VCORE_INIT_RO doesn't cover it entirely.
This will be used in later patches to use the temporarily unused memory while booting.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 99c6021f | 14-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm,pager: make __vcore_init_ro_start follow __vcore_init_rx_end
This concerns configurations with CFG_WITH_PAGER=y. Until this patch, even if __vcore_init_ro_size (VCORE_INIT_RO_SZ) is 0 for
core: arm,pager: make __vcore_init_ro_start follow __vcore_init_rx_end
This concerns configurations with CFG_WITH_PAGER=y. Until this patch, even if __vcore_init_ro_size (VCORE_INIT_RO_SZ) is 0 for CFG_CORE_RODATA_NOEXEC=n, __vcore_init_ro_start was using some value smaller than __vcore_init_rx_end. To simplify code trying to find the end of VCORE_INIT_RX and VCORE_INIT_RO parts of the binary, make sure that __vcore_init_ro_start follows right after __vcore_init_rx_end.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 9c1d818a | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: map memory using requested block size
TEE memory is always supposed to be mapped with 4k pages for maximum flexibility, but can_map_at_level() doesn't check the requested block size for a
core: mm: map memory using requested block size
TEE memory is always supposed to be mapped with 4k pages for maximum flexibility, but can_map_at_level() doesn't check the requested block size for a region, so fix that. However, assign_mem_granularity() assigns smaller than necessary block sizes on page aligned regions, so fix that by only requesting 4k granularity for TEE memory and PGDIR granularity for the rest.
This is needed in later patches where some TEE memory is unmapped.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| fa03dcc0 | 14-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: core_mmu_v7.c: increase MAX_XLAT_TABLES by 2
Increase MAX_XLAT_TABLES by 2 to be able to map all TEE memory with 4k pages.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Revie
core: arm: core_mmu_v7.c: increase MAX_XLAT_TABLES by 2
Increase MAX_XLAT_TABLES by 2 to be able to map all TEE memory with 4k pages.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 177b77f7 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: virt: phys_mem_core_alloc() use both pools
With CFG_NS_VIRTUALIZATION=y let phys_mem_core_alloc() allocate from both the core_pool and ta_pool since both pools keep equally secure memory. This
core: virt: phys_mem_core_alloc() use both pools
With CFG_NS_VIRTUALIZATION=y let phys_mem_core_alloc() allocate from both the core_pool and ta_pool since both pools keep equally secure memory. This is needed in later patches when some translation tables are dynamically allocated from spare physical core memory.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 1c1f8b65 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: unify secure core and TA memory
In configurations where secure core and TA memory is allocated from the same contiguous physical memory block, carve out the memory needed by OP-TEE core an
core: mm: unify secure core and TA memory
In configurations where secure core and TA memory is allocated from the same contiguous physical memory block, carve out the memory needed by OP-TEE core and make the rest available as TA memory.
This is needed by later patches where more core memory is allocated as needed from the pool of TA memory.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 2f2f69df | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: replace MEM_AREA_TA_RAM
Replace MEM_AREA_TA_RAM with MEM_AREA_SEC_RAM_OVERALL.
All read/write secure memory is covered by MEM_AREA_SEC_RAM_OVERALL, sometimes using an aliased map. But sec
core: mm: replace MEM_AREA_TA_RAM
Replace MEM_AREA_TA_RAM with MEM_AREA_SEC_RAM_OVERALL.
All read/write secure memory is covered by MEM_AREA_SEC_RAM_OVERALL, sometimes using an aliased map. But secure read-only or execute core memory is not covered as that would defeat the purpose of CFG_CORE_RWDATA_NOEXEC.
Since the partition TA memory isn't accessed via MEM_AREA_TA_RAM any longer, don't map it using the partition specific map.
This is needed later where unification of OP-TEE core and physical TA memory is possible.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 06a25806 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: allow unmapping VCORE_FREE
Allow unmapping core memory in the VCORE_FREE range when the original boot mapping isn't needed any more.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.o
core: mm: allow unmapping VCORE_FREE
Allow unmapping core memory in the VCORE_FREE range when the original boot mapping isn't needed any more.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| a5ac48d6 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add VCORE_FREE_{PA,SZ,END_PA}
Add VCORE_FREE_{PA,SZ,END_PA} defines to identify the unused and free memory range at the end of TEE_RAM_START..(TEE_RAM_START + TEE_RAM_VA_SIZE).
VCORE_FREE_SZ
core: add VCORE_FREE_{PA,SZ,END_PA}
Add VCORE_FREE_{PA,SZ,END_PA} defines to identify the unused and free memory range at the end of TEE_RAM_START..(TEE_RAM_START + TEE_RAM_VA_SIZE).
VCORE_FREE_SZ is 0 in a pager configuration since all the memory is used by the pager.
The VCORE_FREE range is excluded from the TEE_RAM_RW area for CFG_NS_VIRTUALIZATION=y and instead put in a separate NEX_RAM_RW area. This makes each partition use a bit less memory and leaves the VCORE_FREE range available for the Nexus.
The VCORE_FREE range is added to the TEE_RAM_RW area for the normal configuration with CFG_NS_VIRTUALIZATION=n and CFG_WITH_PAGER=n. It's in practice unchanged behaviour in this configuration.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 1fbe848c | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove CORE_MEM_TA_RAM
The buffer attribute CORE_MEM_TA_RAM isn't used to query the status of a buffer anywhere. So remove the attribute to allow future simplifications.
Signed-off-by: Jens W
core: remove CORE_MEM_TA_RAM
The buffer attribute CORE_MEM_TA_RAM isn't used to query the status of a buffer anywhere. So remove the attribute to allow future simplifications.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 041b1fa2 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: add vaddr_to_phys()
Add a wrapper function for virt_to_phys() using vaddr_t instead of a void pointer.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Foriss
core: mm: add vaddr_to_phys()
Add a wrapper function for virt_to_phys() using vaddr_t instead of a void pointer.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 03f158e9 | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm64: increase thread stack size for debug
Increase STACK_THREAD_SIZE when CFG_CORE_DEBUG_CHECK_STACKS=y.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Foriss
core: arm64: increase thread stack size for debug
Increase STACK_THREAD_SIZE when CFG_CORE_DEBUG_CHECK_STACKS=y.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| ea6b44f4 | 09-Dec-2024 |
Tony Han <tony.han@microchip.com> |
drivers: scmi-msg: fix clock min/max/step triplet description support
The return value of plat_scmi_clock_rates_array() is one of "SCMI_DENIED", "SCMI_GENERIC_ERROR" and "SCMI_SUCCESS". The code in
drivers: scmi-msg: fix clock min/max/step triplet description support
The return value of plat_scmi_clock_rates_array() is one of "SCMI_DENIED", "SCMI_GENERIC_ERROR" and "SCMI_SUCCESS". The code in scmi_clock_describe_rates() for clock min/max/step triplet description support would never be executed due to the return value of plat_scmi_clock_rates_array() could never be "SCMI_NOT_SUPPORTED". Fix by modifying the return value of plat_scmi_clock_rates_array().
Signed-off-by: Tony Han <tony.han@microchip.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| ae0b2678 | 13-Nov-2024 |
Manorit Chawdhry <m-chawdhry@ti.com> |
plat-k3: drivers: Add some trace message for TI-SCI calls
These could be good for debugging tracing of TI-SCI messages
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Manor
plat-k3: drivers: Add some trace message for TI-SCI calls
These could be good for debugging tracing of TI-SCI messages
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
show more ...
|
| bad32466 | 13-Nov-2024 |
Manorit Chawdhry <m-chawdhry@ti.com> |
plat-k3: drivers: Remove ti_sci_get_response function
Currently since all the code is under mutex, it makes sense to remove this function and keep it all under ti_sci_do_xfer for easier readability.
plat-k3: drivers: Remove ti_sci_get_response function
Currently since all the code is under mutex, it makes sense to remove this function and keep it all under ti_sci_do_xfer for easier readability.
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
show more ...
|
| c3e91eef | 29-Oct-2024 |
Manorit Chawdhry <m-chawdhry@ti.com> |
plat-k3: drivers: Move message_sequence updates inside ti_sci_do_xfer
To avoid potential race condition, set the message_sequence inside ti_sci_do_xfer itself as the send and receive paths are prote
plat-k3: drivers: Move message_sequence updates inside ti_sci_do_xfer
To avoid potential race condition, set the message_sequence inside ti_sci_do_xfer itself as the send and receive paths are protected by a mutex and avoid race conditions on message_sequence.
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
show more ...
|
| 0e8b6c80 | 08-Oct-2024 |
Manorit Chawdhry <m-chawdhry@ti.com> |
plat-k3: drivers: Add mutex lock for ti_sci_do_xfer
Current TI-SCI calls are not protected by any locks. OP-TEE running on multiple threads can end up receiving different message response then the o
plat-k3: drivers: Add mutex lock for ti_sci_do_xfer
Current TI-SCI calls are not protected by any locks. OP-TEE running on multiple threads can end up receiving different message response then the one they sent due to no queuing model.
*I/TC: Message with sequence ID <> is not expected
Add mutex lock to prevent such issues.
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
show more ...
|
| 12a5f037 | 06-Nov-2024 |
Ahmad Fatoum <ahmad@a3f.at> |
plat-rockchip: allow specifying DRAM via CFG options
It's currently not possible to use CFG_CORE_DYN_SHM with the Rockchip platforms, because OP-TEE doesn't know what non-secure memory is available;
plat-rockchip: allow specifying DRAM via CFG options
It's currently not possible to use CFG_CORE_DYN_SHM with the Rockchip platforms, because OP-TEE doesn't know what non-secure memory is available; Device tree is not used and no DDR ranges are registered.
This precludes interacting with OP-TEE from barebox and U-Boot, which currently only implement OP-TEE communication with dynamic shared memory.
Make it possible to use CFG_CORE_DYN_SHM=y by adding two sets of config variables to register memory:
CFG_DRAM_BASE, CFG_DRAM_SIZE: For the main memory in the first 4G up to the MMIO range beyond the end of the first RAM bank
CFG_NSEC_DDR_1_BASE, CFG_NSEC_DDR_1_SIZE: For the remainder of the main memory above the MMIO regions.
OP-TEE will take care to carve out the secure memory ranges.
This has been tested on an RK3399 with barebox using OP-TEE's HWRNG TA.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
show more ...
|
| 40848ef1 | 23-Oct-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
plat-stm32mp1: shared_resources: remove pin/GPIO secure state management
Remove the pin and GPIO secure state management from shared_resources platform driver since this is now managed using the fir
plat-stm32mp1: shared_resources: remove pin/GPIO secure state management
Remove the pin and GPIO secure state management from shared_resources platform driver since this is now managed using the firewall framework.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
show more ...
|
| b3f7ebef | 04-Jul-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_gpio: remove gpio/pinctrl API function to set secure state
Remove stm32_gpio_set_secure_cfg() and stm32_pinctrl_set_secure_cfg() functions that are no more used since the STM32 GPIO a
drivers: stm32_gpio: remove gpio/pinctrl API function to set secure state
Remove stm32_gpio_set_secure_cfg() and stm32_pinctrl_set_secure_cfg() functions that are no more used since the STM32 GPIO and pins secure configurations are managed only through the firewall framework facilities.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
show more ...
|
| 2cee8fe6 | 23-Oct-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
plat-stm32mp1: stm32mp1_stpmic: remove use of shared_resource for pinctrl
Remove use of shared_resources platform driver in STM32MP15 PMIC driver to manage the secure state of the pins of a pinctrl
plat-stm32mp1: stm32mp1_stpmic: remove use of shared_resource for pinctrl
Remove use of shared_resources platform driver in STM32MP15 PMIC driver to manage the secure state of the pins of a pinctrl state since this is now managed using the firewall framework.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
show more ...
|
| 48f71fb5 | 23-Oct-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_uart: remove use of shared_resource for pinctlr
Remove use of shared_resources platform driver to manage the secure state of the pins of a pinctrl state since this is now managed usin
drivers: stm32_uart: remove use of shared_resource for pinctlr
Remove use of shared_resources platform driver to manage the secure state of the pins of a pinctrl state since this is now managed using the firewall framework.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
show more ...
|