This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Arm MMU configuration works on (qemu) raspberry(a53) but not on virt(armv7, a53) board

Now, I’m aware that this is a complex question and might not be resolved here. I am new to embedded/processor programming and I would like to know if there are any major differences between those two boards(cpu wise). I thought that since it is the same CPU (which I think has the same mmu, at least I couldn’t find any information about different versions), my code for the page table config would be universal.

A bit more context, both versions run on exactly the same code, and I am configuring one gigabyte as a section for the boot loaders (which is the current code, the one writing to the page tables) memory.

When I turn on the MMU(after writing the page table to memory and configuring tcr), the next read of the pc causes a “memory, not accessible” exception, but only on the virt board, on the raspi3b board it works just fine.

Best regards Niklas

Parents
  • Translation tables describe the memory system to the processor.  So even if the processor is the same, a differing memory system is going to need different tables.  A few things you might want to check.

    Perhaps obvious, but is memory actually in the same place on both boards?

    Are you in the same Exception level and Security state on both systems?  There are differences in the table formats based on EL/Security state.  For example, in Secure state the descriptors include an NS (or NSTable) bit, which is ignored in Non-secure state. 

    Are you relying on any implicit configuration?  Most system registers in Armv8-A don't have defined reset values, it's up to software to initialise them.  It's easy to write code that "works" but is relying on an uninitialised bit (or a bit set up by previous firmware on platform but not another).

Reply
  • Translation tables describe the memory system to the processor.  So even if the processor is the same, a differing memory system is going to need different tables.  A few things you might want to check.

    Perhaps obvious, but is memory actually in the same place on both boards?

    Are you in the same Exception level and Security state on both systems?  There are differences in the table formats based on EL/Security state.  For example, in Secure state the descriptors include an NS (or NSTable) bit, which is ignored in Non-secure state. 

    Are you relying on any implicit configuration?  Most system registers in Armv8-A don't have defined reset values, it's up to software to initialise them.  It's easy to write code that "works" but is relying on an uninitialised bit (or a bit set up by previous firmware on platform but not another).

Children