[Top][All Lists]

[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:57:52 +0100

On Tue, 30 Apr 2019 at 15:48, <address@hidden> wrote:
> Thanks for the response.
> I do see that the 3 mps2_..._class_init() functions are called, but I don't 
> see mps2_common_init() being called which suggests that the mc->init field is 
> not called.
> Shouldn't there be created an instance which then should be calling 
> mps2_common_init() where all the initialization takes place?

mps2_common_init is called if you select one of those
board models:

e104462:bionic:qemu$ gdb --args
./build/clang/arm-softmmu/qemu-system-arm -M mps2-an385
GNU gdb (Ubuntu 8.1-0ubuntu3)

(gdb) break mps2_common_init
Breakpoint 1 at 0x15cd8e1: file
/home/petmay01/linaro/qemu-from-laptop/qemu/hw/arm/mps2.c, line 108.
(gdb) r
Starting program:
-M mps2-an385
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffd4409700 (LWP 14526)]

Thread 1 "qemu-system-arm" hit Breakpoint 1, mps2_common_init
    at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/arm/mps2.c:108
108         MPS2MachineState *mms = MPS2_MACHINE(machine);

> Shouldn't an instance also be created for my MMIO that follows the same style 
> and pattern as MPS2?

You should:
 * find the code for the board model you want to use
   (which is definitely not any of the mps boards if you
   are using cortex-a53 as a CPU)
 * put some more code there which creates and wires up your
 * you can use the mps2 device as an example of what your
   device's code should look like (and the mps2 board code
   as an example of what creating it looks like), but you don't
   want to actually run or modify the mps2 board code, because
   mps2 is cortex-m.

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]