All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq
@ 2014-01-20  0:09 Alistair Francis
  2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 1/2] ARM: Convert MIDR to a property Alistair Francis
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alistair Francis @ 2014-01-20  0:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, peter.crosthwaite, afaerber

This series converts cpu->midr (the MIDR register) to a property.
This allows it to be set after init which is useful for specific
boards (such as Zynq). The change has been done in such a way that
it doesn't break compatibility with boards that don't need a
custom MIDR.

V3: Removed the initialisation of the MIDR property from arm_cpu_post_init
as it is no longer needed
V2: Use dc->props to avoid using qdev_*


Alistair Francis (2):
  ARM: Convert MIDR to a property
  ZYNQ: Implement board MIDR control for Zynq

 hw/arm/xilinx_zynq.c |    7 +++++++
 target-arm/cpu.c     |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH arm-midr v3 1/2] ARM: Convert MIDR to a property
  2014-01-20  0:09 [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq Alistair Francis
@ 2014-01-20  0:09 ` Alistair Francis
  2014-01-23 13:08   ` Peter Crosthwaite
  2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 2/2] ZYNQ: Implement board MIDR control for Zynq Alistair Francis
  2014-01-27 18:09 ` [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq Peter Maydell
  2 siblings, 1 reply; 7+ messages in thread
From: Alistair Francis @ 2014-01-20  0:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, peter.crosthwaite, afaerber

Convert the MIDR register to a property. This allows boards to later set
a custom MIDR value. This has been done in such a way to maintain
compatibility with all existing CPUs and boards

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---
I originally added the properties to the cpu->midr variable in a similar
method to how Peter Crosthwaite did in his 'Fix Support for ARM CBAR and
reset-hivecs' series.
V3: Removed the initialisation of the MIDR property from arm_cpu_post_init
as it is no longer needed
V2: Use dc->props to avoid using qdev_*

 target-arm/cpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 52efd5d..45ad7f0 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -982,6 +982,7 @@ static const ARMCPUInfo arm_cpus[] = {
 
 static Property arm_cpu_properties[] = {
     DEFINE_PROP_BOOL("start-powered-off", ARMCPU, start_powered_off, false),
+    DEFINE_PROP_UINT32("midr", ARMCPU, midr, 0),
     DEFINE_PROP_END_OF_LIST()
 };
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH arm-midr v3 2/2] ZYNQ: Implement board MIDR control for Zynq
  2014-01-20  0:09 [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq Alistair Francis
  2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 1/2] ARM: Convert MIDR to a property Alistair Francis
@ 2014-01-20  0:09 ` Alistair Francis
  2014-01-23 13:12   ` Peter Crosthwaite
  2014-01-27 18:09 ` [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq Peter Maydell
  2 siblings, 1 reply; 7+ messages in thread
From: Alistair Francis @ 2014-01-20  0:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, peter.crosthwaite, afaerber

This patch uses the fact that the midr variable is now a property
This patch sets the midr variable to the boards custom midr

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---

 hw/arm/xilinx_zynq.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 98e0958..9ee21e7 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -37,6 +37,7 @@
 #define IRQ_OFFSET 32 /* pic interrupts start from index 32 */
 
 #define MPCORE_PERIPHBASE 0xF8F00000
+#define ZYNQ_BOARD_MIDR 0x413FC090
 
 static const int dma_irqs[8] = {
     46, 47, 48, 49, 72, 73, 74, 75
@@ -125,6 +126,12 @@ static void zynq_init(QEMUMachineInitArgs *args)
 
     cpu = ARM_CPU(object_new(object_class_get_name(cpu_oc)));
 
+    object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr", &err);
+    if (err) {
+        error_report("%s", error_get_pretty(err));
+        exit(1);
+    }
+
     object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar", &err);
     if (err) {
         error_report("%s", error_get_pretty(err));
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH arm-midr v3 1/2] ARM: Convert MIDR to a property
  2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 1/2] ARM: Convert MIDR to a property Alistair Francis
@ 2014-01-23 13:08   ` Peter Crosthwaite
  2014-01-23 13:11     ` Andreas Färber
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Crosthwaite @ 2014-01-23 13:08 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Peter Maydell, qemu-devel@nongnu.org Developers,
	Andreas Färber

On Mon, Jan 20, 2014 at 10:09 AM, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> Convert the MIDR register to a property. This allows boards to later set
> a custom MIDR value. This has been done in such a way to maintain
> compatibility with all existing CPUs and boards
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

> ---
> I originally added the properties to the cpu->midr variable in a similar
> method to how Peter Crosthwaite did in his 'Fix Support for ARM CBAR and
> reset-hivecs' series.
> V3: Removed the initialisation of the MIDR property from arm_cpu_post_init
> as it is no longer needed
> V2: Use dc->props to avoid using qdev_*
>
>  target-arm/cpu.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> index 52efd5d..45ad7f0 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
> @@ -982,6 +982,7 @@ static const ARMCPUInfo arm_cpus[] = {
>
>  static Property arm_cpu_properties[] = {
>      DEFINE_PROP_BOOL("start-powered-off", ARMCPU, start_powered_off, false),
> +    DEFINE_PROP_UINT32("midr", ARMCPU, midr, 0),
>      DEFINE_PROP_END_OF_LIST()
>  };
>
> --
> 1.7.1
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH arm-midr v3 1/2] ARM: Convert MIDR to a property
  2014-01-23 13:08   ` Peter Crosthwaite
@ 2014-01-23 13:11     ` Andreas Färber
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2014-01-23 13:11 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Peter Maydell, Peter Crosthwaite,
	qemu-devel@nongnu.org Developers

Am 23.01.2014 14:08, schrieb Peter Crosthwaite:
> On Mon, Jan 20, 2014 at 10:09 AM, Alistair Francis
> <alistair.francis@xilinx.com> wrote:
>> Convert the MIDR register to a property. This allows boards to later set
>> a custom MIDR value. This has been done in such a way to maintain
>> compatibility with all existing CPUs and boards
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>

Please use consistent subject prefixes as seen in Git history, in this
case "target-arm", not "ARM".

Andreas

> 
> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> 
>> ---
>> I originally added the properties to the cpu->midr variable in a similar
>> method to how Peter Crosthwaite did in his 'Fix Support for ARM CBAR and
>> reset-hivecs' series.
>> V3: Removed the initialisation of the MIDR property from arm_cpu_post_init
>> as it is no longer needed
>> V2: Use dc->props to avoid using qdev_*
>>
>>  target-arm/cpu.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
>> index 52efd5d..45ad7f0 100644
>> --- a/target-arm/cpu.c
>> +++ b/target-arm/cpu.c
>> @@ -982,6 +982,7 @@ static const ARMCPUInfo arm_cpus[] = {
>>
>>  static Property arm_cpu_properties[] = {
>>      DEFINE_PROP_BOOL("start-powered-off", ARMCPU, start_powered_off, false),
>> +    DEFINE_PROP_UINT32("midr", ARMCPU, midr, 0),
>>      DEFINE_PROP_END_OF_LIST()
>>  };
>>
>> --
>> 1.7.1
>>
>>

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH arm-midr v3 2/2] ZYNQ: Implement board MIDR control for Zynq
  2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 2/2] ZYNQ: Implement board MIDR control for Zynq Alistair Francis
@ 2014-01-23 13:12   ` Peter Crosthwaite
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Crosthwaite @ 2014-01-23 13:12 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Peter Maydell, qemu-devel@nongnu.org Developers,
	Andreas Färber

You should add an "arm:" arch prefix to the patch subject. We also
tend not to use all caps for "Zynq" in-tree.

On Mon, Jan 20, 2014 at 10:09 AM, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> This patch uses the fact that the midr variable is now a property
> This patch sets the midr variable to the boards custom midr
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
>
>  hw/arm/xilinx_zynq.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
> index 98e0958..9ee21e7 100644
> --- a/hw/arm/xilinx_zynq.c
> +++ b/hw/arm/xilinx_zynq.c
> @@ -37,6 +37,7 @@
>  #define IRQ_OFFSET 32 /* pic interrupts start from index 32 */
>
>  #define MPCORE_PERIPHBASE 0xF8F00000
> +#define ZYNQ_BOARD_MIDR 0x413FC090

It's not really a "BOARD" thing. Zynq is a SoC (and this is really a
reference board). I think all you need to do here is drop the "BOARD"
to simply make "ZYNQ_MIDR".

Regards,
Peter

>
>  static const int dma_irqs[8] = {
>      46, 47, 48, 49, 72, 73, 74, 75
> @@ -125,6 +126,12 @@ static void zynq_init(QEMUMachineInitArgs *args)
>
>      cpu = ARM_CPU(object_new(object_class_get_name(cpu_oc)));
>
> +    object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr", &err);
> +    if (err) {
> +        error_report("%s", error_get_pretty(err));
> +        exit(1);
> +    }
> +
>      object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar", &err);
>      if (err) {
>          error_report("%s", error_get_pretty(err));
> --
> 1.7.1
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq
  2014-01-20  0:09 [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq Alistair Francis
  2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 1/2] ARM: Convert MIDR to a property Alistair Francis
  2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 2/2] ZYNQ: Implement board MIDR control for Zynq Alistair Francis
@ 2014-01-27 18:09 ` Peter Maydell
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2014-01-27 18:09 UTC (permalink / raw)
  To: Alistair Francis; +Cc: Peter Crosthwaite, QEMU Developers, Andreas Färber

On 20 January 2014 00:09, Alistair Francis <alistair.francis@xilinx.com> wrote:
> This series converts cpu->midr (the MIDR register) to a property.
> This allows it to be set after init which is useful for specific
> boards (such as Zynq). The change has been done in such a way that
> it doesn't break compatibility with boards that don't need a
> custom MIDR.

Thanks, applied to target-arm.next.

-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-27 18:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20  0:09 [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq Alistair Francis
2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 1/2] ARM: Convert MIDR to a property Alistair Francis
2014-01-23 13:08   ` Peter Crosthwaite
2014-01-23 13:11     ` Andreas Färber
2014-01-20  0:09 ` [Qemu-devel] [PATCH arm-midr v3 2/2] ZYNQ: Implement board MIDR control for Zynq Alistair Francis
2014-01-23 13:12   ` Peter Crosthwaite
2014-01-27 18:09 ` [Qemu-devel] [PATCH arm-midr v3 0/2] Make ARM-MIDR a property and use in Zynq Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.