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
875}875}
876EXPORT_SYMBOL_GPL(zynqmp_pm_aes_engine);876EXPORT_SYMBOL_GPL(zynqmp_pm_aes_engine);
877 877
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 */
885int 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
878static ssize_t ggs_show(struct device *device,891static ssize_t ggs_show(struct device *device,
879 struct device_attribute *attr,892 struct device_attribute *attr,
880 char *buf,893 char *buf,
include/linux/firmware/xlnx-zynqmp.h+6−0
@@ -64,6 +64,7 @@ · 63 unmodified lines
64 64
65enum pm_api_id {65enum pm_api_id {
66 PM_GET_API_VERSION = 1,66 PM_GET_API_VERSION = 1,
67 PM_SYSTEM_SHUTDOWN = 12,
67 PM_REQUEST_NODE = 13,68 PM_REQUEST_NODE = 13,
68 PM_RELEASE_NODE,69 PM_RELEASE_NODE,
69 PM_SET_REQUIREMENT,70 PM_SET_REQUIREMENT,
@@ -340,6 +341,7 @@ int zynqmp_pm_write_ggs(u32 index, u32 value); · 270 unmodified lines
340int zynqmp_pm_read_ggs(u32 index, u32 *value);341int zynqmp_pm_read_ggs(u32 index, u32 *value);
341int zynqmp_pm_write_pggs(u32 index, u32 value);342int zynqmp_pm_write_pggs(u32 index, u32 value);
342int zynqmp_pm_read_pggs(u32 index, u32 *value);343int zynqmp_pm_read_pggs(u32 index, u32 *value);
344int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype);
343#else345#else
344static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)346static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
345{347{
@@ -482,6 +484,10 @@ static inline int zynqmp_pm_read_pggs(u32 index, u32 *value) · 136 unmodified lines
482{484{
483 return -ENODEV;485 return -ENODEV;
484}486}
487static inline int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype)
488{
489 return -ENODEV;
490}
485#endif491#endif
486 492
487#endif /* __FIRMWARE_ZYNQMP_H__ */493#endif /* __FIRMWARE_ZYNQMP_H__ */