public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Jorge Ramirez-Ortiz, Foundries" <jorge@foundries.io>
To: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Cc: Jorge Ramirez-Ortiz <jorge@foundries.io>,
	patrice.chotard@foss.st.com,
	uboot-stm32@st-md-mailman.stormreply.com, u-boot@lists.denx.de,
	cryosay@gmail.com, alain.volmat@foss.st.com,
	Gabriel FERNANDEZ <gabriel.fernandez@foss.st.com>
Subject: Re: [PATCH] configs: stm32mp*: fix system reset
Date: Tue, 6 Sep 2022 16:53:25 +0200	[thread overview]
Message-ID: <20220906145325.GA2015520@trex> (raw)
In-Reply-To: <04ba2a69-9c29-dd84-547c-76043b017e0b@foss.st.com>

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@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

  reply	other threads:[~2022-09-06 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 17:33 [PATCH] configs: stm32mp*: fix system reset Jorge Ramirez-Ortiz
2022-09-05 18:16 ` Oleksandr Suvorov
2022-09-06  8:34 ` Patrick DELAUNAY
2022-09-06 14:53   ` Jorge Ramirez-Ortiz, Foundries [this message]
2022-09-08 16:16     ` Patrick DELAUNAY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220906145325.GA2015520@trex \
    --to=jorge@foundries.io \
    --cc=alain.volmat@foss.st.com \
    --cc=cryosay@gmail.com \
    --cc=gabriel.fernandez@foss.st.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-stm32@st-md-mailman.stormreply.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox