summary refs log tree commit diff stats
path: root/hw/omap_gpmc.c
diff options
context:
space:
mode:
authorJuha Riihimäki <juha.riihimaki@nokia.com>2011-08-28 16:22:19 +0000
committerPeter Maydell <peter.maydell@linaro.org>2011-08-28 16:37:12 +0000
commit7c470ff1eb01605337d2cdba70fde9e8c1012e1a (patch)
tree526a5f7aae8015948be242f72eb44a3429a55a01 /hw/omap_gpmc.c
parentb5325c2739d9795f9462ef87e4080b792835d70a (diff)
downloadfocaccia-qemu-7c470ff1eb01605337d2cdba70fde9e8c1012e1a.tar.gz
focaccia-qemu-7c470ff1eb01605337d2cdba70fde9e8c1012e1a.zip
omap_gpmc: Calculate revision from OMAP model
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/omap_gpmc.c')
-rw-r--r--hw/omap_gpmc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/omap_gpmc.c b/hw/omap_gpmc.c
index c86e7ed713..5c1365cf75 100644
--- a/hw/omap_gpmc.c
+++ b/hw/omap_gpmc.c
@@ -29,6 +29,7 @@ struct omap_gpmc_s {
     qemu_irq irq;
     MemoryRegion iomem;
 
+    uint8_t revision;
     uint8_t sysconfig;
     uint16_t irqst;
     uint16_t irqen;
@@ -163,7 +164,7 @@ static uint64_t omap_gpmc_read(void *opaque, target_phys_addr_t addr,
 
     switch (addr) {
     case 0x000:	/* GPMC_REVISION */
-        return 0x20;
+        return s->revision;
 
     case 0x010:	/* GPMC_SYSCONFIG */
         return s->sysconfig;
@@ -409,6 +410,7 @@ struct omap_gpmc_s *omap_gpmc_init(struct omap_mpu_state_s *mpu,
     memory_region_add_subregion(get_system_memory(), base, &s->iomem);
 
     s->irq = irq;
+    s->revision = cpu_class_omap3(mpu) ? 0x50 : 0x20;
     omap_gpmc_reset(s);
 
     return s;