diff options
author | Nava kishore Manne <nava.manne@xilinx.com> | 2019-02-06 14:07:19 +0300 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2019-02-05 15:22:58 +0300 |
commit | fe6f42cf6eb3183ebd6ab6b0b7dcbee2600c2baa (patch) | |
tree | 3e9094480e5d3a6308400f378de48048353a501f /drivers/firmware/xilinx | |
parent | 62f0d7dc3bae9f7ce2701d6c8cfd3d93130017af (diff) | |
download | linux-fe6f42cf6eb3183ebd6ab6b0b7dcbee2600c2baa.tar.xz |
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/xilinx')
-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) } /** + * zynqmp_pm_get_chipid - Get silicon ID registers + * @idcode: IDCODE register + * @version: version register + * + * Return: Returns the status of the operation and the idcode and version + * registers in @idcode and @version. + */ +static int zynqmp_pm_get_chipid(u32 *idcode, u32 *version) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + if (!idcode || !version) + return -EINVAL; + + ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload); + *idcode = ret_payload[1]; + *version = ret_payload[2]; + + return ret; +} + +/** * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version * @version: Returned version value * @@ -509,6 +532,7 @@ static int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, + .get_chipid = zynqmp_pm_get_chipid, .query_data = zynqmp_pm_query_data, .clock_enable = zynqmp_pm_clock_enable, .clock_disable = zynqmp_pm_clock_disable, |