Changes since V9:
- Default to PCC subspace headers as defined in ACPI v5.1
Changes since V8:
- Removed unncessary header files.
- Added kerneldoc comments.
- Added intro about PCC in pcc.c
Changes since V7:
- Added timeout to tx method in case the remote dies.
- Restructured usage of acpi_status. Had inverted logic previously.
Changes since V6:
- Cosmetic changes based on Lv's suggestions
Changes since V5:
- Optimize loop that matches channel request.
- Use platform_create_bundle.
- Replace ioread/writes.
- Remove redundant code and headers.
- Restructure common mailbox macros.
- Reformat PCC cmd parsing.
Changes since V4:
- Folded PCC Mailbox helpers into pcc.c
Changes since V3:
- Added PCC helper functions to work around "struct device" limitations.
- PCC driver changes to work with PCC specific Mailbox helpers.
Changes since V2:
- Rebased on top of git://git.linaro.org/landing-teams/working/fujitsu/integration.git
branch mailbox-for-3.17
- Added PCC API to mailbox framework as per Arnd's suggestion to allow usage without ACPI.
Changes since V1:
- Integration with Mailbox framework - https://lkml.org/lkml/2014/5/15/49
This patchset adds support for the PCC (Platform Communication Channel)
interface as described in the current ACPI 5.0 spec. See Section 14 of the
ACPI spec - http://acpi.info/DOWNLOADS/ACPI_5_Errata%20A.pdf for more details
on how PCC works.
In brief PCC is a generic means for PCC clients, to talk to the firmware. The
PCC register space is typically memory mapped IO and uses a doorbell mechanism
to communicate synchronously from the OS to the firmware. The PCC driver is
completely agnostic to the protocol implemented by the PCC clients. It only
implements the enumeration of PCC channels and the low level transport mechanism
and leaves the rest to the PCC clients.
The PCC is meant to be useable in the future by clients such as CPPC
(Collaborative Processor Performance Control), RAS (Reliability,
Availability and Serviceability) and MPST (Memory Power State Tables) and possibly others.
Ashwin Chaugule (1):
Mailbox: Add support for Platform Communication Channel
drivers/mailbox/Kconfig | 12 ++
drivers/mailbox/Makefile | 2 +
drivers/mailbox/mailbox.c | 4 +-
drivers/mailbox/mailbox.h | 16 ++
drivers/mailbox/pcc.c | 367 ++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 398 insertions(+), 3 deletions(-)
create mode 100644 drivers/mailbox/mailbox.h
create mode 100644 drivers/mailbox/pcc.c
--
1.9.1
Hi our dear ACPI experts,
I ran my ci job yesterday night. then I run a test on my new leg Image, because I recompiled the FWTS in the test , so the test took a long time.
https://validation.linaro.org/scheduler/job/198839/log_file
The result.log is attached.
UPDATE:
(1)disabling STATIC_DEVMEM is working, it's not a blocker for FWTS in short term.
(2)we test the latest kernel, so the result should be better
Please let me know what are the rest problem we need to fix , according to the test log.
Great thanks for your time!
--
Best regards,
Fu Wei
Software Engineer From Red Hat
LEG Team
Linaro.org | Open source software for ARM SoCs
Ph: +86 186 2020 4684 (mobile)
IRC: fuwei
Skype: tekkamanninja
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
The Mailbox API so far discounted controllers and clients that
may not have a DT based channel mapping capability, as in ACPI.
Allow such mailbox clients to ask for a mailbox channel by simply
specifying a token. The token would be globally unique
among channels provided by such controllers... which shouldn't
be a problem because practically non-DT means ACPI and ACPI
specifies just one controller instance called the Platform
Communications Channel (PCC) that could have max 256 subspaces
(channels or mailboxes). So this is simply going to be the value
from 'Signature' field (first 4bytes) of the SharedMemory Region
corresponding to the subspace/channel the client is interested in.
Signed-off-by: Jassi Brar <jaswinder.singh(a)linaro.org>
---
drivers/mailbox/mailbox.c | 50 +++++++++++++++++++++-----------------
include/linux/mailbox_controller.h | 7 ++++++
2 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index afcb430..8260451 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -296,36 +296,42 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index)
{
struct device *dev = cl->dev;
struct mbox_controller *mbox;
- struct of_phandle_args spec;
- struct mbox_chan *chan;
+ struct mbox_chan *chan = NULL;
unsigned long flags;
int ret;
- if (!dev || !dev->of_node) {
- pr_debug("%s: No owner device node\n", __func__);
- return ERR_PTR(-ENODEV);
- }
-
mutex_lock(&con_mutex);
- if (of_parse_phandle_with_args(dev->of_node, "mboxes",
- "#mbox-cells", index, &spec)) {
- dev_dbg(dev, "%s: can't parse \"mboxes\" property\n", __func__);
- mutex_unlock(&con_mutex);
- return ERR_PTR(-ENODEV);
- }
-
- chan = NULL;
- list_for_each_entry(mbox, &mbox_cons, node)
- if (mbox->dev->of_node == spec.np) {
- chan = mbox->of_xlate(mbox, &spec);
- break;
+ if (!dev || !dev->of_node) { /* If it's an ACPI client */
+ list_for_each_entry(mbox, &mbox_cons, node) {
+ if (!mbox->global_xlate)
+ continue;
+ chan = mbox->global_xlate(mbox, index);
+ if (chan && !chan->cl)
+ break;
+ }
+ } else {
+ struct of_phandle_args spec;
+
+ if (of_parse_phandle_with_args(dev->of_node, "mboxes",
+ "#mbox-cells", index, &spec)) {
+ dev_dbg(dev, "%s: can't parse \"mboxes\" property\n",
+ __func__);
+ mutex_unlock(&con_mutex);
+ return ERR_PTR(-ENODEV);
}
- of_node_put(spec.np);
+ list_for_each_entry(mbox, &mbox_cons, node)
+ if (mbox->dev->of_node == spec.np) {
+ chan = mbox->of_xlate(mbox, &spec);
+ break;
+ }
+
+ of_node_put(spec.np);
+ }
if (!chan || chan->cl || !try_module_get(mbox->dev->driver->owner)) {
- dev_dbg(dev, "%s: mailbox not free\n", __func__);
+ pr_err("%s: mailbox not available\n", __func__);
mutex_unlock(&con_mutex);
return ERR_PTR(-EBUSY);
}
@@ -344,7 +350,7 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index)
ret = chan->mbox->ops->startup(chan);
if (ret) {
- dev_err(dev, "Unable to startup the chan (%d)\n", ret);
+ pr_err("Unable to startup the chan (%d)\n", ret);
mbox_free_channel(chan);
chan = ERR_PTR(ret);
}
diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_controller.h
index d4cf96f..76871b2 100644
--- a/include/linux/mailbox_controller.h
+++ b/include/linux/mailbox_controller.h
@@ -67,6 +67,11 @@ struct mbox_chan_ops {
* @txpoll_period: If 'txdone_poll' is in effect, the API polls for
* last TX's status after these many millisecs
* @of_xlate: Controller driver specific mapping of channel via DT
+ * @global_xlate: Controller driver specific mapping of channel for
+ * non-DT based clients (like ACPI). The 'global_id'
+ * argument is a token to uniquely identify the mbox_chan
+ * fromm those provided by more than one such controllers.
+ * 'of_xlate' takes precedence for DT based clients.
* @poll: API private. Used to poll for TXDONE on all channels.
* @node: API private. To hook into list of controllers.
*/
@@ -80,6 +85,8 @@ struct mbox_controller {
unsigned txpoll_period;
struct mbox_chan *(*of_xlate)(struct mbox_controller *mbox,
const struct of_phandle_args *sp);
+ struct mbox_chan *(*global_xlate)(struct mbox_controller *mbox,
+ int global_id);
/* Internal to API */
struct timer_list poll;
struct list_head node;
--
1.8.1.2