All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: qemu-ppc@nongnu.org
Cc: "Daniel Henrique Barboza" <danielhb413@gmail.com>,
	qemu-devel@nongnu.org, "BALATON Zoltan" <balaton@eik.bme.hu>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: [PATCH v3 03/22] ppc/ppc405: Move devices under the ref405ep machine
Date: Mon,  8 Aug 2022 12:27:15 +0200	[thread overview]
Message-ID: <20220808102734.133084-4-clg@kaod.org> (raw)
In-Reply-To: <20220808102734.133084-1-clg@kaod.org>

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ppc/ppc405_boards.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 96700be74d08..f4794ba40ce6 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -230,13 +230,11 @@ static void boot_from_kernel(MachineState *machine, PowerPCCPU *cpu)
     env->load_info = &boot_info;
 }
 
-static void ref405ep_init(MachineState *machine)
+static void ppc405_init(MachineState *machine)
 {
     MachineClass *mc = MACHINE_GET_CLASS(machine);
     const char *kernel_filename = machine->kernel_filename;
     PowerPCCPU *cpu;
-    DeviceState *dev;
-    SysBusDevice *s;
     MemoryRegion *sram = g_new(MemoryRegion, 1);
     MemoryRegion *ram_memories = g_new(MemoryRegion, 2);
     hwaddr ram_bases[2], ram_sizes[2];
@@ -294,15 +292,6 @@ static void ref405ep_init(MachineState *machine)
         memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
     }
 
-    /* Register FPGA */
-    ref405ep_fpga_init(sysmem, PPC405EP_FPGA_BASE);
-    /* Register NVRAM */
-    dev = qdev_new("sysbus-m48t08");
-    qdev_prop_set_int32(dev, "base-year", 1968);
-    s = SYS_BUS_DEVICE(dev);
-    sysbus_realize_and_unref(s, &error_fatal);
-    sysbus_mmio_map(s, 0, PPC405EP_NVRAM_BASE);
-
     /* Load kernel and initrd using U-Boot images */
     if (kernel_filename && machine->firmware) {
         target_ulong kernel_base, initrd_base;
@@ -335,6 +324,23 @@ static void ref405ep_init(MachineState *machine)
     }
 }
 
+static void ref405ep_init(MachineState *machine)
+{
+    DeviceState *dev;
+    SysBusDevice *s;
+
+    ppc405_init(machine);
+
+    /* Register FPGA */
+    ref405ep_fpga_init(get_system_memory(), PPC405EP_FPGA_BASE);
+    /* Register NVRAM */
+    dev = qdev_new("sysbus-m48t08");
+    qdev_prop_set_int32(dev, "base-year", 1968);
+    s = SYS_BUS_DEVICE(dev);
+    sysbus_realize_and_unref(s, &error_fatal);
+    sysbus_mmio_map(s, 0, PPC405EP_NVRAM_BASE);
+}
+
 static void ref405ep_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
@@ -354,6 +360,7 @@ static void ppc405_machine_class_init(ObjectClass *oc, void *data)
     MachineClass *mc = MACHINE_CLASS(oc);
 
     mc->desc = "PPC405 generic machine";
+    mc->init = ppc405_init;
     mc->default_ram_size = 128 * MiB;
     mc->default_ram_id = "ppc405.ram";
 }
-- 
2.37.1



  parent reply	other threads:[~2022-08-08 10:31 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 10:27 [PATCH v3 00/22] ppc: QOM'ify 405 board Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 01/22] ppc/ppc405: Remove taihu machine Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 02/22] ppc/ppc405: Introduce a PPC405 generic machine Cédric Le Goater
2022-08-08 12:23   ` BALATON Zoltan
2022-08-08 10:27 ` Cédric Le Goater [this message]
2022-08-08 12:23   ` [PATCH v3 03/22] ppc/ppc405: Move devices under the ref405ep machine BALATON Zoltan
2022-08-08 10:27 ` [PATCH v3 04/22] ppc/ppc405: Move SRAM " Cédric Le Goater
2022-08-08 12:25   ` BALATON Zoltan
2022-08-08 13:38     ` Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 05/22] ppc/ppc405: Introduce a PPC405 SoC Cédric Le Goater
2022-08-08 12:43   ` BALATON Zoltan
2022-08-08 13:51     ` Cédric Le Goater
2022-08-08 14:02       ` BALATON Zoltan
2022-08-08 10:27 ` [PATCH v3 06/22] ppc/ppc405: Start QOMification of the SoC Cédric Le Goater
2022-08-08 12:59   ` BALATON Zoltan
2022-08-08 15:20     ` Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 07/22] ppc/ppc405: QOM'ify CPU Cédric Le Goater
2022-08-08 13:17   ` BALATON Zoltan
2022-08-08 16:06     ` Cédric Le Goater
2022-08-08 17:05       ` BALATON Zoltan
2022-08-08 17:14         ` Peter Maydell
2022-08-08 17:25           ` BALATON Zoltan
2022-08-09 10:09             ` Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 08/22] ppc/ppc4xx: Introduce a DCR device model Cédric Le Goater
2022-08-08 13:29   ` BALATON Zoltan
2022-08-08 15:35     ` Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 09/22] ppc/ppc405: QOM'ify CPC Cédric Le Goater
2022-08-08 14:12   ` BALATON Zoltan
2022-08-08 10:27 ` [PATCH v3 10/22] ppc/ppc405: QOM'ify GPT Cédric Le Goater
2022-08-08 14:25   ` BALATON Zoltan
2022-08-08 10:27 ` [PATCH v3 11/22] ppc/ppc405: QOM'ify OCM Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 12/22] ppc/ppc405: QOM'ify GPIO Cédric Le Goater
2022-08-08 14:32   ` BALATON Zoltan
2022-08-08 14:50     ` Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 13/22] ppc/ppc405: QOM'ify DMA Cédric Le Goater
2022-08-08 14:35   ` BALATON Zoltan
2022-08-08 10:27 ` [PATCH v3 14/22] ppc/ppc405: QOM'ify EBC Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 15/22] ppc/ppc405: QOM'ify OPBA Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 16/22] ppc/ppc405: QOM'ify POB Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 17/22] ppc/ppc405: QOM'ify PLB Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 18/22] ppc/ppc405: QOM'ify MAL Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 19/22] ppc/ppc405: QOM'ify FPGA Cédric Le Goater
2022-08-08 14:55   ` BALATON Zoltan
2022-08-08 15:58     ` Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 20/22] ppc/ppc405: Use an explicit PPCUIC object Cédric Le Goater
2022-08-08 14:58   ` BALATON Zoltan
2022-08-08 10:27 ` [PATCH v3 21/22] ppc/ppc405: Use an explicit I2C object Cédric Le Goater
2022-08-08 10:27 ` [PATCH v3 22/22] ppc/ppc4xx: Fix sdram trace events Cédric Le Goater
2022-08-08 12:16 ` [PATCH v3 00/22] ppc: QOM'ify 405 board BALATON Zoltan
2022-08-08 13:10   ` Cédric Le Goater
2022-08-08 14:08     ` BALATON Zoltan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220808102734.133084-4-clg@kaod.org \
    --to=clg@kaod.org \
    --cc=balaton@eik.bme.hu \
    --cc=danielhb413@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.