| 704f6edd | 12-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: make struct dt_driver_provider opaque
Move struct dt_driver_provider from header file to source file so that the DT driver provider internals are not exposed to core.
Provider data
core: dt_driver: make struct dt_driver_provider opaque
Move struct dt_driver_provider from header file to source file so that the DT driver provider internals are not exposed to core.
Provider database reference dt_driver_provider can now be internal to dt_driver.c.
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| ef20efc4 | 05-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: factorize clk_dt_node_clock_probe_driver()
Move/rename clk_dt_get_from_provider() to dt_driver_probe_device_by_node() and local helper clk_get_compatible_driver() to probe_device_by
core: dt_driver: factorize clk_dt_node_clock_probe_driver()
Move/rename clk_dt_get_from_provider() to dt_driver_probe_device_by_node() and local helper clk_get_compatible_driver() to probe_device_by_compat().
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| a22e85b2 | 05-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: factorize clk_dt_get_from_provider()
Implement dt_driver_device_from_node_idx_prop() for clk_dt_get_by_idx_prop() to get target reference instance.
Move/rename clk_dt_get_from_prov
core: dt_driver: factorize clk_dt_get_from_provider()
Implement dt_driver_device_from_node_idx_prop() for clk_dt_get_by_idx_prop() to get target reference instance.
Move/rename clk_dt_get_from_provider() to dt_driver_device_from_provider_prop()
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| f498c404 | 05-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: factorize clk_get_provider_by_*()
Move rename clk_get_provider_by_{node|phandle}() to dt_driver_get_provider_by_*().
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Clé
core: dt_driver: factorize clk_get_provider_by_*()
Move rename clk_get_provider_by_{node|phandle}() to dt_driver_get_provider_by_*().
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 3fd340e5 | 04-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: factorize DT cells helper functions
Move/rename fdt_clock_cells() to fdt_get_dt_driver_cells(). and clk_dt_register_clk_provider() to dt_driver_register_provider().
Add helper func
core: dt_driver: factorize DT cells helper functions
Move/rename fdt_clock_cells() to fdt_get_dt_driver_cells(). and clk_dt_register_clk_provider() to dt_driver_register_provider().
Add helper function dt_driver_provider_cells() to get ::provider_cells from a registered provider reference.
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 8c0c44c9 | 10-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: factorize DT phandle util resources
Move struct clk_dt_phandle_args and struct clk_dt_provider from clk_dt.h to dt_driver.h and rename them to struct dt_driver_phandle_args and stru
core: dt_driver: factorize DT phandle util resources
Move struct clk_dt_phandle_args and struct clk_dt_provider from clk_dt.h to dt_driver.h and rename them to struct dt_driver_phandle_args and struct dt_driver_provider.
Introduce type get_of_device_func for callback functions used to retrieve a device instance reference from a DT phandle possible with arguments.
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 06fd21dd | 03-Nov-2021 |
Lionel Debieve <lionel.debieve@foss.st.com> |
core: kernel: add reg_size in the dt_node_info structure
Add the register size read from device tree in the dt_node_info structure. It may be used to map the IO registers with the correct address ra
core: kernel: add reg_size in the dt_node_info structure
Add the register size read from device tree in the dt_node_info structure. It may be used to map the IO registers with the correct address range.
Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| df7cecc0 | 03-Nov-2021 |
Lionel Debieve <lionel.debieve@foss.st.com> |
core: kernel: use size_t instead of ssize_t for _fdt_reg_size()
Size is read from the reg device tree property as an unsigned value coming from fdt32_to_cpu(). Use a size_t with associated error cod
core: kernel: use size_t instead of ssize_t for _fdt_reg_size()
Size is read from the reg device tree property as an unsigned value coming from fdt32_to_cpu(). Use a size_t with associated error code DT_INFO_INVALID_REG_SIZE as return in prototype. Update the current users according to this change.
Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 5e588771 | 10-Jun-2021 |
Clément Léger <clement.leger@bootlin.com> |
drivers: add type field to dt_driver struct
In order to keep the current mechanism simple but allow parsing the device tree by iterating on driver (clocks for instance), add a type field to dt drive
drivers: add type field to dt_driver struct
In order to keep the current mechanism simple but allow parsing the device tree by iterating on driver (clocks for instance), add a type field to dt driver struct which will allow differentiating drivers when iterating on entries and thus avoid casting struct dt_driver::driver to the wrong type in case a bad DT is provided. This will also allow adding a more generic driver model by probing generic driver based on their compatible.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
show more ...
|
| 702fe5a7 | 10-Aug-2021 |
Clément Léger <clement.leger@bootlin.com> |
core: kernel: interrupt: add type and prio for interrupts
When describing a device in the device tree, it is sometimes necessary to parse the interrupts properties and propagates them until adding t
core: kernel: interrupt: add type and prio for interrupts
When describing a device in the device tree, it is sometimes necessary to parse the interrupts properties and propagates them until adding the interrupt. For instance some interrupt-cells allows to describe priority and type of interrupt:
interrupts = <67 IRQ_TYPE_LEVEL_HIGH 2>;
With existing support, only the interrupt number is returned by `dt_get_irq()`. This patch adds type and prio parameter which are passed to `dt_get_irq_type_prio()` and `itr_add_type_prio()`. This allows interrupt drivers to fill this from devicetree in `dt_get_irq()` but also use these information in the `add()` callback. Additionally, it allows to specify these flags manually when not using devicetree.
These parameters can then be used by the interrupt controller driver to setup the irq line correctly.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 888bb63d | 13-Oct-2021 |
Clément Léger <clement.leger@bootlin.com> |
core: kernel: interrupt: rename len argument of dt_get_irq to count
len can be missleading, use a more descriptive name.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienn
core: kernel: interrupt: rename len argument of dt_get_irq to count
len can be missleading, use a more descriptive name.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| bd59a6ad | 31-Aug-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add call_preinitcalls()
Adds call_preinitcalls() for really early initcalls. This function is supposed to be called before call_initcalls() is called. With virtualization enabled it is called
core: add call_preinitcalls()
Adds call_preinitcalls() for really early initcalls. This function is supposed to be called before call_initcalls() is called. With virtualization enabled it is called in a blocking context when the OP-TEE partition is created.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| df45c114 | 17-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt: fix missing const attribute on fdt reference
The standard FDT reference in libfdt and friends is a const void *. Fix few function prototypes that miss the const attribute.
Signed-off-by:
core: dt: fix missing const attribute on fdt reference
The standard FDT reference in libfdt and friends is a const void *. Fix few function prototypes that miss the const attribute.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.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 ...
|
| 927d81ac | 27-Aug-2021 |
Jerome Forissier <jerome@forissier.org> |
core: panic: introduce cpu_idle() function
Adds a cpu_idle() weak function to panic.h/panic.c, which can later be implemented in arch-specific code. The purpose is to avoid a busy loop (which is the
core: panic: introduce cpu_idle() function
Adds a cpu_idle() weak function to panic.h/panic.c, which can later be implemented in arch-specific code. The purpose is to avoid a busy loop (which is the default implementation) when __do_panic() is done but cannot return.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 49a87500 | 21-Jun-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add more overflow checks in ree_fs_ta_open()
Adds more overflow checks in ree_fs_ta_open() and also checks that the encrypted header (struct shdr_encrypted_ta) also fits in the size of the TA
core: add more overflow checks in ree_fs_ta_open()
Adds more overflow checks in ree_fs_ta_open() and also checks that the encrypted header (struct shdr_encrypted_ta) also fits in the size of the TA binary.
The latter check is needed to guard against fabricated values in struct shdr_encrypted_ta for iv_size and/or tag_size which could trick OP-TEE to read beyond the end of the buffer where the TA was loaded.
Reading beyond the end of the TA buffer would normally result in a crash or if there's a valid mappings just after just a failure to load the TA. No unchecked code will be executed, but it may result in a secure world crash.
So this commit will check that the iv_size and tag_size values can point to a valid buffer before attempting to read and thus prevent a crash.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reported-by: Patrik Lantz <Patrik.Lantz@axis.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 76753661 | 12-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: separate user_ta_ops using a __weak attribute instead
Breaks the dependency chain for user_ta_ops using the standard method with a __weak symbol and an overriding symbol in link_dummies_paged.
core: separate user_ta_ops using a __weak attribute instead
Breaks the dependency chain for user_ta_ops using the standard method with a __weak symbol and an overriding symbol in link_dummies_paged.c.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 077732a0 | 12-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: make __wq_rpc() static again
With dependency chains properly broken for various ops structs we can make __wq_rpc() static again and remove it from link_dummies_paged.c.
Acked-by: Jerome Foris
core: make __wq_rpc() static again
With dependency chains properly broken for various ops structs we can make __wq_rpc() static again and remove it from link_dummies_paged.c.
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 27c64925 | 12-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: use separate sections for each __rodata_unpaged variable
Adds a mandatory argument to the macro __rodata_unpaged() to take the name of the variable to put in the unpaged rodata section. This w
core: use separate sections for each __rodata_unpaged variable
Adds a mandatory argument to the macro __rodata_unpaged() to take the name of the variable to put in the unpaged rodata section. This will result in separate sections for each such variable and make it easier to debug the pruning of the dependency tree for unpaged sections.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| bc9618c0 | 17-May-2021 |
Anton Rybakov <a.rybakov@omp.ru> |
core_mmu: fix implicit behavior of core_mmu_add_mapping()
In core_mmu_add_mapping() requested physical address rounded up/down to granule size (0x100000), which leads to establishing of virtual mapp
core_mmu: fix implicit behavior of core_mmu_add_mapping()
In core_mmu_add_mapping() requested physical address rounded up/down to granule size (0x100000), which leads to establishing of virtual mappings with overlapped physical counterparts. If two virtual mappings overlaps due to such roundings, then following phys_to_virt() can implicitly return result of virtual address from unexpected mapping. This patch fix such behavior by returning virtual address of newly established mapping.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Anton Rybakov <a.rybakov@omp.ru>
show more ...
|
| 3cc2413a | 11-May-2021 |
Jerome Forissier <jerome@forissier.org> |
core: allow configuration without any secure storage
Support a configuration with no secure storage (CFG_REE_FS=n and CFG_RPMB_FS=n). In such a case, user TAs will get error code TEEC_ERROR_ITEM_NOT
core: allow configuration without any secure storage
Support a configuration with no secure storage (CFG_REE_FS=n and CFG_RPMB_FS=n). In such a case, user TAs will get error code TEEC_ERROR_ITEM_NOT_FOUND when trying to access persistent objects.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| d5ad7ccf | 10-Jan-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: rename struct tee_pager_area to vm_paged_region
Renames struct tee_pager_area to struct vm_paged_region and moves it next to the declaration of struct vm_region. Since areas are now called pag
core: rename struct tee_pager_area to vm_paged_region
Renames struct tee_pager_area to struct vm_paged_region and moves it next to the declaration of struct vm_region. Since areas are now called paged regions or regions also rename functions, variables and struct members accordingly.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c6e827c0 | 25-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
Rename to barrier_read_counter_timer()
Renames barrier_read_cntpct() to barrier_read_counter_timer() to use a neutral name for the counter.
With SPMC at S-EL2 OP-TEE will be virtualized and must us
Rename to barrier_read_counter_timer()
Renames barrier_read_cntpct() to barrier_read_counter_timer() to use a neutral name for the counter.
With SPMC at S-EL2 OP-TEE will be virtualized and must use CNTVCT instead of CNTPCT while the old physical OP-TEE must continue to use CNTPCT.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| acc5dd21 | 09-Apr-2021 |
Ludovic Barre <ludovic.barre@foss.st.com> |
core: kernel: interrupt: add interface to allocate and add handler
This commit adds an interface to allocate and add an interrupt handler. This change allows to factorize code when dynamic interrupt
core: kernel: interrupt: add interface to allocate and add handler
This commit adds an interface to allocate and add an interrupt handler. This change allows to factorize code when dynamic interrupt handler allocation is needed.
Signed-off-by: Ludovic Barre <ludovic.barre@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 7acb3a47 | 09-Apr-2021 |
Ludovic Barre <ludovic.barre@foss.st.com> |
core: add interrupt resource in dt_node_info
Adds interrupt resource in dt_node_info and load it from _fdt_fill_device_info().
Signed-off-by: Ludovic Barre <ludovic.barre@foss.st.com> Reviewed-by:
core: add interrupt resource in dt_node_info
Adds interrupt resource in dt_node_info and load it from _fdt_fill_device_info().
Signed-off-by: Ludovic Barre <ludovic.barre@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|