diff options
| author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-05 08:43:38 -0600 |
|---|---|---|
| committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-05 08:43:38 -0600 |
| commit | 01e7a53aed945adafc3ee54e2159227839daf0b4 (patch) | |
| tree | 992b5c4a38316289ed5b2fa6ddf486cb3d59bead /hw/omap_tap.c | |
| parent | 4eb2d2d900eb6f63cad2b5cb6ca4273bfb9b230c (diff) | |
| parent | f44336c594c7e7887ee43ece3b53ba68b827fd1d (diff) | |
| download | focaccia-qemu-01e7a53aed945adafc3ee54e2159227839daf0b4.tar.gz focaccia-qemu-01e7a53aed945adafc3ee54e2159227839daf0b4.zip | |
Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging
Diffstat (limited to 'hw/omap_tap.c')
| -rw-r--r-- | hw/omap_tap.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/hw/omap_tap.c b/hw/omap_tap.c index 1f18dddb22..0277c73652 100644 --- a/hw/omap_tap.c +++ b/hw/omap_tap.c @@ -22,10 +22,15 @@ #include "omap.h" /* TEST-Chip-level TAP */ -static uint32_t omap_tap_read(void *opaque, target_phys_addr_t addr) +static uint64_t omap_tap_read(void *opaque, target_phys_addr_t addr, + unsigned size) { struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; + if (size != 4) { + return omap_badwidth_read32(opaque, addr); + } + switch (addr) { case 0x204: /* IDCODE_reg */ switch (s->mpu_model) { @@ -87,26 +92,25 @@ static uint32_t omap_tap_read(void *opaque, target_phys_addr_t addr) } static void omap_tap_write(void *opaque, target_phys_addr_t addr, - uint32_t value) + uint64_t value, unsigned size) { + if (size != 4) { + return omap_badwidth_write32(opaque, addr, value); + } + OMAP_BAD_REG(addr); } -static CPUReadMemoryFunc * const omap_tap_readfn[] = { - omap_badwidth_read32, - omap_badwidth_read32, - omap_tap_read, -}; - -static CPUWriteMemoryFunc * const omap_tap_writefn[] = { - omap_badwidth_write32, - omap_badwidth_write32, - omap_tap_write, +static const MemoryRegionOps omap_tap_ops = { + .read = omap_tap_read, + .write = omap_tap_write, + .endianness = DEVICE_NATIVE_ENDIAN, }; void omap_tap_init(struct omap_target_agent_s *ta, struct omap_mpu_state_s *mpu) { - omap_l4_attach(ta, 0, l4_register_io_memory( - omap_tap_readfn, omap_tap_writefn, mpu)); + memory_region_init_io(&mpu->tap_iomem, &omap_tap_ops, mpu, "omap.tap", + omap_l4_region_size(ta, 0)); + omap_l4_attach(ta, 0, &mpu->tap_iomem); } |