diff --git a/devices/memctrl/platinum.cpp b/devices/memctrl/platinum.cpp index 8cc85d4..962c544 100644 --- a/devices/memctrl/platinum.cpp +++ b/devices/memctrl/platinum.cpp @@ -113,11 +113,10 @@ uint32_t PlatinumCtrl::read(uint32_t rgn_start, uint32_t offset, int size) { } } - if (size != 4) { - LOG_F(WARNING, "%s: unsupported register access size %d!", this->name.c_str(), - size); + // non-DWORD accesses will produce undefined results according with the ERS + // I believe we can safely return 0 in this case + if (size != 4) return 0; - } switch (offset) { case PlatinumReg::CPU_ID: @@ -169,6 +168,12 @@ void PlatinumCtrl::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in return; } + if (size != 4) { + LOG_F(WARNING, "%s: non-DWORD write access, size %d!", this->name.c_str(), + size); + return; + } + switch (offset) { case PlatinumReg::ROM_TIMING: this->rom_timing = value;