Fix board type in db1x00
PATCH 1/1 Fix board type in db1x00
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(-)
arch/mips/au1000/db1x00/init.c +11 -1
@@ -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 ();
arch/mips/au1000/db1x00/init.c void __init prom_init(void) · line 74
Quoted 10 lines · Jordan Crouse
arch/mips/au1000/db1x00/init.c +10
-0+/* 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
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
Quoted 15 lines · Dan Malek
arch/mips/au1000/db1x00/init.c void __init prom_init(void) · line 74
Quoted 10 lines · Jordan Crouse
arch/mips/au1000/db1x00/init.c +10
-0+/* 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 Can't we just do something like
Quoted 6 lines
#define MACH_ALCHEMY_TYPE xxxxxin 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;
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
Signature · 4 lines
Jordan Crouse Senior Linux Engineer AMD - Personal Connectivity Solutions Group <www.amd.com/embeddedprocessors>
Quoted 2 lines · Jordan Crouse
.... 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
Quoted 6 lines · Dan Malek
Quoted 2 lines · Jordan Crouse
.... That means either the mess goes in here or it goes in
asm-mips/mach-db1x00/db1x00.h,
Quoted 9 lines
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
Kconfigprocess 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.
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
Signature · 4 lines
Jordan Crouse Senior Linux Engineer AMD - Personal Connectivity Solutions Group <www.amd.com/embeddedprocessors>
Hi
Quoted 12 lines
arch/mips/au1000/db1x00/init.c void __init prom_init(void) · line 74
Quoted 10 lines
arch/mips/au1000/db1x00/init.c +10
-0+/* 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 Can't we just do something like
Quoted 6 lines
#define MACH_ALCHEMY_TYPE xxxxxin 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;
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
Quoted 3 lines · Matej Kupljen
And please, don't forget about DB1200 board also. I already sent some minor patches, but they didn't get in :(
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
Quoted 14 lines · Dan Malek
arch/mips/au1000/db1x00/init.c void __init prom_init(void) · line 74
Quoted 10 lines · Jordan Crouse
arch/mips/au1000/db1x00/init.c +10
-0+/* 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 Can't we just do something like
Quoted 6 lines
#define MACH_ALCHEMY_TYPE xxxxxin 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;
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
Hi
Quoted 3 lines
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.
You forgot DBAU1200.
BR,
Matej
Quoted 5 lines · Matej Kupljen
Quoted 3 lines
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.
You forgot DBAU1200.
Was not part of the patch posted. Can you cook up a patch?
Ralf
Quoted 1 line
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
Signature · 4 lines
Jordan Crouse Senior Linux Engineer AMD - Personal Connectivity Solutions Group <www.amd.com/embeddedprocessors>