summaryrefslogtreecommitdiffstats
path: root/hw/xtensa/xtfpga.c
diff options
context:
space:
mode:
authorMax Filippov2014-02-17 17:57:45 +0100
committerMax Filippov2015-03-07 13:27:54 +0100
commit8bb3b575448aeff086b2849943da47dce3c2b6ec (patch)
treecd77e1f629a48db4f1e44b68013ebe499f935d75 /hw/xtensa/xtfpga.c
parentMerge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150302.0' i... (diff)
downloadqemu-8bb3b575448aeff086b2849943da47dce3c2b6ec.tar.gz
qemu-8bb3b575448aeff086b2849943da47dce3c2b6ec.tar.xz
qemu-8bb3b575448aeff086b2849943da47dce3c2b6ec.zip
hw/xtensa: allow reads/writes in the system I/O region
Ignore writes to unassigned areas of system I/O regison and return 0 for reads. This makes drivers for unimportant unimplemented hardware blocks happy. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'hw/xtensa/xtfpga.c')
-rw-r--r--hw/xtensa/xtfpga.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index e5a6bba783..2c2f9974a5 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -162,6 +162,23 @@ static void lx60_reset(void *opaque)
cpu_reset(CPU(cpu));
}
+static uint64_t lx60_io_read(void *opaque, hwaddr addr,
+ unsigned size)
+{
+ return 0;
+}
+
+static void lx60_io_write(void *opaque, hwaddr addr,
+ uint64_t val, unsigned size)
+{
+}
+
+static const MemoryRegionOps lx60_io_ops = {
+ .read = lx60_io_read,
+ .write = lx60_io_write,
+ .endianness = DEVICE_NATIVE_ENDIAN,
+};
+
static void lx_init(const LxBoardDesc *board, MachineState *machine)
{
#ifdef TARGET_WORDS_BIGENDIAN
@@ -211,7 +228,8 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
memory_region_add_subregion(system_memory, 0, ram);
system_io = g_malloc(sizeof(*system_io));
- memory_region_init(system_io, NULL, "lx60.io", 224 * 1024 * 1024);
+ memory_region_init_io(system_io, NULL, &lx60_io_ops, NULL, "lx60.io",
+ 224 * 1024 * 1024);
memory_region_add_subregion(system_memory, 0xf0000000, system_io);
lx60_fpga_init(system_io, 0x0d020000);
if (nd_table[0].used) {