summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2012-10-08 07:44:10 +0000
committerAndy Fleming <afleming@freescale.com>2012-10-22 14:31:15 -0500
commit2f1712b275af3ed960b92cd1ed9b99d23c4919a5 (patch)
treeae2e4901de910d98c85fd8b9ec71017e6a765206 /arch
parentf77329cfcf65e142ffbe930594c4d411c5d66429 (diff)
downloadu-boot-imx-2f1712b275af3ed960b92cd1ed9b99d23c4919a5.zip
u-boot-imx-2f1712b275af3ed960b92cd1ed9b99d23c4919a5.tar.gz
u-boot-imx-2f1712b275af3ed960b92cd1ed9b99d23c4919a5.tar.bz2
powerpc/mpc85xx: check number of cores
Panic if the number of cores is more than CONFIG_MAX_CPUS because it will surely overflow gd structure. Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/cpu/mpc85xx/cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 26fc84c..40cce1d 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -127,6 +127,11 @@ int checkcpu (void)
printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr);
+ if (nr_cores > CONFIG_MAX_CPUS) {
+ panic("\nUnexpected number of cores: %d, max is %d\n",
+ nr_cores, CONFIG_MAX_CPUS);
+ }
+
get_sys_info(&sysinfo);
puts("Clock Configuration:");