Skip to contentSkip to conversation

mips: PMC MSP71xx mips common

PATCH Marc St-Jean 2 participants 2 messages Feb 27, 2007 – Feb 28, 2007 MIPS

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Thiemo Seufer
Quoted 3 lines · Marc St-Jean

Thiemo Seufer wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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).

Thanks, I'll introduce this config option to add the above 'jal kernel_entry'. Our build system already takes care of doing the objcopy as well as combining a rootfs, etc. so I'd rather not change the makefile if you have no objections.

Quoted 29 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+ /*
* Reserved space for exception handlers.
* Necessary for machines which link their kernels at

KSEG0.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
       */
      .fill   0x400

+#endif /* CONFIG_PMC_MSP */

This is getting kind of ugly. There are a whole lot of config

choices

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

that need to use the 'j kernel_entry'. Do they all have to

have their

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

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

Quoted 13 lines
Quoted 12 lines
Quoted 3 lines

SYS_NO_EXEPT_FILL or similar flag but this seems excessive.

Any other ideas from arch/mips folks?

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.

Quoted 7 lines
Quoted 3 lines

Thanks for the suggestions Thiemo.

We only need one of these solutions and I think the second one is

cleaner.

You need both as they solve two independent problems. One is rerouting the kernel entry, the other saves some space in the image.

I thought without the .fill that the kernel_entry function would be at the start of text. Apparently not, a quick test shows a crash with both the jal and .fill removed.

Quoted 14 lines
Quoted 3 lines

I do have a few questions before respinning the patch:

1. Why do you want to create another name, wouldn't there be less

confusion

Quoted 1 line

and chance for errors by reusing LOADADDR and ensuring it's the same

as what

Quoted 1 line

the linker script uses?

LOADADDR is a short and thus bad name for a global symbol.

Quoted 2 lines

2. Looking at arch/mips/Makefile there are many boards not using 0xffffffff80000000. If we introduce this check it seems that all of

these

Quoted 1 line

boards will have their _stext changed and it'll affect their "jump"

Quoted 8 lines

address

Quoted 1 line

from monitor/boot scripts?

For targets with a raw binary kernel the assumption is that their firmware jumps to the start of the image. The .fill translates to nops.

Targets which don't use 0x80000000 as load address don't need to reserve space at the start for exception handlers.

Thanks for clarifying,
Marc

#1 lore raw
Quoted 3 lines · Marc St-Jean

I thought without the .fill that the kernel_entry function would be at the start of text. Apparently not, a quick test shows a crash with both the jal and .fill removed.

kernel_entry is __INIT so will actually end near the end of the the executable. That's why the j kernel_entry is needed at all.

Ralf