diff options
Diffstat (limited to 'hw/etraxfs_dma.c')
-rw-r--r-- | hw/etraxfs_dma.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/hw/etraxfs_dma.c b/hw/etraxfs_dma.c index 2e5de50..54e55d1 100644 --- a/hw/etraxfs_dma.c +++ b/hw/etraxfs_dma.c @@ -188,7 +188,6 @@ struct fs_dma_channel struct fs_dma_ctrl { CPUState *env; - target_phys_addr_t base; int nr_channels; struct fs_dma_channel *channels; @@ -212,10 +211,10 @@ static inline int channel_en(struct fs_dma_ctrl *ctrl, int c) && ctrl->channels[c].client; } -static inline int fs_channel(target_phys_addr_t base, target_phys_addr_t addr) +static inline int fs_channel(target_phys_addr_t addr) { /* Every channel has a 0x2000 ctrl register map. */ - return (addr - base) >> 13; + return addr >> 13; } #ifdef USE_THIS_DEAD_CODE @@ -572,7 +571,7 @@ dma_readl (void *opaque, target_phys_addr_t addr) uint32_t r = 0; /* Make addr relative to this instances base. */ - c = fs_channel(ctrl->base, addr); + c = fs_channel(addr); addr &= 0x1fff; switch (addr) { @@ -618,7 +617,7 @@ dma_writel (void *opaque, target_phys_addr_t addr, uint32_t value) int c; /* Make addr relative to this instances base. */ - c = fs_channel(ctrl->base, addr); + c = fs_channel(addr); addr &= 0x1fff; switch (addr) { @@ -753,7 +752,6 @@ void *etraxfs_dmac_init(CPUState *env, ctrl->bh = qemu_bh_new(DMA_run, ctrl); - ctrl->base = base; ctrl->env = env; ctrl->nr_channels = nr_channels; ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels); @@ -766,9 +764,9 @@ void *etraxfs_dmac_init(CPUState *env, dma_read, dma_write, ctrl); - cpu_register_physical_memory (base + i * 0x2000, - sizeof ctrl->channels[i].regs, - ctrl->channels[i].regmap); + cpu_register_physical_memory_offset (base + i * 0x2000, + sizeof ctrl->channels[i].regs, ctrl->channels[i].regmap, + i * 0x2000); } return ctrl; |