mirror of https://github.com/xqemu/xqemu.git
omap_tap: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
c304fed7eb
commit
0a9ee1a7d5
|
@ -827,6 +827,7 @@ struct omap_mpu_state_s {
|
||||||
MemoryRegion pwl_iomem;
|
MemoryRegion pwl_iomem;
|
||||||
MemoryRegion pwt_iomem;
|
MemoryRegion pwt_iomem;
|
||||||
MemoryRegion mpui_io_iomem;
|
MemoryRegion mpui_io_iomem;
|
||||||
|
MemoryRegion tap_iomem;
|
||||||
MemoryRegion imif_ram;
|
MemoryRegion imif_ram;
|
||||||
MemoryRegion emiff_ram;
|
MemoryRegion emiff_ram;
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,15 @@
|
||||||
#include "omap.h"
|
#include "omap.h"
|
||||||
|
|
||||||
/* TEST-Chip-level TAP */
|
/* 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;
|
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque;
|
||||||
|
|
||||||
|
if (size != 4) {
|
||||||
|
return omap_badwidth_read32(opaque, addr);
|
||||||
|
}
|
||||||
|
|
||||||
switch (addr) {
|
switch (addr) {
|
||||||
case 0x204: /* IDCODE_reg */
|
case 0x204: /* IDCODE_reg */
|
||||||
switch (s->mpu_model) {
|
switch (s->mpu_model) {
|
||||||
|
@ -87,27 +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,
|
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);
|
OMAP_BAD_REG(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static CPUReadMemoryFunc * const omap_tap_readfn[] = {
|
static const MemoryRegionOps omap_tap_ops = {
|
||||||
omap_badwidth_read32,
|
.read = omap_tap_read,
|
||||||
omap_badwidth_read32,
|
.write = omap_tap_write,
|
||||||
omap_tap_read,
|
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||||
};
|
|
||||||
|
|
||||||
static CPUWriteMemoryFunc * const omap_tap_writefn[] = {
|
|
||||||
omap_badwidth_write32,
|
|
||||||
omap_badwidth_write32,
|
|
||||||
omap_tap_write,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void omap_tap_init(struct omap_target_agent_s *ta,
|
void omap_tap_init(struct omap_target_agent_s *ta,
|
||||||
struct omap_mpu_state_s *mpu)
|
struct omap_mpu_state_s *mpu)
|
||||||
{
|
{
|
||||||
omap_l4_attach(ta, 0, cpu_register_io_memory(
|
memory_region_init_io(&mpu->tap_iomem, &omap_tap_ops, mpu, "omap.tap",
|
||||||
omap_tap_readfn, omap_tap_writefn, mpu,
|
omap_l4_region_size(ta, 0));
|
||||||
DEVICE_NATIVE_ENDIAN));
|
omap_l4_attach_region(ta, 0, &mpu->tap_iomem);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue