[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 02/24] ppc/ppc405: Introduce a PPC405 generic machine
From: |
Cédric Le Goater |
Subject: |
[PATCH v4 02/24] ppc/ppc405: Introduce a PPC405 generic machine |
Date: |
Tue, 9 Aug 2022 17:38:42 +0200 |
We will use this machine as a base to define the ref405ep and possibly
the PPC405 hotfoot board as found in the Linux kernel.
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/ppc405_boards.c | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 1a4e7588c584..96700be74d08 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -50,6 +50,15 @@
#define USE_FLASH_BIOS
+#define TYPE_PPC405_MACHINE MACHINE_TYPE_NAME("ppc405")
+OBJECT_DECLARE_SIMPLE_TYPE(Ppc405MachineState, PPC405_MACHINE);
+
+struct Ppc405MachineState {
+ /* Private */
+ MachineState parent_obj;
+ /* Public */
+};
+
/*****************************************************************************/
/* PPC405EP reference board (IBM) */
/* Standalone board with:
@@ -332,18 +341,34 @@ static void ref405ep_class_init(ObjectClass *oc, void
*data)
mc->desc = "ref405ep";
mc->init = ref405ep_init;
- mc->default_ram_size = 0x08000000;
- mc->default_ram_id = "ef405ep.ram";
}
static const TypeInfo ref405ep_type = {
.name = MACHINE_TYPE_NAME("ref405ep"),
- .parent = TYPE_MACHINE,
+ .parent = TYPE_PPC405_MACHINE,
.class_init = ref405ep_class_init,
};
+static void ppc405_machine_class_init(ObjectClass *oc, void *data)
+{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
+ mc->desc = "PPC405 generic machine";
+ mc->default_ram_size = 128 * MiB;
+ mc->default_ram_id = "ppc405.ram";
+}
+
+static const TypeInfo ppc405_machine_type = {
+ .name = TYPE_PPC405_MACHINE,
+ .parent = TYPE_MACHINE,
+ .instance_size = sizeof(Ppc405MachineState),
+ .class_init = ppc405_machine_class_init,
+ .abstract = true,
+};
+
static void ppc405_machine_init(void)
{
+ type_register_static(&ppc405_machine_type);
type_register_static(&ref405ep_type);
}
--
2.37.1
- [PATCH v4 00/24] ppc: QOM'ify 405 board, Cédric Le Goater, 2022/08/09
- [PATCH v4 01/24] ppc/ppc405: Remove taihu machine, Cédric Le Goater, 2022/08/09
- [PATCH v4 04/24] ppc/ppc405: Move SRAM under the ref405ep machine, Cédric Le Goater, 2022/08/09
- [PATCH v4 06/24] ppc/ppc405: Start QOMification of the SoC, Cédric Le Goater, 2022/08/09
- [PATCH v4 03/24] ppc/ppc405: Move devices under the ref405ep machine, Cédric Le Goater, 2022/08/09
- [PATCH v4 02/24] ppc/ppc405: Introduce a PPC405 generic machine,
Cédric Le Goater <=
- [PATCH v4 07/24] ppc/ppc405: QOM'ify CPU, Cédric Le Goater, 2022/08/09
- [PATCH v4 05/24] ppc/ppc405: Introduce a PPC405 SoC, Cédric Le Goater, 2022/08/09
- [PATCH v4 08/24] ppc/ppc4xx: Introduce a DCR device model, Cédric Le Goater, 2022/08/09