0

I am trying to boot my small ARMv7 kernel (which runs just fine using qemu vexpress model) in ARMv8 Foundation Model v2.1. The model boots at level EL3 / 64 bits, and I managed to go down to level EL1 / 32 bits, but I encounter some issues (in a few words, the timer doesn't tick and some kprintf are missing, but that's not the issue here).

To debug my UART issue, I wanted to use the led / switches provides by the model. I can read their value from software quite easily, but I can't write a new value to either of them. The kernel seems to hang. Here is a minimal asm code that writes to the switches register:

.global Start
Start: 
    # we are in EL3 / 64 bits mode
    # create the 0x1C010000 + 0x4 address of switches
    mov  x0, #4
    movk x0, #0x1c01, lsl #16
    # value to write
    mov  w1, #0xaa
    # actual writing
    strb w1, [x0]

It seems I am stuck at the strb instruction. For the record, if I replace strb with ldrb, I can correctly read and display the value of this register (I played with the --switches flag to be sure it worked).

Any one knows what I am doing wrong here ?

EDIT: thanks to unixsmurf suggestions, I know now that I got an synchronous Data Abort Exception with no level change, and that the reason is "Synchronous External Abort". I don't know how to inspect further, I guess I'll try ARM's forum.

Best,

V.

Oak Bytes
  • 4,649
  • 4
  • 36
  • 53
Vinz
  • 5,997
  • 1
  • 31
  • 52
  • Do you have any form of exception trapping set up? Could the write be generating an abort? Do you see the same issue when writing to offset #0x8 (LEDs)? – unixsmurf Sep 19 '14 at 01:53
  • I have the same issue writing to the offset #0x8 for the led. Since I have no mmu at setup at this point (very early boot), I have no exception vector setup at the time. You're right I should try to add one an check if an exception happens. I'll let you know when I can test your suggestion. – Vinz Sep 19 '14 at 05:56
  • Thank you @unixsmurf, I indeed run into an exception (according to arm V8 ref man, it is labeled as "Current Exception level with SP_ELx, Synchronous"). I'll try to figure out what was wrong (I read about some syndrome register I have to read). – Vinz Sep 19 '14 at 07:28
  • I edited the main post with a bit more infos – Vinz Sep 19 '14 at 07:51

1 Answers1

0

The ARM community finally solved the problem. The complete discussion can be found here.

Vinz
  • 5,997
  • 1
  • 31
  • 52