History log of /optee_os/core/kernel/dt_driver.c (Results 1 – 25 of 48)
Revision Date Author Comments
# 00a2b8c7 28-Apr-2025 Jerome Forissier <jerome.forissier@linaro.org>

core: kernel: dt_driver: variable may be unused

Fix the following warning with Clang 18.6.1:

core/kernel/dt_driver.c:456:15: error: variable 'count' set but not used [-Werror,-Wunused-but-set-vari

core: kernel: dt_driver: variable may be unused

Fix the following warning with Clang 18.6.1:

core/kernel/dt_driver.c:456:15: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
456 | unsigned int count = 0;
| ^

Indeed, when CFG_TEE_CORE_LOG_LEVEL <= 2, the value of count is never
read.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>

show more ...


# 39f965c2 10-Jul-2024 Etienne Carriere <etienne.carriere@foss.st.com>

core: kernel: print node name on provider driver registering failure

Print the name of the node when failing to register a provider driver
in DT_DRIVER framework.

Signed-off-by: Etienne Carriere <e

core: kernel: print node name on provider driver registering failure

Print the name of the node when failing to register a provider driver
in DT_DRIVER framework.

Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>

show more ...


# f4cc581b 09-Jul-2024 Etienne Carriere <etienne.carriere@foss.st.com>

core: kernel: dt_driver: fix nodes reference passed in dt_pargs

Correct the DT node references passed in struct dt_pargs. Field
phandle_node is expected to be the node offset of the provider driver

core: kernel: dt_driver: fix nodes reference passed in dt_pargs

Correct the DT node references passed in struct dt_pargs. Field
phandle_node is expected to be the node offset of the provider driver
but dt_driver_device_from_node_idx_prop_phandle() implementation passes
node offset -1, dt_driver_device_from_parent() passes the consumer
node offset and dt_driver_device_from_node_idx_prop() may pass the
phandle node offset from a previous index in the parsed DT node property.

Fix that by adding field consumer_node to reference the node offset of
the consumer device and fixing phandle_node where applicable and
update atmel_i2c and stm32_i2c drivers to get the I2C device address
from the consumer_node field instead of the phandle_node that is now
fixed.

Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>

show more ...


# 48a1cce4 02-May-2024 Gatien Chevallier <gatien.chevallier@foss.st.com>

core: firewall: add firewall framework

Add a generic firewall controller framework. The goal of this framework
is to offer access control and configuration APIs, that are implemented
in the firewall

core: firewall: add firewall framework

Add a generic firewall controller framework. The goal of this framework
is to offer access control and configuration APIs, that are implemented
in the firewall controllers drivers, to the firewall consumers. This
framework requires an embedded device tree.

A firewall controller is an access controller [1]. It should register
itself as a provider to the framework. Firewall controllers have the
possibility to populate their bus according to defined firewall accesses
defined in the "access-controllers" property in each of the device's
node.

Any device that consumes one or more firewall should refer it/them in
their "access-controllers" property. Arguments can be passed along with
the phandle of the firewall controller(s).

Link: https://patchwork.kernel.org/project/linux-media/patch/20240105130404.301172-2-gatien.chevallier@foss.st.com/ [1]
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# e33c3ff5 05-Jan-2024 Clement Faure <clement.faure@nxp.com>

core: kernel: check device tree property pointer

Assert `prop` pointer before using it in fdt32_to_cpu().

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Jerome Forissier <jerome.

core: kernel: check device tree property pointer

Assert `prop` pointer before using it in fdt32_to_cpu().

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# 4fd40c39 22-Mar-2023 Clément Léger <clement.leger@bootlin.com>

core: dt_driver: add DT_DRIVER_NVMEM support

Handle DT_DRIVER_NVMEM the same way that DT_DRIVER_PINCTRL is handled.
Indeed, it uses the same kind of DT references (phandle to a subnode of a
controll

core: dt_driver: add DT_DRIVER_NVMEM support

Handle DT_DRIVER_NVMEM the same way that DT_DRIVER_PINCTRL is handled.
Indeed, it uses the same kind of DT references (phandle to a subnode of a
controller) to get a nvmem cell.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# a5bf88f0 17-Jun-2022 Gatien Chevallier <gatien.chevallier@foss.st.com>

core: fix trace in add_node_to_probe()

Fix trace format, drv_name and node_name are inverted.

Fixes: b3a88b52a17c ("core: dt_driver probe sequence")
Signed-off-by: Gatien Chevallier <gatien.chevall

core: fix trace in add_node_to_probe()

Fix trace format, drv_name and node_name are inverted.

Fixes: b3a88b52a17c ("core: dt_driver probe sequence")
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# c038f3da 29-Nov-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: dt_driver: do not defer probe on skip phandler arguments

Prevent dt_driver_device_from_node_idx_prop() to request driver probe
deferral when needing to skip phandle arguments cells related to

core: dt_driver: do not defer probe on skip phandler arguments

Prevent dt_driver_device_from_node_idx_prop() to request driver probe
deferral when needing to skip phandle arguments cells related to
providers not yet registered. When skipping these phandle argument cells
we don't really need the skipped provider is registered, we can read
the #xxx-cells property in the provider DT node straight.

For example, consider a driver which DT node defines:
clocks = <&foo_clock 1 2 3>, <&bar_clock 2>;
clock-names = "foo", "bar";
If driver calls clk_get_by_name(fdt, node, "bar"), it does not need to
wait &foo_clock related driver to be already probed, it does not even
need the driver to be ever probed.

Fixes: a22e85b25772 ("core: dt_driver: factorize clk_dt_get_from_provider()")
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# b548a657 06-Nov-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: dt_driver: reference output device reference as void *

Changes dt_driver API function to reference device reference as
void * instead of void ** which could be confusing as the reference
can b

core: dt_driver: reference output device reference as void *

Changes dt_driver API function to reference device reference as
void * instead of void ** which could be confusing as the reference
can be a pointer to a device pointer (e.g. in clk_dt.c) or a pointer
to a structure (e.g. interrupt.c).

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# 955b02aa 10-Oct-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: dt_driver: don't enforce phandle 1st arg is a phandle

Changes local function device_from_provider_prop() to assume its
argument @prop points to the first argument to pass with phandle.

This c

core: dt_driver: don't enforce phandle 1st arg is a phandle

Changes local function device_from_provider_prop() to assume its
argument @prop points to the first argument to pass with phandle.

This change allows a later change to support other DT bindings
("interrupts" property) where 1st cell of the property is not
a phandle but the 1st phandle argument to be passed.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# c9c53de1 14-Sep-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: dt_driver: add dt_driver_provider_priv_data()

Implements dt_driver_provider_priv_data() to get the private data
registered with a provider. Regulator framework will use this
function to return

core: dt_driver: add dt_driver_provider_priv_data()

Implements dt_driver_provider_priv_data() to get the private data
registered with a provider. Regulator framework will use this
function to return the regulator handle associated to a regulator
provider driver.

Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# 193944aa 14-Sep-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: dt_driver: define DT_DRIVER_REGULATOR

Adds DT_DRIVER_REGULATOR for a regulator consumer to retrieve its
regulator device(s) from device tree information.

Acked-by: Gatien Chevallier <gatien.c

core: dt_driver: define DT_DRIVER_REGULATOR

Adds DT_DRIVER_REGULATOR for a regulator consumer to retrieve its
regulator device(s) from device tree information.

Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# 8f3e49fa 06-Sep-2023 Gatien Chevallier <gatien.chevallier@foss.st.com>

core: dt_driver: fix error handling in probe_dt_drivers()

When the dt_driver_probe_list is empty but the dt_driver_failed_list
is not empty, meaning a probe has failed, and that there's no more prob

core: dt_driver: fix error handling in probe_dt_drivers()

When the dt_driver_probe_list is empty but the dt_driver_failed_list
is not empty, meaning a probe has failed, and that there's no more probe
to defer, the probe_dt_drivers() does not panic().

Fix and simplify the error handling to panic if a probe has failed.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# b357d34f 06-Jun-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: dt_driver: swap TEE_result and retrieved device reference

Changes dt_driver callback function to return a TEE_Result value
and pass retrieved device reference by a output argument rather
than

core: dt_driver: swap TEE_result and retrieved device reference

Changes dt_driver callback function to return a TEE_Result value
and pass retrieved device reference by a output argument rather
than the opposite.

This change updates dt_driver.c, dt_driver.h and all drivers
implementing related dt_driver callback function.

As a consequence, this change removes all type definition related
to device specific callback handler function types which are useless
as all these now comply with type dt_driver_probe_func defined in
dt_driver.h.

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# 50dd2af0 08-Feb-2023 Etienne Carriere <etienne.carriere@linaro.org>

core: dt_driver: add helper for old fashion interrupt bindings

Adds a helper function dt_driver_device_from_node_idx_prop_phandle()
in device tree driver probing framework for when a DT node propert

core: dt_driver: add helper for old fashion interrupt bindings

Adds a helper function dt_driver_device_from_node_idx_prop_phandle()
in device tree driver probing framework for when a DT node property
contains a resource references but not the related device phandle as
first property cell, as for property "interrupts" which should get the
interrupt controller phandle from property "interrupt-parent". This
change aims at supporting "interrupts" property DT bindings.

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# ed33eb2e 05-Feb-2023 Etienne Carriere <etienne.carriere@linaro.org>

core: dt_driver: define interrupt controller drivers identifier

Defines identifier DT_DRIVER_INTERRUPT in dt_driver_type enumerated type
for interrupt controller drivers.

Acked-by: Jens Wiklander <

core: dt_driver: define interrupt controller drivers identifier

Defines identifier DT_DRIVER_INTERRUPT in dt_driver_type enumerated type
for interrupt controller drivers.

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# 8fd620f7 22-May-2023 Etienne Carriere <etienne.carriere@linaro.org>

core: rename dt_driver_phandle_args to dt_pargs

Renames struct dt_driver_phandle_args to struct dt_pargs to
shorten the label and prevent ugly line breaks in function
signatures.

Acked-by: Jens Wik

core: rename dt_driver_phandle_args to dt_pargs

Renames struct dt_driver_phandle_args to struct dt_pargs to
shorten the label and prevent ugly line breaks in function
signatures.

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# b5aff6de 02-Mar-2023 Clément Léger <clement.leger@bootlin.com>

core: dt_driver: add support for DT_DRIVER_PINCTRL

In order to handle pinctrl the same way that other driver are handled by
DT driver support, modify node parsing to refer to the parent node in case

core: dt_driver: add support for DT_DRIVER_PINCTRL

In order to handle pinctrl the same way that other driver are handled by
DT driver support, modify node parsing to refer to the parent node in case
we are handling a pinctrl request.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>

show more ...


# 4fc179b6 11-May-2023 Thomas Perrot <thomas.perrot@bootlin.com>

drivers: gpio: add device-tree based gpio controller framework

Build a small gpio framework based on the device-tree infrastructure and
on top of the existing gpio.h content. This framework allows t

drivers: gpio: add device-tree based gpio controller framework

Build a small gpio framework based on the device-tree infrastructure and
on top of the existing gpio.h content. This framework allows to register
gpio controllers and to retrieve gpio struct based on a "<name>-gpios"
properties.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# f354a5d8 05-Apr-2023 Gatien Chevallier <gatien.chevallier@foss.st.com>

core: replace _fdt_ prefix with fdt_ for device tree API

As per upstream discussion, there is no reason to keep _fdt_ prefix.
Replaces it with fdt_ for all occurrences.

Signed-off-by: Gatien Cheval

core: replace _fdt_ prefix with fdt_ for device tree API

As per upstream discussion, there is no reason to keep _fdt_ prefix.
Replaces it with fdt_ for all occurrences.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# e7a2db34 14-Mar-2023 Clément Léger <clement.leger@bootlin.com>

core: dt_driver: add support for DT_DRIVER_I2C

Integrating I2C support within the dt_driver mechanism require to change
the way controller are retrieved. Indeed, when using i2c, the children are
loc

core: dt_driver: add support for DT_DRIVER_I2C

Integrating I2C support within the dt_driver mechanism require to change
the way controller are retrieved. Indeed, when using i2c, the children are
located under a parent I2C controller node. This implies to use another
method to parse node heriarchy and ignore the case when the provider
has no phandle.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# bbbb5d00 27-Mar-2023 Clément Léger <clement.leger@bootlin.com>

core: dt_driver: remove early return if no phandle is found for provider

This case now happens for various subsystems which do not uses direct
phandles to the controller but rather phandles to child

core: dt_driver: remove early return if no phandle is found for provider

This case now happens for various subsystems which do not uses direct
phandles to the controller but rather phandles to child of the controller.
For such description, the controller itself might not have any "phandle"
property since there is no reference to it.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# 33cc94df 13-Mar-2023 Clément Léger <clement.leger@bootlin.com>

core: dt_driver: add phandle node and fdt to dt_driver_phandle_args

With pinctrl, it is necessary for the provider to access the node which
will need to be apply since it contains custom controller

core: dt_driver: add phandle node and fdt to dt_driver_phandle_args

With pinctrl, it is necessary for the provider to access the node which
will need to be apply since it contains custom controller properties
that need to be parsed. In order to integrate pinctrl with the existing
dt_driver generic support, add these members and fill them when invoking
the get_of_device() callback.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# 0adca93a 04-Jan-2023 Gatien Chevallier <gatien.chevallier@foss.st.com>

core: dt_driver: differentiate error codes if property is not found

Differentiates error codes in dt_driver_device_from_node_idx_prop() if
the requested resource is not found by returning TEE_ERROR_

core: dt_driver: differentiate error codes if property is not found

Differentiates error codes in dt_driver_device_from_node_idx_prop() if
the requested resource is not found by returning TEE_ERROR_ITEM_NOT_FOUND.
This is useful to differentiate cases for optional properties in
drivers.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# d2289450 24-Mar-2022 Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>

core: dt_driver: Add driver probing to use secure device tree

When secure external device tree is configured for use OP-TEE's drivers
should be loaded based on its definitions. Add support to probe

core: dt_driver: Add driver probing to use secure device tree

When secure external device tree is configured for use OP-TEE's drivers
should be loaded based on its definitions. Add support to probe drivers
also with secure external device tree.

This allows common system device tree to be used to define devices for
bootloaders and OP-TEE.

In any case if embedded device tree is defined this will take precedense.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


12