AnsweredAssumed Answered

Problems with mainline (4.2.0) kernel on custom iMX28 board

Question asked by Paul Brown on Sep 30, 2015
Latest reply on Oct 3, 2015 by OtavioSalvador

Hi All,

 

Very new to all this, but please bare with me, also, I apologise if the group I have posted into is not correct, couldn't decide if it was an iMX problem or kernel!!!!

 

I have a custom board, based very loosely on the imx28evk. It is currently running the Freescale 3.2.0 kernel (from http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/)) which works fine (with the very latest u-boot). Basically, when I try to run the 4.2.0 (mainline) kernel I get the usual thing "Uncompressing Linux... done, booting the kernel." and then nothing. I have tried the recommendations from this site:

 

http://stackoverflow.com/questions/24302830/how-to-debug-using-printf-an-assembly-code-of-linux-kernel

 

I found that it gets to the point where it switches on the MMU and then hangs. I have confirmed this by using a JTAG debugger (I was hoping to have done a lot more with it, but I struggle to get on with OpenOCD and gdb), I read the registers after the hang and the PC is at 0xfffffffe, which I believe is a hard fault.

 

Problem is in arch/arm/kernel/head.S

 

ENTRY(__turn_mmu_on)

    mov    r0, r0

-------> ok until this point

    instr_sync

    mcr    p15, 0, r0, c1, c0, 0        @ write control reg

    mrc    p15, 0, r3, c0, c0, 0        @ read id reg

    instr_sync

--------> never gets to here, unless mcr instruction is removed

    mov    r3, r3

    mov    r3, r13

    ret    r3

__turn_mmu_on_end:

ENDPROC(__turn_mmu_on)

 

I have checked the register contents on both working and non-working kernels and both appear to be the same, although I'm not sure how to check c0 or c1! the mov instructions I use to printhex8 the normal registers don't work.

 

I'm not an ARM expert and find the assembler that it uses quite difficult to follow and haven't got time to learn the MMU inside and out.

 

Just wondered if anyone had any ideas on what to try next.

 

Many thanks

 

Paul

Outcomes