diff options
Diffstat (limited to 'sim/bfin/dv-bfin_dma.c')
-rw-r--r-- | sim/bfin/dv-bfin_dma.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sim/bfin/dv-bfin_dma.c b/sim/bfin/dv-bfin_dma.c index 33a80f3..c329ab7 100644 --- a/sim/bfin/dv-bfin_dma.c +++ b/sim/bfin/dv-bfin_dma.c @@ -318,6 +318,10 @@ bfin_dma_io_write_buffer (struct hw *me, const void *source, int space, bu32 *value32p; void *valuep; + /* Invalid access mode is higher priority than missing register. */ + if (!dv_bfin_mmr_require_16_32 (me, addr, nr_bytes, true)) + return 0; + if (nr_bytes == 4) value = dv_load_4 (source); else @@ -401,7 +405,7 @@ bfin_dma_io_write_buffer (struct hw *me, const void *source, int space, default: /* XXX: The HW lets the pad regions be read/written ... */ dv_bfin_mmr_invalid (me, addr, nr_bytes, true); - break; + return 0; } return nr_bytes; @@ -417,6 +421,10 @@ bfin_dma_io_read_buffer (struct hw *me, void *dest, int space, bu32 *value32p; void *valuep; + /* Invalid access mode is higher priority than missing register. */ + if (!dv_bfin_mmr_require_16_32 (me, addr, nr_bytes, false)) + return 0; + mmr_off = addr % dma->base; valuep = (void *)((unsigned long)dma + mmr_base() + mmr_off); value16p = valuep; |