Patchwork [15/19] openpic: make brr1 model specific

login
register
mail settings
Submitter Alexander Graf
Date Dec. 8, 2012, 1:44 p.m.
Message ID <1354974282-1915-16-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/204663/
State New
Headers show

Comments

Alexander Graf - Dec. 8, 2012, 1:44 p.m.
Now that we can properly distinguish between openpic model differences,
let's move brr1 out of the raven code path.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/openpic.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/openpic.c b/hw/openpic.c
index 6aac4b8..f2f152f 100644
--- a/hw/openpic.c
+++ b/hw/openpic.c
@@ -205,6 +205,7 @@  typedef struct OpenPICState {
     uint32_t tifr_reset;
     uint32_t ipvp_reset;
     uint32_t ide_reset;
+    uint32_t brr1;
 
     /* Sub-regions */
     MemoryRegion sub_io_mem[7];
@@ -783,7 +784,7 @@  static uint32_t openpic_cpu_read_internal(void *opaque, hwaddr addr,
     addr &= 0xFF0;
     switch (addr) {
     case 0x00: /* Block Revision Register1 (BRR1) */
-        retval = FSL_BRR1_IPID | FSL_BRR1_IPMJ | FSL_BRR1_IPMN;
+        retval = opp->brr1;
         break;
     case 0x80: /* PCTP */
         retval = dst->pctp;
@@ -1081,6 +1082,7 @@  static int openpic_init(SysBusDevice *dev)
         opp->max_irq = MPC8544_MAX_IRQ;
         opp->irq_ipi0 = MPC8544_IPI_IRQ;
         opp->irq_tim0 = MPC8544_TMR_IRQ;
+        opp->brr1 = FSL_BRR1_IPID | FSL_BRR1_IPMJ | FSL_BRR1_IPMN;
         list = list_be;
         break;
     case OPENPIC_MODEL_RAVEN:
@@ -1094,6 +1096,7 @@  static int openpic_init(SysBusDevice *dev)
         opp->max_irq = RAVEN_MAX_IRQ;
         opp->irq_ipi0 = RAVEN_IPI_IRQ;
         opp->irq_tim0 = RAVEN_TMR_IRQ;
+        opp->brr1 = -1;
         list = list_le;
 
         /* Only UP supported today */