History

firmware: xilinx: Add zynqmp_pm_get_chipid() API

This patch adds a new API to provide access to the hardware related data like soc revision, IDCODE... etc.

Nava kishore Manne committed 7 years ago

Commit fe6f42c1 parent 62f0d7d2 files · +26 −0Browse files

Unified · Split

2 files
  1. drivers/firmware/xilinx/zynqmp.c +24 −0
  2. include/linux/firmware/xlnx-zynqmp.h +2 −0
drivers/firmware/xilinx/zynqmp.c+24−0
@@ -186,6 +186,29 @@ static int zynqmp_pm_get_api_version(u32 *version) · 185 unmodified lines
186186 return ret;
187187 }
188188
189+/**
190+ * zynqmp_pm_get_chipid - Get silicon ID registers
191+ * @idcode: IDCODE register
192+ * @version: version register
193+ *
194+ * Return: Returns the status of the operation and the idcode and version
195+ * registers in @idcode and @version.
196+ */
197+static int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
198+{
199+ u32 ret_payload[PAYLOAD_ARG_CNT];
200+ int ret;
201+
202+ if (!idcode || !version)
203+ return -EINVAL;
204+
205+ ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload);
206+ *idcode = ret_payload[1];
207+ *version = ret_payload[2];
208+
209+ return ret;
210+}
211+
189212 /**
190213 * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version
191214 * @version: Returned version value
@@ -509,6 +532,7 @@ static int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, · 317 unmodified lines
509532
510533 static const struct zynqmp_eemi_ops eemi_ops = {
511534 .get_api_version = zynqmp_pm_get_api_version,
535+ .get_chipid = zynqmp_pm_get_chipid,
512536 .query_data = zynqmp_pm_query_data,
513537 .clock_enable = zynqmp_pm_clock_enable,
514538 .clock_disable = zynqmp_pm_clock_disable,
include/linux/firmware/xlnx-zynqmp.h+2−0
@@ -36,6 +36,7 @@ enum pm_api_id { · 35 unmodified lines
3636 PM_GET_API_VERSION = 1,
3737 PM_RESET_ASSERT = 17,
3838 PM_RESET_GET_STATUS,
39+ PM_GET_CHIPID = 24,
3940 PM_IOCTL = 34,
4041 PM_QUERY_DATA,
4142 PM_CLOCK_ENABLE,
@@ -224,6 +225,7 @@ struct zynqmp_pm_query_data { · 182 unmodified lines
224225
225226 struct zynqmp_eemi_ops {
226227 int (*get_api_version)(u32 *version);
228+ int (*get_chipid)(u32 *idcode, u32 *version);
227229 int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
228230 int (*clock_enable)(u32 clock_id);
229231 int (*clock_disable)(u32 clock_id);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t