Adding secondary ARM processor
Hello,
I have board with A9 processor (playing with vexpress model),
for test I want to also add to this setup M3 processor.
The problem is that secondary CPU sees the same device (eg. UART) with different address. I can not figure out, how should I do that. Is it possible in qemu?
If yes, could you point me where I should start to look at it?
Regards,
Marcin
Quoted 6 lines · mar.krzeminski
Hello,
I have board with A9 processor (playing with vexpress model), for test I want to also add to this setup M3 processor.
The problem is that secondary CPU sees the same device (eg. UART) with different address.
How far into the boot are you? Does A9 have MMU turned on?
info mtree from the monitor should show the view of the address maps. Anything weird there?
Quoted 1 line
I can not figure out, how should I do that. Is it possible in qemu?
Yes it should be possible.
Quoted 2 lines
If yes, could you point me where I should start to look at it?
xlnx-zynqmp board, which does something similar with A53 and R5. It is mixed with a combo of MMU and no-MMU capable CPUs.
Regards,
Peter
Quoted 3 lines
Regards,
Marcin
W dniu 01.09.2015 o 19:45, Peter Crosthwaite pisze:
Quoted 4 lines
Quoted 2 lines · mar.krzeminski
Hello,
Quoted 8 lines
Quoted 4 lines
I have board with A9 processor (playing with vexpress model), for test I want to also add to this setup M3 processor.
The problem is that secondary CPU sees the same device (eg. UART) with different address.How far into the boot are you? Does A9 have MMU turned on?
info mtree from the monitor should show the view of the address maps. Anything weird there?
I mess my question, sorry.
I meant that address seen from M3 are different by design,
eg. UART0 seen from M3 has base address 0x100, but same UART0 from A9 is mapped at 0x200 and I want to emulate this. This required some remapping at sysbus level (I think), and I do not know how to do that - even where to start, that is why I need your help.
Quoted 7 lines
Quoted 1 line
I can not figure out, how should I do that. Is it possible in qemu?
Yes it should be possible.
Quoted 2 lines
If yes, could you point me where I should start to look at it?
xlnx-zynqmp board, which does something similar with A53 and R5. It is mixed with a combo of MMU and no-MMU capable CPUs.
I saw this board, but my basic problem is with address mapping.
Quoted 7 lines
Regards,
PeterQuoted 3 lines
Regards,
Marcin
Quoted 17 lines · mar.krzeminski
W dniu 01.09.2015 o 19:45, Peter Crosthwaite pisze:
Quoted 11 lines
Quoted 7 lines · mar.krzeminski
Hello,
I have board with A9 processor (playing with vexpress model), for test I want to also add to this setup M3 processor.
The problem is that secondary CPU sees the same device (eg. UART) with different address.Quoted 4 lines
How far into the boot are you? Does A9 have MMU turned on?
info mtree from the monitor should show the view of the address maps. Anything weird there?
Quoted 6 lines
I mess my question, sorry.
I meant that address seen from M3 are different by design, eg. UART0 seen from M3 has base address0x100, but same UART0 from A9 is mapped at0x200and I want to emulate this.
This required some remapping at sysbus level (I think), and I do not know how to do that - even where to start, that is why I need your help.
You need the have multiple address spaces, on the machine level. Create an alternate address space for you M3 and assign it as the cpu address space (.as field) for that CPU.
sysbus-mmio-map maps things into the default address space. To map into this non-default AS you need to sysbus_mmio_get_region + memory_region_add_subregion (to the AS root Memory Region). But you can only map the original MR once, so you need an alias. Overall something like this:
ARMCPU m3 = ...
AddressSpace m3as = ...
MemoryRegion uart_m3_alias
CPU(m3)->as = m3as //This is more complex than this but the general idea.
sysbus_mmio_map(uart ...); // as normal, handles A9 via default memory_region_init_alias(uart_m3_alias, sysbus_mmio_get_region(uart ...)); memory_region_add_subregion(m3as->root, uart_m3_alias, M3_UART_ALTERNATE_ADDRESS);
This will leave you with an M3 that can see only the UART (at the new address). You also probably want to map other things from the default address (RAM etc). Have a look at memory region priorities which can make lighter work of this, with a big background region and some overlaying higher prio regions to do your specifics.
HTH.
Regards,
Peter
Quoted 20 lines
Quoted 9 lines
Quoted 2 lines
I can not figure out, how should I do that. Is it possible in qemu?
Yes it should be possible.
Quoted 2 lines
If yes, could you point me where I should start to look at it?
xlnx-zynqmp board, which does something similar with A53 and R5. It is mixed with a combo of MMU and no-MMU capable CPUs.
I saw this board, but my basic problem is with address mapping.
Quoted 8 lines
Regards,
PeterQuoted 3 lines
Regards,
Marcin
Thanks Peter,
Now I am know where I need to start digging and reading so it really helped!
Regards,
Marcin
2015-09-01 22:12 GMT+02:00 Peter Crosthwaite <[email protected]>:
Quoted 78 lines
Quoted 17 lines · mar.krzeminski
W dniu 01.09.2015 o 19:45, Peter Crosthwaite pisze:
Quoted 11 lines
Quoted 7 lines · mar.krzeminski
Hello,
I have board with A9 processor (playing with vexpress model), for test I want to also add to this setup M3 processor.
The problem is that secondary CPU sees the same device (eg. UART) with different address.Quoted 4 lines
How far into the boot are you? Does A9 have MMU turned on?
info mtree from the monitor should show the view of the address maps. Anything weird there?
Quoted 6 lines
I mess my question, sorry.
I meant that address seen from M3 are different by design, eg. UART0 seen from M3 has base address0x100, but same UART0 from A9 is mapped at0x200and I want to emulate this.
This required some remapping at sysbus level (I think), and I do not know how to do that - even where to start, that is why I need your help.You need the have multiple address spaces, on the machine level. Create an alternate address space for you M3 and assign it as the cpu address space (.as field) for that CPU.
sysbus-mmio-map maps things into the default address space. To map into this non-default AS you need to
sysbus_mmio_get_region+memory_region_add_subregion(to the AS root Memory Region). But you can only map the original MR once, so you need an alias. Overall something like this:ARMCPU m3 = ...
AddressSpace m3as = ...
MemoryRegionuart_m3_alias
CPU(m3)->as = m3as //This is more complex than this but the general idea.
sysbus_mmio_map(uart ...); // as normal, handles A9 via defaultmemory_region_init_alias(uart_m3_alias, sysbus_mmio_get_region(uart ...));memory_region_add_subregion(m3as->root, uart_m3_alias, M3_UART_ALTERNATE_ADDRESS);This will leave you with an M3 that can see only the UART (at the new address). You also probably want to map other things from the default address (RAM etc). Have a look at memory region priorities which can make lighter work of this, with a big background region and some overlaying higher prio regions to do your specifics.
HTH.
Regards,
PeterQuoted 20 lines
Quoted 9 lines
Quoted 2 lines
I can not figure out, how should I do that. Is it possible in qemu?
Yes it should be possible.
Quoted 2 lines
If yes, could you point me where I should start to look at it?
xlnx-zynqmp board, which does something similar with A53 and R5. It is mixed with a combo of MMU and no-MMU capable CPUs.
I saw this board, but my basic problem is with address mapping.
Quoted 8 lines
Regards,
PeterQuoted 3 lines
Regards,
Marcin