Commit 3d512f0b authored by Siva Durga Prasad Paladugu's avatar Siva Durga Prasad Paladugu
Browse files

zynqmp: pm: Reverse logic for detecting that the PMU firmware is loaded



Use positive logic (pm_up instead of pm_down) to check whether PMU
services are available. This change also puts the variable into the
BSS section rather than the Data section as the variable is now
initialized to 0 rather than 1.
Signed-off-by: default avatarWill Wong <WILLW@xilinx.com>
Signed-off-by: default avatarStefan Krsmanovic <stefan.krsmanovic@aggios.com>
Signed-off-by: default avatarSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
parent 756e7f28
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#define PM_SET_SUSPEND_MODE 0xa02 #define PM_SET_SUSPEND_MODE 0xa02
#define PM_GET_TRUSTZONE_VERSION 0xa03 #define PM_GET_TRUSTZONE_VERSION 0xa03
/* 0 - UP, !0 - DOWN */ /* !0 - UP, 0 - DOWN */
static int32_t pm_down = !0; static int32_t pm_up = 0;
/** /**
* pm_context - Structure which contains data for power management * pm_context - Structure which contains data for power management
...@@ -67,7 +67,7 @@ int pm_setup(void) ...@@ -67,7 +67,7 @@ int pm_setup(void)
ret = status; ret = status;
} }
pm_down = status; pm_up = !status;
return ret; return ret;
} }
...@@ -96,7 +96,7 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -96,7 +96,7 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
uint32_t pm_arg[4]; uint32_t pm_arg[4];
/* Handle case where PM wasn't initialized properly */ /* Handle case where PM wasn't initialized properly */
if (pm_down) if (!pm_up)
SMC_RET1(handle, SMC_UNK); SMC_RET1(handle, SMC_UNK);
pm_arg[0] = (uint32_t)x1; pm_arg[0] = (uint32_t)x1;
......
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