public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Etienne CARRIERE - foss <etienne.carriere@foss.st.com>
Cc: "trini@konsulko.com" <trini@konsulko.com>,
	"sjg@chromium.org" <sjg@chromium.org>,
	Etienne CARRIERE <etienne.carriere@st.com>,
	"u-boot@lists.denx.de" <u-boot@lists.denx.de>
Subject: Re: [PATCH v6 08/14] firmware: scmi: add a version check against base protocol
Date: Thu, 12 Oct 2023 09:41:00 +0900	[thread overview]
Message-ID: <ZSdAnCsGhOPhxAYo@octopus> (raw)
In-Reply-To: <571b810596424ea6a5feba27b417487a@foss.st.com>

Hi Etienne,

Thank you again for your review.

On Wed, Oct 11, 2023 at 03:44:36PM +0000, Etienne CARRIERE - foss wrote:
> > From: U-Boot <u-boot-bounces@lists.denx.de> on behalf of AKASHI Takahiro <takahiro.akashi@linaro.org>
> > Sent: Wednesday, October 11, 2023 12:07 PM
> > 
> > In SCMI base protocol version 2 (0x20000), new interfaces,
> > BASE_SET_DEVICE_PERMISSIONS/BASE_SET_PROTOCOL_PERMISSIONS/
> > BASE_RESET_AGENT_CONFIGURATION, were added. Moreover, the api of
> > BASE_DISCOVER_AGENT was changed to support self-agent discovery.
> > 
> > So the driver expects SCMI firmware support version 2 of base protocol.
> > 
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> > v6
> > * new commit
> > ---
> >  drivers/firmware/scmi/base.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/firmware/scmi/base.c b/drivers/firmware/scmi/base.c
> > index ee84e261945a..1d41a8a98fc6 100644
> > --- a/drivers/firmware/scmi/base.c
> > +++ b/drivers/firmware/scmi/base.c
> > @@ -481,6 +481,7 @@ static int scmi_base_reset_agent_configuration_int(struct udevice *dev,
> >   */
> >  static int scmi_base_probe(struct udevice *dev)
> >  {
> > +       u32 version;
> >         int ret;
> > 
> >         ret = devm_scmi_of_get_channel(dev);
> > @@ -488,6 +489,13 @@ static int scmi_base_probe(struct udevice *dev)
> >                 dev_err(dev, "get_channel failed\n");
> >                 return ret;
> >         }
> > +       ret = scmi_base_protocol_version_int(dev, &version);
> > +       if (ret) {
> > +               dev_err(dev, "getting protocol version failed\n");
> > +               return ret;
> > +       }
> > +       if (version < SCMI_BASE_PROTOCOL_VERSION)
> > +               return -EINVAL;
> 
> LGTM. The open source SCMI server implementations I'm aware of (scp-firmware, tf-a and optee-os) all report SCMI Base protocol version v2.0.

Yeah, I also confirmed this.

> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
> 
> That said, maybe a more flexible implementation would support both version v1.0 (0x10000) and v2.0

SCMI v2.0 (not the base protocol, but the specification itself)
introduced base protocol v2.0 and the spec was published in 2019.
Along with the status of the existing SCMI server implementation (as you
mentioned above), I doubt any chance that there comes up any new SCMI with
the base protocol v1.0 in the future.

> but disable permission commands for v1.0 compliant servers. Maybe in a later change, if there is a need for.

Yes, we can make a tweak later. But anyhow "permission" commands are
categorized as optional even in v2.0 (i.e. the firmware may still return
SCMI_NOT_SUPPORTED) and U-Boot has no framework to utilize them for now.

BTW, I will not add a version check against all the existing protocols
(you implemented) as they utilize only the interfaces defined in each one's v1.0.

Thanks,
-Takahiro Akashi

> I fear using such strict minima protocol version values for other SCMI procotols make U-Boot client too restrictive.
> 
> BR,
> Etienne
> 
> > 
> >         return ret;
> >  }
> > --
> > 2.34.1
> > 
> > 

  reply	other threads:[~2023-10-12  0:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 10:06 [PATCH v6 00/14] firmware: scmi: add SCMI base protocol support AKASHI Takahiro
2023-10-11 10:06 ` [PATCH v6 01/14] scmi: refactor the code to hide a channel from devices AKASHI Takahiro
2023-10-14 14:49   ` Tom Rini
2023-10-11 10:06 ` [PATCH v6 02/14] firmware: scmi: use a protocol's own channel if assigned AKASHI Takahiro
2023-10-12  3:45   ` Simon Glass
2024-06-10 14:16   ` Quentin Schulz
2023-10-11 10:06 ` [PATCH v6 03/14] firmware: scmi: support dummy channels for sandbox agent AKASHI Takahiro
2023-10-11 10:06 ` [PATCH v6 04/14] firmware: scmi: move scmi_bind_protocols() backward AKASHI Takahiro
2023-10-11 10:06 ` [PATCH v6 05/14] firmware: scmi: framework for installing additional protocols AKASHI Takahiro
2023-10-11 10:06 ` [PATCH v6 06/14] test: dm: add protocol-specific channel test AKASHI Takahiro
2023-10-11 10:07 ` [PATCH v6 07/14] firmware: scmi: implement SCMI base protocol AKASHI Takahiro
2023-10-11 10:07 ` [PATCH v6 08/14] firmware: scmi: add a version check against " AKASHI Takahiro
2023-10-11 15:44   ` Etienne CARRIERE - foss
2023-10-12  0:41     ` AKASHI Takahiro [this message]
2023-10-11 10:07 ` [PATCH v6 09/14] firmware: scmi: fake base protocol commands on sandbox AKASHI Takahiro
2023-10-11 10:07 ` [PATCH v6 10/14] test: dm: simplify SCMI unit test " AKASHI Takahiro
2023-10-11 10:07 ` [PATCH v6 11/14] firmware: scmi: install base protocol to SCMI agent AKASHI Takahiro
2023-10-11 10:07 ` [PATCH v6 12/14] sandbox: remove SCMI base node definition from test.dts AKASHI Takahiro
2023-10-11 10:07 ` [PATCH v6 13/14] test: dm: add SCMI base protocol test AKASHI Takahiro
2023-10-11 10:07 ` [PATCH v6 14/14] firmware: scmi: add a check against availability of protocols AKASHI Takahiro

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=ZSdAnCsGhOPhxAYo@octopus \
    --to=takahiro.akashi@linaro.org \
    --cc=etienne.carriere@foss.st.com \
    --cc=etienne.carriere@st.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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