All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xen.org
Cc: edgar.iglesias@xilinx.com,
	Stefano Stabellini <stefanos@xilinx.com>,
	julien.grall@arm.com, sstabellini@kernel.org,
	saeed.nowshadi@xilinx.com
Subject: [PATCH v7 6/6] xen/zynqmp: add IPI calls virtualization
Date: Mon, 17 Dec 2018 14:10:30 -0800	[thread overview]
Message-ID: <1545084630-3873-6-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1812171407210.15901@sstabellini-ThinkPad-X260>

ZynqMP IPI mailbox calls are a small set of EEMI sister calls, often
used in conjunction with EEMI related functionalities.

Unfortunately they are not part of the EEMI spec, or any other public
spec, but the implementation is upstream in ATF:

https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/xilinx/zynqmp/ipi_mailbox_service/ipi_mailbox_svc.h

And patches are close to getting into Linux:

https://patchwork.kernel.org/cover/10689501/

Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>

---

Changes in v7:
- add IPI_MAILBOX_FID and use it
- remove tabs

Changes in v6:
- new patch
---
 xen/arch/arm/platforms/xilinx-zynqmp-eemi.c        | 18 ++++++++++++++++++
 xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h | 15 +++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
index f2fc5b5..7cd3936 100644
--- a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
+++ b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
@@ -25,6 +25,9 @@
  * EEMI firmware API:
  * https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf
  *
+ * IPI firmware API:
+ * https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/xilinx/zynqmp/ipi_mailbox_service/ipi_mailbox_svc.h
+ *
  * Power domain node_ids identify the area of effect of the power
  * management operations. They are the first parameter passed to power
  * management EEMI calls.
@@ -156,6 +159,21 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
         ret = XST_PM_NO_ACCESS;
         goto done;
 
+    case IPI_MAILBOX_FID(IPI_MAILBOX_OPEN):
+    case IPI_MAILBOX_FID(IPI_MAILBOX_RELEASE):
+    case IPI_MAILBOX_FID(IPI_MAILBOX_STATUS_ENQUIRY):
+    case IPI_MAILBOX_FID(IPI_MAILBOX_NOTIFY):
+    case IPI_MAILBOX_FID(IPI_MAILBOX_ACK):
+    case IPI_MAILBOX_FID(IPI_MAILBOX_ENABLE_IRQ):
+    case IPI_MAILBOX_FID(IPI_MAILBOX_DISABLE_IRQ):
+        if ( !is_hardware_domain(current->domain) )
+        {
+            gprintk(XENLOG_WARNING, "IPI mailbox: fn=%u No access", pm_fn);
+            ret = XST_PM_NO_ACCESS;
+            goto done;
+        }
+        goto forward_to_fw;
+
     default:
         gprintk(XENLOG_WARNING, "zynqmp-pm: Unhandled PM Call: %u\n", fid);
         return false;
diff --git a/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h b/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
index 9779b6a..c27fec6 100644
--- a/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
+++ b/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
@@ -106,6 +106,21 @@ enum pm_ret_status {
     XST_PM_ABORT_SUSPEND,
 };
 
+/* IPI SMC function numbers enum definition and fids */
+#define IPI_MAILBOX_FID(fid) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
+                                                ARM_SMCCC_CONV_32,   \
+                                                ARM_SMCCC_OWNER_SIP, \
+                                                fid)
+enum ipi_api_id {
+    IPI_MAILBOX_OPEN = 0x1000,
+    IPI_MAILBOX_RELEASE,
+    IPI_MAILBOX_STATUS_ENQUIRY,
+    IPI_MAILBOX_NOTIFY,
+    IPI_MAILBOX_ACK,
+    IPI_MAILBOX_ENABLE_IRQ,
+    IPI_MAILBOX_DISABLE_IRQ,
+};
+
 extern bool zynqmp_eemi(struct cpu_user_regs *regs);
 
 #endif /* __ASM_ARM_PLATFORMS_ZYNQMP_H */
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-12-17 22:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 22:10 [PATCH v7 0/6] zynqmp: Add forwarding of platform specific firmware calls Stefano Stabellini
2018-12-17 22:10 ` [PATCH v7 1/6] xen/arm: introduce platform_smc Stefano Stabellini
2018-12-17 22:10 ` [PATCH v7 2/6] xen/arm: zynqmp: Forward plaform specific firmware calls Stefano Stabellini
2018-12-18 15:49   ` Julien Grall
2018-12-17 22:10 ` [PATCH v7 3/6] xen/arm: zynqmp: introduce zynqmp specific defines Stefano Stabellini
2018-12-18 15:51   ` Julien Grall
2018-12-18 22:36     ` Stefano Stabellini
2018-12-17 22:10 ` [PATCH v7 4/6] xen/arm: zynqmp: implement zynqmp_eemi Stefano Stabellini
2018-12-18 16:02   ` Julien Grall
2018-12-18 22:36     ` Stefano Stabellini
2018-12-18 16:15   ` Julien Grall
2018-12-18 22:36     ` Stefano Stabellini
2018-12-19 13:14       ` Julien Grall
2018-12-20  0:32         ` Stefano Stabellini
2018-12-17 22:10 ` [PATCH v7 5/6] xen/arm: zynqmp: Remove blacklist of ZynqMP's PM node Stefano Stabellini
2018-12-18 16:02   ` Julien Grall
2018-12-17 22:10 ` Stefano Stabellini [this message]
2018-12-18 16:03   ` [PATCH v7 6/6] xen/zynqmp: add IPI calls virtualization Julien Grall

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=1545084630-3873-6-git-send-email-sstabellini@kernel.org \
    --to=sstabellini@kernel.org \
    --cc=edgar.iglesias@xilinx.com \
    --cc=julien.grall@arm.com \
    --cc=saeed.nowshadi@xilinx.com \
    --cc=stefanos@xilinx.com \
    --cc=xen-devel@lists.xen.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.