summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv8/zynqmp
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2018-06-13 08:56:31 +0200
committerTom Rini <trini@konsulko.com>2018-06-19 07:31:45 -0400
commit20b016a33665f7b3ff875b4b7063180eb955f092 (patch)
treee2b5bc68ecd9b0da8cba3122a9ab9f5b6f0129f6 /arch/arm/cpu/armv8/zynqmp
parent487b5fa6deb1f02843dbc9a9ac792bb38ef4d52a (diff)
common: Fix cpu nr type which is always unsigned type
cpu_cmd() is reading cpu number via simple_strtoul() which is always unsigned type. Platform code implementations are not expecting that nr can be negative and there is not checking in the code for that too. This patch is using u32 type for cpu number to make sure that platform code get proper value range. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/arm/cpu/armv8/zynqmp')
-rw-r--r--arch/arm/cpu/armv8/zynqmp/mp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/cpu/armv8/zynqmp/mp.c b/arch/arm/cpu/armv8/zynqmp/mp.c
index 7e270a7dc23..2a71870ae7b 100644
--- a/arch/arm/cpu/armv8/zynqmp/mp.c
+++ b/arch/arm/cpu/armv8/zynqmp/mp.c
@@ -45,7 +45,7 @@ int is_core_valid(unsigned int core)
return 0;
}
-int cpu_reset(int nr)
+int cpu_reset(u32 nr)
{
puts("Feature is not implemented.\n");
return 0;
@@ -131,7 +131,7 @@ static void enable_clock_r5(void)
udelay(0x500);
}
-int cpu_disable(int nr)
+int cpu_disable(u32 nr)
{
if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) {
u32 val = readl(&crfapb_base->rst_fpd_apu);
@@ -144,7 +144,7 @@ int cpu_disable(int nr)
return 0;
}
-int cpu_status(int nr)
+int cpu_status(u32 nr)
{
if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) {
u32 addr_low = readl(((u8 *)&apu_base->rvbar_addr0_l) + nr * 8);
@@ -220,7 +220,7 @@ void initialize_tcm(bool mode)
}
}
-int cpu_release(int nr, int argc, char * const argv[])
+int cpu_release(u32 nr, int argc, char * const argv[])
{
if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) {
u64 boot_addr = simple_strtoull(argv[0], NULL, 16);