[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH 3/6] ast2400: use machine cpu_model to initialize
From: |
Andrew Jeffery |
Subject: |
Re: [Qemu-arm] [PATCH 3/6] ast2400: use machine cpu_model to initialize the soc cpu |
Date: |
Thu, 28 Jul 2016 12:07:18 +0930 |
On Wed, 2016-07-27 at 18:46 +0200, Cédric Le Goater wrote:
> 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);
I did a similar thing in the series introducing the AST2400 SoC, and
Peter had a comment on the approach[1]:
What we do now is not let the user override the cpu model at all;
presumably this SoC only ever has an ARM926 and it doesn't make
any sense to have some frankenstein "this SoC but with a different
CPU in it" config.
Given this is the ast2400_init() it looks to me like we should be
hardwiring the CPU rather than leaving it to the machine to define.
[1] https://patchwork.kernel.org/patch/8325651/
>
> 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);
> }
>
signature.asc
Description: This is a digitally signed message part
- Re: [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, 2016/07/27
- Re: [Qemu-arm] [PATCH 3/6] ast2400: use machine cpu_model to initialize the soc cpu,
Andrew Jeffery <=
[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