Commit acfe3be2 authored by Madhukar Pappireddy's avatar Madhukar Pappireddy Committed by TrustedFirmware Code Review
Browse files

Merge changes I976aef15,I11ae679f into integration

* changes:
  feat(plat/xilinx/zynqmp): add support for runtime feature config
  feat(plat/xilinx/zynqmp): sync IOCTL IDs
parents 3b15e9ad 578f468a
...@@ -677,6 +677,10 @@ enum pm_ret_status pm_api_ioctl(enum pm_node_id nid, ...@@ -677,6 +677,10 @@ enum pm_ret_status pm_api_ioctl(enum pm_node_id nid,
case IOCTL_AFI: case IOCTL_AFI:
ret = pm_ioctl_afi(arg1, arg2); ret = pm_ioctl_afi(arg1, arg2);
break; break;
case IOCTL_SET_FEATURE_CONFIG:
case IOCTL_GET_FEATURE_CONFIG:
ret = pm_feature_config(ioctl_id, arg1, arg2, value);
break;
default: default:
ret = PM_RET_ERROR_NOTSUPPORTED; ret = PM_RET_ERROR_NOTSUPPORTED;
break; break;
......
...@@ -15,28 +15,43 @@ ...@@ -15,28 +15,43 @@
//ioctl id //ioctl id
enum { enum {
IOCTL_GET_RPU_OPER_MODE, IOCTL_GET_RPU_OPER_MODE = 0,
IOCTL_SET_RPU_OPER_MODE, IOCTL_SET_RPU_OPER_MODE = 1,
IOCTL_RPU_BOOT_ADDR_CONFIG, IOCTL_RPU_BOOT_ADDR_CONFIG = 2,
IOCTL_TCM_COMB_CONFIG, IOCTL_TCM_COMB_CONFIG = 3,
IOCTL_SET_TAPDELAY_BYPASS, IOCTL_SET_TAPDELAY_BYPASS = 4,
IOCTL_SET_SGMII_MODE, IOCTL_SET_SGMII_MODE = 5,
IOCTL_SD_DLL_RESET, IOCTL_SD_DLL_RESET = 6,
IOCTL_SET_SD_TAPDELAY, IOCTL_SET_SD_TAPDELAY = 7,
/* Ioctl for clock driver */ /* Ioctl for clock driver */
IOCTL_SET_PLL_FRAC_MODE, IOCTL_SET_PLL_FRAC_MODE = 8,
IOCTL_GET_PLL_FRAC_MODE, IOCTL_GET_PLL_FRAC_MODE = 9,
IOCTL_SET_PLL_FRAC_DATA, IOCTL_SET_PLL_FRAC_DATA = 10,
IOCTL_GET_PLL_FRAC_DATA, IOCTL_GET_PLL_FRAC_DATA = 11,
IOCTL_WRITE_GGS, IOCTL_WRITE_GGS = 12,
IOCTL_READ_GGS, IOCTL_READ_GGS = 13,
IOCTL_WRITE_PGGS, IOCTL_WRITE_PGGS = 14,
IOCTL_READ_PGGS, IOCTL_READ_PGGS = 15,
/* IOCTL for ULPI reset */ /* IOCTL for ULPI reset */
IOCTL_ULPI_RESET, IOCTL_ULPI_RESET = 16,
/* Set healthy bit value */ /* Set healthy bit value */
IOCTL_SET_BOOT_HEALTH_STATUS, IOCTL_SET_BOOT_HEALTH_STATUS = 17,
IOCTL_AFI, IOCTL_AFI = 18,
/* Probe counter read/write */
IOCTL_PROBE_COUNTER_READ = 19,
IOCTL_PROBE_COUNTER_WRITE = 20,
IOCTL_OSPI_MUX_SELECT = 21,
/* IOCTL for USB power request */
IOCTL_USB_SET_STATE = 22,
/* IOCTL to get last reset reason */
IOCTL_GET_LAST_RESET_REASON = 23,
/* AI engine NPI ISR clear */
IOCTL_AIE_ISR_CLEAR = 24,
/* Register SGI to ATF */
IOCTL_REGISTER_SGI = 25,
/* Runtime feature configuration */
IOCTL_SET_FEATURE_CONFIG = 26,
IOCTL_GET_FEATURE_CONFIG = 27,
}; };
//RPU operation mode //RPU operation mode
......
...@@ -1648,3 +1648,36 @@ enum pm_ret_status em_send_errors(unsigned int *value) ...@@ -1648,3 +1648,36 @@ enum pm_ret_status em_send_errors(unsigned int *value)
EM_PACK_PAYLOAD1(payload, EM_SEND_ERRORS); EM_PACK_PAYLOAD1(payload, EM_SEND_ERRORS);
return pm_ipi_send_sync(primary_proc, payload, value, 1); return pm_ipi_send_sync(primary_proc, payload, value, 1);
} }
/**
* pm_feature_config() - feature configuration at runtime
*
* This function is used to send IPI request to PMUFW to configure feature
* at runtime. The feature can be enable or disable as well as the feature
* can be configure at runtime using an IOCTL call.
*
* @ioctl_id The ioctl id for the feature configuration
* @config_id The config id of the feature to be configured
* @value The value to be configured
* @response Return to reference pointer
*
* @return Returns 0 on success or error value on failure
*/
enum pm_ret_status pm_feature_config(unsigned int ioctl_id,
unsigned int config_id,
unsigned int value,
unsigned int *response)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMU */
PM_PACK_PAYLOAD5(payload, PM_IOCTL, 0, ioctl_id, config_id, value);
if (ioctl_id == IOCTL_GET_FEATURE_CONFIG) {
return pm_ipi_send_sync(primary_proc, payload, response, 1);
} else if (ioctl_id == IOCTL_SET_FEATURE_CONFIG) {
return pm_ipi_send_sync(primary_proc, payload, NULL, 0);
} else {
return PM_RET_ERROR_ARGS;
}
}
...@@ -202,4 +202,9 @@ enum pm_ret_status em_set_action(unsigned int *value); ...@@ -202,4 +202,9 @@ enum pm_ret_status em_set_action(unsigned int *value);
enum pm_ret_status em_remove_action(unsigned int *value); enum pm_ret_status em_remove_action(unsigned int *value);
enum pm_ret_status em_send_errors(unsigned int *value); enum pm_ret_status em_send_errors(unsigned int *value);
enum pm_ret_status pm_feature_config(unsigned int ioctl_id,
unsigned int config_id,
unsigned int value,
unsigned int *response);
#endif /* PM_API_SYS_H */ #endif /* PM_API_SYS_H */
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