Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e482cad2 authored by Robin Getz's avatar Robin Getz Committed by Bryan Wu
Browse files

Blackfin arch: print out error/warning if you are running on the incorrect CPU type

parent 6d0b8c99
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -134,6 +134,12 @@ static inline uint32_t __pure bfin_revid(void)
	return revid;
}

static inline uint16_t __pure bfin_cpuid(void)
{
	return (bfin_read_CHIPID() & CHIPID_FAMILY) >> 12;

}

static inline uint32_t __pure bfin_compiled_revid(void)
{
#if defined(CONFIG_BF_REV_0_0)
+27 −16
Original line number Diff line number Diff line
@@ -813,6 +813,11 @@ void __init setup_arch(char **cmdline_p)
		printk(KERN_INFO "Compiled for ADSP-%s Rev none\n", CPU);
	else
		printk(KERN_INFO "Compiled for ADSP-%s Rev 0.%d\n", CPU, bfin_compiled_revid());

	if (unlikely(CPUID != bfin_cpuid()))
		printk(KERN_ERR "ERROR: Not running on ADSP-%s: unknown CPUID 0x%04x Rev 0.%d\n",
			CPU, bfin_cpuid(), bfin_revid());
	else {
		if (bfin_revid() != bfin_compiled_revid()) {
			if (bfin_compiled_revid() == -1)
				printk(KERN_ERR "Warning: Compiled for Rev none, but running on Rev %d\n",
@@ -824,6 +829,7 @@ void __init setup_arch(char **cmdline_p)
		if (bfin_revid() <= CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX)
			printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n",
			       CPU, bfin_revid());
	}

	printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");

@@ -997,13 +1003,18 @@ static int show_cpuinfo(struct seq_file *m, void *v)
	}

	seq_printf(m, "processor\t: %d\n"
		"vendor_id\t: %s\n"
		"cpu family\t: 0x%x\n"
		"model name\t: ADSP-%s %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n"
		"stepping\t: %d\n",
		"vendor_id\t: %s\n",
		*(unsigned int *)v,
		vendor,
		(bfin_read_CHIPID() & CHIPID_FAMILY),
		vendor);

	if (CPUID == bfin_cpuid())
		seq_printf(m, "cpu family\t: 0x%04x\n", CPUID);
	else
		seq_printf(m, "cpu family\t: Compiled for:0x%04x, running on:0x%04x\n",
			CPUID, bfin_cpuid());

	seq_printf(m, "model name\t: ADSP-%s %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n"
		"stepping\t: %d\n",
		cpu, cclk/1000000, sclk/1000000,
#ifdef CONFIG_MPU
		"mpu on",
+17 −2
Original line number Diff line number Diff line
@@ -110,16 +110,31 @@

#ifdef CONFIG_BF527
#define CPU "BF527"
#define CPUID 0x27e4
#endif
#ifdef CONFIG_BF526
#define CPU "BF526"
#define CPUID 0x27e4
#endif
#ifdef CONFIG_BF525
#define CPU "BF525"
#define CPUID 0x27e4
#endif
#ifdef CONFIG_BF524
#define CPU "BF524"
#define CPUID 0x27e4
#endif
#ifdef CONFIG_BF523
#define CPU "BF523"
#define CPUID 0x27e4
#endif
#ifdef CONFIG_BF522
#define CPU "BF522"
#define CPUID 0x27e4
#endif

#ifndef CPU
#define	CPU "UNKNOWN"
#define CPUID 0x0
#error Unknown CPU type - This kernel doesn't seem to be configured properly
#endif

#endif				/* __MACH_BF527_H__  */
+5 −5
Original line number Diff line number Diff line
@@ -141,19 +141,19 @@

#ifdef CONFIG_BF533
#define CPU "BF533"
#define CPUID 0x027a5000
#define CPUID 0x27a5
#endif
#ifdef CONFIG_BF532
#define CPU "BF532"
#define CPUID 0x0275A000
#define CPUID 0x275A
#endif
#ifdef CONFIG_BF531
#define CPU "BF531"
#define CPUID 0x027a5000
#define CPUID 0x27a5
#endif

#ifndef CPU
#define	CPU "UNKNOWN"
#define CPUID 0x0
#error Unknown CPU type - This kernel doesn't seem to be configured properly
#endif

#endif				/* __MACH_BF533_H__  */
+5 −5
Original line number Diff line number Diff line
@@ -121,19 +121,19 @@

#ifdef CONFIG_BF537
#define CPU "BF537"
#define CPUID 0x027c8000
#define CPUID 0x27c8
#endif
#ifdef CONFIG_BF536
#define CPU "BF536"
#define CPUID 0x027c8000
#define CPUID 0x27c8
#endif
#ifdef CONFIG_BF534
#define CPU "BF534"
#define CPUID 0x027c6000
#define CPUID 0x27c6
#endif

#ifndef CPU
#define	CPU "UNKNOWN"
#define CPUID 0x0
#error Unknown CPU type - This kernel doesn't seem to be configured properly
#endif

#endif				/* __MACH_BF537_H__  */
Loading