Booting 2.6.29-rc3 on mpc8661d_hpcn failing
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
Using MPC86xx HPCN machine description Total memory = 1024MB; using 2048kB for hash table (at cf400000) Linux version 2.6.29-rc3-00014-g4cd6797 (welchma@ubuntu8041) (gcc version 4.1.29 Found initrd at 0xcf783000:0xcfe8ab7e CPU maps initialized for 1 thread per core console [udbg0] enabled setup_arch: bootmem mpc86xx_hpcn_setup_arch() Found FSL PCI host bridge at 0x00000000ffe08000. Firmware bus number: 0->2 PCI host bridge /pcie@ffe08000 (primary) ranges: MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000
IO 0x00000000ffc00000..0x00000000ffc0ffff -> 0x0000000000000000
Found FSL PCI host bridge at 0x00000000ffe09000. Firmware bus number: 0->0 PCI host bridge /pcie@ffe09000 ranges: MEM 0x00000000a0000000..0x00000000bfffffff -> 0x00000000a0000000
IO 0x00000000ffc10000..0x00000000ffc1ffff -> 0x0000000000000000
MPC86xx HPCN board from Freescale Semiconductor arch: exit Zone PFN ranges:
DMA 0x00000000 -> 0x00030000 Normal 0x00030000 -> 0x00030000 HighMem 0x00030000 -> 0x00040000 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0x00000000 -> 0x00040000 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260096 Kernel command line: mpic: Setting up MPIC " MPIC " version 1.2 at ffe40000, max 2 CPUs mpic: ISU size: 256, shift: 8, mask: ff mpic: Initializing for 256 sources i8259 legacy interrupt controller initialized PID hash table entries: 4096 (order: 12, 16384 bytes) clocksource: timebase mult[2800000] shift[22] registered Console: colour dummy device 80x25 Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Memory: 1023696k/1048576k available (4968k kernel code, 23968k reserved, 160k d) SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 Calibrating delay loop... 199.68 BogoMIPS (lpj=99840) Mount-cache hash table entries: 512 mpic: requesting IPIs ... Processor 1 found.
Martyn
Signature · 4 lines
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748 GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square, Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 729849476
Quoted 4 lines · Martyn Welch
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
Gah! That lost it's formatting some how, sorry.
I have just tried 2.6.29-rc2 and I get the same.
Martyn
Signature · 4 lines
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748 GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square, Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 729849476
Quoted 3 lines · Martyn Welch
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
did you update your .dtb as well?
- k
Quoted 8 lines · Kumar Gala
Quoted 3 lines · Martyn Welch
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
did you update your .dtb as well?
We've changed the memory map for that board in the latest u-boot, which is why you need a new .dtb. If this still failing, let me know, and I'll give it a try on my board and see what's up since this is probably my fault :)
Cheers,
B
Quoted 11 lines · Becky Bruce
Quoted 8 lines · Kumar Gala
Quoted 3 lines · Martyn Welch
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
did you update your .dtb as well?
Yup, just double checked it. SOC mapped at ffe00000. If I use the wrong DTB I don't get any serial output...
Quoted 3 lines
We've changed the memory map for that board in the latest u-boot, which is why you need a new .dtb. If this still failing, let me know, and I'll give it a try on my board and see what's up since this is probably my fault :)
It appears the same problem is affecting our sbc610 as well, the location of the SOC hasn't changed on that board.
Martyn
Signature · 4 lines
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748 GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square, Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 729849476
Quoted 11 lines · Martyn Welch
Quoted 9 lines · Becky Bruce
Quoted 8 lines · Kumar Gala
Quoted 3 lines · Martyn Welch
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
did you update your .dtb as well?
Quoted 7 lines
Yup, just double checked it. SOC mapped at
ffe00000. If I use the wrong DTB I don't get any serial output...Quoted 1 line
We've changed the memory map for that board in the latest u-boot, which is why you need a new .dtb. If this still failing, let me know, and I'll give it a try on my board and see what's up since this is probably my fault :)
It appears the same problem is affecting our sbc610 as well, the location of the SOC hasn't changed on that board.
Martyn
Hm.. maybe try a git-bisect between 2.6.28 and 2.6.29-rc3?
- k
Quoted 16 lines · Kumar Gala
Quoted 13 lines · Martyn Welch
Quoted 9 lines · Becky Bruce
Quoted 8 lines · Kumar Gala
Quoted 3 lines · Martyn Welch
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
did you update your .dtb as well?
Yup, just double checked it. SOC mapped at
ffe00000. If I use the wrong DTB I don't get any serial output...
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
We've changed the memory map for that board in the latest u-boot, which is why you need a new .dtb. If this still failing, let me know, and I'll give it a try on my board and see what's up since this is probably my fault :)
It appears the same problem is affecting our sbc610 as well, the location of the SOC hasn't changed on that board.
Martyn
Hm.. maybe try a git-bisect between 2.6.28 and 2.6.29-rc3?
That's was today's "little" task. I was just in the process of writing an email :-)
It got me to the following commit:
commit 64b3d0e8122b422e879b23d42f9e0e8efbbf9744
Author: Benjamin Herrenschmidt <[email protected]>
powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED
I tried reverting it, but as I had kinda thought, that really didn't help.
I'm just recompiling to check that I didn't screw-up during the bisection.
Martyn
Signature · 4 lines
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748 GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square, Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 729849476
Quoted 26 lines · Martyn Welch
Quoted 12 lines · Kumar Gala
Quoted 11 lines · Martyn Welch
Quoted 9 lines · Becky Bruce
Quoted 8 lines · Kumar Gala
Quoted 3 lines · Martyn Welch
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
did you update your .dtb as well?
Quoted 8 lines
Quoted 7 lines
Yup, just double checked it. SOC mapped at
ffe00000. If I use the wrong DTB I don't get any serial output...Quoted 1 line
We've changed the memory map for that board in the latest u-boot, which is why you need a new .dtb. If this still failing, let me know, and I'll give it a try on my board and see what's up since this is probably my fault :)
It appears the same problem is affecting our sbc610 as well, the location of the SOC hasn't changed on that board.
Martyn
Hm.. maybe try a git-bisect between 2.6.28 and 2.6.29-rc3?
That's was today's "little" task. I was just in the process of writing an email :-)
It got me to the following commit:
Quoted 8 lines
commit
64b3d0e8122b422e879b23d42f9e0e8efbbf9744
Author: Benjamin Herrenschmidt <[email protected]>powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED
I tried reverting it, but as I had kinda thought, that really didn't help.
I'm just recompiling to check that I didn't screw-up during the bisection.
Hmm.
take a look at this thread.
http://ozlabs.org/pipermail/linuxppc-dev/2009-January/067437.html
- k
Quoted 29 lines · Kumar Gala
Quoted 26 lines · Martyn Welch
Quoted 12 lines · Kumar Gala
Quoted 11 lines · Martyn Welch
Quoted 9 lines · Becky Bruce
Quoted 8 lines · Kumar Gala
Quoted 3 lines · Martyn Welch
Hi Guys,
It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have just updated u-boot to the latest git to see if that improved matters, however I get stuck at the following. Any ideas?
did you update your .dtb as well?
Quoted 8 lines
Quoted 7 lines
Yup, just double checked it. SOC mapped at
ffe00000. If I use the wrong DTB I don't get any serial output...Quoted 1 line
We've changed the memory map for that board in the latest u-boot, which is why you need a new .dtb. If this still failing, let me know, and I'll give it a try on my board and see what's up since this is probably my fault :)
It appears the same problem is affecting our sbc610 as well, the location of the SOC hasn't changed on that board.
Martyn
Hm.. maybe try a git-bisect between 2.6.28 and 2.6.29-rc3?
That's was today's "little" task. I was just in the process of writing an email :-)
It got me to the following commit:
Quoted 9 lines
Quoted 8 lines
commit
64b3d0e8122b422e879b23d42f9e0e8efbbf9744
Author: Benjamin Herrenschmidt <[email protected]>powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED
I tried reverting it, but as I had kinda thought, that really didn't help.
I'm just recompiling to check that I didn't screw-up during the bisection.
Nope, didn't screw-up...
Quoted 6 lines
Hmm.
take a look at this thread.
http://ozlabs.org/pipermail/linuxppc-dev/2009-January/067437.html
...and that confirms that this issue has well and truly left this newbies comfort zone ;-)
Martyn
Signature · 4 lines
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748 GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square, Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 729849476
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
commit
64b3d0e8122b422e879b23d42f9e0e8efbbf9744
Author: Benjamin Herrenschmidt <[email protected]>
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED
I tried reverting it, but as I had kinda thought, that really didn't help.
I'm just recompiling to check that I didn't screw-up during the bisection.
Is this a chip that must not have M set ? Or something else ? You guys have to help if you CC me, I have about 0 idea what a MPC8661d is :-)
Also, does 4c456a67f501b8b15542c7c21c28812bf88f484b help ?
Quoted 1 line
Cheers,
Ben.
Quoted 12 lines · Benjamin Herrenschmidt
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
commit
64b3d0e8122b422e879b23d42f9e0e8efbbf9744
Author: Benjamin Herrenschmidt <[email protected]>powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED
I tried reverting it, but as I had kinda thought, that really didn't help.
I'm just recompiling to check that I didn't screw-up during the bisection.
Is this a chip that must not have M set ? Or something else ? You guys have to help if you CC me, I have about 0 idea what a MPC8661d is :-)
Sorry, my fault. It's a Freescale SOC with two e600 cores. Beyond that, I'm afraid I'm a little out of my depth.
Quoted 1 line
Also, does
4c456a67f501b8b15542c7c21c28812bf88f484bhelp ?
I believe that to be included in 2.6.29-rc3 if my (rather rudimentary) git skills haven't let me down? The problem persists in 2.6.29-rc3.
Martyn
Signature · 4 lines
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748 GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square, Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 729849476
Quoted 10 lines · Martyn Welch
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
commit
64b3d0e8122b422e879b23d42f9e0e8efbbf9744
Author: Benjamin Herrenschmidt <[email protected]>powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED
I tried reverting it, but as I had kinda thought, that really didn't help.
I'm just recompiling to check that I didn't screw-up during the bisection.
Quoted 9 lines
Quoted 3 lines
Is this a chip that must not have M set ? Or something else ? You guys have to help if you CC me, I have about 0 idea what a MPC8661d is :-)
Sorry, my fault. It's a Freescale SOC with two e600 cores. Beyond that, I'm afraid I'm a little out of my depth.
Quoted 1 line
Also, does
4c456a67f501b8b15542c7c21c28812bf88f484bhelp ?I believe that to be included in 2.6.29-rc3 if my (rather rudimentary) git skills haven't let me down? The problem persists in 2.6.29-rc3.
I've done a bit more investigation:
The primary CPU is spinning in smp_generic_give_timebase() waiting for "!tbsync->ack". The secondary CPU has made it into smp_generic_take_timebase() and has apparently (according to some printk's I put in there) set "tbsync->ack=1". After that I don't get any printk's, I guess that the one I have put in the "!tbsync->handshake" while loop is making it to the print buffer, but with both processors spinning it's not getting to the serial console.
At a guess, given that commit 64b3d0e8122b422e879b23d42f9e0e8efbbf9744 seems to be the point that it stopped working correctly, that "tbsync" is now somehow becoming cached?
Martyn
Signature · 4 lines
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748 GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square, Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 729849476
Quoted 9 lines · Martyn Welch
The primary CPU is spinning in
smp_generic_give_timebase()waiting for "!tbsync->ack". The secondary CPU has made it intosmp_generic_take_timebase()and has apparently (according to some printk's I put in there) set "tbsync->ack=1". After that I don't get any printk's, I guess that the one I have put in the "!tbsync->handshake" while loop is making it to the print buffer, but with both processors spinning it's not getting to the serial console.
Quoted 4 lines
At a guess, given that commit
64b3d0e8122b422e879b23d42f9e0e8efbbf9744seems to be the point that it stopped working correctly, that "tbsync" is now somehow becoming cached?
Maybe we are missing the M bit in the mapping ?
Let's see... the kernel mapping is done via BATs on those guys (ie, e600 is a hash table based processor right ? some kind of 74xx). The code that sets them up is in
arch/powerpc/mm/ppc_mmu_32.c
In mmu_mapin_ram() we call setbat() multiple times. The last argument is the "flags" which is set to _PAGE_RAM. That should contain _PAGE_COHERENT when CONFIG_SMP is set unless I screwed up. IE. _PAGE_RAM is _PAGE_KERNEL | _PAGE_HWEXEC. _PAGE_KERNEL is _PAGE_BASE plus things, and _PAGE_BASE should contains _PAGE_COHERENT if CONFIG_SMP or CONFIG_PPC_STD_MMU are set and they should both be in your case.
setbat() itself will clear _PAGE_COHERENT under some circumstances however. Either if the flags contain _PAGE_NO_CACHE, which should not be the case here, or if the CPU feature bit CPU_FTR_NEED_COHERENT is -not- set. I think that could be the cause of the problem.
CPU_FTR_NEED_COHERENT is set as part of CPU_FTR_COMMON if CONFIG_SMP is set (among other things). So it -should- be set for you. since CPU_FTR_COMMON should be OR'ed with all CPU table entries.
So I'm a bit at a loss here... unless something else went wrong.
Please let me know what you find out.
Cheers,
Ben.
Quoted 38 lines · Benjamin Herrenschmidt
Quoted 9 lines · Martyn Welch
The primary CPU is spinning in
smp_generic_give_timebase()waiting for "!tbsync->ack". The secondary CPU has made it intosmp_generic_take_timebase()and has apparently (according to some printk's I put in there) set "tbsync->ack=1". After that I don't get any printk's, I guess that the one I have put in the "!tbsync->handshake" while loop is making it to the print buffer, but with both processors spinning it's not getting to the serial console.Quoted 4 lines
At a guess, given that commit
64b3d0e8122b422e879b23d42f9e0e8efbbf9744seems to be the point that it stopped working correctly, that "tbsync" is now somehow becoming cached?Maybe we are missing the M bit in the mapping ?
Let's see... the kernel mapping is done via BATs on those guys (ie, e600 is a hash table based processor right ? some kind of 74xx). The code that sets them up is in
arch/powerpc/mm/ppc_mmu_32.cIn
mmu_mapin_ram()we callsetbat()multiple times. The last argument is the "flags" which is set to_PAGE_RAM. That should contain_PAGE_COHERENTwhenCONFIG_SMPis set unless I screwed up. IE._PAGE_RAMis_PAGE_KERNEL|_PAGE_HWEXEC._PAGE_KERNELis_PAGE_BASEplus things, and_PAGE_BASEshould contains_PAGE_COHERENTifCONFIG_SMPorCONFIG_PPC_STD_MMUare set and they should both be in your case.
setbat()itself will clear_PAGE_COHERENTunder some circumstances however. Either if the flags contain_PAGE_NO_CACHE, which should not be the case here, or if the CPU feature bitCPU_FTR_NEED_COHERENTis -not- set. I think that could be the cause of the problem.
CPU_FTR_NEED_COHERENTis set as part ofCPU_FTR_COMMONifCONFIG_SMPis set (among other things). So it -should- be set for you. sinceCPU_FTR_COMMONshould be OR'ed with all CPU table entries.
Quoted 6 lines
So I'm a bit at a loss here... unless something else went wrong.
Please let me know what you find out.
Cheers,
Ben.
I think it is indeed something else. I added the patch below which resulted in the following lines in the kernel messages:
Set BAT 2 for 0x10000000 from phys:0x0 at virt:0xc0000000 Page coherency set
Set BAT 3 for 0x10000000 from phys:0x10000000 at virt:0xd0000000 Page coherency set
...
tbsync structure allocated at 0xef818360 for 0x48 tbsync happens to live at 0xc0515110
running happens to live at 0xc0515114
This suggests to me that whilst *tbsync and running are located within RAM mapped by the BATs, the memory allocated for the tbsync structure is not and is mapped via page tables. I guess this structure is then only mapped correctly for the first core.
Martyn
arch/powerpc/kernel/smp-tbsync.c +4 -0
@@ -117,6 +117,10 @@ void __devinit smp_generic_give_timebase(void)/* if this fails then this kernel won't work anyway... */ tbsync =kzalloc (sizeof (*tbsync),GFP_KERNEL ); +printk ("tbsync structure allocated at 0x%p for 0x%x\n" , tbsync, +sizeof (*tbsync)); +printk ("tbsync happens to live at 0x%p\n" , &tbsync); +printk ("running happens to live at 0x%p\n" , &running);mb (); running =1 ;
arch/powerpc/mm/ppc_mmu_32.c +8 -0
@@ -123,6 +123,9 @@ void __init setbat(int index, unsigned long virt, phys_addr_int wimgxpp;struct ppc_bat *bat =BATS [index]; +printk ("Set BAT %d for 0x%x from phys:0x%lx at virt:0x%lx\n" , index, + size, phys, virt); +if ((flags & _PAGE_NO_CACHE) || (cpu_has_feature (CPU_FTR_NEED_COHERENT ) ==0 )) flags &= ~_PAGE_COHERENT;
@@ -134,6 +137,11 @@ void __init setbat(int index, unsigned long virt, phys_addr wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE | _PAGE_COHERENT | _PAGE_GUARDED); wimgxpp |= (flags & _PAGE_RW)?BPP_RW :BPP_RX ; +if (wimgxpp & _PAGE_COHERENT) { +printk ("Page coherency set\n" ); + }else { +printk ("Page coherency cleared\n" ); + } bat[1 ].batu = virt | (bl <<2 ) |2 ;/* Vs=1, Vp=0 */ bat[1 ].batl =BAT_PHYS_ADDR (phys) | wimgxpp;#ifndef CONFIG_KGDB /* want user access for breakpoints */
Signature · 4 lines
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748 GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square, Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 729849476
I might have missed this but what u-boot rev are you using?
- k
I've posted a patch that I believe should fix your issue.
- k