From: Cristian Marussi <cristian.marussi@arm.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
girish.pathak@arm.com, arm-scmi@vger.kernel.org,
vincent.guittot@linaro.org,
Linus Walleij <linus.walleij@linaro.org>,
Souvik.Chakravarty@arm.com
Subject: Re: Question about identifiers
Date: Tue, 29 Oct 2024 10:32:01 +0000 [thread overview]
Message-ID: <ZyC5oTomdBF0Ywfb@pluto> (raw)
In-Reply-To: <f305d661-71e8-48c0-a6a5-4271c0436bc1@stanley.mountain>
On Tue, Oct 29, 2024 at 01:20:58PM +0300, Dan Carpenter wrote:
> On Tue, Oct 29, 2024 at 09:42:24AM +0000, Cristian Marussi wrote:
> > On Mon, Oct 28, 2024 at 06:09:50PM +0300, Dan Carpenter wrote:
> > > Two questions:
> >
> > [CC: Souvik]
> >
> > Hi Dan,
> >
> > >
> > > 1) In SCMI pinctrl protocol each pin, group or function has an identifier.
> > > uint32 identifier
> > > Identifiers are limited to 16 bits, and the upper 16 bits of this
> > > field are ignored by the platform.
> > > The linux-kernel assumes that the identifiers are basically, 0 to nr_pins,
> > > 0 to nr_groups and 0 to nr_funcs. Is that a fair assumption to make?
> >
> > It's not an assumption really, any SCMI resource on the system, across
> > all of the protocols, is identified by a number in the *contiguos* range
> > (0... TOT_RESOURCE - 1) where TOT_RESOURCE is usually gathered with some
> > discovery initial command...looking at Pinctrl specifically in 4.11:
> >
> > "Protocol commands take integer identifiers to describe a pin, group, or function.
> > The identifiers are sequential and start from 0."
> >
> > Pinctrl deviates a bit from this since you have 3 different kind of
> > resources, so you have 3 different TOT_RESOURCES values to query.
> >
> > ...maybe adding "sequential and contiguos" would have been clearer...or
> > maybe it is just that I am used to SCMI spec parlance/world so I
> > implictly interepret like this...
> >
> > IOW, for any protocol, in general, the platform is expected to expose
> > to the agent a contiguos set of IDs numbered from zero...i.e. without
> > holes due to reason like 'resource X is not present on platform Y so
> > we'll leave a hole in the set of IDs returned at discovery time because
> > is easier than remap the physical resources to the set of IDs exposed to
> > the agent'
> >
>
> Alright. Good. Thanks.
>
> > >
> > > 2) In the spec 4.11.2.7 PINCTRL_SETTINGS_GET and 4.11.2.8
> > > PINCTRL_SETTINGS_CONFIGURE it only allows for pins and groups, not functions.
> > > Meanwhile gpio functions are functions. That's just a mistake, right? I've
> > > been working under the assumtion that it is.
> > >
> >
> > Mmm, there were a lot of discussions around functions and GPIOs (which I
> > dont recall now) and a last minute rework to some commands in that
> > regards, so that now you can use those 2 commands to (optionally) get/set
> > the selected function for a pin or group specified in the command.
> > All the other configurations are, indeed, only pertaining to pin and groups:
> > what do you think is missing around functions ?
> >
> > Moreover, are you sure that you have the latest v3.2 spec from developer.arm.com ?
> >
> > Since there were a lot of betaS for v3.2 cycle...with changes especially
> > around functions/gpios...so many betaS that, till last month, AFAICS, even
> > the ACS SCMI compliance suite on the tip of master (still not an official
> > release, though) was broken, since it was really implementing Pinctrl
> > testcases against an old obsolete v3.2-beta (i.e. testing non-existent/older
> > pinctrl commands...and I have fixes to upstream for this...once I'll have a
> > bit of time...)
> >
>
> I am using the 3.2 Spec.
>
> In PINCTRL_ATTRIBUTES it says that GPIOs are a function resource, not a group
> resource. See the last line especially.
>
> Bit[17] GPIO function descriptor
>
> Set to 0 if Bits[1:0] of the flags field in the command is set to 2, and
> the function does not support GPIO functionality.
>
> Set to 1 if Bits[1:0] of the flags field in the command is set to 2, and
> the function supports GPIO functionality. The agent should ignore the
> value of this bit if Bits[1:0] of flags field in the command is set to 0
> or 1.
>
> This value of bit must not be 1 for more than one function associated with
> a pin or a group.
>
> Either way, he PINCTRL_SETTINGS_GET/PINCTRL_SETTINGS_CONFIGURE need to add
> functions. Here is how that reads now:
>
> uint32 attributes
> Bits[17:16]
> Selector: Whether the identifier field refers to a
> pin or a group.
> 0 – Pin
> 1 – Group
> All other values are reserved for future use
>
Well, it seems a reasonable amend in order NOT to go through the
mappings that Vincent describes to obtain the same result...
...now I sincereley dont know if this is something missing in the
spec (since there was really no GPIO-wise usage/implementation
of ASCMI/PINCTRL really till now ..so it could have been missed)...
...OR this was done on purpose to keep down the SCP/SCMI server
complexity... (argument this, that could be questionable I agree..)
Need to know what ATG/SCP think around this...Souvik ? Girish ?
Thanks,
Cristian
next prev parent reply other threads:[~2024-10-29 10:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 15:09 Question about identifiers Dan Carpenter
2024-10-29 9:42 ` Cristian Marussi
2024-10-29 10:09 ` Vincent Guittot
2024-10-29 10:30 ` Dan Carpenter
2024-10-29 10:48 ` Vincent Guittot
2024-10-29 10:20 ` Dan Carpenter
2024-10-29 10:32 ` Cristian Marussi [this message]
2024-10-30 10:35 ` Souvik Chakravarty
2024-11-01 16:08 ` Dan Carpenter
2024-11-09 0:04 ` Linus Walleij
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=ZyC5oTomdBF0Ywfb@pluto \
--to=cristian.marussi@arm.com \
--cc=Souvik.Chakravarty@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=girish.pathak@arm.com \
--cc=linus.walleij@linaro.org \
--cc=vincent.guittot@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.