All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Alchemy: remove superfluous cpu-model constants.
@ 2009-01-13 13:53 Manuel Lauss
  2009-01-13 14:35 ` [RFC PATCH] Alchemy: detect Au1300 Manuel Lauss
  0 siblings, 1 reply; 4+ messages in thread
From: Manuel Lauss @ 2009-01-13 13:53 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Linux-MIPS

All currently existing Alchemy models are identical in terms
of cpu core and cache size/organization.  The parts in the mips
kernel which need to know the exact CPU revision extract it from
the c0_prid register already, and there are no other in-tree
users.

This patch removes the various CPU_AU1000 model constants in
favor of a single CPU_ALCHEMY constant.

Should a new variant with slightly different "company options"
or "processor revision" bits in c0_prid appear, it will be
supported immediately (minus an exact model string in cpuinfo).

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
---
 arch/mips/include/asm/cpu.h  |    3 +--
 arch/mips/kernel/cpu-probe.c |   21 ++++-----------------
 arch/mips/mm/c-r4k.c         |   17 +++++------------
 arch/mips/mm/tlbex.c         |    8 +-------
 4 files changed, 11 insertions(+), 38 deletions(-)

diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index c018727..3bdc0e3 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -209,8 +209,7 @@ enum cpu_type_enum {
 	 * MIPS32 class processors
 	 */
 	CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K,
-	CPU_AU1000, CPU_AU1100, CPU_AU1200, CPU_AU1210, CPU_AU1250, CPU_AU1500,
-	CPU_AU1550, CPU_PR4450, CPU_BCM3302, CPU_BCM4710,
+	CPU_ALCHEMY, CPU_PR4450, CPU_BCM3302, CPU_BCM4710,
 
 	/*
 	 * MIPS64 class processors
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index a7162a4..0f33858 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -182,13 +182,7 @@ void __init check_wait(void)
 	case CPU_TX49XX:
 		cpu_wait = r4k_wait_irqoff;
 		break;
-	case CPU_AU1000:
-	case CPU_AU1100:
-	case CPU_AU1500:
-	case CPU_AU1550:
-	case CPU_AU1200:
-	case CPU_AU1210:
-	case CPU_AU1250:
+	case CPU_ALCHEMY:
 		cpu_wait = au1k_wait;
 		break;
 	case CPU_20KC:
@@ -782,37 +776,30 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
 	switch (c->processor_id & 0xff00) {
 	case PRID_IMP_AU1_REV1:
 	case PRID_IMP_AU1_REV2:
+		c->cputype = CPU_ALCHEMY;
 		switch ((c->processor_id >> 24) & 0xff) {
 		case 0:
-			c->cputype = CPU_AU1000;
 			__cpu_name[cpu] = "Au1000";
 			break;
 		case 1:
-			c->cputype = CPU_AU1500;
 			__cpu_name[cpu] = "Au1500";
 			break;
 		case 2:
-			c->cputype = CPU_AU1100;
 			__cpu_name[cpu] = "Au1100";
 			break;
 		case 3:
-			c->cputype = CPU_AU1550;
 			__cpu_name[cpu] = "Au1550";
 			break;
 		case 4:
-			c->cputype = CPU_AU1200;
 			__cpu_name[cpu] = "Au1200";
-			if ((c->processor_id & 0xff) == 2) {
-				c->cputype = CPU_AU1250;
+			if ((c->processor_id & 0xff) == 2)
 				__cpu_name[cpu] = "Au1250";
-			}
 			break;
 		case 5:
-			c->cputype = CPU_AU1210;
 			__cpu_name[cpu] = "Au1210";
 			break;
 		default:
-			panic("Unknown Au Core!");
+			__cpu_name[cpu] = "Au1xxx";
 			break;
 		}
 		break;
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 6e99665..2f9cded 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -1006,13 +1006,7 @@ static void __cpuinit probe_pcache(void)
 		c->icache.flags |= MIPS_CACHE_VTAG;
 		break;
 
-	case CPU_AU1000:
-	case CPU_AU1500:
-	case CPU_AU1100:
-	case CPU_AU1550:
-	case CPU_AU1200:
-	case CPU_AU1210:
-	case CPU_AU1250:
+	case CPU_ALCHEMY:
 		c->icache.flags |= MIPS_CACHE_IC_F_DC;
 		break;
 	}
@@ -1224,7 +1218,7 @@ void au1x00_fixup_config_od(void)
 	/*
 	 * Au1100 errata actually keeps silence about this bit, so we set it
 	 * just in case for those revisions that require it to be set according
-	 * to arch/mips/au1000/common/cputable.c
+	 * to the (now gone) cpu table.
 	 */
 	case 0x02030200: /* Au1100 AB */
 	case 0x02030201: /* Au1100 BA */
@@ -1294,11 +1288,10 @@ static void __cpuinit coherency_setup(void)
 		break;
 	/*
 	 * We need to catch the early Alchemy SOCs with
-	 * the write-only co_config.od bit and set it back to one...
+	 * the write-only co_config.od bit and set it back to one on:
+	 * Au1000 rev DA, HA, HB;  Au1100 AB, BA, BC, Au1500 AB
 	 */
-	case CPU_AU1000: /* rev. DA, HA, HB */
-	case CPU_AU1100: /* rev. AB, BA, BC ?? */
-	case CPU_AU1500: /* rev. AB */
+	case CPU_ALCHEMY:
 		au1x00_fixup_config_od();
 		break;
 
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 4294203..00ac573 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -292,13 +292,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
 	case CPU_R4300:
 	case CPU_5KC:
 	case CPU_TX49XX:
-	case CPU_AU1000:
-	case CPU_AU1100:
-	case CPU_AU1500:
-	case CPU_AU1550:
-	case CPU_AU1200:
-	case CPU_AU1210:
-	case CPU_AU1250:
+	case CPU_ALCHEMY:
 	case CPU_PR4450:
 		uasm_i_nop(p);
 		tlbw(p);
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [RFC PATCH] Alchemy: detect Au1300
  2009-01-13 13:53 [PATCH] Alchemy: remove superfluous cpu-model constants Manuel Lauss
@ 2009-01-13 14:35 ` Manuel Lauss
  2009-01-13 14:42   ` Kevin Hickey
  0 siblings, 1 reply; 4+ messages in thread
From: Manuel Lauss @ 2009-01-13 14:35 UTC (permalink / raw)
  To: Linux-MIPS

Add code to detect Au1300 and its variants.  c0_prid uses a layout
different from previous Alchemy chips and company ID switched to RMI.

Core and cache-wise it is compatible with previous Alchemy chips.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
---
This patch depends on "Alchemy: remove superfluous cpu-model constants."
Information was pieced together from the Au1300 databook, and obviously
only compile tested. (Also, the irq controller looks completely different
so this patch alone is insufficient to get linux working on it).

 arch/mips/include/asm/cpu.h  |    1 +
 arch/mips/kernel/cpu-probe.c |   39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 3bdc0e3..8dd3038 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -33,6 +33,7 @@
 #define PRID_COMP_TOSHIBA	0x070000
 #define PRID_COMP_LSI		0x080000
 #define PRID_COMP_LEXRA		0x0b0000
+#define PRID_COMP_RMI		0x0c0000
 #define PRID_COMP_CAVIUM	0x0d0000
 
 
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 0f33858..9499610 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -19,6 +19,7 @@
 #include <asm/bugs.h>
 #include <asm/cpu.h>
 #include <asm/fpu.h>
+#include <asm/io.h>
 #include <asm/mipsregs.h>
 #include <asm/system.h>
 #include <asm/watch.h>
@@ -886,6 +887,41 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
 	}
 }
 
+static inline void cpu_probe_rmi(struct cpuinfo_mips *c, unsigned int cpu)
+{
+	decode_configs(c);
+	switch (c->processor_id & 0xff000000) {
+	case 0x80000000:		/* Au1300 */
+		c->cputype = CPU_ALCHEMY;
+
+		/* OTP-ROM Config0 register indicates the presence
+		 * of various peripherals.  Combinations of those
+		 * bits are marketed unter different names.
+		 */
+		switch (__raw_readl((void *)0xb0002000)) {
+		case 0x00000000:
+			__cpu_name[cpu] = "Au1380";
+			break;
+		case 0x0000000d:
+			__cpu_name[cpu] = "Au1370";
+			break;
+		case 0x00000010:
+			__cpu_name[cpu] = "Au1350";
+			break;
+		case 0x0000001d:
+			__cpu_name[cpu] = "Au1340";
+			break;
+		default:
+			__cpu_name[cpu] = "Au1300";
+			break;
+		}
+	default:
+		printk(KERN_INFO "Unknown RMI chip!\n");
+		c->cputype = CPU_UNKNOWN;
+		break;
+	}
+}
+
 const char *__cpu_name[NR_CPUS];
 
 __cpuinit void cpu_probe(void)
@@ -920,6 +956,9 @@ __cpuinit void cpu_probe(void)
 	case PRID_COMP_NXP:
 		cpu_probe_nxp(c, cpu);
 		break;
+	case PRID_COMP_RMI:
+		cpu_probe_rmi(c, cpu);
+		break;
 	case PRID_COMP_CAVIUM:
 		cpu_probe_cavium(c, cpu);
 		break;
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] Alchemy: detect Au1300
  2009-01-13 14:35 ` [RFC PATCH] Alchemy: detect Au1300 Manuel Lauss
@ 2009-01-13 14:42   ` Kevin Hickey
  2009-01-13 14:59     ` Manuel Lauss
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Hickey @ 2009-01-13 14:42 UTC (permalink / raw)
  To: Manuel Lauss; +Cc: Linux-MIPS

It might make sense to hold off on this patch for now.  I am going to be
pushing out the first tested Au13xx code shortly.  This detection and
much more are covered.

=Kevin

On Tue, 2009-01-13 at 15:35 +0100, Manuel Lauss wrote:
> Add code to detect Au1300 and its variants.  c0_prid uses a layout
> different from previous Alchemy chips and company ID switched to RMI.
> 
> Core and cache-wise it is compatible with previous Alchemy chips.
> 
> Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
> ---
> This patch depends on "Alchemy: remove superfluous cpu-model constants."
> Information was pieced together from the Au1300 databook, and obviously
> only compile tested. (Also, the irq controller looks completely different
> so this patch alone is insufficient to get linux working on it).

-- 
Kevin Hickey
Alchemy Solutions
RMI Corporation
khickey@rmicorp.com
P:  512.691.8044

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] Alchemy: detect Au1300
  2009-01-13 14:42   ` Kevin Hickey
@ 2009-01-13 14:59     ` Manuel Lauss
  0 siblings, 0 replies; 4+ messages in thread
From: Manuel Lauss @ 2009-01-13 14:59 UTC (permalink / raw)
  To: Kevin Hickey; +Cc: Linux-MIPS

On Tue, Jan 13, 2009 at 08:42:13AM -0600, Kevin Hickey wrote:
> It might make sense to hold off on this patch for now.  I am going to be
> pushing out the first tested Au13xx code shortly.  This detection and
> much more are covered.

Oh, cool, even better!

Thanks!
 
> =Kevin

-- ml.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-13 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-13 13:53 [PATCH] Alchemy: remove superfluous cpu-model constants Manuel Lauss
2009-01-13 14:35 ` [RFC PATCH] Alchemy: detect Au1300 Manuel Lauss
2009-01-13 14:42   ` Kevin Hickey
2009-01-13 14:59     ` Manuel Lauss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.