platinum: handle non-DWORD register accesses.

This commit is contained in:
Maxim Poliakovski 2024-02-15 15:35:17 +01:00
parent 38d94e509f
commit bc2714ab2a
1 changed files with 9 additions and 4 deletions

View File

@ -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;