aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/setup.c
diff options
context:
space:
mode:
authorRobin Getz <rgetz@blackfin.uclinux.org>2008-10-10 06:21:45 -0400
committerBryan Wu <cooloney@kernel.org>2008-10-10 06:21:45 -0400
commite482cad241c0b7108cbc94959307a73d19ba17d5 (patch)
tree7cde7e1af828d74d55ec059d1955c5129b89a892 /arch/blackfin/kernel/setup.c
parent6d0b8c993dc0a26fe7a9ee8b839d1964bd0debd4 (diff)
Blackfin arch: print out error/warning if you are running on the incorrect CPU type
Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/setup.c')
-rw-r--r--arch/blackfin/kernel/setup.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 4267523912bd..74370f3707b9 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -813,17 +813,23 @@ void __init setup_arch(char **cmdline_p)
813 printk(KERN_INFO "Compiled for ADSP-%s Rev none\n", CPU); 813 printk(KERN_INFO "Compiled for ADSP-%s Rev none\n", CPU);
814 else 814 else
815 printk(KERN_INFO "Compiled for ADSP-%s Rev 0.%d\n", CPU, bfin_compiled_revid()); 815 printk(KERN_INFO "Compiled for ADSP-%s Rev 0.%d\n", CPU, bfin_compiled_revid());
816 if (bfin_revid() != bfin_compiled_revid()) { 816
817 if (bfin_compiled_revid() == -1) 817 if (unlikely(CPUID != bfin_cpuid()))
818 printk(KERN_ERR "Warning: Compiled for Rev none, but running on Rev %d\n", 818 printk(KERN_ERR "ERROR: Not running on ADSP-%s: unknown CPUID 0x%04x Rev 0.%d\n",
819 bfin_revid()); 819 CPU, bfin_cpuid(), bfin_revid());
820 else if (bfin_compiled_revid() != 0xffff) 820 else {
821 printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", 821 if (bfin_revid() != bfin_compiled_revid()) {
822 bfin_compiled_revid(), bfin_revid()); 822 if (bfin_compiled_revid() == -1)
823 printk(KERN_ERR "Warning: Compiled for Rev none, but running on Rev %d\n",
824 bfin_revid());
825 else if (bfin_compiled_revid() != 0xffff)
826 printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n",
827 bfin_compiled_revid(), bfin_revid());
828 }
829 if (bfin_revid() <= CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX)
830 printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n",
831 CPU, bfin_revid());
823 } 832 }
824 if (bfin_revid() <= CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX)
825 printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n",
826 CPU, bfin_revid());
827 833
828 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); 834 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
829 835
@@ -997,13 +1003,18 @@ static int show_cpuinfo(struct seq_file *m, void *v)
997 } 1003 }
998 1004
999 seq_printf(m, "processor\t: %d\n" 1005 seq_printf(m, "processor\t: %d\n"
1000 "vendor_id\t: %s\n" 1006 "vendor_id\t: %s\n",
1001 "cpu family\t: 0x%x\n"
1002 "model name\t: ADSP-%s %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n"
1003 "stepping\t: %d\n",
1004 *(unsigned int *)v, 1007 *(unsigned int *)v,
1005 vendor, 1008 vendor);
1006 (bfin_read_CHIPID() & CHIPID_FAMILY), 1009
1010 if (CPUID == bfin_cpuid())
1011 seq_printf(m, "cpu family\t: 0x%04x\n", CPUID);
1012 else
1013 seq_printf(m, "cpu family\t: Compiled for:0x%04x, running on:0x%04x\n",
1014 CPUID, bfin_cpuid());
1015
1016 seq_printf(m, "model name\t: ADSP-%s %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n"
1017 "stepping\t: %d\n",
1007 cpu, cclk/1000000, sclk/1000000, 1018 cpu, cclk/1000000, sclk/1000000,
1008#ifdef CONFIG_MPU 1019#ifdef CONFIG_MPU
1009 "mpu on", 1020 "mpu on",