diff options
author | Nava kishore Manne <nava.manne@xilinx.com> | 2019-02-06 06:07:19 -0500 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2019-02-05 07:22:58 -0500 |
commit | fe6f42cf6eb3183ebd6ab6b0b7dcbee2600c2baa (patch) | |
tree | 3e9094480e5d3a6308400f378de48048353a501f /drivers/firmware | |
parent | 62f0d7dc3bae9f7ce2701d6c8cfd3d93130017af (diff) |
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.
Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/xilinx/zynqmp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 70b50377ae5f..16a23bc4c2c3 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c | |||
@@ -187,6 +187,29 @@ static int zynqmp_pm_get_api_version(u32 *version) | |||
187 | } | 187 | } |
188 | 188 | ||
189 | /** | 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 | |||
212 | /** | ||
190 | * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version | 213 | * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version |
191 | * @version: Returned version value | 214 | * @version: Returned version value |
192 | * | 215 | * |
@@ -509,6 +532,7 @@ static int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, | |||
509 | 532 | ||
510 | static const struct zynqmp_eemi_ops eemi_ops = { | 533 | static const struct zynqmp_eemi_ops eemi_ops = { |
511 | .get_api_version = zynqmp_pm_get_api_version, | 534 | .get_api_version = zynqmp_pm_get_api_version, |
535 | .get_chipid = zynqmp_pm_get_chipid, | ||
512 | .query_data = zynqmp_pm_query_data, | 536 | .query_data = zynqmp_pm_query_data, |
513 | .clock_enable = zynqmp_pm_clock_enable, | 537 | .clock_enable = zynqmp_pm_clock_enable, |
514 | .clock_disable = zynqmp_pm_clock_disable, | 538 | .clock_disable = zynqmp_pm_clock_disable, |