| #
113110f8 |
| 04-Apr-2023 |
Philip Oberfichtner <pro@denx.de> |
TZASC: Allow 32KB region size
According to the ARM TZC-380 Technical Reference Manual, 32KB is the minimum region size [1]. But before this patch, tzc_auto_configure() allowed only 64KB as minimum.
TZASC: Allow 32KB region size
According to the ARM TZC-380 Technical Reference Manual, 32KB is the minimum region size [1]. But before this patch, tzc_auto_configure() allowed only 64KB as minimum.
(pow > 15) implies the following: region_size = (1ULL << pow) = (2^pow) > 32KB
After this patch, (pow >= 15) gives us region_size >= 32KB.
Tested on i.MX6UL.
Link: [1] https://developer.arm.com/documentation/ddi0431/c/programmers-model/register-descriptions/region-attributes--n--register?lang=en Signed-off-by: Philip Oberfichtner <pro@denx.de> Acked-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
552e0c1c |
| 26-Jul-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: tzc380: fix the lockdown range register value
This register controls the range of regions that are locked down. The number of regions to lockdown are defined in [1]: lockdown_range[3:0] and
drivers: tzc380: fix the lockdown range register value
This register controls the range of regions that are locked down. The number of regions to lockdown are defined in [1]: lockdown_range[3:0] and its value goes from b0000 to b1111.
If the goal of tzc_regions_lockdown() is to lock all regions supported by the platforms, then the value of lockdown_range[3:0] should be equal to no_of_regions[3:0] of the configuration register [2].
Currently, tzc.num_regions is used to defined the lockdown range which is incorrect because it has been incremented during initialization. Fix the issue by decrementing tzc.num_regions before the configuration of lockdown_range[3:0].
Link: [1] https://developer.arm.com/documentation/ddi0431/c/programmers-model/register-descriptions/lockdown-range-register Link: [2] https://developer.arm.com/documentation/ddi0431/c/programmers-model/register-descriptions/configuration-register Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
c2e4eb43 |
| 23-May-2021 |
Anton Rybakov <a.rybakov@omp.ru> |
core_mmu: fix phys_to_virt() to check length
phys_to_virt() function without length parameter doesn`t always have ability to find the correct mapping for requested physical address. This is because
core_mmu: fix phys_to_virt() to check length
phys_to_virt() function without length parameter doesn`t always have ability to find the correct mapping for requested physical address. This is because physical address can be mapped in the same time in different virtual regions with different length. So the first found region which contains the requested physical address possibly doesn`t have enough mapped data. This is fixed by adding the length parameter to phys_to_virt() function. Length parameter can be set to 1 if caller knows that requested (pa + len) doesn`t cross mapping granule boundary.
core_mmu_get_va() and io_pa_or_va() functions now are take length parameter too as they based on phys_to_virt() in case of MMU enabled.
Signed-off-by: Anton Rybakov <a.rybakov@omp.ru> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (stm32mp1-157C_DK2) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabreauto) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabresd) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6qpsabreauto) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6sllevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ullevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulzevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7dsabresd) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7ulpevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mmevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mnevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mqevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mpevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qmmek) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qxpmek)
show more ...
|
| #
5ae1f02a |
| 10-Dec-2020 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
core: tzc380: restart search at full size
Restart the search at the biggest region size after finding a region. This way we can use subregions for the first offset and use full regions afterwards.
core: tzc380: restart search at full size
Restart the search at the biggest region size after finding a region. This way we can use subregions for the first offset and use full regions afterwards.
Fixes https://github.com/OP-TEE/optee_os/issues/4252
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Tested-by: Robin van der Gracht <robin@protonic.nl> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
9fff1a96 |
| 06-Feb-2020 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
tzc380: add lockdown and action to tzc_dump_state
Also dump the lockdown and action configuration while dumping the TZC380 configuration state.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengut
tzc380: add lockdown and action to tzc_dump_state
Also dump the lockdown and action configuration while dumping the TZC380 configuration state.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Reviewed-by: Clement Faure <clement.faure@nxp.com>
show more ...
|
| #
5544b89d |
| 06-Feb-2020 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
tzc380: add function to lockdown regions
The TZC380 allows a lockdown of the region configuration to prevent unintended or malicious configuration changes. Add a function which locks down all region
tzc380: add function to lockdown regions
The TZC380 allows a lockdown of the region configuration to prevent unintended or malicious configuration changes. Add a function which locks down all regions of the current configuration
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Reviewed-by: Clement Faure <clement.faure@nxp.com>
show more ...
|
| #
dd13645c |
| 30-Jan-2020 |
Clement Faure <clement.faure@nxp.com> |
drivers: tzc: set maximum region size for tzc_auto_configure()
According to the TZC380 documentation, the AXI address width controls the upper limit value of the region size. This fix makes sure tha
drivers: tzc: set maximum region size for tzc_auto_configure()
According to the TZC380 documentation, the AXI address width controls the upper limit value of the region size. This fix makes sure that tzc_auto_configure() function will not allocated a region bigger that the AXI address width.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
show more ...
|
| #
e8e7f1c5 |
| 18-Mar-2019 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
tzc380: add region auto configuration function
The tzc_auto_configure() function takes an address, a size, the attribute and a region as arguments. It calculates the fitting tzc380 region configurat
tzc380: add region auto configuration function
The tzc_auto_configure() function takes an address, a size, the attribute and a region as arguments. It calculates the fitting tzc380 region configuration and applies it to the controller.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
7eedcd15 |
| 12-Mar-2019 |
Rouven Czerwinski <rouven@czerwinskis.de> |
tzc380: add function to retrieve action register
The TZC380 IP has an action configuration which defines the action taken if a region is accessed with the wrong permissions. Devices do not have to s
tzc380: add function to retrieve action register
The TZC380 IP has an action configuration which defines the action taken if a region is accessed with the wrong permissions. Devices do not have to set the action register explicitly, add a function to retrieve the default configuration.
Signed-off-by: Rouven Czerwinski <rouven@czerwinskis.de> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
65fe41db |
| 01-Mar-2019 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: cleanup generic traces
Remove useless newline character in few generic debug traces.
Remove argument __func__ from a FMSG trace since already output by macro FMSG().
Remove error trace from
core: cleanup generic traces
Remove useless newline character in few generic debug traces.
Remove argument __func__ from a FMSG trace since already output by macro FMSG().
Remove error trace from syscall_storage_obj_read() that, prior this change, output failing error code from storage read() handler. This is useless and not done for other storage handlers return code.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
918bb3a5 |
| 12-Feb-2019 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: upgrade from write32() to io_write32() and friends
Replace use of readX() and writeX() with io_readX() and io_writeX(). The former function are about to be deprecated in favor to the later.
T
core: upgrade from write32() to io_write32() and friends
Replace use of readX() and writeX() with io_readX() and io_writeX(). The former function are about to be deprecated in favor to the later.
This change upgrades core generic code and drivers. At some place, io_clrbitsX(), io_setbitsX() and io_clrsetbitsX() replace the writeX(readX() ...) operations when obvious.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
343c1571 |
| 17-Jan-2018 |
Peng Fan <peng.fan@nxp.com> |
tzc380: export more api
Introduce tzc_security_inversion_en tzc_enable_region tzc_fail_dump and tzc_int_clear.
When we want to block secure access to region configured TZC_ATTR_SP_NS_RW, need to us
tzc380: export more api
Introduce tzc_security_inversion_en tzc_enable_region tzc_fail_dump and tzc_int_clear.
When we want to block secure access to region configured TZC_ATTR_SP_NS_RW, need to use tzc_security_inversion_en.
Sometimes we need to configure the regions first, then enable the region.
tzasc380 interrupt could be enabled to catch some illegal access with tzc_fail_dump and tzc_int_clear.
Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
fe1404da |
| 20-Dec-2017 |
Peng Fan <peng.fan@nxp.com> |
tzc380: do not write reserved bits
For region0, only SP is configurable, so should not configure region low/high.
Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Jens Wiklander <jens.wiklander
tzc380: do not write reserved bits
For region0, only SP is configurable, so should not configure region low/high.
Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@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 ...
|
| #
4c56bf5f |
| 07-Jun-2017 |
Peng Fan <peng.fan@nxp.com> |
drivers: tzc380: add tzc380 driver
Add tzc380 driver support.
The usage: Use tzc_init(vaddr_t base) to get the tzc380 configuration. Use tzc_configure_region to configure the memory region, such as
drivers: tzc380: add tzc380 driver
Add tzc380 driver support.
The usage: Use tzc_init(vaddr_t base) to get the tzc380 configuration. Use tzc_configure_region to configure the memory region, such as "tzc_configure_region(5, 0x4e000000, TZC_ATTR_REGION_SIZE(TZC_REGION_SIZE_32M) | TZC_ATTR_REGION_EN_MASK | TZC_ATTR_SP_S_RW);"
Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|