* 2.6.8.1 not booting on 405CR
@ 2004-09-23 9:35 Piotr Perak
2004-09-23 11:08 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: Piotr Perak @ 2004-09-23 9:35 UTC (permalink / raw)
To: linux-kernel
Hi.
We already have 2.4.23 kernel working on our board using IBM 405CR
processor. Now we're trying to start 2.6.8.1. But we have some strange
problems.
We use assembler intruction resetting the processor to see what is
executing (our breakpoint mechanism :) ). No metter what crosstool we use
the execuiton stops in same function. Here's the call stack.
setup_arch() - arch/ppc/kernel/setup.c
-> ocp_early_init() - arch/ppc/syslib/ocp.c
-> ocp_add_one_device() - arch/ppc/syslib/ocp.c
-> alloc_bootmem MACRO calling __alloc_bootmem_core() -
mm/bootmem.c
We added our "breakpoint" so __alloc_bootmem_core() looks like:
/* ... */
160 eidx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
161 asm ("mtspr 0x3f2, 12"); /* <-- our "breakpoint" */
162 offset = 0;
/* ... */
What is happening is that in working 2.4.23 kernel this code resets
processor, but in 2.6.8.1 it doesn't. This is very strange because the
assembler code generated in both is the same.
[root@localhost kernel]# powerpc-405-linux-gnu-objdump -S mm/bootmem.o >
asm
for kernel 2.4.23:
eidx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
338: 80 dd 00 00 lwz r6,0(r29)
33c: 81 3d 00 04 lwz r9,4(r29)
340: 54 c0 a3 3e rlwinm r0,r6,20,12,31
344: 7c e0 48 50 subf r7,r0,r9
asm ("mtspr 0x3f2, 12");
348: 7d 92 fb a6 mtdbcr0 r12
offset = 0;
and for kernel 2.6.8.1:
eidx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
22c: 80 bf 00 00 lwz r5,0(r31)
230: 81 3f 00 04 lwz r9,4(r31)
234: 54 a0 a3 3e rlwinm r0,r5,20,12,31
238: 7d 80 48 50 subf r12,r0,r9
asm ("mtspr 0x3f2, 12");
23c: 7d 92 fb a6 mtdbcr0 r12
offset = 0;
As you can see only used registers differ.
We moved eidx = bdata->node_low_pfn ... to the local variables definition
section so it looks like:
unsigned long eidx = bdata->node_low_pfn - (bdata->node_boot_start >>
PAGE_SHIFT);
and now the reset works in 2.6.8.1 too. Why? But then we move our
breakpoint to:
181 preferred = ((preferred + align - 1) & ~(align - 1)) >> PAGE_SHIFT;
182 preferred += offset;
183 areasize = (size+PAGE_SIZE-1)/PAGE_SIZE;
184 asm ("mtspr 0x3f2, 12");
185 incr = align >> PAGE_SHIFT ? : 1;
and it doesn't reset the processor. In 2.4.23 it does. We splitted 183
line into two and it resets then! But after we place reset instruction
after 185 line (incr = ...) it doesn't reset again!
Anyone has any ideas? Anyone seen 2.6.8.1 kernel working on 405CR?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: 2.6.8.1 not booting on 405CR
2004-09-23 9:35 2.6.8.1 not booting on 405CR Piotr Perak
@ 2004-09-23 11:08 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2004-09-23 11:08 UTC (permalink / raw)
To: Piotr Perak; +Cc: Linux Kernel list
On Thu, 2004-09-23 at 19:35, Piotr Perak wrote:
> Hi.
>
> We already have 2.4.23 kernel working on our board using IBM 405CR
> processor. Now we're trying to start 2.6.8.1. But we have some strange
> problems.
I suggest you ask your question on the linuxppc-dev list (or better,
linuxppc-embedded, but that one was just re-created from the old
dead listserver so people may not be subscribed yet).
Look for those on http://ozlabs.org/mailman/listinfo
Ben.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-23 11:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-23 9:35 2.6.8.1 not booting on 405CR Piotr Perak
2004-09-23 11:08 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox