mips: PMC MSP71xx mips common
Quoted 43 lines · Andrew Sharp
Quoted 26 lines · On Mon, 26 Feb 2007 18:12:55 -0600 Marc St-Jean <[email protected]> wrote:
[PATCH 2/5] mips: PMC MSP71xx mips common
Patch to add mips common support for the PMC-Sierra MSP71xx devices.
These 5 patches along with the previously posted serial patch will boot the PMC-Sierra MSP7120 Residential Gateway board.
Thanks,
MarcSigned-off-by Marc St-Jean <[email protected]>---
Re-posting patch with two recommended changes:
1. Dropped thePMC_MSP_UNCACHEDconfiguration item as this was already available inarch/mips/Kconfig.debug.
3. Dropped 'else' case to simplify patch todo_watch()inarch/mips/kernel/traps.carch/mips/Kconfig | 78 ++++++++++++++++++++ arch/mips/Makefile | 8 ++ arch/mips/kernel/head.S | 8 ++ arch/mips/kernel/traps.c | 6 + include/asm-mips/bootinfo.h | 12 +++ include/asm-mips/mipsregs.h | 30 +++++++ include/asm-mips/regops.h | 168Quoted 2 lines
++++++++++++++++++++++++++++++++++++++++++++
include/asm-mips/war.h| 11 ++ 8 files changed, 321 insertions(+)My mailer kind of made a mess of things, hope I caught them all.
arch/mips/kernel/head.S line 133
Quoted 9 lines
arch/mips/kernel/head.S +1
-0@@ -130,10 +130,18 @@ .endm /* + * Reserverd space not required for PMC boards, although weneed to
Quoted 15 lines
arch/mips/kernel/head.S line 144
Quoted 11 lines
arch/mips/kernel/head.S +7
-0+ * jump to kernel start. + */ +#ifdef CONFIG_PMC_MSP + jal kernel_entry +#else + /* * Reserved space for exception handlers. * Necessary for machines which link their kernels at KSEG0. */ .fill 0x400 +#endif /* CONFIG_PMC_MSP */This is getting kind of ugly. There are a whole lot of config choices that need to use the 'j
kernel_entry'. Do they all have to have their own? I'm not sure what the best way is to handle them all.
I agree but don't know the best way to handle this. I could introduce a SYS_NO_EXEPT_FILL or similar flag but this seems excessive.
Any other ideas from arch/mips folks?
I'm not sure why the fill is needed before _stext. The comment states kernels linked against kseg0 require this. We link our kernels to 0x8010_0000 and expect that to be the start of text. We aren't changing anything else in the startup code.
Quoted 25 lines
include/asm-mips/bootinfo.h line 218
Quoted 11 lines
include/asm-mips/bootinfo.h +4
-0@@ -213,6 +213,18 @@#define MACH_GROUP_NEC_EMMA2RH 25/* NEC EMMA2RH (was 23) */ #define MACH_NEC_MARKEINS 0/* NEC EMMA2RH Mark-eins */ +/* +* Valid machtype for group PMC-MSP +*/ +#define MACH_GROUP_MSP 23/* PMC-Sierra MSP boards/CPUs */
include/asm-mips/bootinfo.h line 219
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP4200_EVAL 0/* PMC-Sierra MSP4200 Evaluation board */
include/asm-mips/bootinfo.h line 220
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP4200_GW 1/* PMC-Sierra MSP4200 Gateway demo board */
include/asm-mips/bootinfo.h line 221
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP4200_FPGA 2/* PMC-Sierra MSP4200 Emulation board */
include/asm-mips/bootinfo.h line 222
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP7120_EVAL 3/* PMC-Sierra MSP7120 Evaluation board *
/include/asm-mips/bootinfo.h line 223
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP7120_GW 4/* PMC-Sierra MSP7120 Residential Gateway board */
include/asm-mips/bootinfo.h line 224
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP7120_FPGA 5/* PMC-Sierra MSP7120 Emulation board */
Quoted 8 lines
include/asm-mips/bootinfo.h line 225
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP_OTHER 255/* PMC-Sierra unknown board type */
include/asm-mips/bootinfo.h line 226
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define CL_SIZE COMMAND_LINE_SIZEReally I would add
MACH_GROUP_MSPafterMACH_GROUP_NEC_EMMA2RH, perhaps 27 or 28, rather than an interior number. Especially if you are going to put it afterMACH_GROUP_NEC_EMMA2RHin the file. ~:^)
Sure we aren't tied to this number. Looking at the numbering more closely, it looks like numbers aren't reused when they are dropped so it may be safer in case existing boards are still using 23.
Why do you recommend 27 or higher when apparently 26 hasn't been used?
Marc
Marc St-Jean wrote:
[snip]
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+#ifdef CONFIG_PMC_MSP + jal kernel_entry +#else
Maybe introduce a CONFIG_BOOT_RAW (and use it in arch/mips/Makefile to objcopy the kernel to a raw binary).
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
(quoted diff) +2
-0+ /* * Reserved space for exception handlers. * Necessary for machines which link their kernels at KSEG0. */ .fill 0x400 +#endif /* CONFIG_PMC_MSP */
Quoted 8 lines
Quoted 3 lines
This is getting kind of ugly. There are a whole lot of config choices that need to use the 'j
kernel_entry'. Do they all have to have their own? I'm not sure what the best way is to handle them all.I agree but don't know the best way to handle this. I could introduce a
SYS_NO_EXEPT_FILLor similar flag but this seems excessive.Any other ideas from
arch/mipsfolks?
Something like
#if LOADADDR == 0xffffffff80000000 .fill 0x400
#endif
but by defining an appropriate name in arch/mips/Makefile instead of externalizing the load-y/LOADADDR there.
Thiemo
Quoted 37 lines · Marc St-Jean
Quoted 26 lines · Andrew Sharp
include/asm-mips/bootinfo.h line 218
Quoted 11 lines · On Mon, 26 Feb 2007 18:12:55 -0600 Marc St-Jean <[email protected]> wrote:
include/asm-mips/bootinfo.h +4
-0@@ -213,6 +213,18 @@#define MACH_GROUP_NEC_EMMA2RH 25/* NEC EMMA2RH (was 23) */ #define MACH_NEC_MARKEINS 0/* NEC EMMA2RH Mark-eins */ +/* +* Valid machtype for group PMC-MSP +*/ +#define MACH_GROUP_MSP 23/* PMC-Sierra MSP boards/CPUs */
include/asm-mips/bootinfo.h line 219
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP4200_EVAL 0/* PMC-Sierra MSP4200 Evaluation board */
include/asm-mips/bootinfo.h line 220
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP4200_GW 1/* PMC-Sierra MSP4200 Gateway demo board */
include/asm-mips/bootinfo.h line 221
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP4200_FPGA 2/* PMC-Sierra MSP4200 Emulation board */
include/asm-mips/bootinfo.h line 222
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP7120_EVAL 3/* PMC-Sierra MSP7120 Evaluation board *
/include/asm-mips/bootinfo.h line 223
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP7120_GW 4/* PMC-Sierra MSP7120 Residential Gateway board */
include/asm-mips/bootinfo.h line 224
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP7120_FPGA 5/* PMC-Sierra MSP7120 Emulation board */
Quoted 8 lines
include/asm-mips/bootinfo.h line 225
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define MACH_MSP_OTHER 255/* PMC-Sierra unknown board type */
include/asm-mips/bootinfo.h line 226
Quoted 1 line
include/asm-mips/bootinfo.h +1
-0+#define CL_SIZE COMMAND_LINE_SIZEReally I would add
MACH_GROUP_MSPafterMACH_GROUP_NEC_EMMA2RH, perhaps 27 or 28, rather than an interior number. Especially if you are going to put it afterMACH_GROUP_NEC_EMMA2RHin the file. ~:^)
Quoted 5 lines
Sure we aren't tied to this number. Looking at the numbering more closely, it looks like numbers aren't reused when they are dropped so it may be safer in case existing boards are still using 23.
Why do you recommend 27 or higher when apparently 26 hasn't been used?
Experience. ~:^) You never know when a little extra room for expansion might come in handy. For example, let's say next year you release a quad-core SOC (hint-hint), and a line of eval boards. You would have room to put them in the file next to your other boards. But just a suggestion.
Cheers,
a
Quoted 8 lines · Thiemo Seufer
Something like
#if LOADADDR == 0xffffffff80000000 .fill 0x400#endif
but by defining an appropriate name in
arch/mips/Makefileinstead of externalizing the load-y/LOADADDR there.
Basically a good idea but it will fail for 64-bit kernels so the test would need to be extended to cover XKPHYS as well. Also R2 processors which have the c0_ebase registers do no need to reserve space for exception handlers as they can easily move them elsewhere.
Ralf
Quoted 5 lines · Andrew Sharp
Experience. ~:^) You never know when a little extra room for expansion might come in handy. For example, let's say next year you release a quad-core SOC (hint-hint), and a line of eval boards. You would have room to put them in the file next to your other boards. But just a suggestion.
Since mips_machtype and mips_machgroup are mostly used to identify systems within Linux changing would not be the most terrible thing on earth. There is no requirement for these numbers to be contiguous either.
Ralf