qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] hw/mips: Add MIPS virt board


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 2/2] hw/mips: Add MIPS virt board
Date: Tue, 7 Mar 2023 21:10:45 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 4/3/23 23:38, Jiaxun Yang wrote:
MIPS virt board is design to utilize existing VirtIO infrastures
but also comptitable with MIPS's existing internal simulation tools.

It includes virtio-pci, virtio-mmio, pcie gpex, flash rom, fw_cfg,
goldfish-rtc and MIPS CPS system.

It should be able to cooperate with any MIPS CPU cores.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
v1:
  - Rename to virt board
  - Convert BIOS flash to ROM
  - Cleanups
v2:
  - Fix fdt flash
  - Remove UP variant
---
  MAINTAINERS                             |   7 +
  configs/devices/mips-softmmu/common.mak |   1 +
  docs/system/target-mips.rst             |  22 +
  hw/mips/Kconfig                         |  17 +
  hw/mips/meson.build                     |   1 +
  hw/mips/virt.c                          | 916 ++++++++++++++++++++++++
  6 files changed, 964 insertions(+)
  create mode 100644 hw/mips/virt.c


+static void virt_machine_init(MachineState *machine)
+{
+    MIPSVirtState *s = MIPS_VIRT_MACHINE(machine);
+    MemoryRegion *system_memory = get_system_memory();
+    const MemMapEntry *memmap = virt_memmap;
+    int i;
+
+    s->cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
+    clock_set_hz(s->cpuclk, VIRT_CPU_REF_CLK_FREQ);
+
+    s->cps = MIPS_CPS(qdev_new(TYPE_MIPS_CPS));
+    object_property_set_str(OBJECT(s->cps), "cpu-type", machine->cpu_type,
+                            &error_fatal);
+    object_property_set_int(OBJECT(s->cps), "num-core", machine->smp.cpus,
+                            &error_fatal);
+    qdev_connect_clock_in(DEVICE(s->cps), "clk-in", s->cpuclk);
+    sysbus_realize(SYS_BUS_DEVICE(s->cps), &error_fatal);

qemu-system-mips64el: Property 'mips-cps.num-core' not found

I'm worried. I suppose you want this property:

  DEFINE_PROP_UINT32("num-vp", MIPSCPSState, num_vp, 1),

Is your series based on mainstream QEMU?



reply via email to

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