diff options
Diffstat (limited to 'sim/bfin/dv-bfin_eppi.c')
-rw-r--r-- | sim/bfin/dv-bfin_eppi.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sim/bfin/dv-bfin_eppi.c b/sim/bfin/dv-bfin_eppi.c index 5999568..5ca2a9c 100644 --- a/sim/bfin/dv-bfin_eppi.c +++ b/sim/bfin/dv-bfin_eppi.c @@ -90,6 +90,10 @@ bfin_eppi_io_write_buffer (struct hw *me, const void *source, 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 @@ -105,7 +109,8 @@ bfin_eppi_io_write_buffer (struct hw *me, const void *source, switch (mmr_off) { case mmr_offset(status): - dv_bfin_mmr_require_16 (me, addr, nr_bytes, true); + if (!dv_bfin_mmr_require_16 (me, addr, nr_bytes, true)) + return 0; dv_w1c_2 (value16p, value, 0x1ff); break; case mmr_offset(hcount): @@ -115,7 +120,8 @@ bfin_eppi_io_write_buffer (struct hw *me, const void *source, case mmr_offset(frame): case mmr_offset(line): case mmr_offset(clkdiv): - dv_bfin_mmr_require_16 (me, addr, nr_bytes, true); + if (!dv_bfin_mmr_require_16 (me, addr, nr_bytes, true)) + return 0; *value16p = value; break; case mmr_offset(control): @@ -128,12 +134,13 @@ bfin_eppi_io_write_buffer (struct hw *me, const void *source, case mmr_offset(fs2p_lavf): case mmr_offset(clip): case mmr_offset(err): - dv_bfin_mmr_require_32 (me, addr, nr_bytes, true); + if (!dv_bfin_mmr_require_32 (me, addr, nr_bytes, true)) + return 0; *value32p = value; break; default: dv_bfin_mmr_invalid (me, addr, nr_bytes, true); - break; + return 0; } return nr_bytes; @@ -149,6 +156,10 @@ bfin_eppi_io_read_buffer (struct hw *me, void *dest, 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; + mmr_off = addr - eppi->base; valuep = (void *)((unsigned long)eppi + mmr_base() + mmr_off); value16p = valuep; @@ -166,7 +177,8 @@ bfin_eppi_io_read_buffer (struct hw *me, void *dest, case mmr_offset(frame): case mmr_offset(line): case mmr_offset(clkdiv): - dv_bfin_mmr_require_16 (me, addr, nr_bytes, false); + if (!dv_bfin_mmr_require_16 (me, addr, nr_bytes, false)) + return 0; dv_store_2 (dest, *value16p); break; case mmr_offset(control): @@ -176,12 +188,13 @@ bfin_eppi_io_read_buffer (struct hw *me, void *dest, case mmr_offset(fs2p_lavf): case mmr_offset(clip): case mmr_offset(err): - dv_bfin_mmr_require_32 (me, addr, nr_bytes, false); + if (!dv_bfin_mmr_require_32 (me, addr, nr_bytes, false)) + return 0; dv_store_4 (dest, *value32p); break; default: dv_bfin_mmr_invalid (me, addr, nr_bytes, false); - break; + return 0; } return nr_bytes; |