| 670fa4aa | 01-Dec-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt: prevent build failure when CFG_DT is disabled
Fixes dt.h to prevent build failure when dt_driver.h is pre-compiled while CFG_DT is disabled. Below are examples of such build error traces:
core: dt: prevent build failure when CFG_DT is disabled
Fixes dt.h to prevent build failure when dt_driver.h is pre-compiled while CFG_DT is disabled. Below are examples of such build error traces:
core/include/kernel/dt_driver.h:61:29: warning: ‘enum dt_driver_type’ declared inside parameter list will not be visible outside of this definition or declaration 61 | void *data, enum dt_driver_type type); | ^~~~~~~~~~~~~~ core/include/drivers/clk_dt.h: In function ‘clk_dt_register_clk_provider’: core/include/drivers/clk_dt.h:101:15: error: ‘DT_DRIVER_CLK’ undeclared (first use in this function); did you mean ‘CFG_DRIVERS_CLK’? 101 | data, DT_DRIVER_CLK); | ^~~~~~~~~~~~~
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 8dca59b4 | 19-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: use driver type when finding a driver provider
Adds driver type argument to functions dt_driver_get_provider_by_node(), and dt_driver_get_provider_by_phandle() to differentiate driv
core: dt_driver: use driver type when finding a driver provider
Adds driver type argument to functions dt_driver_get_provider_by_node(), and dt_driver_get_provider_by_phandle() to differentiate driver provider references when a single DT node relates to several driver providers that are of different type by DT binding definition. For example, a DT node may describe a device that acts both as a clock provider and a reset controller, for which two driver references are needed in the driver provider list.
Updates dt_driver_device_from_node_idx_prop() accordingly.
Fixes: f498c4042931 ("core: dt_driver: factorize clk_get_provider_by_*()") Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| c020046d | 23-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt: fix inline description of _fdt_get_status()
Corrects inline comment describing _fdt_get_status() helper function.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etien
core: dt: fix inline description of _fdt_get_status()
Corrects inline comment describing _fdt_get_status() helper function.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| b3a88b52 | 12-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver probe sequence
Add a driver_init initcall function to parse DT from root node and probe devices for which a compatible driver is registered in the dt_driver list. When a matching dri
core: dt_driver probe sequence
Add a driver_init initcall function to parse DT from root node and probe devices for which a compatible driver is registered in the dt_driver list. When a matching driver is found, its probe function is called to initialize the device.
Driver probe function returns TEE_SUCCESS or successful initialization, TEE_ERROR_DEFER_DRIVER_INIT if waiting for a dependent device, otherwise another TEE_Result error code. In the later case, the probe function panics.
The probe sequence uses 2 lists: a list of the device DT nodes for which a driver shall be probed (probe list) and a list of devices that were successfully probed and initialized (ready list). Since at least clock framework and dt_driver do both parse DT for matching nodes, we must centralized successfully probed devices to not add them twice in the probe list.
Note that a DT node can probe several drivers, one per driver type, as defined by dt_driver_type enumerated type.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Co-developed-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| d8b14b46 | 27-Oct-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: get return code when querying a device
Change dt_driver_device_from_provider_prop() function and friends to output return a TEE_Result code if failing to find target device instance
core: dt_driver: get return code when querying a device
Change dt_driver_device_from_provider_prop() function and friends to output return a TEE_Result code if failing to find target device instance. Return code TEE_ERROR_DEFER_DRIVER_INIT reports that requested device is not yet registered and initialized in the dt_driver provider list.
This change will be used to probed device drivers and allow probe deferral when a device depends on another device driver that is not yet initialized.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 502e23ad | 02-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: pm: add a name to registered pm_callback_handle
Adds an argument to register a name (string debug identifier) for PM handlers registered to PM framework.
Caller can provide a NULL reference o
core: pm: add a name to registered pm_callback_handle
Adds an argument to register a name (string debug identifier) for PM handlers registered to PM framework.
Caller can provide a NULL reference or a valid string pointer. When pager is enabled, the registration ensures the name lies in an unpaged section, possibly allocating heap for that purpose.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Gatien Chevallier <gatien.chevallier@st.com>
show more ...
|
| 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 ...
|
| 01254f1d | 05-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: move probe callback to dt_driver
Move ::probe field from struct dt_driver_setup to struct dt_driver and remove struct dt_driver_setup.
Acked-by: Jerome Forissier <jerome@forissier.
core: dt_driver: move probe callback to dt_driver
Move ::probe field from struct dt_driver_setup to struct dt_driver and remove struct dt_driver_setup.
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 ...
|
| 7e6a39fe | 03-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers: clk: add platform data per compatible identifier
Add a platform data reference field in struct dt_device_match so that a driver knows data related to the compatible it is probed for.
Signe
drivers: clk: add platform data per compatible identifier
Add a platform data reference field in struct dt_device_match so that a driver knows data related to the compatible it is probed for.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2305544b | 10-Jun-2021 |
Clément Léger <clement.leger@bootlin.com> |
drivers: clk: add generic clock framework
In order to ease clock support in OP-TEE, add a generic clock framework which allows to add clocks driver and handle clock hierarchy. This clock framework p
drivers: clk: add generic clock framework
In order to ease clock support in OP-TEE, add a generic clock framework which allows to add clocks driver and handle clock hierarchy. This clock framework provides various functions to enable/disable clock and to get their rate. Some basic behavior are supported such as gating when parent or rate is set. This option is enabled using CFG_DRIVERS_CLK which is disabled by default.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
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 ...
|
| a94111b9 | 31-Aug-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: virtualization.h: add dummy static inline functions
Adds dummy static inline functions to replace the normal virt_*() functions in virtualization.h when CFG_VIRTUALIZATION is not configured.
core: virtualization.h: add dummy static inline functions
Adds dummy static inline functions to replace the normal virt_*() functions in virtualization.h when CFG_VIRTUALIZATION is not configured.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| bddb2f89 | 31-Aug-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: virt: use TEE_Result return type for virt_*() functions
Uses TEE_Result as return type for all virt_*() functions returning anything but void in <kernel/virtualization.h>
Reviewed-by: Etienne
core: virt: use TEE_Result return type for virt_*() functions
Uses TEE_Result as return type for all virt_*() functions returning anything but void in <kernel/virtualization.h>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
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 ...
|
| 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 ...
|
| 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 ...
|
| 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 ...
|