Skip to contentSkip to conversation

40x PPC relocation issue during boot

DISCUSSION Torben Mathiasen 2 participants 2 messages Apr 2, 2004

lore
Share & tools
lore
#0 lore raw

Looking at the current 2.6 tree, there's an issue when one tries to boot a zImage image (with or without an attached initrd). This is present in the -benh tree as well.

In ~/arch/ppc/boot/simple/relocate.S the following snip is present:

..

	li	r9,0xc
	mtlr	r9
#ifdef CONFIG_PPC_MULTIPLATFORM
	/* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD,
	 * and tell the kernel to start on the 4th instruction since we
	 * overwrite the first 3 sometimes (which are 'nop').
	 */
	lis	r10,0xdeadc0de@h
	ori	r10,r10,0xdeadc0de@l
	li	r9,0
	stw	r10,0(r9)

#endif
blr

We jump to the 4th instruction, but for the 40x class of cpu's this inst being taken into account anymore. 3 nop's are missing from head_4xx.S:

.text
_GLOBAL(_stext)
_GLOBAL(_start)

	/* Save parameters we are passed.
	*/
	mr	r31,r3
	mr	r30,r4
	...
	...

The requirements of the 3 nops is silly anyway, but the relocation code needs to be fixed. I haven't done the patch as I'm not sure if any other code will overwrite the first 3 instructions. I hit this bug on an IBM 405EP dev platform.

Torben
-

#1 lore raw
Quoted 5 lines · Torben Mathiasen

Looking at the current 2.6 tree, there's an issue when one tries to boot a zImage image (with or without an attached initrd). This is present in the -benh tree as well.

In ~/arch/ppc/boot/simple/relocate.S the following snip is present:

Tom and I discussed this yesterday since it was breaking ppc44x as well. He already has a relocate.S patch in akpm's queue to fix the issue.

-Matt