[PATCH] configs: stm32mp*: fix system reset

Jorge Ramirez-Ortiz, Foundries jorge at foundries.io
Tue Sep 6 16:53:25 CEST 2022


On 06/09/22, Patrick DELAUNAY wrote:
> Hi,
> 
> On 9/5/22 19:33, Jorge Ramirez-Ortiz wrote:
> > Enabling CONFIG_SYSRESET_PSCI prevents CONFIG_RESET_SCMI
> > from executing.
> > 
> > The side effect observed are I2C devices no longer being
> > accessible from U-boot after a soft reset.
> > 
> > Fixes: 11517ccc8c52 ("configs: add stm32mp13 defconfig")
> > Fixes: 17aeb589fa9d ("stm32mp15: remove configs dependency on
> >                        CONFIG_TFABOOT")
> > 
> > Signed-off-by: Jorge Ramirez-Ortiz <jorge at foundries.io>
> > ---
> >   configs/stm32mp13_defconfig         | 1 -
> >   configs/stm32mp15_defconfig         | 1 -
> >   configs/stm32mp15_trusted_defconfig | 1 -
> >   3 files changed, 3 deletions(-)
> 
> 
> The reset driver (used to managed Hardware device reset with RCC)
> 
> based on RCC register or on SCMI for 'system' / 'secured' ressource
> 
> and the sysret for global platform based on PSCI are indendent.

Yes. But AFAICS in the trace only one executes during the sys reset walk and
PSCI gets in first (so SCMI doesnt run when U-boot reboots).

> 
> Deactivate CONFIG_SYSRESET_PSCI only prevent soft reset support
> with the command reset or after crash.

Also AFAICS, the kernel only uses SCMI for reset (which probably explains why
OP-TEE controlled I2C devices still work when the board reboots).

> 
> 
> I don't think it is the correct solution if the I2C devices is no longer accessible
> after SW reset.
> 
> i think that it is more a bug / problem for reinit of I2C in STM32 driver
> so the configuration is not correct after a SW reset.

Not sure about that...but lets find out because something is wrong for sure.

> 
> 
> We have not detect this issue for I2C communication to PMIC after SW reset.

that could be because the PMIC uses the only I2C mode that works with
OP-TEE (the master transfer mode is broken until my fixes are merged...hopefully
soon)

> 
> 
> Can you provide more information for your use-case, for reproduction on my
> side
> 
> - platform used (STM32MP13 or STM32MP15), board used

STM32MP15

> 
> - I2C instance used and I2C device connected

NXPSE050 - i2c in master xfer mode, accessible only from OP-TEE
https://www.nxp.com/docs/en/data-sheet/SE050-DATASHEET.pdf

> 
> - version of TF-A / OP-TEE used

OP-TEE: 3.18
TF-A: 2.7.0

> 
> 
> Patrick
> 
> 
> > diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig
> > index 673b468d31..44cee2e656 100644
> > --- a/configs/stm32mp13_defconfig
> > +++ b/configs/stm32mp13_defconfig
> > @@ -69,7 +69,6 @@ CONFIG_RNG_OPTEE=y
> >   CONFIG_DM_RTC=y
> >   CONFIG_RTC_STM32=y
> >   CONFIG_SERIAL_RX_BUFFER=y
> > -CONFIG_SYSRESET_PSCI=y
> >   CONFIG_TEE=y
> >   CONFIG_OPTEE=y
> >   # CONFIG_OPTEE_TA_AVB is not set
> > diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig
> > index e5a2996c2c..2ad02f3652 100644
> > --- a/configs/stm32mp15_defconfig
> > +++ b/configs/stm32mp15_defconfig
> > @@ -133,7 +133,6 @@ CONFIG_SPI=y
> >   CONFIG_DM_SPI=y
> >   CONFIG_STM32_QSPI=y
> >   CONFIG_STM32_SPI=y
> > -CONFIG_SYSRESET_PSCI=y
> >   CONFIG_TEE=y
> >   CONFIG_OPTEE=y
> >   # CONFIG_OPTEE_TA_AVB is not set
> > diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
> > index e14668042f..9e24e82920 100644
> > --- a/configs/stm32mp15_trusted_defconfig
> > +++ b/configs/stm32mp15_trusted_defconfig
> > @@ -134,7 +134,6 @@ CONFIG_SPI=y
> >   CONFIG_DM_SPI=y
> >   CONFIG_STM32_QSPI=y
> >   CONFIG_STM32_SPI=y
> > -CONFIG_SYSRESET_PSCI=y
> >   CONFIG_TEE=y
> >   CONFIG_OPTEE=y
> >   # CONFIG_OPTEE_TA_AVB is not set


More information about the U-Boot mailing list