[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] Guidance requested creating a QEMU MMIO device
From: |
Peter Maydell |
Subject: |
Re: [Qemu-discuss] Guidance requested creating a QEMU MMIO device |
Date: |
Tue, 30 Apr 2019 15:24:25 +0100 |
On Tue, 30 Apr 2019 at 15:09, <address@hidden> wrote:
>
> I made some good progress and has been able to create the code for my
> MMIO-device borrowing from MPS2, compile and link it.
> When I start qemu with gdb to debug MPS2, I get to mps2_machine_init(), then
> to mps2_scc_register_types(), but not to mps2_scc_init() nor to
> mps2_common_init().
>
> I know that the cpu is cortex-a53 and it may not have any UARTs at all.
> I was hoping there was a way to introduce a new device on any cpu that is not
> 'born' with it from the manufacturer, like I attempt to introduce the MPS2 on
> the cortex-a53.
Cortex-A53 is a CPU. This is not related to whethher there's a
UART present or not, which is a question of the design of a
particular SoC or board.
For Cortex-A53 you definitely want to use a different board from
the MPS2, though, because MPS2 is M-profile specific. When
I mentioned it I just meant to say that you could look at the
code in the MPS2 board code that is creating a simple device
and copy the way that works for whatever board it is that
you are using.
> In reality I 'just' need to create a device which is at some physical memory
> address (e.g. 0x09070000) and of size 0x1000, and I want to catch reads and
> writes to this physical address range in my device and respond there. My new
> device is unknown to a real cortex-a53 board.
>
> Is there a way to add such a device, provided that the chosen physical
> address range is free?
> Since I may not have created my MMIO-device correctly, I had hoped I could
> use MPS2 as debugging subject, so I could verify what is done in
> mps2_common_init().
Yes, as I say you can look at the mps2-scc device to see how it
is created and wired up into the memory map.
> I fear that the device-tree is built-in and unique to each cpu
> and cannot be modified in a simple way.
No, the device creation is handled by code for a particular
board, it's not CPU-specific.
thanks
-- PMM