/* Blackfin External Bus Interface Unit (EBIU) SDRAM Controller (SDC) Model.
- Copyright (C) 2010-2014 Free Software Foundation, Inc.
+ Copyright (C) 2010-2016 Free Software Foundation, Inc.
Contributed by Analog Devices, Inc.
This file is part of simulators.
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
case mmr_offset(sdbctl):
if (sdc->type == 561)
{
- 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;
}
else
{
- 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(sdrrc):
- 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(sdstat):
- dv_bfin_mmr_require_16 (me, addr, nr_bytes, true);
+ if (!dv_bfin_mmr_require_16 (me, addr, nr_bytes, true))
+ return 0;
/* XXX: Some bits are W1C ... */
break;
}
bu16 *value16p;
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 - sdc->base;
valuep = (void *)((unsigned long)sdc + mmr_base() + mmr_off);
value16p = valuep;
case mmr_offset(sdbctl):
if (sdc->type == 561)
{
- 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);
}
else
{
- 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(sdrrc):
case mmr_offset(sdstat):
- 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;
}