#define XPM_DEVID_ACPU_0 APU_DEVID(XPM_NODEIDX_DEV_ACPU_0)
#define XPM_DEVID_ACPU_1 APU_DEVID(XPM_NODEIDX_DEV_ACPU_1)
-#define PERIPH_DEVID(IDX) NODEID(XPM_NODECLASS_DEVICE, \
- XPM_NODESUBCL_DEV_PERIPH, \
- XPM_NODETYPE_DEV_PERIPH, (IDX))
+#define PERIPH_DEVID(IDX) NODEID((uint32_t)XPM_NODECLASS_DEVICE, \
+ (uint32_t)XPM_NODESUBCL_DEV_PERIPH, \
+ (uint32_t)XPM_NODETYPE_DEV_PERIPH, (IDX))
#define PM_GET_CALLBACK_DATA 0xa01U
#define PM_GET_TRUSTZONE_VERSION 0xa03U
#define NODE_SUBCLASS_SHIFT 20U
#define NODE_TYPE_SHIFT 14U
#define NODE_INDEX_SHIFT 0U
-#define NODE_CLASS_MASK_BITS 0x3F
-#define NODE_SUBCLASS_MASK_BITS 0x3F
-#define NODE_TYPE_MASK_BITS 0x3F
-#define NODE_INDEX_MASK_BITS 0x3FFF
+#define NODE_CLASS_MASK_BITS GENMASK_32(5, 0)
+#define NODE_SUBCLASS_MASK_BITS GENMASK_32(5, 0)
+#define NODE_TYPE_MASK_BITS GENMASK_32(5, 0)
+#define NODE_INDEX_MASK_BITS GENMASK_32(13, 0)
#define NODE_CLASS_MASK (NODE_CLASS_MASK_BITS << NODE_CLASS_SHIFT)
#define NODE_SUBCLASS_MASK (NODE_SUBCLASS_MASK_BITS << NODE_SUBCLASS_SHIFT)
#define NODE_TYPE_MASK (NODE_TYPE_MASK_BITS << NODE_TYPE_SHIFT)
{
uint32_t reg_num, device_id;
uint8_t pm_wakeup_nodes_set[XPM_NODEIDX_DEV_MAX] = {0U};
- uintptr_t isenabler1 = PLAT_GICD_BASE_VALUE + GICD_ISENABLER + 4U;
+ uint32_t isenabler1 = PLAT_GICD_BASE_VALUE + GICD_ISENABLER + 4U;
zeromem(&pm_wakeup_nodes_set, (u_register_t)sizeof(pm_wakeup_nodes_set));
uint32_t idx, irq, lowest_set = reg & (-reg);
enum pm_ret_status ret;
- idx = __builtin_ctz(lowest_set);
+ idx = (uint32_t)__builtin_ctz(lowest_set);
irq = base_irq + idx;
if (irq > IRQ_MAX) {
if (node_idx > XPM_NODEIDX_DEV_MIN) {
if (pm_wakeup_nodes_set[node_idx] == 0U) {
/* Get device ID from node index */
- device_id = PERIPH_DEVID(node_idx);
+ device_id = PERIPH_DEVID((uint32_t)node_idx);
ret = pm_set_wakeup_source(node_id,
device_id, 1U,
SECURE_FLAG);
PM_PACK_PAYLOAD5(payload, LIBPM_MODULE_ID, flag, PM_QUERY_DATA, qid,
arg1, arg2, arg3);
- ret = pm_feature_check(PM_QUERY_DATA, &version[0], flag);
+ ret = pm_feature_check((uint32_t)PM_QUERY_DATA, &version[0], flag);
if (ret == PM_RET_SUCCESS) {
fw_api_version = version[0] & 0xFFFFU;
if ((fw_api_version == 2U) &&
ret = pm_pll_get_mode(arg1, value, flag);
break;
case IOCTL_SET_PLL_FRAC_DATA:
- ret = pm_pll_set_param(arg1, PM_PLL_PARAM_DATA, arg2, flag);
+ ret = pm_pll_set_param(arg1, (uint32_t)PM_PLL_PARAM_DATA, arg2, flag);
break;
case IOCTL_GET_PLL_FRAC_DATA:
- ret = pm_pll_get_param(arg1, PM_PLL_PARAM_DATA, value, flag);
+ ret = pm_pll_get_param(arg1, (uint32_t)PM_PLL_PARAM_DATA, value, flag);
break;
case IOCTL_SET_SGI:
/* Get the sgi number */
switch (api_id) {
- case PM_IOCTL:
+ case (uint32_t)PM_IOCTL:
{
uint32_t value = 0U;
SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32U);
}
- case PM_QUERY_DATA:
+ case (uint32_t)PM_QUERY_DATA:
{
uint32_t data[PAYLOAD_ARG_CNT] = { 0 };
(uint64_t)data[1] | ((uint64_t)data[2] << 32U));
}
- case PM_FEATURE_CHECK:
+ case (uint32_t)PM_FEATURE_CHECK:
{
uint32_t result[PAYLOAD_ARG_CNT] = {0U};
switch (api_id) {
- case PM_SELF_SUSPEND:
+ case (uint32_t)PM_SELF_SUSPEND:
ret = pm_self_suspend(pm_arg[0], pm_arg[1], pm_arg[2],
pm_arg[3], security_flag);
SMC_RET1(handle, (u_register_t)ret);
- case PM_FORCE_POWERDOWN:
+ case (uint32_t)PM_FORCE_POWERDOWN:
ret = pm_force_powerdown(pm_arg[0], pm_arg[1], security_flag);
SMC_RET1(handle, (u_register_t)ret);
- case PM_REQ_SUSPEND:
+ case (uint32_t)PM_REQ_SUSPEND:
ret = pm_req_suspend(pm_arg[0], pm_arg[1], pm_arg[2],
pm_arg[3], security_flag);
SMC_RET1(handle, (u_register_t)ret);
- case PM_ABORT_SUSPEND:
+ case (uint32_t)PM_ABORT_SUSPEND:
ret = pm_abort_suspend(pm_arg[0], security_flag);
SMC_RET1(handle, (u_register_t)ret);
- case PM_SYSTEM_SHUTDOWN:
+ case (uint32_t)PM_SYSTEM_SHUTDOWN:
ret = pm_system_shutdown(pm_arg[0], pm_arg[1], security_flag);
SMC_RET1(handle, (u_register_t)ret);
* receive only 4 words from TF-A. So, this needs to be handled separately
* than other eemi calls.
*/
- if (api_id == PM_QUERY_DATA) {
+ if (api_id == (uint32_t)PM_QUERY_DATA) {
if ((pm_arg[0] == XPM_QID_CLOCK_GET_NAME ||
pm_arg[0] == XPM_QID_PINCTRL_GET_FUNCTION_NAME) &&
ret == PM_RET_SUCCESS) {