aboutsummaryrefslogtreecommitdiff
path: root/hw/zaurus.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-04 08:49:17 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-04 08:49:17 +0000
commit1f163b149345225f234216289a958b8ae691de61 (patch)
tree09bacf4a0b05533d7d6e04c92052df691d25e734 /hw/zaurus.c
parent86660795be6549a50550cc6880a79d596e7cd0b3 (diff)
scoop: GPRR reports the state of GPIO lines (Dmitry Baryshkov).
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5615 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/zaurus.c')
-rw-r--r--hw/zaurus.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/hw/zaurus.c b/hw/zaurus.c
index c475eaa613..8ba2d4acf9 100644
--- a/hw/zaurus.c
+++ b/hw/zaurus.c
@@ -46,7 +46,6 @@ struct scoop_info_s {
uint16_t irr;
uint16_t imr;
uint16_t isr;
- uint16_t gprr;
};
#define SCOOP_MCR 0x00
@@ -99,9 +98,8 @@ static uint32_t scoop_readb(void *opaque, target_phys_addr_t addr)
case SCOOP_GPCR:
return s->gpio_dir;
case SCOOP_GPWR:
- return s->gpio_level;
case SCOOP_GPRR:
- return s->gprr;
+ return s->gpio_level;
default:
zaurus_printf("Bad register offset " REG_FMT "\n", addr);
}
@@ -144,12 +142,10 @@ static void scoop_writeb(void *opaque, target_phys_addr_t addr, uint32_t value)
scoop_gpio_handler_update(s);
break;
case SCOOP_GPWR:
+ case SCOOP_GPRR: /* GPRR is probably R/O in real HW */
s->gpio_level = value & s->gpio_dir;
scoop_gpio_handler_update(s);
break;
- case SCOOP_GPRR:
- s->gprr = value;
- break;
default:
zaurus_printf("Bad register offset " REG_FMT "\n", addr);
}
@@ -205,11 +201,11 @@ static void scoop_save(QEMUFile *f, void *opaque)
qemu_put_be16s(f, &s->irr);
qemu_put_be16s(f, &s->imr);
qemu_put_be16s(f, &s->isr);
- qemu_put_be16s(f, &s->gprr);
}
static int scoop_load(QEMUFile *f, void *opaque, int version_id)
{
+ uint16_t dummy;
struct scoop_info_s *s = (struct scoop_info_s *) opaque;
qemu_get_be16s(f, &s->status);
qemu_get_be16s(f, &s->power);
@@ -222,7 +218,8 @@ static int scoop_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_be16s(f, &s->irr);
qemu_get_be16s(f, &s->imr);
qemu_get_be16s(f, &s->isr);
- qemu_get_be16s(f, &s->gprr);
+ if (version_id < 1)
+ qemu_get_be16s(f, &dummy);
return 0;
}
@@ -243,7 +240,7 @@ struct scoop_info_s *scoop_init(struct pxa2xx_state_s *cpu,
iomemtype = cpu_register_io_memory(0, scoop_readfn,
scoop_writefn, s);
cpu_register_physical_memory(s->target_base, 0x1000, iomemtype);
- register_savevm("scoop", instance, 0, scoop_save, scoop_load, s);
+ register_savevm("scoop", instance, 1, scoop_save, scoop_load, s);
return s;
}