public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Cc: "linaro-acpi@lists.linaro.org" <linaro-acpi@lists.linaro.org>,
	Patch Tracking <patches@linaro.org>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	rjw@rjwysocki.net, linux-acpi@vger.kernel.org,
	Mark Brown <broonie@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Linaro-acpi] [RFC v2 1/3] Mailbox: Add support for ACPI
Date: Tue, 24 Jun 2014 16:18:27 +0200	[thread overview]
Message-ID: <17846485.GZEaSd7XIs@wuerfel> (raw)
In-Reply-To: <CAJ5Y-ebS0axNd24VCW-ZJy=4WLYWJ_VAptdw6c7zNCTeJhut7Q@mail.gmail.com>

On Monday 23 June 2014 17:27:21 Ashwin Chaugule wrote:
> On 23 June 2014 16:21, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 23 June 2014 15:46:08 Ashwin Chaugule wrote:
> >> Hello,
> >>
> >> On 23 June 2014 15:10, Arnd Bergmann <arnd@arndb.de> wrote:
> >> >> Fair point. The more I think about this, it seems that if we want to
> >> >> use the mailbox framework for ACPI kernels, we should have a PCC
> >> >> specific bypass, something like the one you suggested below. The ACPI
> >> >> spec defines PCC as the only "mailbox" like mechanism. There are 3 PCC
> >> >> clients defined as well; CPPC, MPST and RASF. Each of these have their
> >> >> own ACPI tables and so they dont require special DSDT entries.
> >> >
> >> > Ok, I see. Can you describe what data is in these tables?
> >>
> >> For CPPC, its a field for version number, number of entries and then
> >> followed by a bunch of PCC entries that have the following structure:
> >>
> >>  51 struct pcc_register_resource {
> >>  52     u8 descriptor;
> >>  53     u16 length;
> >>  54     u8 space_id;
> >>  55     u8 bit_width;
> >>  56     u8 bit_offset;
> >>  57     u8 access_size;
> >>  58     u64 address;
> >>  59 } __attribute__ ((packed));
> >>
> >> These essentially describe the PCC register space to be used by the
> >> respective protocol. e.g. CPPC uses these to exchange CPU performance
> >> metrics between the OS and the firmware.
> >> I believe MPST and RASF also follow the same format.
> >
> > Interesting. So I guess it's one entry per client of the PCC? How
> > exactly does the client know which index to use in this table?
> 
> Nah. Just when you'd think - surely there cant be any more 4 letter
> ACPI acronyms. ;)
> 
> CPPC is one PCC client by itself.

Ok, I see.

> There is a table called PCCT, which describes a list of all PCC
> subspaces. Each subspace is like a shared mem region dedicated to a
> PCC client. e.g. a platform may choose subspace id 1 for CPPC. The
> CPPC has its own table(s) (in case of CPPC, it is a table per CPU),
> which lists the PCC registers using the structure above. These
> registers reside in the dedicated PCC subspace.
>
> The PCC client drivers will probe their own tables and parse the PCC
> register entries from within. e.g. the CPPC driver will look for the
> CPC table (per CPU) and parse its PCC registers. Each PCC register
> entry reuses the "access_size" field to indicate a PCC subspace index.
> This is the index into the PCCT list of subspaces. From here the
> client can get the base address of its shared mem region and the
> doorbell semantics for communication.

I think a model that's closer to the mailbox subsystem would imply
that the common mailbox code (or the pcc driver itself) parses the
PCCT table, while the slave driver only passes an index.
Or even better, the slave driver would only pass a device pointer,
from which the pcc driver can find the pcc_register_resource in
the corresponding ACPI table. The name of that table can be the
string you pass down to the mailbox API. I suspect there is some
issue that makes this all break down though, but that would be
a portable way to do this for both DT and ACPI:

If we wanted to use DT with the same driver, we would put the
name of the table containing pcc_register_resource into the
mbox-names property, and that could get used to look up a
reference to the pcc device, and to the other data that you
have in pcc_register_resource and PCCT.

	Arnd

  reply	other threads:[~2014-06-24 14:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 16:48 [RFC v2 0/3] ACPI Platform Communication Channel driver Ashwin Chaugule
2014-06-12 16:48 ` [RFC v2 1/3] Mailbox: Add support for ACPI Ashwin Chaugule
2014-06-12 16:52   ` Ashwin Chaugule
2014-06-12 17:02   ` Arnd Bergmann
2014-06-12 17:14     ` Ashwin Chaugule
2014-06-20 18:55       ` Ashwin Chaugule
2014-06-20 18:57         ` Ashwin Chaugule
2014-06-20 19:08         ` [Linaro-acpi] " Arnd Bergmann
2014-06-20 19:29           ` Ashwin Chaugule
2014-06-20 20:49             ` Arnd Bergmann
2014-06-20 21:43               ` Ashwin Chaugule
2014-06-21  9:34                 ` Arnd Bergmann
2014-06-23 18:25                   ` Ashwin Chaugule
2014-06-23 19:10                     ` Arnd Bergmann
2014-06-23 19:46                       ` Ashwin Chaugule
2014-06-23 20:21                         ` Arnd Bergmann
2014-06-23 21:27                           ` Ashwin Chaugule
2014-06-24 14:18                             ` Arnd Bergmann [this message]
2014-06-24 17:55                               ` Ashwin Chaugule
2014-06-25 15:08                                 ` Arnd Bergmann
2014-06-12 16:48 ` [RFC v2 2/3] ACPI: Add support for Platform Communication Channel Ashwin Chaugule
2014-06-12 16:48 ` [RFC v2 3/3] PCC test driver Ashwin Chaugule

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=17846485.GZEaSd7XIs@wuerfel \
    --to=arnd@arndb.de \
    --cc=ashwin.chaugule@linaro.org \
    --cc=broonie@kernel.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=patches@linaro.org \
    --cc=rjw@rjwysocki.net \
    /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