diff mbox

[arm-midr,v3,2/2] ZYNQ: Implement board MIDR control for Zynq

Message ID a3754b10d150af72e4688a993e484fa2b9b8fa21.1390176489.git.alistair.francis@xilinx.com
State New
Headers show

Commit Message

Alistair Francis Jan. 20, 2014, 12:09 a.m. UTC
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(-)

Comments

Peter Crosthwaite Jan. 23, 2014, 1:12 p.m. UTC | #1
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
>
>
diff mbox

Patch

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));