aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sim/bfin/dv-bfin_wp.c')
-rw-r--r--sim/bfin/dv-bfin_wp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sim/bfin/dv-bfin_wp.c b/sim/bfin/dv-bfin_wp.c
index 5292cb28150..17dc9794746 100644
--- a/sim/bfin/dv-bfin_wp.c
+++ b/sim/bfin/dv-bfin_wp.c
@@ -77,6 +77,10 @@ bfin_wp_io_write_buffer (struct hw *me, const void *source, int space,
bu32 value;
bu32 *valuep;
+ /* Invalid access mode is higher priority than missing register. */
+ if (!dv_bfin_mmr_require_32 (me, addr, nr_bytes, true))
+ return 0;
+
value = dv_load_4 (source);
mmr_off = addr - wp->base;
valuep = (void *)((unsigned long)wp + mmr_base() + mmr_off);
@@ -99,7 +103,7 @@ bfin_wp_io_write_buffer (struct hw *me, const void *source, int space,
break;
default:
dv_bfin_mmr_invalid (me, addr, nr_bytes, true);
- break;
+ return 0;
}
return nr_bytes;
@@ -114,6 +118,10 @@ bfin_wp_io_read_buffer (struct hw *me, void *dest, int space,
bu32 value;
bu32 *valuep;
+ /* Invalid access mode is higher priority than missing register. */
+ if (!dv_bfin_mmr_require_32 (me, addr, nr_bytes, false))
+ return 0;
+
mmr_off = addr - wp->base;
valuep = (void *)((unsigned long)wp + mmr_base() + mmr_off);
@@ -131,9 +139,8 @@ bfin_wp_io_read_buffer (struct hw *me, void *dest, int space,
value = *valuep;
break;
default:
- while (1) /* Core MMRs -> exception -> doesn't return. */
- dv_bfin_mmr_invalid (me, addr, nr_bytes, false);
- break;
+ dv_bfin_mmr_invalid (me, addr, nr_bytes, false);
+ return 0;
}
dv_store_4 (dest, value);