diff mbox

[v5,4/6] raspi: Specify the valid CPUs

Message ID fa1d4990d897f61dd748ad7f10f6b88435e6cb46.1517532021.git.alistair.francis@xilinx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alistair Francis Feb. 2, 2018, 12:42 a.m. UTC
List all possible valid CPU options.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---

V5:
 - Use cpu_model names
V4:
 - Remove spaces
V3:
 - Add static property
V2:
 - Fix the indentation

 hw/arm/raspi.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Peter Maydell Feb. 15, 2018, 11:29 a.m. UTC | #1
On 2 February 2018 at 00:42, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> List all possible valid CPU options.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>
> V5:
>  - Use cpu_model names
> V4:
>  - Remove spaces
> V3:
>  - Add static property
> V2:
>  - Fix the indentation
>
>  hw/arm/raspi.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
> index cd5fa8c3dc..745a880726 100644
> --- a/hw/arm/raspi.c
> +++ b/hw/arm/raspi.c
> @@ -158,6 +158,11 @@ static void raspi2_init(MachineState *machine)
>      setup_boot(machine, 2, machine->ram_size - vcram_size);
>  }
>
> +static const char *raspi2_valid_cpus[] = {
> +    "cortex-a7",
> +    NULL
> +};

Is this definitely right? Looking at the code, the raspi2 board
creates a TYPE_BCM2836, and that creates cortex-a15 CPUs...

thanks
-- PMM
Philippe Mathieu-Daudé Feb. 15, 2018, 1:04 p.m. UTC | #2
Hi Peter,

On 02/15/2018 08:29 AM, Peter Maydell wrote:
> On 2 February 2018 at 00:42, Alistair Francis
> <alistair.francis@xilinx.com> wrote:
>> List all possible valid CPU options.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>
>> V5:
>>  - Use cpu_model names
>> V4:
>>  - Remove spaces
>> V3:
>>  - Add static property
>> V2:
>>  - Fix the indentation
>>
>>  hw/arm/raspi.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
>> index cd5fa8c3dc..745a880726 100644
>> --- a/hw/arm/raspi.c
>> +++ b/hw/arm/raspi.c
>> @@ -158,6 +158,11 @@ static void raspi2_init(MachineState *machine)
>>      setup_boot(machine, 2, machine->ram_size - vcram_size);
>>  }
>>
>> +static const char *raspi2_valid_cpus[] = {
>> +    "cortex-a7",
>> +    NULL
>> +};
> 
> Is this definitely right? Looking at the code, the raspi2 board
> creates a TYPE_BCM2836, and that creates cortex-a15 CPUs...

The BCM2836 use a cortex-a7 but this cpu was not available at the time
of this commit (bad5623690b) and was added later in dcf578ed8ce "The A7
is very similar to the A15."

I can prepare a patch for it to apply before this series.

> 
> thanks
> -- PMM
>
Peter Maydell Feb. 15, 2018, 1:17 p.m. UTC | #3
On 15 February 2018 at 13:04, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Hi Peter,
>
> On 02/15/2018 08:29 AM, Peter Maydell wrote:
>> On 2 February 2018 at 00:42, Alistair Francis
>> <alistair.francis@xilinx.com> wrote:
>>> List all possible valid CPU options.
>>>
>>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>>
>>> V5:
>>>  - Use cpu_model names
>>> V4:
>>>  - Remove spaces
>>> V3:
>>>  - Add static property
>>> V2:
>>>  - Fix the indentation
>>>
>>>  hw/arm/raspi.c | 7 +++++++
>>>  1 file changed, 7 insertions(+)
>>>
>>> diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
>>> index cd5fa8c3dc..745a880726 100644
>>> --- a/hw/arm/raspi.c
>>> +++ b/hw/arm/raspi.c
>>> @@ -158,6 +158,11 @@ static void raspi2_init(MachineState *machine)
>>>      setup_boot(machine, 2, machine->ram_size - vcram_size);
>>>  }
>>>
>>> +static const char *raspi2_valid_cpus[] = {
>>> +    "cortex-a7",
>>> +    NULL
>>> +};
>>
>> Is this definitely right? Looking at the code, the raspi2 board
>> creates a TYPE_BCM2836, and that creates cortex-a15 CPUs...
>
> The BCM2836 use a cortex-a7 but this cpu was not available at the time
> of this commit (bad5623690b) and was added later in dcf578ed8ce "The A7
> is very similar to the A15."
>
> I can prepare a patch for it to apply before this series.

I noticed after I'd written that comment that patch 3 in this
series does exactly the change to cortex-a7...

thanks
-- PMM
Igor Mammedov Feb. 15, 2018, 5:08 p.m. UTC | #4
On Thu, 15 Feb 2018 13:17:50 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> On 15 February 2018 at 13:04, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> > Hi Peter,
> >
> > On 02/15/2018 08:29 AM, Peter Maydell wrote:  
> >> On 2 February 2018 at 00:42, Alistair Francis
> >> <alistair.francis@xilinx.com> wrote:  
> >>> List all possible valid CPU options.
> >>>
> >>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> >>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >>> ---
> >>>
> >>> V5:
> >>>  - Use cpu_model names
> >>> V4:
> >>>  - Remove spaces
> >>> V3:
> >>>  - Add static property
> >>> V2:
> >>>  - Fix the indentation
> >>>
> >>>  hw/arm/raspi.c | 7 +++++++
> >>>  1 file changed, 7 insertions(+)
> >>>
> >>> diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
> >>> index cd5fa8c3dc..745a880726 100644
> >>> --- a/hw/arm/raspi.c
> >>> +++ b/hw/arm/raspi.c
> >>> @@ -158,6 +158,11 @@ static void raspi2_init(MachineState *machine)
> >>>      setup_boot(machine, 2, machine->ram_size - vcram_size);
> >>>  }
> >>>
> >>> +static const char *raspi2_valid_cpus[] = {
> >>> +    "cortex-a7",
> >>> +    NULL
> >>> +};  
> >>
> >> Is this definitely right? Looking at the code, the raspi2 board
> >> creates a TYPE_BCM2836, and that creates cortex-a15 CPUs...  
> >
> > The BCM2836 use a cortex-a7 but this cpu was not available at the time
> > of this commit (bad5623690b) and was added later in dcf578ed8ce "The A7
> > is very similar to the A15."
> >
> > I can prepare a patch for it to apply before this series.  
> 
> I noticed after I'd written that comment that patch 3 in this
> series does exactly the change to cortex-a7...
anyways this series, needs not to depend MachineState::cpu_model,
removal of which is queued in Eduardo's tree.

It seems we can't find consensus on how to deal with cpu_model names
in boards code [1/6].

> 
> thanks
> -- PMM
diff mbox

Patch

diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index cd5fa8c3dc..745a880726 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -158,6 +158,11 @@  static void raspi2_init(MachineState *machine)
     setup_boot(machine, 2, machine->ram_size - vcram_size);
 }
 
+static const char *raspi2_valid_cpus[] = {
+    "cortex-a7",
+    NULL
+};
+
 static void raspi2_machine_init(MachineClass *mc)
 {
     mc->desc = "Raspberry Pi 2";
@@ -171,5 +176,7 @@  static void raspi2_machine_init(MachineClass *mc)
     mc->default_cpus = BCM2836_NCPUS;
     mc->default_ram_size = 1024 * 1024 * 1024;
     mc->ignore_memory_transaction_failures = true;
+    mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a7");
+    mc->valid_cpu_types = raspi2_valid_cpus;
 };
 DEFINE_MACHINE("raspi2", raspi2_machine_init)