Commit 1f910194 authored by VNSL Durga's avatar VNSL Durga Committed by Manish Pandey
Browse files

zynqmp:pm: Adds new zynqmp-pm api SMC call for efuse



This patch adds new api to access zynqmp efuse memory
Signed-off-by: default avatarVNSL Durga <vnsl.durga.challa@xilinx.com>
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Change-Id: I0971ab6549552a6f96412431388d19b822db00ab
parent d716f045
...@@ -1591,3 +1591,29 @@ enum pm_ret_status pm_register_access(unsigned int register_access_id, ...@@ -1591,3 +1591,29 @@ enum pm_ret_status pm_register_access(unsigned int register_access_id,
} }
return ret; return ret;
} }
/**
* pm_efuse_access() - To program or read efuse bits.
*
* This function provides access to the xilskey library to program/read
* efuse bits.
*
* address_low: lower 32-bit Linear memory space address
* address_high: higher 32-bit Linear memory space address
*
* value: Returned output value
*
* @return Returns status, either success or error+reason
*
*/
enum pm_ret_status pm_efuse_access(uint32_t address_high,
uint32_t address_low,
uint32_t *value)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMU */
PM_PACK_PAYLOAD3(payload, PM_EFUSE_ACCESS, address_high, address_low);
return pm_ipi_send_sync(primary_proc, payload, value, 1);
}
...@@ -196,5 +196,7 @@ enum pm_ret_status pm_pll_get_parameter(enum pm_node_id nid, ...@@ -196,5 +196,7 @@ enum pm_ret_status pm_pll_get_parameter(enum pm_node_id nid,
enum pm_ret_status pm_pll_set_mode(enum pm_node_id nid, enum pm_pll_mode mode); enum pm_ret_status pm_pll_set_mode(enum pm_node_id nid, enum pm_pll_mode mode);
enum pm_ret_status pm_pll_get_mode(enum pm_node_id nid, enum pm_pll_mode *mode); enum pm_ret_status pm_pll_get_mode(enum pm_node_id nid, enum pm_pll_mode *mode);
enum pm_ret_status pm_efuse_access(uint32_t address_high,
uint32_t address_low, uint32_t *value);
#endif /* PM_API_SYS_H */ #endif /* PM_API_SYS_H */
...@@ -99,6 +99,7 @@ enum pm_api_id { ...@@ -99,6 +99,7 @@ enum pm_api_id {
PM_PLL_GET_MODE, PM_PLL_GET_MODE,
/* PM Register Access API */ /* PM Register Access API */
PM_REGISTER_ACCESS, PM_REGISTER_ACCESS,
PM_EFUSE_ACCESS,
PM_API_MAX PM_API_MAX
}; };
......
...@@ -615,6 +615,14 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -615,6 +615,14 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
} }
case PM_EFUSE_ACCESS:
{
uint32_t value;
ret = pm_efuse_access(pm_arg[0], pm_arg[1], &value);
SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
}
default: default:
WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid); WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid);
SMC_RET1(handle, SMC_UNK); SMC_RET1(handle, SMC_UNK);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment