Subject: [PATCH] Fix board type in db1x00

From: "Jordan Crouse" <[email-masked]>
Date: Tue, 22 Nov 2005 15:15:26 -0700

Ok, one more one more from Sergei Shtylyov - add all the board types 
serviced by db1x00/init.c:

ALCHEMY:  Select correct machine type in db1x00
---

 arch/mips/au1000/db1x00/init.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/arch/mips/au1000/db1x00/init.c b/arch/mips/au1000/db1x00/init.c
index 4b9d5e4..41e0522 100644
--- a/arch/mips/au1000/db1x00/init.c
+++ b/arch/mips/au1000/db1x00/init.c
@@ -61,7 +61,17 @@ void __init prom_init(void)
 	prom_envp = (char **) fw_arg2;
 
 	mips_machgroup = MACH_GROUP_ALCHEMY;
-	mips_machtype = MACH_DB1000;	/* set the platform # */
+
+	/* Set the platform # */
+#if	defined (CONFIG_MIPS_DB1550)
+	mips_machtype = MACH_DB1550;
+#elif	defined (CONFIG_MIPS_DB1500)
+	mips_machtype = MACH_DB1500;
+#elif	defined (CONFIG_MIPS_DB1100)
+	mips_machtype = MACH_DB1100;
+#else
+	mips_machtype = MACH_DB1000;
+#endif
 
 	prom_init_cmdline();

---

From: Dan Malek <[email-masked]>
Date: Tue, 22 Nov 2005 17:31:20 -0500

> +	mips_machtype = MACH_DB1000;

Can't we just do something like
	#define MACH_ALCHEMY_TYPE  xxxxx

in the include files and not have this mess in the
actual code?  Then, all we have to do here is:

	mips_machtype = MACH_ALCHEMY_TYPE;

Thanks.

	-- Dan

---

From: "Jordan Crouse" <[email-masked]>
Date: Tue, 22 Nov 2005 17:15:34 -0700

> 	mips_machtype = MACH_ALCHEMY_TYPE;

The problem with db1x00 in particular is that its sort of a 
catch all for all the Alchemy boards that don't have a proper home
of their own, so there really isn't a DB1000/DB1100/DB1500/DB1550 
header file.  That means either the mess goes in here or it goes
in asm-mips/mach-db1x00/db1x00.h, and I think I rather prefer it to
be in the .c file, just so one doesn't have to chase down the 
MACH_ALCHEMY_TYPE define. 

Jordan

-- 
Jordan Crouse
Senior Linux Engineer
AMD - Personal Connectivity Solutions Group
<www.amd.com/embeddedprocessors>

---

From: Dan Malek <[email-masked]>
Date: Tue, 22 Nov 2005 19:24:51 -0500

On Nov 22, 2005, at 7:15 PM, Jordan Crouse wrote:

> ....  That means either the mess goes in here or it goes
> in asm-mips/mach-db1x00/db1x00.h,

You are already doing this for other things, like the BCSR
differences with the db1550.  Why not put it all on one place?
You could even generate out of the Kconfig process and
not need it in any file. :-)  The problem is if you propagate
stuff like this "...  because there isn't an include file ..." others
will also take that attitude.  Someone has to start the
process.  For something as generic as these boards, the
next one should simply be an include file update, not the
need to edit various source files as is necessary today.

Thanks.

	-- Dan

---

From: "Jordan Crouse" <[email-masked]>
Date: Tue, 22 Nov 2005 18:18:45 -0700

> need to edit various source files as is necessary today.

I'll buy into the general idea, but I'll defer to Ralf to see if
he wants us to start inflicting this on the tree, or if he would
just prefer to let sleeping dogs lay.  One one hand, its nice to 
clean things up, but on the other hand, we're not making any more
DB boards :( so its doubtful the ugliness will grow much further then
this.

Thanks for your comments,
Jordan

---

From: Matej Kupljen <[email-masked]>
Date: Wed, 23 Nov 2005 07:31:37 +0100

Hi

> 	mips_machtype = MACH_ALCHEMY_TYPE;

I prefer Dan's suggestion, if it counts.

And please, don't forget about DB1200 board also.
I already sent some minor patches, but they didn't
get in :(

BR,
Matej

---

From: Dan Malek <[email-masked]>
Date: Wed, 23 Nov 2005 09:39:15 -0500

> I already sent some minor patches, but they didn't

They didn't get lost.  Pete and I knew there would
be things coming from AMD, there are several
other patches that have been posted.  We just
need to merge it all together.

Thanks.

	-- Dan

---

From: Ralf Baechle <[email-masked]>
Date: Tue, 29 Nov 2005 16:51:48 +0000

> 	mips_machtype = MACH_ALCHEMY_TYPE;

But we don't have a nice space for this in header files either right now.
So I'll apply this one but if you come up with something better I'll
certainly appreciate it.

  Ralf

---

From: Matej Kupljen <[email-masked]>
Date: Wed, 30 Nov 2005 09:35:27 +0100

Hi

> So I'll apply this one but if you come up with something better I'll

You forgot DBAU1200.

BR,
Matej

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 30 Nov 2005 11:23:44 +0000

> > So I'll apply this one but if you come up with something better I'll

Was not part of the patch posted.  Can you cook up a patch?

  Ralf

---

From: "Jordan Crouse" <[email-masked]>
Date: Wed, 30 Nov 2005 08:29:16 -0700

> You forgot DBAU1200.

Nope.  PB1200 and DB1200 boards do not compile au1000/db1x00/init.c  they use
au1000/pb1200/init.c instead, and said file already has the correct machine
type.

Jordan