Commit 26a754f6 authored by Siva Durga Prasad Paladugu's avatar Siva Durga Prasad Paladugu
Browse files

zynqmp: Add new API for pl configuration readback



This patch adds new API's for performing pl configuration
readback.
Signed-off-by: default avatarAppana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Signed-off-by: default avatarSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
parent 88a28a40
...@@ -1183,3 +1183,33 @@ enum pm_ret_status pm_secure_image(uint32_t address_low, ...@@ -1183,3 +1183,33 @@ enum pm_ret_status pm_secure_image(uint32_t address_low,
key_hi, key_lo); key_hi, key_lo);
return pm_ipi_send_sync(primary_proc, payload, value, 2); return pm_ipi_send_sync(primary_proc, payload, value, 2);
} }
/**
* pm_fpga_read - Perform the fpga configuration readback
*
* @reg_numframes: Configuration register offset (or) Number of frames to read
* @address_low: lower 32-bit Linear memory space address
* @address_high: higher 32-bit Linear memory space address
* @readback_type: Type of fpga readback operation
* 0 -- Configuration Register readback
* 1 -- Configuration Data readback
* @value: Value to read
*
* This function provides access to the xilfpga library to read
* the PL configuration.
*
* Return: Returns status, either success or error+reason.
*/
enum pm_ret_status pm_fpga_read(uint32_t reg_numframes,
uint32_t address_low,
uint32_t address_high,
uint32_t readback_type,
uint32_t *value)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMU */
PM_PACK_PAYLOAD5(payload, PM_FPGA_READ, reg_numframes, address_low,
address_high, readback_type);
return pm_ipi_send_sync(primary_proc, payload, value, 1);
}
...@@ -166,4 +166,11 @@ enum pm_ret_status pm_secure_image(uint32_t address_low, ...@@ -166,4 +166,11 @@ enum pm_ret_status pm_secure_image(uint32_t address_low,
uint32_t key_lo, uint32_t key_lo,
uint32_t key_hi, uint32_t key_hi,
uint32_t *value); uint32_t *value);
enum pm_ret_status pm_fpga_read(uint32_t reg_numframes,
uint32_t address_low,
uint32_t address_high,
uint32_t readback_type,
uint32_t *value);
#endif /* _PM_API_SYS_H_ */ #endif /* _PM_API_SYS_H_ */
...@@ -89,6 +89,8 @@ enum pm_api_id { ...@@ -89,6 +89,8 @@ enum pm_api_id {
PM_CLOCK_SETPARENT, PM_CLOCK_SETPARENT,
PM_CLOCK_GETPARENT, PM_CLOCK_GETPARENT,
PM_SECURE_IMAGE, PM_SECURE_IMAGE,
/* FPGA PL Readback */
PM_FPGA_READ,
PM_API_MAX PM_API_MAX
}; };
......
...@@ -546,6 +546,15 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -546,6 +546,15 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
result[1]); result[1]);
} }
case PM_FPGA_READ:
{
uint32_t value;
ret = pm_fpga_read(pm_arg[0], pm_arg[1], pm_arg[2], pm_arg[3],
&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