Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH][MIPS] mips_machtype define as one group
@ 2008-07-11 13:57 Yoichi Yuasa
  2008-07-11 14:32 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 9+ messages in thread
From: Yoichi Yuasa @ 2008-07-11 13:57 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: yoichi_yuasa, linux-mips

mips_machtype define as one group.

mips_machtype are defined for each machines group.
But firmware uses two or more groups. 
They should be defined as one group.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/dec/prom/identify.c linux/arch/mips/dec/prom/identify.c
--- linux-orig/arch/mips/dec/prom/identify.c	2008-06-08 00:10:22.951942195 +0900
+++ linux/arch/mips/dec/prom/identify.c	2008-06-07 22:16:54.037641315 +0900
@@ -27,7 +27,7 @@
 #include "dectypes.h"
 
 static const char *dec_system_strings[] = {
-	[MACH_DSUNKNOWN]	"unknown DECstation",
+	[MACH_UNKNOWN]		"unknown DECstation",
 	[MACH_DS23100]		"DECstation 2100/3100",
 	[MACH_DS5100]		"DECsystem 5100",
 	[MACH_DS5000_200]	"DECstation 5000/200",
@@ -174,11 +174,10 @@ void __init prom_identify_arch(u32 magic
 		mips_machtype = MACH_DS5500;
 		break;
 	default:
-		mips_machtype = MACH_DSUNKNOWN;
 		break;
 	}
 
-	if (mips_machtype == MACH_DSUNKNOWN)
+	if (mips_machtype == MACH_UNKNOWN)
 		printk("This is an %s, id is %x\n",
 		       dec_system_strings[mips_machtype], dec_systype);
 	else
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/dec/setup.c linux/arch/mips/dec/setup.c
--- linux-orig/arch/mips/dec/setup.c	2008-06-08 00:10:22.959942648 +0900
+++ linux/arch/mips/dec/setup.c	2008-06-07 22:16:54.037641315 +0900
@@ -142,6 +142,9 @@ static void __init dec_be_init(void)
 		busirq.handler = dec_ecc_be_interrupt;
 		dec_ecc_be_init();
 		break;
+	default:
+		panic("Don't know how to set this up!");
+		break;
 	}
 }
 
@@ -737,6 +740,9 @@ void __init arch_init_irq(void)
 	case MACH_DS5500:	/* DS5500 MIPSfair-2 */
 		panic("Don't know how to set this up!");
 		break;
+	default:
+		panic("Don't know how to set this up!");
+		break;
 	}
 
 	/* Free the FPU interrupt if the exception is present. */
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/emma2rh/common/prom.c linux/arch/mips/emma2rh/common/prom.c
--- linux-orig/arch/mips/emma2rh/common/prom.c	2008-06-08 00:10:22.963942877 +0900
+++ linux/arch/mips/emma2rh/common/prom.c	2008-06-07 22:16:54.037641315 +0900
@@ -32,16 +32,6 @@
 #include <asm/emma2rh/emma2rh.h>
 #include <asm/debug.h>
 
-const char *get_system_type(void)
-{
-	switch (mips_machtype) {
-	case MACH_NEC_MARKEINS:
-		return "NEC EMMA2RH Mark-eins";
-	default:
-		return "Unknown NEC board";
-	}
-}
-
 /* [jsun@junsun.net] PMON passes arguments in C main() style */
 void __init prom_init(void)
 {
@@ -63,7 +53,6 @@ void __init prom_init(void)
 	}
 
 #if defined(CONFIG_MARKEINS)
-	mips_machtype = MACH_NEC_MARKEINS;
 	add_memory_region(0, EMMA2RH_RAM_SIZE, BOOT_MEM_RAM);
 #endif
 
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/emma2rh/markeins/setup.c linux/arch/mips/emma2rh/markeins/setup.c
--- linux-orig/arch/mips/emma2rh/markeins/setup.c	2008-06-08 00:10:22.971943334 +0900
+++ linux/arch/mips/emma2rh/markeins/setup.c	2008-06-07 22:16:54.061642678 +0900
@@ -149,3 +149,8 @@ static void __init markeins_board_init(v
 
 	markeins_led("MVL E2RH");
 }
+
+const char *get_system_type(void)
+{
+	return "NEC EMMA2RH Mark-eins";
+}
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/setup.c linux/arch/mips/kernel/setup.c
--- linux-orig/arch/mips/kernel/setup.c	2008-06-08 00:10:22.975943558 +0900
+++ linux/arch/mips/kernel/setup.c	2008-06-08 00:12:16.370405542 +0900
@@ -52,7 +52,7 @@ EXPORT_SYMBOL(PCI_DMA_BUS_IS_PHYS);
  *
  * These are initialized so they are in the .data section
  */
-unsigned long mips_machtype __read_mostly = MACH_UNKNOWN;
+enum mips_machtype mips_machtype __read_mostly = MACH_UNKNOWN;
 
 EXPORT_SYMBOL(mips_machtype);
 
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/pmc-sierra/msp71xx/msp_setup.c linux/arch/mips/pmc-sierra/msp71xx/msp_setup.c
--- linux-orig/arch/mips/pmc-sierra/msp71xx/msp_setup.c	2008-06-08 00:10:22.983944018 +0900
+++ linux/arch/mips/pmc-sierra/msp71xx/msp_setup.c	2008-06-07 22:16:54.061642678 +0900
@@ -171,12 +171,9 @@ void __init prom_init(void)
 
 	switch (family)	{
 	case FAMILY_FPGA:
-		if (FPGA_IS_MSP4200(revision)) {
+		if (FPGA_IS_MSP4200(revision))
 			/* Old-style revision ID */
 			mips_machtype = MACH_MSP4200_FPGA;
-		} else {
-			mips_machtype = MACH_MSP_OTHER;
-		}
 		break;
 
 	case FAMILY_MSP4200:
@@ -184,8 +181,6 @@ void __init prom_init(void)
 		mips_machtype  = MACH_MSP4200_EVAL;
 #elif defined(CONFIG_PMC_MSP4200_GW)
 		mips_machtype  = MACH_MSP4200_GW;
-#else
-		mips_machtype = MACH_MSP_OTHER;
 #endif
 		break;
 
@@ -198,8 +193,6 @@ void __init prom_init(void)
 		mips_machtype = MACH_MSP7120_EVAL;
 #elif defined(CONFIG_PMC_MSP7120_GW)
 		mips_machtype = MACH_MSP7120_GW;
-#else
-		mips_machtype = MACH_MSP_OTHER;
 #endif
 		break;
 
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/include/asm-mips/bootinfo.h linux/include/asm-mips/bootinfo.h
--- linux-orig/include/asm-mips/bootinfo.h	2008-06-08 00:10:22.991944475 +0900
+++ linux/include/asm-mips/bootinfo.h	2008-06-08 00:12:34.967465327 +0900
@@ -19,87 +19,75 @@
  * numbers do not necessarily reflect technical relations or similarities
  * between systems.
  */
-
-/*
- * Valid machtype values for group unknown
- */
-#define  MACH_UNKNOWN		0	/* whatever...			*/
-
-/*
- * Valid machtype values for group JAZZ
- */
-#define  MACH_ACER_PICA_61	0	/* Acer PICA-61 (PICA1)		*/
-#define  MACH_MIPS_MAGNUM_4000	1	/* Mips Magnum 4000 "RC4030"	*/
-#define  MACH_OLIVETTI_M700	2	/* Olivetti M700-10 (-15 ??)    */
-
-/*
- * Valid machtype for group DEC
- */
-#define  MACH_DSUNKNOWN		0
-#define  MACH_DS23100		1	/* DECstation 2100 or 3100	*/
-#define  MACH_DS5100		2	/* DECsystem 5100		*/
-#define  MACH_DS5000_200	3	/* DECstation 5000/200		*/
-#define  MACH_DS5000_1XX	4	/* DECstation 5000/120, 125, 133, 150 */
-#define  MACH_DS5000_XX		5	/* DECstation 5000/20, 25, 33, 50 */
-#define  MACH_DS5000_2X0	6	/* DECstation 5000/240, 260	*/
-#define  MACH_DS5400		7	/* DECsystem 5400		*/
-#define  MACH_DS5500		8	/* DECsystem 5500		*/
-#define  MACH_DS5800		9	/* DECsystem 5800		*/
-#define  MACH_DS5900		10	/* DECsystem 5900		*/
-
-/*
- * Valid machtype for group SNI_RM
- */
-#define  MACH_SNI_RM200_PCI	0	/* RM200/RM300/RM400 PCI series */
-
-/*
- * Valid machtype for group SGI
- */
-#define  MACH_SGI_IP22		0	/* Indy, Indigo2, Challenge S	*/
-#define  MACH_SGI_IP27		1	/* Origin 200, Origin 2000, Onyx 2 */
-#define  MACH_SGI_IP28		2	/* Indigo2 Impact		*/
-#define  MACH_SGI_IP32		3	/* O2				*/
-#define  MACH_SGI_IP30		4	/* Octane, Octane2              */
-
-/*
- * Valid machtypes for group Toshiba
- */
-#define  MACH_PALLAS		0
-#define  MACH_TOPAS		1
-#define  MACH_JMR		2
-#define  MACH_TOSHIBA_JMR3927	3	/* JMR-TX3927 CPU/IO board */
-#define  MACH_TOSHIBA_RBTX4927	4
-#define  MACH_TOSHIBA_RBTX4937	5
-#define  MACH_TOSHIBA_RBTX4938	6
-
-/*
- * Valid machtype for group LASAT
- */
-#define  MACH_LASAT_100		0	/* Masquerade II/SP100/SP50/SP25 */
-#define  MACH_LASAT_200		1	/* Masquerade PRO/SP200 */
-
-/*
- * Valid machtype for group NEC EMMA2RH
- */
-#define  MACH_NEC_MARKEINS	0	/* NEC EMMA2RH Mark-eins	*/
-
-/*
- * Valid machtype for group PMC-MSP
- */
-#define MACH_MSP4200_EVAL       0	/* PMC-Sierra MSP4200 Evaluation */
-#define MACH_MSP4200_GW         1	/* PMC-Sierra MSP4200 Gateway demo */
-#define MACH_MSP4200_FPGA       2	/* PMC-Sierra MSP4200 Emulation */
-#define MACH_MSP7120_EVAL       3	/* PMC-Sierra MSP7120 Evaluation */
-#define MACH_MSP7120_GW         4	/* PMC-Sierra MSP7120 Residential GW */
-#define MACH_MSP7120_FPGA       5	/* PMC-Sierra MSP7120 Emulation */
-#define MACH_MSP_OTHER        255	/* PMC-Sierra unknown board type */
+enum mips_machtype {
+	/*
+	 * Valid machtype values for group unknown
+	 */
+	MACH_UNKNOWN = 0,	/* whatever... */
+
+	/*
+	 * Valid machtype values for group JAZZ
+	 */
+	MACH_ACER_PICA_61,	/* Acer PICA-61 (PICA1) */
+	MACH_MIPS_MAGNUM_4000,	/* Mips Magnum 4000 "RC4030" */
+
+	/*
+	 * Valid machtype for group DEC
+	 */
+	MACH_DS23100,		/* DECstation 2100 or 3100 */
+	MACH_DS5100,		/* DECsystem 5100 */
+	MACH_DS5000_200,	/* DECstation 5000/200 */
+	MACH_DS5000_1XX,	/* DECstation 5000/120, 125, 133, 150 */
+	MACH_DS5000_XX,		/* DECstation 5000/20, 25, 33, 50 */
+	MACH_DS5000_2X0,	/* DECstation 5000/240, 260 */
+	MACH_DS5400,		/* DECsystem 5400 */
+	MACH_DS5500,		/* DECsystem 5500 */
+	MACH_DS5800,		/* DECsystem 5800 */
+	MACH_DS5900,		/* DECsystem 5900 */
+
+	/*
+	 * Valid machtype for group SNI_RM
+	 */
+	MACH_SNI_RM200_PCI,	/* RM200/RM300/RM400 PCI series */
+
+	/*
+	 * Valid machtype for group SGI
+	 */
+	MACH_SGI_IP22,		/* Indy, Indigo2, Challenge S */
+	MACH_SGI_IP27,		/* Origin 200, Origin 2000, Onyx 2 */
+	MACH_SGI_IP28,		/* Indigo2 Impact */
+	MACH_SGI_IP30,		/* Octane, Octane2 */
+	MACH_SGI_IP32,		/* O2 */
+
+	/*
+	 * Valid machtypes for group Toshiba
+	 */
+	MACH_TOSHIBA_RBTX4927,
+	MACH_TOSHIBA_RBTX4937,
+
+	/*
+	 * Valid machtype for group LASAT
+	 */
+	MACH_LASAT_100,		/* Masquerade II/SP100/SP50/SP25 */
+	MACH_LASAT_200,		/* Masquerade PRO/SP200 */
+
+	/*
+	 * Valid machtype for group PMC-MSP
+	 */
+	MACH_MSP4200_EVAL,	/* PMC-Sierra MSP4200 Evaluation */
+	MACH_MSP4200_GW,	/* PMC-Sierra MSP4200 Gateway demo */
+	MACH_MSP4200_FPGA,	/* PMC-Sierra MSP4200 Emulation */
+	MACH_MSP7120_EVAL,	/* PMC-Sierra MSP7120 Evaluation */
+	MACH_MSP7120_GW,	/* PMC-Sierra MSP7120 Residential GW */
+	MACH_MSP7120_FPGA,	/* PMC-Sierra MSP7120 Emulation */
+};
 
 #define CL_SIZE			COMMAND_LINE_SIZE
 
 extern char *system_type;
 const char *get_system_type(void);
 
-extern unsigned long mips_machtype;
+extern enum mips_machtype mips_machtype;
 
 #define BOOT_MEM_MAP_MAX	32
 #define BOOT_MEM_RAM		1

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

* Re: [PATCH][MIPS] mips_machtype define as one group
  2008-07-11 13:57 [PATCH][MIPS] mips_machtype define as one group Yoichi Yuasa
@ 2008-07-11 14:32 ` Thomas Bogendoerfer
  2008-07-12  8:47   ` Yoichi Yuasa
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Bogendoerfer @ 2008-07-11 14:32 UTC (permalink / raw)
  To: Yoichi Yuasa; +Cc: Ralf Baechle, linux-mips

On Fri, Jul 11, 2008 at 10:57:17PM +0900, Yoichi Yuasa wrote:
> mips_machtype define as one group.

wouldn't it make more sense to kill that completly ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

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

* Re: [PATCH][MIPS] mips_machtype define as one group
  2008-07-11 14:32 ` Thomas Bogendoerfer
@ 2008-07-12  8:47   ` Yoichi Yuasa
  2008-07-12  8:47     ` Yoichi Yuasa
  2008-07-12 14:32     ` Thomas Bogendoerfer
  0 siblings, 2 replies; 9+ messages in thread
From: Yoichi Yuasa @ 2008-07-12  8:47 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: yoichi_yuasa, Ralf Baechle, linux-mips

On Fri, 11 Jul 2008 16:32:35 +0200
tsbogend@alpha.franken.de (Thomas Bogendoerfer) wrote:

> On Fri, Jul 11, 2008 at 10:57:17PM +0900, Yoichi Yuasa wrote:
> > mips_machtype define as one group.
> 
> wouldn't it make more sense to kill that completly ?

mips_machtype is still used in some places.
Should we check first whether it can be removed?

Yoichi

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

* Re: [PATCH][MIPS] mips_machtype define as one group
  2008-07-12  8:47   ` Yoichi Yuasa
@ 2008-07-12  8:47     ` Yoichi Yuasa
  2008-07-12 14:32     ` Thomas Bogendoerfer
  1 sibling, 0 replies; 9+ messages in thread
From: Yoichi Yuasa @ 2008-07-12  8:47 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: yoichi_yuasa, Ralf Baechle, linux-mips

On Fri, 11 Jul 2008 16:32:35 +0200
tsbogend@alpha.franken.de (Thomas Bogendoerfer) wrote:

> On Fri, Jul 11, 2008 at 10:57:17PM +0900, Yoichi Yuasa wrote:
> > mips_machtype define as one group.
> 
> wouldn't it make more sense to kill that completly ?

mips_machtype is still used in some places.
Should we check first whether it can be removed?

Yoichi

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

* Re: [PATCH][MIPS] mips_machtype define as one group
  2008-07-12  8:47   ` Yoichi Yuasa
  2008-07-12  8:47     ` Yoichi Yuasa
@ 2008-07-12 14:32     ` Thomas Bogendoerfer
  2008-07-13 10:45       ` Yoichi Yuasa
  2008-07-14 11:27       ` Ralf Baechle
  1 sibling, 2 replies; 9+ messages in thread
From: Thomas Bogendoerfer @ 2008-07-12 14:32 UTC (permalink / raw)
  To: Yoichi Yuasa; +Cc: Ralf Baechle, linux-mips

On Sat, Jul 12, 2008 at 05:47:41PM +0900, Yoichi Yuasa wrote:
> On Fri, 11 Jul 2008 16:32:35 +0200
> tsbogend@alpha.franken.de (Thomas Bogendoerfer) wrote:
> 
> > On Fri, Jul 11, 2008 at 10:57:17PM +0900, Yoichi Yuasa wrote:
> > > mips_machtype define as one group.
> > 
> > wouldn't it make more sense to kill that completly ?
> 
> mips_machtype is still used in some places.
> Should we check first whether it can be removed?

I don't know Ralf's opinion about the removal, but if he agrees, we
should just look for the remaining usage cases and see, if it could
be resolved in a differnt way.

Here is my first look at all the various MACH_XXX:

> #define  MACH_ACER_PICA_61      0     /* Acer PICA-61 (PICA1) */
> #define  MACH_MIPS_MAGNUM_4000  1     /* Mips Magnum 4000 "RC4030" */
> #define  MACH_OLIVETTI_M700     2     /* Olivetti M700-10 (-15 ??) */

all three are in arch/mips/fw/arc/identify.c, but only MACH_MIPS_MAGNUM_4000
is used in arch/mips/jazz/setup.c. But the usage in arch/mips/jazz/setup.c
is not quite correct and I'd like to remove it there.

> #define  MACH_DSUNKNOWN         0
> #define  MACH_DS23100           1     /* DECstation 2100 or 3100 */
> #define  MACH_DS5100            2     /* DECsystem 5100 */
> #define  MACH_DS5000_200        3     /* DECstation 5000/200 */
> #define  MACH_DS5000_1XX        4     /* DECstation 5000/120, 125, 133, 150*/
> #define  MACH_DS5000_XX         5     /* DECstation 5000/20, 25, 33, 50 */
> #define  MACH_DS5000_2X0        6     /* DECstation 5000/240, 260 */
> #define  MACH_DS5400            7     /* DECsystem 5400 */
> #define  MACH_DS5500            8     /* DECsystem 5500 */
> #define  MACH_DS5800            9     /* DECsystem 5800 */
> #define  MACH_DS5900            10    /* DECsystem 5900 */

that's the only poweruser. I'd rename mips_machtype to dec_machtype and
just use it for decstation as it is today.

> #define  MACH_SNI_RM200_PCI     0     /* RM200/RM300/RM400 PCI series */

only in arch/mips/fw/arc/identify

> #define  MACH_SGI_IP22          0     /* Indy, Indigo2, Challenge S */
> #define  MACH_SGI_IP27          1     /* Origin 200, Origin 2000, Onyx 2 */
> #define  MACH_SGI_IP28          2     /* Indigo2 Impact */
> #define  MACH_SGI_IP32          3     /* O2 */
> #define  MACH_SGI_IP30          4     /* Octane, Octane2 */

all SGI defines are only in arch/mips/fw/arc/identify

> #define  MACH_PALLAS            0
> #define  MACH_TOPAS             1
> #define  MACH_JMR               2
> #define  MACH_TOSHIBA_JMR3927   3     /* JMR-TX3927 CPU/IO board */

these 4 are unused

> #define  MACH_TOSHIBA_RBTX4927  4
> #define  MACH_TOSHIBA_RBTX4937  5
> #define  MACH_TOSHIBA_RBTX4938  6

there is only one usage for that, so moving the code for setting of
mips_machtype from toshiba_rbtx4927_prom.c to toshiba_rbtx4927_setup.c
will make that defines obsolete.

> #define  MACH_LASAT_100         0     /* Masquerade II/SP100/SP50/SP25 */
> #define  MACH_LASAT_200         1     /* Masquerade PRO/SP200 */

these are used, but could easily replaced by checking for CPU type
(see lasat/prom.c how LASAT_100/LASAT_200 get selected).

> #define  MACH_NEC_MARKEINS      0     /* NEC EMMA2RH Mark-eins */

unused

> #define MACH_MSP4200_EVAL       0     /* PMC-Sierra MSP4200 Evaluation */
> #define MACH_MSP4200_GW         1     /* PMC-Sierra MSP4200 Gateway demo */
> #define MACH_MSP4200_FPGA       2     /* PMC-Sierra MSP4200 Emulation */
> #define MACH_MSP7120_EVAL       3     /* PMC-Sierra MSP7120 Evaluation */
> #define MACH_MSP7120_GW         4     /* PMC-Sierra MSP7120 Residential GW */
> #define MACH_MSP7120_FPGA       5     /* PMC-Sierra MSP7120 Emulation */
> #define MACH_MSP_OTHER        255     /* PMC-Sierra unknown board type */

this looks a little messy. The _EVAL and _GW defines are more a kernel
config option than a real machine type and all they are good for is
selecting whether there is a second serial port and which speed the
speed kgdb should use. I'd remove that all and just set a flag, whether
there is a second uart. I'd remove the kgbd usage, but if it's really
needed adding another flag/variabne would do the trick.

Anything I missed ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

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

* Re: [PATCH][MIPS] mips_machtype define as one group
  2008-07-12 14:32     ` Thomas Bogendoerfer
@ 2008-07-13 10:45       ` Yoichi Yuasa
  2008-07-13 10:45         ` Yoichi Yuasa
  2008-07-13 13:13         ` Atsushi Nemoto
  2008-07-14 11:27       ` Ralf Baechle
  1 sibling, 2 replies; 9+ messages in thread
From: Yoichi Yuasa @ 2008-07-13 10:45 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: yoichi_yuasa, Ralf Baechle, linux-mips

On Sat, 12 Jul 2008 16:32:25 +0200
tsbogend@alpha.franken.de (Thomas Bogendoerfer) wrote:

> On Sat, Jul 12, 2008 at 05:47:41PM +0900, Yoichi Yuasa wrote:
> > On Fri, 11 Jul 2008 16:32:35 +0200
> > tsbogend@alpha.franken.de (Thomas Bogendoerfer) wrote:
> > 
> > > On Fri, Jul 11, 2008 at 10:57:17PM +0900, Yoichi Yuasa wrote:
> > > > mips_machtype define as one group.
> > > 
> > > wouldn't it make more sense to kill that completly ?
> > 
> > mips_machtype is still used in some places.
> > Should we check first whether it can be removed?
> 
> I don't know Ralf's opinion about the removal, but if he agrees, we
> should just look for the remaining usage cases and see, if it could
> be resolved in a differnt way.
> 
> Here is my first look at all the various MACH_XXX:
> 
> > #define  MACH_ACER_PICA_61      0     /* Acer PICA-61 (PICA1) */
> > #define  MACH_MIPS_MAGNUM_4000  1     /* Mips Magnum 4000 "RC4030" */
> > #define  MACH_OLIVETTI_M700     2     /* Olivetti M700-10 (-15 ??) */
> 
> all three are in arch/mips/fw/arc/identify.c, but only MACH_MIPS_MAGNUM_4000
> is used in arch/mips/jazz/setup.c. But the usage in arch/mips/jazz/setup.c
> is not quite correct and I'd like to remove it there.
> 
> > #define  MACH_DSUNKNOWN         0
> > #define  MACH_DS23100           1     /* DECstation 2100 or 3100 */
> > #define  MACH_DS5100            2     /* DECsystem 5100 */
> > #define  MACH_DS5000_200        3     /* DECstation 5000/200 */
> > #define  MACH_DS5000_1XX        4     /* DECstation 5000/120, 125, 133, 150*/
> > #define  MACH_DS5000_XX         5     /* DECstation 5000/20, 25, 33, 50 */
> > #define  MACH_DS5000_2X0        6     /* DECstation 5000/240, 260 */
> > #define  MACH_DS5400            7     /* DECsystem 5400 */
> > #define  MACH_DS5500            8     /* DECsystem 5500 */
> > #define  MACH_DS5800            9     /* DECsystem 5800 */
> > #define  MACH_DS5900            10    /* DECsystem 5900 */
> 
> that's the only poweruser. I'd rename mips_machtype to dec_machtype and
> just use it for decstation as it is today.
> 
> > #define  MACH_SNI_RM200_PCI     0     /* RM200/RM300/RM400 PCI series */
> 
> only in arch/mips/fw/arc/identify
> 
> > #define  MACH_SGI_IP22          0     /* Indy, Indigo2, Challenge S */
> > #define  MACH_SGI_IP27          1     /* Origin 200, Origin 2000, Onyx 2 */
> > #define  MACH_SGI_IP28          2     /* Indigo2 Impact */
> > #define  MACH_SGI_IP32          3     /* O2 */
> > #define  MACH_SGI_IP30          4     /* Octane, Octane2 */
> 
> all SGI defines are only in arch/mips/fw/arc/identify
> 
> > #define  MACH_PALLAS            0
> > #define  MACH_TOPAS             1
> > #define  MACH_JMR               2
> > #define  MACH_TOSHIBA_JMR3927   3     /* JMR-TX3927 CPU/IO board */
> 
> these 4 are unused
> 
> > #define  MACH_TOSHIBA_RBTX4927  4
> > #define  MACH_TOSHIBA_RBTX4937  5
> > #define  MACH_TOSHIBA_RBTX4938  6
> 
> there is only one usage for that, so moving the code for setting of
> mips_machtype from toshiba_rbtx4927_prom.c to toshiba_rbtx4927_setup.c
> will make that defines obsolete.
> 
> > #define  MACH_LASAT_100         0     /* Masquerade II/SP100/SP50/SP25 */
> > #define  MACH_LASAT_200         1     /* Masquerade PRO/SP200 */
> 
> these are used, but could easily replaced by checking for CPU type
> (see lasat/prom.c how LASAT_100/LASAT_200 get selected).
> 
> > #define  MACH_NEC_MARKEINS      0     /* NEC EMMA2RH Mark-eins */
> 
> unused
> 
> > #define MACH_MSP4200_EVAL       0     /* PMC-Sierra MSP4200 Evaluation */
> > #define MACH_MSP4200_GW         1     /* PMC-Sierra MSP4200 Gateway demo */
> > #define MACH_MSP4200_FPGA       2     /* PMC-Sierra MSP4200 Emulation */
> > #define MACH_MSP7120_EVAL       3     /* PMC-Sierra MSP7120 Evaluation */
> > #define MACH_MSP7120_GW         4     /* PMC-Sierra MSP7120 Residential GW */
> > #define MACH_MSP7120_FPGA       5     /* PMC-Sierra MSP7120 Emulation */
> > #define MACH_MSP_OTHER        255     /* PMC-Sierra unknown board type */
> 
> this looks a little messy. The _EVAL and _GW defines are more a kernel
> config option than a real machine type and all they are good for is
> selecting whether there is a second serial port and which speed the
> speed kgdb should use. I'd remove that all and just set a flag, whether
> there is a second uart. I'd remove the kgbd usage, but if it's really
> needed adding another flag/variabne would do the trick.
> 
> Anything I missed ?

I totally agree with you.
I'm making a patch for MACH_TOSHIBA_* .

Yoichi

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

* Re: [PATCH][MIPS] mips_machtype define as one group
  2008-07-13 10:45       ` Yoichi Yuasa
@ 2008-07-13 10:45         ` Yoichi Yuasa
  2008-07-13 13:13         ` Atsushi Nemoto
  1 sibling, 0 replies; 9+ messages in thread
From: Yoichi Yuasa @ 2008-07-13 10:45 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: yoichi_yuasa, Ralf Baechle, linux-mips

On Sat, 12 Jul 2008 16:32:25 +0200
tsbogend@alpha.franken.de (Thomas Bogendoerfer) wrote:

> On Sat, Jul 12, 2008 at 05:47:41PM +0900, Yoichi Yuasa wrote:
> > On Fri, 11 Jul 2008 16:32:35 +0200
> > tsbogend@alpha.franken.de (Thomas Bogendoerfer) wrote:
> > 
> > > On Fri, Jul 11, 2008 at 10:57:17PM +0900, Yoichi Yuasa wrote:
> > > > mips_machtype define as one group.
> > > 
> > > wouldn't it make more sense to kill that completly ?
> > 
> > mips_machtype is still used in some places.
> > Should we check first whether it can be removed?
> 
> I don't know Ralf's opinion about the removal, but if he agrees, we
> should just look for the remaining usage cases and see, if it could
> be resolved in a differnt way.
> 
> Here is my first look at all the various MACH_XXX:
> 
> > #define  MACH_ACER_PICA_61      0     /* Acer PICA-61 (PICA1) */
> > #define  MACH_MIPS_MAGNUM_4000  1     /* Mips Magnum 4000 "RC4030" */
> > #define  MACH_OLIVETTI_M700     2     /* Olivetti M700-10 (-15 ??) */
> 
> all three are in arch/mips/fw/arc/identify.c, but only MACH_MIPS_MAGNUM_4000
> is used in arch/mips/jazz/setup.c. But the usage in arch/mips/jazz/setup.c
> is not quite correct and I'd like to remove it there.
> 
> > #define  MACH_DSUNKNOWN         0
> > #define  MACH_DS23100           1     /* DECstation 2100 or 3100 */
> > #define  MACH_DS5100            2     /* DECsystem 5100 */
> > #define  MACH_DS5000_200        3     /* DECstation 5000/200 */
> > #define  MACH_DS5000_1XX        4     /* DECstation 5000/120, 125, 133, 150*/
> > #define  MACH_DS5000_XX         5     /* DECstation 5000/20, 25, 33, 50 */
> > #define  MACH_DS5000_2X0        6     /* DECstation 5000/240, 260 */
> > #define  MACH_DS5400            7     /* DECsystem 5400 */
> > #define  MACH_DS5500            8     /* DECsystem 5500 */
> > #define  MACH_DS5800            9     /* DECsystem 5800 */
> > #define  MACH_DS5900            10    /* DECsystem 5900 */
> 
> that's the only poweruser. I'd rename mips_machtype to dec_machtype and
> just use it for decstation as it is today.
> 
> > #define  MACH_SNI_RM200_PCI     0     /* RM200/RM300/RM400 PCI series */
> 
> only in arch/mips/fw/arc/identify
> 
> > #define  MACH_SGI_IP22          0     /* Indy, Indigo2, Challenge S */
> > #define  MACH_SGI_IP27          1     /* Origin 200, Origin 2000, Onyx 2 */
> > #define  MACH_SGI_IP28          2     /* Indigo2 Impact */
> > #define  MACH_SGI_IP32          3     /* O2 */
> > #define  MACH_SGI_IP30          4     /* Octane, Octane2 */
> 
> all SGI defines are only in arch/mips/fw/arc/identify
> 
> > #define  MACH_PALLAS            0
> > #define  MACH_TOPAS             1
> > #define  MACH_JMR               2
> > #define  MACH_TOSHIBA_JMR3927   3     /* JMR-TX3927 CPU/IO board */
> 
> these 4 are unused
> 
> > #define  MACH_TOSHIBA_RBTX4927  4
> > #define  MACH_TOSHIBA_RBTX4937  5
> > #define  MACH_TOSHIBA_RBTX4938  6
> 
> there is only one usage for that, so moving the code for setting of
> mips_machtype from toshiba_rbtx4927_prom.c to toshiba_rbtx4927_setup.c
> will make that defines obsolete.
> 
> > #define  MACH_LASAT_100         0     /* Masquerade II/SP100/SP50/SP25 */
> > #define  MACH_LASAT_200         1     /* Masquerade PRO/SP200 */
> 
> these are used, but could easily replaced by checking for CPU type
> (see lasat/prom.c how LASAT_100/LASAT_200 get selected).
> 
> > #define  MACH_NEC_MARKEINS      0     /* NEC EMMA2RH Mark-eins */
> 
> unused
> 
> > #define MACH_MSP4200_EVAL       0     /* PMC-Sierra MSP4200 Evaluation */
> > #define MACH_MSP4200_GW         1     /* PMC-Sierra MSP4200 Gateway demo */
> > #define MACH_MSP4200_FPGA       2     /* PMC-Sierra MSP4200 Emulation */
> > #define MACH_MSP7120_EVAL       3     /* PMC-Sierra MSP7120 Evaluation */
> > #define MACH_MSP7120_GW         4     /* PMC-Sierra MSP7120 Residential GW */
> > #define MACH_MSP7120_FPGA       5     /* PMC-Sierra MSP7120 Emulation */
> > #define MACH_MSP_OTHER        255     /* PMC-Sierra unknown board type */
> 
> this looks a little messy. The _EVAL and _GW defines are more a kernel
> config option than a real machine type and all they are good for is
> selecting whether there is a second serial port and which speed the
> speed kgdb should use. I'd remove that all and just set a flag, whether
> there is a second uart. I'd remove the kgbd usage, but if it's really
> needed adding another flag/variabne would do the trick.
> 
> Anything I missed ?

I totally agree with you.
I'm making a patch for MACH_TOSHIBA_* .

Yoichi

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

* Re: [PATCH][MIPS] mips_machtype define as one group
  2008-07-13 10:45       ` Yoichi Yuasa
  2008-07-13 10:45         ` Yoichi Yuasa
@ 2008-07-13 13:13         ` Atsushi Nemoto
  1 sibling, 0 replies; 9+ messages in thread
From: Atsushi Nemoto @ 2008-07-13 13:13 UTC (permalink / raw)
  To: yoichi_yuasa; +Cc: tsbogend, ralf, linux-mips

On Sun, 13 Jul 2008 19:45:03 +0900, Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> wrote:
> > this looks a little messy. The _EVAL and _GW defines are more a kernel
> > config option than a real machine type and all they are good for is
> > selecting whether there is a second serial port and which speed the
> > speed kgdb should use. I'd remove that all and just set a flag, whether
> > there is a second uart. I'd remove the kgbd usage, but if it's really
> > needed adding another flag/variabne would do the trick.
> > 
> > Anything I missed ?
> 
> I totally agree with you.
> I'm making a patch for MACH_TOSHIBA_* .

Thanks, I'll review your patchset soon.

---
Atsushi Nemoto

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

* Re: [PATCH][MIPS] mips_machtype define as one group
  2008-07-12 14:32     ` Thomas Bogendoerfer
  2008-07-13 10:45       ` Yoichi Yuasa
@ 2008-07-14 11:27       ` Ralf Baechle
  1 sibling, 0 replies; 9+ messages in thread
From: Ralf Baechle @ 2008-07-14 11:27 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: Yoichi Yuasa, linux-mips

On Sat, Jul 12, 2008 at 04:32:25PM +0200, Thomas Bogendoerfer wrote:

> > mips_machtype is still used in some places.
> > Should we check first whether it can be removed?
> 
> I don't know Ralf's opinion about the removal, but if he agrees, we
> should just look for the remaining usage cases and see, if it could
> be resolved in a differnt way.

I was also planning to get rid of it. A while ago I already removed
mips_machgroup.  This was easy with no real user remaining.  Removing
mips_machtype turned out to be slightly trickier since there are actual
users remaining.


> Here is my first look at all the various MACH_XXX:
> 
> > #define  MACH_ACER_PICA_61      0     /* Acer PICA-61 (PICA1) */
> > #define  MACH_MIPS_MAGNUM_4000  1     /* Mips Magnum 4000 "RC4030" */
> > #define  MACH_OLIVETTI_M700     2     /* Olivetti M700-10 (-15 ??) */
> 
> all three are in arch/mips/fw/arc/identify.c, but only MACH_MIPS_MAGNUM_4000
> is used in arch/mips/jazz/setup.c. But the usage in arch/mips/jazz/setup.c
> is not quite correct and I'd like to remove it there.
> 
> > #define  MACH_DSUNKNOWN         0
> > #define  MACH_DS23100           1     /* DECstation 2100 or 3100 */
> > #define  MACH_DS5100            2     /* DECsystem 5100 */
> > #define  MACH_DS5000_200        3     /* DECstation 5000/200 */
> > #define  MACH_DS5000_1XX        4     /* DECstation 5000/120, 125, 133, 150*/
> > #define  MACH_DS5000_XX         5     /* DECstation 5000/20, 25, 33, 50 */
> > #define  MACH_DS5000_2X0        6     /* DECstation 5000/240, 260 */
> > #define  MACH_DS5400            7     /* DECsystem 5400 */
> > #define  MACH_DS5500            8     /* DECsystem 5500 */
> > #define  MACH_DS5800            9     /* DECsystem 5800 */
> > #define  MACH_DS5900            10    /* DECsystem 5900 */
> 
> that's the only poweruser. I'd rename mips_machtype to dec_machtype and
> just use it for decstation as it is today.

Yep.

> > #define  MACH_SNI_RM200_PCI     0     /* RM200/RM300/RM400 PCI series */
> 
> only in arch/mips/fw/arc/identify
> 
> > #define  MACH_SGI_IP22          0     /* Indy, Indigo2, Challenge S */
> > #define  MACH_SGI_IP27          1     /* Origin 200, Origin 2000, Onyx 2 */
> > #define  MACH_SGI_IP28          2     /* Indigo2 Impact */
> > #define  MACH_SGI_IP32          3     /* O2 */
> > #define  MACH_SGI_IP30          4     /* Octane, Octane2 */
> 
> all SGI defines are only in arch/mips/fw/arc/identify
> 
> > #define  MACH_PALLAS            0
> > #define  MACH_TOPAS             1
> > #define  MACH_JMR               2
> > #define  MACH_TOSHIBA_JMR3927   3     /* JMR-TX3927 CPU/IO board */
> 
> these 4 are unused
> 
> > #define  MACH_TOSHIBA_RBTX4927  4
> > #define  MACH_TOSHIBA_RBTX4937  5
> > #define  MACH_TOSHIBA_RBTX4938  6
> 
> there is only one usage for that, so moving the code for setting of
> mips_machtype from toshiba_rbtx4927_prom.c to toshiba_rbtx4927_setup.c
> will make that defines obsolete.
> 
> > #define  MACH_LASAT_100         0     /* Masquerade II/SP100/SP50/SP25 */
> > #define  MACH_LASAT_200         1     /* Masquerade PRO/SP200 */
> 
> these are used, but could easily replaced by checking for CPU type
> (see lasat/prom.c how LASAT_100/LASAT_200 get selected).

That or a platform-private variable.

> > #define  MACH_NEC_MARKEINS      0     /* NEC EMMA2RH Mark-eins */
> 
> unused

I guess people blindly following Jun's old porting howto ...

> > #define MACH_MSP4200_EVAL       0     /* PMC-Sierra MSP4200 Evaluation */
> > #define MACH_MSP4200_GW         1     /* PMC-Sierra MSP4200 Gateway demo */
> > #define MACH_MSP4200_FPGA       2     /* PMC-Sierra MSP4200 Emulation */
> > #define MACH_MSP7120_EVAL       3     /* PMC-Sierra MSP7120 Evaluation */
> > #define MACH_MSP7120_GW         4     /* PMC-Sierra MSP7120 Residential GW */
> > #define MACH_MSP7120_FPGA       5     /* PMC-Sierra MSP7120 Emulation */
> > #define MACH_MSP_OTHER        255     /* PMC-Sierra unknown board type */
> 
> this looks a little messy. The _EVAL and _GW defines are more a kernel
> config option than a real machine type and all they are good for is
> selecting whether there is a second serial port and which speed the
> speed kgdb should use. I'd remove that all and just set a flag, whether
> there is a second uart. I'd remove the kgbd usage, but if it's really
> needed adding another flag/variabne would do the trick.

When I looked at it last time I found that some of the mips_machtype uses
might be replaced with platform devices.

  Ralf

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

end of thread, other threads:[~2008-07-14 11:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-11 13:57 [PATCH][MIPS] mips_machtype define as one group Yoichi Yuasa
2008-07-11 14:32 ` Thomas Bogendoerfer
2008-07-12  8:47   ` Yoichi Yuasa
2008-07-12  8:47     ` Yoichi Yuasa
2008-07-12 14:32     ` Thomas Bogendoerfer
2008-07-13 10:45       ` Yoichi Yuasa
2008-07-13 10:45         ` Yoichi Yuasa
2008-07-13 13:13         ` Atsushi Nemoto
2008-07-14 11:27       ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox