History

firmware: xilinx: Add system shutdown API interface

Add system shutdown API interface which asks firmware to perform system shutdown/restart.

Rajan Vaja committed 6 years ago

Commit fdd2ed81 parent ae5c9612 files · +19 −0Browse files

Unified · Split

2 files
  1. drivers/firmware/xilinx/zynqmp.c +13 −0
  2. include/linux/firmware/xlnx-zynqmp.h +6 −0
drivers/firmware/xilinx/zynqmp.c+13−0
@@ -875,6 +875,19 @@ int zynqmp_pm_aes_engine(const u64 address, u32 *out) · 874 unmodified lines
875875 }
876876 EXPORT_SYMBOL_GPL(zynqmp_pm_aes_engine);
877877
878+/**
879+ * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart
880+ * @type: Shutdown or restart? 0 for shutdown, 1 for restart
881+ * @subtype: Specifies which system should be restarted or shut down
882+ *
883+ * Return: Returns status, either success or error+reason
884+ */
885+int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype)
886+{
887+ return zynqmp_pm_invoke_fn(PM_SYSTEM_SHUTDOWN, type, subtype,
888+ 0, 0, NULL);
889+}
890+
878891 static ssize_t ggs_show(struct device *device,
879892 struct device_attribute *attr,
880893 char *buf,
include/linux/firmware/xlnx-zynqmp.h+6−0
@@ -64,6 +64,7 @@ · 63 unmodified lines
6464
6565 enum pm_api_id {
6666 PM_GET_API_VERSION = 1,
67+ PM_SYSTEM_SHUTDOWN = 12,
6768 PM_REQUEST_NODE = 13,
6869 PM_RELEASE_NODE,
6970 PM_SET_REQUIREMENT,
@@ -340,6 +341,7 @@ int zynqmp_pm_write_ggs(u32 index, u32 value); · 270 unmodified lines
340341 int zynqmp_pm_read_ggs(u32 index, u32 *value);
341342 int zynqmp_pm_write_pggs(u32 index, u32 value);
342343 int zynqmp_pm_read_pggs(u32 index, u32 *value);
344+int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype);
343345 #else
344346 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
345347 {
@@ -482,6 +484,10 @@ static inline int zynqmp_pm_read_pggs(u32 index, u32 *value) · 136 unmodified lines
482484 {
483485 return -ENODEV;
484486 }
487+static inline int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype)
488+{
489+ return -ENODEV;
490+}
485491 #endif
486492
487493 #endif /* __FIRMWARE_ZYNQMP_H__ */