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

[Xen-devel] [PATCH v6 3/6] xen/arm: zynqmp: introduce zynqmp specific defines



From: "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxxx>

From: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxxx>

Introduce zynqmp specific defines for the firmware calls.
See EEMI:
https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf

The error codes are described, under XIlPM Error Codes:
https://www.xilinx.com/support/documentation/user_guides/ug1137-zynq-ultrascale-mpsoc-swdev.pdf

- pm_api_id
These are the EEMI function IDs. Unavoidable.

- pm_ret_status
These are the EEMI return statuses. Unavoidable.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx>

---

Changes in v6:
- improve commit message
- remove MM_*, node ids and reset ids

Changes in v5:
- remove MMIO access related definitions

Changes in v4:
- define PM_MMIO_SHIFT
---
 xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h | 86 ++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h 
b/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
index 43cefb5..84b8cbd 100644
--- a/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
+++ b/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
@@ -16,6 +16,92 @@
 
 #include <asm/processor.h>
 
+/* Service calls.  */
+#define PM_GET_TRUSTZONE_VERSION       0xa03
+
+/* SMC function IDs for SiP Service queries */
+#define ZYNQMP_SIP_SVC_CALL_COUNT       0xff00
+#define ZYNQMP_SIP_SVC_UID              0xff01
+#define ZYNQMP_SIP_SVC_VERSION          0xff03
+
+#define PM_MMIO_SHIFT                   32
+
+enum pm_api_id {
+       /* Miscellaneous API functions: */
+       PM_GET_API_VERSION = 1, /* Do not change or move */
+       PM_SET_CONFIGURATION,
+       PM_GET_NODE_STATUS,
+       PM_GET_OP_CHARACTERISTIC,
+       PM_REGISTER_NOTIFIER,
+       /* API for suspending of PUs: */
+       PM_REQ_SUSPEND,
+       PM_SELF_SUSPEND,
+       PM_FORCE_POWERDOWN,
+       PM_ABORT_SUSPEND,
+       PM_REQ_WAKEUP,
+       PM_SET_WAKEUP_SOURCE,
+       PM_SYSTEM_SHUTDOWN,
+       /* API for managing PM slaves: */
+       PM_REQ_NODE,
+       PM_RELEASE_NODE,
+       PM_SET_REQUIREMENT,
+       PM_SET_MAX_LATENCY,
+       /* Direct control API functions: */
+       PM_RESET_ASSERT,
+       PM_RESET_GET_STATUS,
+       PM_MMIO_WRITE,
+       PM_MMIO_READ,
+       PM_INIT,
+       PM_FPGA_LOAD,
+       PM_FPGA_GET_STATUS,
+       PM_GET_CHIPID,
+       /* ID 25 is been used by U-boot to process secure boot images */
+       /* Secure library generic API functions */
+       PM_SECURE_SHA = 26,
+       PM_SECURE_RSA,
+       /* Pin control API functions */
+       PM_PINCTRL_REQUEST,
+       PM_PINCTRL_RELEASE,
+       PM_PINCTRL_GET_FUNCTION,
+       PM_PINCTRL_SET_FUNCTION,
+       PM_PINCTRL_CONFIG_PARAM_GET,
+       PM_PINCTRL_CONFIG_PARAM_SET,
+       /* PM IOCTL API */
+       PM_IOCTL,
+       /* API to query information from firmware */
+       PM_QUERY_DATA,
+       /* Clock control API functions */
+       PM_CLOCK_ENABLE,
+       PM_CLOCK_DISABLE,
+       PM_CLOCK_GETSTATE,
+       PM_CLOCK_SETDIVIDER,
+       PM_CLOCK_GETDIVIDER,
+       PM_CLOCK_SETRATE,
+       PM_CLOCK_GETRATE,
+       PM_CLOCK_SETPARENT,
+       PM_CLOCK_GETPARENT,
+       PM_API_MAX
+};
+
+/**
+ * @XST_PM_SUCCESS:            Success
+ * @XST_PM_INTERNAL:   Unexpected error
+ * @XST_PM_CONFLICT:   Conflicting requirements
+ * @XST_PM_NO_ACCESS:  Access rights violation
+ * @XST_PM_INVALID_NODE:       Does not apply to node passed as argument
+ * @XST_PM_DOUBLE_REQ: Duplicate request
+ * @XST_PM_ABORT_SUSPEND:      Target has aborted suspend
+ */
+enum pm_ret_status {
+       XST_PM_SUCCESS = 0,
+       XST_PM_INTERNAL = 2000,
+       XST_PM_CONFLICT,
+       XST_PM_NO_ACCESS,
+       XST_PM_INVALID_NODE,
+       XST_PM_DOUBLE_REQ,
+       XST_PM_ABORT_SUSPEND,
+};
+
 extern bool zynqmp_eemi(struct cpu_user_regs *regs);
 
 #endif /* __ASM_ARM_PLATFORMS_ZYNQMP_H */
-- 
1.9.1


_______________________________________________
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®.