archive mirror
 help / color / mirror / Atom feed
* mpc8572e linux kernel board bring-up problem
@ 2016-11-23 14:00 Nicolas Beland
  2016-11-23 23:05 ` Rob Landley
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Beland @ 2016-11-23 14:00 UTC (permalink / raw)
  To: linux-embedded

Hi everyone! 

I got lucky and got an embedded linux internship:)

I'm trying to port linux to an existing board that is currently using vxWorks. 
The board uses an mpc8572e processor which contains two e500v2 cores. Basically, the entry point in vmlinux is arch/powerpc/kernel/head_fsl_booke.S 

We are using the simpleboot bootwrapper which works just fine (simpleboot passes the device tree address and jump right into the gunziped vmlinux which is located at 0x0 physical). 

head_fsl_booke.S include arch/powerpc/kernel/fsl_booke_entry_mapping.S and we just crash at line 223 (rfi instruction) of fsl_booke_entry_mapping.S 

215 lis r7,MSR_KERNEL@h 
216 ori r7,r7,MSR_KERNEL@l 
217 bl 1f /* Find our address */ 
218 1: mflr r9 
219 rlwimi r6,r9,0,20,31 
220 addi r6,r6,(2f - 1b) 
221 mtspr SPRN_SRR0,r6 
222 mtspr SPRN_SRR1,r7 
223 rfi /* start execution out of TLB1[0] entry */ 

rfi at line 223 causes us to jump to 0xc000_0264 while we want to jump to 0x000_0264. 
This is not caused by our mmu, we are basically loading 0xc000_0264 in srr0 

I think it's related to the following config fields in our defconfig: 
CONFIG_PAGE_OFFSET=0xc0000000 <---- 
CONFIG_KERNEL_START=0xc00000000 <----- 

I tried to set CONFIG_KERNEL_START and CONFIG_PAGE_OFFSET to 0x0 but this would not compile: 
arch/powerpc/include/asm/processor.h:100:2: error: #error User TASK_SIZE overlaps with KERNEL_START address 

By the way CONFIG_TASK_SIZE=0xc0000000 

Also, my debugger cannot map anything because all the symbols in vmlinux are at 0xcxxx_xxxx but we are at 0x0xxx_xxxx 

Pretty much all the ports that uses the simpleboot bootwrapper are gunzipping vmlinux at 0x0 but I can easily change that and I tried to send vmlinux at 0xc000_0000 and it solved this particular issue but then the mmu mapping just does not work because simpleboot extract our device tree at about 0x0011_0000 and we need vmlinux and the device tree to be inside a 64Mb page (also tried to hack fsl_booke_entry_mapping.S to create a 4GB tlb entry based at 0x0 and this was causing other issues...) 

Got any idea? 
Also, I found out that __machine_desc_start is invalid (I see .long 0x0 as value in my on-chip debugger for this symbol when I tried to use a 4GB tlb entry.). This was causing me issues in probe_machine() located in arch/powerpc/kernel/setup-common.c when I tried the 4GB tlb approach. The 4GB tlb entry was also causing issues with the __va() macro (it was doing address translation from physical to virtual address) so I was removing the calls to that macro to make it work. but I don't really wan't to hack the kernel all over the place because I don't understand how it's supposed to be done. I suppose it's somehow still related to the configs above? For the 4GB tlb entry I want  __va() to return what it received because we are using a 1:1 mapping.
Btw, I'm on the right mailing list?


Nicolas Béland
Dialogic Inc. Montreal (Canada)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mpc8572e linux kernel board bring-up problem
  2016-11-23 14:00 mpc8572e linux kernel board bring-up problem Nicolas Beland
@ 2016-11-23 23:05 ` Rob Landley
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Landley @ 2016-11-23 23:05 UTC (permalink / raw)
  To: Nicolas Beland, linux-embedded

On 11/23/2016 08:00 AM, Nicolas Beland wrote:
> Btw, I'm on the right mailing list?

It's an ok mailing list for this but the volume here is pretty low. You
might have better luck on the powerpc mailing list.

The list of lists is at by the way.

If you want more rapid turnaround, freenode irc channels might (or might
not) work for that.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-23 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-23 14:00 mpc8572e linux kernel board bring-up problem Nicolas Beland
2016-11-23 23:05 ` Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).