qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1 1/3] bcm2836: Make CPU type configurable


From: Pekka Enberg
Subject: Re: [Qemu-devel] [PATCH v1 1/3] bcm2836: Make CPU type configurable
Date: Fri, 16 Feb 2018 09:04:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2



On 02/15/2018 01:48 PM, Peter Maydell wrote:
On 8 February 2018 at 05:50, Pekka Enberg <address@hidden> wrote:
This patch adds a "cpu-type" property to BCM2836 SoC in preparation for
reusing the code for the Raspberry Pi 3, which has a different processor
model.

Signed-off-by: Pekka Enberg <address@hidden>

--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -135,6 +135,8 @@ static void raspi2_init(MachineState *machine)
      /* Setup the SOC */
      object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(&s->ram),
                                     &error_abort);
+    object_property_set_str(OBJECT(&s->soc), machine->cpu_type, "cpu-type",
+                            &error_abort);
      object_property_set_int(OBJECT(&s->soc), smp_cpus, "enabled-cpus",
                              &error_abort);
      object_property_set_int(OBJECT(&s->soc), 0xa21041, "board-rev",
@@ -166,6 +168,7 @@ static void raspi2_machine_init(MachineClass *mc)
      mc->no_parallel = 1;
      mc->no_floppy = 1;
      mc->no_cdrom = 1;
+    mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15");
      mc->max_cpus = BCM2836_NCPUS;
      mc->min_cpus = BCM2836_NCPUS;
      mc->default_cpus = BCM2836_NCPUS;

This change means that instead of ignoring the user's -cpu argument
we'll now unconditionally accept it even if it's nonsense for this
board. Neither behaviour is great. However, the patchset to allow
boards to easily specify the valid set of CPU types is still in
code review:
https://lists.gnu.org/archive/html/qemu-devel/2018-02/msg00308.html

so I'm happy to take this as-is, and we'll add the validity check
when that patchset goes in.

I wondered about that too, but I applied the "monkey see, monkey do" approach to your review comments of the previous attempt. :-) But indeed, I also think we can fix this later in the tree.

- Pekka



reply via email to

[Prev in Thread] Current Thread [Next in Thread]