[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7 6/6] xen/zynqmp: add IPI calls virtualization



Hi Stefano,

On 12/17/18 10:10 PM, Stefano Stabellini wrote:
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@xxxxxxxxxx>

Acked-by: Julien Grall <julien.grall@xxxxxxx>

Cheers,


---

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 */


--
Julien Grall

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.