aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
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/mach-imx
parent487b5fa6deb1f02843dbc9a9ac792bb38ef4d52a (diff)
downloadu-boot-20b016a33665f7b3ff875b4b7063180eb955f092.zip
u-boot-20b016a33665f7b3ff875b4b7063180eb955f092.tar.gz
u-boot-20b016a33665f7b3ff875b4b7063180eb955f092.tar.bz2
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/mach-imx')
-rw-r--r--arch/arm/mach-imx/mx6/mp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/mx6/mp.c b/arch/arm/mach-imx/mx6/mp.c
index c3806dc..eda168d 100644
--- a/arch/arm/mach-imx/mx6/mp.c
+++ b/arch/arm/mach-imx/mx6/mp.c
@@ -29,20 +29,20 @@ static uint32_t cpu_ctrl_mask[MAX_CPUS] = {
SRC_SCR_CORE_3_ENABLE_MASK
};
-int cpu_reset(int nr)
+int cpu_reset(u32 nr)
{
/* Software reset of the CPU N */
src->scr |= cpu_reset_mask[nr];
return 0;
}
-int cpu_status(int nr)
+int cpu_status(u32 nr)
{
printf("core %d => %d\n", nr, !!(src->scr & cpu_ctrl_mask[nr]));
return 0;
}
-int cpu_release(int nr, int argc, char *const argv[])
+int cpu_release(u32 nr, int argc, char *const argv[])
{
uint32_t boot_addr;
@@ -78,7 +78,7 @@ int is_core_valid(unsigned int core)
return 1;
}
-int cpu_disable(int nr)
+int cpu_disable(u32 nr)
{
/* Disable the CPU N */
src->scr &= ~cpu_ctrl_mask[nr];