| #
1e3057c6 |
| 26-Feb-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: fallback to interrupt access when no bottom half
Change stm32_i2c driver to allow I2C transfers in interrupt context before bottom half thread is initialized and after it's relea
drivers: stm32_i2c: fallback to interrupt access when no bottom half
Change stm32_i2c driver to allow I2C transfers in interrupt context before bottom half thread is initialized and after it's released.
This can be needed by PMIC driver to handle PMCI interrupt events when bottom half thread is not supported by normal wold. In that case, PMIC driver would need to register its interrupt to stm32_i2c driver.
Thread accesses to the bus still start by locking the I2C bus mutex. Before using the bus, the sequence now masks the PMIC interrupt and polls (with timeout) on I2C bus access atomic lock. This lock may be held by an I2C transfer currently executing in an interrupt context. A 100ms timeout is short enough to also allow debug console traces in the interrupt sequence. Masking the interrupt before polling the lock ensures no new pending interrupt will interrupt us (and execute a I2C transfer) while the thread context accesses the I2C bus.
Interrupt accesses to the bus atomically set/clear the I2C bus access lock while executing the interrupt sequence.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
show more ...
|
| #
0f92c2ad |
| 28-Oct-2025 |
Thomas Bourgoin <thomas.bourgoin@foss.st.com> |
drivers: stm32_i2c: add support of stm32mp2 family
Add compatible st,stm32mp25-i2c to support stm32mp2x SoCs.
Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com> Reviewed-by: Etienne Carri
drivers: stm32_i2c: add support of stm32mp2 family
Add compatible st,stm32mp25-i2c to support stm32mp2x SoCs.
Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
show more ...
|
| #
ded20780 |
| 23-Oct-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: use compatible st,stm32mp15-i2c-non-secure
Change STM32 I2C driver to rely on the compatible DT property of the node to store whether the bus is expected assigned to secure or no
drivers: stm32_i2c: use compatible st,stm32mp15-i2c-non-secure
Change STM32 I2C driver to rely on the compatible DT property of the node to store whether the bus is expected assigned to secure or non-secure world. Using a non-secure I2C bus in OP-TEE on stm32mp1 platforms is something expected only on STM32MP15 variant for compatibility with platform already supported in upstream Linux/U-Boot components, as defined by st,stm32mp15-i2c-non-secure specific compatible string ID.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
show more ...
|
| #
be3e069c |
| 23-Oct-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: remove use of stm32_pinctrl_set_secure_cfg()
Remove use of stm32_pinctrl_set_secure_cfg() to set the secure state of the pins of a pinctrl state since this is now handled from ST
drivers: stm32_i2c: remove use of stm32_pinctrl_set_secure_cfg()
Remove use of stm32_pinctrl_set_secure_cfg() to set the secure state of the pins of a pinctrl state since this is now handled from STM32 GPIO driver based on the firewall framework.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-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 ...
|
| #
bdde1c99 |
| 18-Mar-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: protect bus access with a mutex
Protect concurrent accesses to an STM32 I2C bus with a PM aware mutex.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by:
drivers: stm32_i2c: protect bus access with a mutex
Protect concurrent accesses to an STM32 I2C bus with a PM aware mutex.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
37fbce01 |
| 12-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: fix header file inclusion order
Fix the order of header file inclusions.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carrier
drivers: stm32_i2c: fix header file inclusion order
Fix the order of header file inclusions.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
c425380f |
| 17-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
driver: i2c: stm32_i2c: fix call to stm32_i2c_init()
Fix call to stm32_i2c_init() that returns an int value, not a TEE_Result code.
Fixes: 5bc9f8e5618b ("drivers: stm32_i2c: register a DT_DRIVER_I2
driver: i2c: stm32_i2c: fix call to stm32_i2c_init()
Fix call to stm32_i2c_init() that returns an int value, not a TEE_Result code.
Fixes: 5bc9f8e5618b ("drivers: stm32_i2c: register a DT_DRIVER_I2C driver") Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
2b9d7661 |
| 16-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: apply pinctrl config at init
Add missing load of stm32_i2c pinctrl state at driver init.
Fixes: 73ba32eb0f6c ("drivers: stm32_i2c: support CFG_DRIVERS_PINCTRL") Reviewed-by: Gat
drivers: stm32_i2c: apply pinctrl config at init
Add missing load of stm32_i2c pinctrl state at driver init.
Fixes: 73ba32eb0f6c ("drivers: stm32_i2c: support CFG_DRIVERS_PINCTRL") Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
87aead6f |
| 16-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: analog filter config cannot fail
Local function i2c_config_analog_filter() cannot failed. Remove useless test on bus state and useless return value.
Reviewed-by: Gatien Chevalli
drivers: stm32_i2c: analog filter config cannot fail
Local function i2c_config_analog_filter() cannot failed. Remove useless test on bus state and useless return value.
Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
5bc9f8e5 |
| 05-Oct-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: register a DT_DRIVER_I2C driver
Registers stm32_i2c driver as a DT_DRIVER_I2C driver.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Acked-by: Thomas Bourgoin <thom
drivers: stm32_i2c: register a DT_DRIVER_I2C driver
Registers stm32_i2c driver as a DT_DRIVER_I2C driver.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Acked-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
9ef7a09c |
| 25-May-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: remove cases when CFG_DRIVERS_PINCTRL is disabled
Removes implementation when CFG_DRIVERS_PINCTRL is disables as stm32mp1 platform configuration enforces the switch is enabled.
drivers: stm32_i2c: remove cases when CFG_DRIVERS_PINCTRL is disabled
Removes implementation when CFG_DRIVERS_PINCTRL is disables as stm32mp1 platform configuration enforces the switch is enabled.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
73ba32eb |
| 23-May-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: support CFG_DRIVERS_PINCTRL
Updates stm32_i2c driver for when CFG_DRIVERS_PINCTRL is enabled making I2C driver to get pin control configuration using the generic pin control fram
drivers: stm32_i2c: support CFG_DRIVERS_PINCTRL
Updates stm32_i2c driver for when CFG_DRIVERS_PINCTRL is enabled making I2C driver to get pin control configuration using the generic pin control framework. When enabled, stm32_i2c driver get the active and sleep pin control configuration from the device tree. Sleep pinctrl configuration is optional.
SE050 and STM32MP1 PMIC drivers that use the stm32_i2c bus are both updated accordingly.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
5e30c514 |
| 14-Jun-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: stm32_i2c: fix pin secure configuration for STM32MP13
Fixes the implementation for configuring I2C pins as secure for STM32MP13. The implementation must consider the number of pins in the r
drivers: stm32_i2c: fix pin secure configuration for STM32MP13
Fixes the implementation for configuring I2C pins as secure for STM32MP13. The implementation must consider the number of pins in the related pinctrl instance.
Fixes: 1c81e5f9458a ("drivers: stm32_gpio: temporary GPIO configuration for STM32MP13") Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
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 ...
|
| #
98fca444 |
| 29-Aug-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
drivers: stm32_i2c: optimize the master receive path
Early error detection prevents an invalid read request made to the device from blocking the bus for the whole transfer timeout.
Signed-off-by: J
drivers: stm32_i2c: optimize the master receive path
Early error detection prevents an invalid read request made to the device from blocking the bus for the whole transfer timeout.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
646c0a2b |
| 18-Aug-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
drivers: stm32_i2c: fix read operations on I2C_MODE_MASTER mode
One of the valid conditions that leads to the generation of a NACK is when the controller-receiver signals the end of the transfer to
drivers: stm32_i2c: fix read operations on I2C_MODE_MASTER mode
One of the valid conditions that leads to the generation of a NACK is when the controller-receiver signals the end of the transfer to the target transmitter.
The code being fixed - not clearing the NACK - was causing subsequent write operations to fail.
This has been validated using the NXP SE050 device.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
1c81e5f9 |
| 06-Jul-2022 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
drivers: stm32_gpio: temporary GPIO configuration for STM32MP13
This temporary change set all configured GPIOs to non-secure state on STM32MP13 platform. This change is needed while we align all com
drivers: stm32_gpio: temporary GPIO configuration for STM32MP13
This temporary change set all configured GPIOs to non-secure state on STM32MP13 platform. This change is needed while we align all components.
Changes I2C driver to assign I2C pins to secure world for STM32MP13.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
929ec061 |
| 16-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers: stm32_i2c: use generic clock API
Replaces use of ST specific stm32mp_clk_xxx() clocks functions in favor to OP-TEE generic clock API functions clk_xxx() using struct clk * as clock referenc
drivers: stm32_i2c: use generic clock API
Replaces use of ST specific stm32mp_clk_xxx() clocks functions in favor to OP-TEE generic clock API functions clk_xxx() using struct clk * as clock references. Updates I2C driver and PMIC that is a consumer of an I2C bus.
Reviewed-by: Lionel Debieve <lionel.debieve@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
2b81d819 |
| 23-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers: stm32_i2c: stm32_i2c_get_setup_from_fdt() returns TEE_Result
Change stm32_i2c interface function stm32_i2c_get_setup_from_fdt() to return a TEE_Result code rather than a FDT error code.
Re
drivers: stm32_i2c: stm32_i2c_get_setup_from_fdt() returns TEE_Result
Change stm32_i2c interface function stm32_i2c_get_setup_from_fdt() to return a TEE_Result code rather than a FDT error code.
Reviewed-by: Lionel Debieve <lionel.debieve@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
717f942a |
| 03-Nov-2021 |
Lionel Debieve <lionel.debieve@foss.st.com> |
drivers: stm32_i2c: use reg_size to map virtual addresses
Use directly the register map size from the dt_node_info structure to call the io_pa_or_va() function.
Signed-off-by: Lionel Debieve <lione
drivers: stm32_i2c: use reg_size to map virtual addresses
Use directly the register map size from the dt_node_info structure to call the io_pa_or_va() function.
Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@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 ...
|
| #
65401337 |
| 07-Jun-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove generic_ from generic_boot
Now that the CFG_GENERIC_BOOT configuration flag has been removed also remove "generic_" prefix from and in the related files.
Acked-by: Etienne Carriere <et
core: remove generic_ from generic_boot
Now that the CFG_GENERIC_BOOT configuration flag has been removed also remove "generic_" prefix from and in the related files.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
c50e170e |
| 03-May-2020 |
Etienne Carriere <etienne.carriere@st.com> |
drivers: stm32_i2c: refine trace messages
Mostly change trace message from error level to debug level. Remove useless 1st space character in trace messages. Use PRI* and # flag characters were appli
drivers: stm32_i2c: refine trace messages
Mostly change trace message from error level to debug level. Remove useless 1st space character in trace messages. Use PRI* and # flag characters were applicable. Fix indentation.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| #
3ebb1380 |
| 01-May-2020 |
Etienne Carriere <etienne.carriere@st.com> |
drivers: stm32_i2c: allow any bus frequency
Do not limit I2C bus to 3 frequencies (100KHz, 400KHz, 1MHz). Instead allow for any frequency up to 1MHz. Depending on the requested frequency defined in
drivers: stm32_i2c: allow any bus frequency
Do not limit I2C bus to 3 frequencies (100KHz, 400KHz, 1MHz). Instead allow for any frequency up to 1MHz. Depending on the requested frequency defined in clock-frequency DT entry, use the I2C spec data from either Standard, Fast or Fast Plus mode.
This change removes use of rate IDs and use instead the rate value itself as identifiers, allowing more flexible implementation.
Changes local variable clock_src in i2c_setup_timing() from uint32_t to unsigned long for consistency.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Signed-off-by: Yann Gautier <yann.gautier@st.com> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|