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.y...@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