diff options
author | Avi Kivity <avi@redhat.com> | 2011-11-23 14:06:31 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-11-28 15:38:39 +0200 |
commit | 92c0bba9a95739c92e959fe478cb1acb92fa5446 (patch) | |
tree | accb71700fa4fbd4871fa064230004d57e996599 | |
parent | aee39503dfae943728e99a67decf06e76211ade0 (diff) |
omap: remove L4_MUX_HACK
This was introduced apparently to overcome a limitation on the number of
cpu_register_io_memory() calls. 477b24ef91175 (July 2008) removed use
of the hack, but retained the code. This patch removes the code as well.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | hw/omap.h | 3 | ||||
-rw-r--r-- | hw/omap_l4.c | 118 |
2 files changed, 0 insertions, 121 deletions
@@ -1127,7 +1127,4 @@ inline static int debug_register_io_memory(CPUReadMemoryFunc * const *mem_read, # define cpu_register_io_memory debug_register_io_memory # endif -/* Define when we want to reduce the number of IO regions registered. */ -/*# define L4_MUX_HACK*/ - #endif /* hw_omap_h */ diff --git a/hw/omap_l4.c b/hw/omap_l4.c index a4a8883d2a..ebec8747a9 100644 --- a/hw/omap_l4.c +++ b/hw/omap_l4.c @@ -20,89 +20,6 @@ #include "hw.h" #include "omap.h" -#ifdef L4_MUX_HACK -static int omap_l4_io_entries; -static int omap_cpu_io_entry; -static struct omap_l4_entry { - CPUReadMemoryFunc * const *mem_read; - CPUWriteMemoryFunc * const *mem_write; - void *opaque; -} *omap_l4_io_entry; -static CPUReadMemoryFunc * const *omap_l4_io_readb_fn; -static CPUReadMemoryFunc * const *omap_l4_io_readh_fn; -static CPUReadMemoryFunc * const *omap_l4_io_readw_fn; -static CPUWriteMemoryFunc * const *omap_l4_io_writeb_fn; -static CPUWriteMemoryFunc * const *omap_l4_io_writeh_fn; -static CPUWriteMemoryFunc * const *omap_l4_io_writew_fn; -static void **omap_l4_io_opaque; - -int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read, - CPUWriteMemoryFunc * const *mem_write, void *opaque) -{ - omap_l4_io_entry[omap_l4_io_entries].mem_read = mem_read; - omap_l4_io_entry[omap_l4_io_entries].mem_write = mem_write; - omap_l4_io_entry[omap_l4_io_entries].opaque = opaque; - - return omap_l4_io_entries ++; -} - -static uint32_t omap_l4_io_readb(void *opaque, target_phys_addr_t addr) -{ - unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS; - - return omap_l4_io_readb_fn[i](omap_l4_io_opaque[i], addr); -} - -static uint32_t omap_l4_io_readh(void *opaque, target_phys_addr_t addr) -{ - unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS; - - return omap_l4_io_readh_fn[i](omap_l4_io_opaque[i], addr); -} - -static uint32_t omap_l4_io_readw(void *opaque, target_phys_addr_t addr) -{ - unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS; - - return omap_l4_io_readw_fn[i](omap_l4_io_opaque[i], addr); -} - -static void omap_l4_io_writeb(void *opaque, target_phys_addr_t addr, - uint32_t value) -{ - unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS; - - return omap_l4_io_writeb_fn[i](omap_l4_io_opaque[i], addr, value); -} - -static void omap_l4_io_writeh(void *opaque, target_phys_addr_t addr, - uint32_t value) -{ - unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS; - - return omap_l4_io_writeh_fn[i](omap_l4_io_opaque[i], addr, value); -} - -static void omap_l4_io_writew(void *opaque, target_phys_addr_t addr, - uint32_t value) -{ - unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS; - - return omap_l4_io_writew_fn[i](omap_l4_io_opaque[i], addr, value); -} - -static CPUReadMemoryFunc * const omap_l4_io_readfn[] = { - omap_l4_io_readb, - omap_l4_io_readh, - omap_l4_io_readw, -}; - -static CPUWriteMemoryFunc * const omap_l4_io_writefn[] = { - omap_l4_io_writeb, - omap_l4_io_writeh, - omap_l4_io_writew, -}; -#else int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read, CPUWriteMemoryFunc * const *mem_write, void *opaque) @@ -110,7 +27,6 @@ int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read, return cpu_register_io_memory(mem_read, mem_write, opaque, DEVICE_NATIVE_ENDIAN); } -#endif struct omap_l4_s { target_phys_addr_t base; @@ -126,23 +42,6 @@ struct omap_l4_s *omap_l4_init(target_phys_addr_t base, int ta_num) bus->ta_num = ta_num; bus->base = base; -#ifdef L4_MUX_HACK - omap_l4_io_entries = 1; - omap_l4_io_entry = g_malloc0(125 * sizeof(*omap_l4_io_entry)); - - omap_cpu_io_entry = - cpu_register_io_memory(omap_l4_io_readfn, - omap_l4_io_writefn, bus, DEVICE_NATIVE_ENDIAN); -# define L4_PAGES (0xb4000 / TARGET_PAGE_SIZE) - omap_l4_io_readb_fn = g_malloc0(sizeof(void *) * L4_PAGES); - omap_l4_io_readh_fn = g_malloc0(sizeof(void *) * L4_PAGES); - omap_l4_io_readw_fn = g_malloc0(sizeof(void *) * L4_PAGES); - omap_l4_io_writeb_fn = g_malloc0(sizeof(void *) * L4_PAGES); - omap_l4_io_writeh_fn = g_malloc0(sizeof(void *) * L4_PAGES); - omap_l4_io_writew_fn = g_malloc0(sizeof(void *) * L4_PAGES); - omap_l4_io_opaque = g_malloc0(sizeof(void *) * L4_PAGES); -#endif - return bus; } @@ -245,9 +144,6 @@ target_phys_addr_t omap_l4_attach(struct omap_target_agent_s *ta, int region, { target_phys_addr_t base; ssize_t size; -#ifdef L4_MUX_HACK - int i; -#endif if (region < 0 || region >= ta->regions) { fprintf(stderr, "%s: bad io region (%i)\n", __FUNCTION__, region); @@ -257,21 +153,7 @@ target_phys_addr_t omap_l4_attach(struct omap_target_agent_s *ta, int region, base = ta->bus->base + ta->start[region].offset; size = ta->start[region].size; if (iotype) { -#ifndef L4_MUX_HACK cpu_register_physical_memory(base, size, iotype); -#else - cpu_register_physical_memory(base, size, omap_cpu_io_entry); - i = (base - ta->bus->base) / TARGET_PAGE_SIZE; - for (; size > 0; size -= TARGET_PAGE_SIZE, i ++) { - omap_l4_io_readb_fn[i] = omap_l4_io_entry[iotype].mem_read[0]; - omap_l4_io_readh_fn[i] = omap_l4_io_entry[iotype].mem_read[1]; - omap_l4_io_readw_fn[i] = omap_l4_io_entry[iotype].mem_read[2]; - omap_l4_io_writeb_fn[i] = omap_l4_io_entry[iotype].mem_write[0]; - omap_l4_io_writeh_fn[i] = omap_l4_io_entry[iotype].mem_write[1]; - omap_l4_io_writew_fn[i] = omap_l4_io_entry[iotype].mem_write[2]; - omap_l4_io_opaque[i] = omap_l4_io_entry[iotype].opaque; - } -#endif } return base; |