[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 3/6] ast2400: use machine cpu_model to initialize the
From: |
Cédric Le Goater |
Subject: |
[Qemu-arm] [PATCH 3/6] ast2400: use machine cpu_model to initialize the soc cpu |
Date: |
Wed, 27 Jul 2016 18:46:55 +0200 |
It will be easier to specify a different cpu for other soc derived
from the ast2400 soc.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/arm/ast2400.c | 8 +++++++-
hw/arm/palmetto-bmc.c | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/arm/ast2400.c b/hw/arm/ast2400.c
index fa535065f765..7f3517a2c6c6 100644
--- a/hw/arm/ast2400.c
+++ b/hw/arm/ast2400.c
@@ -15,6 +15,7 @@
#include "qemu-common.h"
#include "cpu.h"
#include "exec/address-spaces.h"
+#include "hw/boards.h"
#include "hw/arm/ast2400.h"
#include "hw/char/serial.h"
#include "qemu/log.h"
@@ -65,9 +66,14 @@ static const MemoryRegionOps ast2400_io_ops = {
static void ast2400_init(Object *obj)
{
+ const char *cpu_model = current_machine->cpu_model;
AST2400State *s = AST2400(obj);
- s->cpu = cpu_arm_init("arm926");
+ if (!cpu_model) {
+ cpu_model = "arm926";
+ }
+
+ s->cpu = cpu_arm_init(cpu_model);
object_initialize(&s->vic, sizeof(s->vic), TYPE_ASPEED_VIC);
object_property_add_child(obj, "vic", OBJECT(&s->vic), NULL);
diff --git a/hw/arm/palmetto-bmc.c b/hw/arm/palmetto-bmc.c
index f80a15733864..8a3ff5568575 100644
--- a/hw/arm/palmetto-bmc.c
+++ b/hw/arm/palmetto-bmc.c
@@ -91,6 +91,7 @@ static void aspeed_init(MachineState *machine)
static void palmetto_bmc_init(MachineState *machine)
{
+ machine->cpu_model = "arm926";
aspeed_init(machine);
}
--
2.1.4
- [Qemu-arm] [PATCH 1/6] palmetto-bmc: add a "silicon-rev" property at the soc level, (continued)
- [Qemu-arm] [PATCH 2/6] palmetto-bmc: replace palmetto_bmc with aspeed, Cédric Le Goater, 2016/07/27
- [Qemu-arm] [PATCH 4/6] palmetto-bmc: add board specific configuration, Cédric Le Goater, 2016/07/27
- [Qemu-arm] [PATCH 3/6] ast2400: use machine cpu_model to initialize the soc cpu,
Cédric Le Goater <=
- [Qemu-arm] [PATCH 5/6] aspeed: add ast2500 support to scu and sdmc controllers, Cédric Le Goater, 2016/07/27
- [Qemu-arm] [PATCH 6/6] arm: add support for an ast2500 evaluation board, Cédric Le Goater, 2016/07/27