platinum: use meaningful name for 'register _4B'.

This commit is contained in:
Maxim Poliakovski 2024-03-12 17:05:47 +01:00
parent 6e4544450e
commit 2d68b72dbd
2 changed files with 8 additions and 6 deletions

View File

@ -186,8 +186,8 @@ uint32_t PlatinumCtrl::read(uint32_t rgn_start, uint32_t offset, int size) {
case PlatinumReg::IRIDIUM_CONFIG:
value = this->iridium_cfg;
break;
case PlatinumReg::_4B:
value = this->_4b;
case PlatinumReg::POWER_DOWN_CTRL:
value = this->power_down_ctrl;
break;
default:
LOG_F(WARNING, "%s: unknown register read at offset 0x%X", this->name.c_str(),
@ -328,8 +328,10 @@ void PlatinumCtrl::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in
LOG_F(ERROR, "%s: little-endian system bus is not implemented", this->name.c_str());
this->iridium_cfg = (this->iridium_cfg & ~7) | (value & 7);
break;
case PlatinumReg::_4B:
this->_4b = value;
case PlatinumReg::POWER_DOWN_CTRL:
this->power_down_ctrl = value;
if (value & 1)
LOG_F(INFO, "%s: power down mode enabled", this->name.c_str());
break;
default:
LOG_F(WARNING, "%s: unknown register write at offset 0x%X", this->name.c_str(),

View File

@ -167,7 +167,7 @@ enum PlatinumReg : uint32_t {
// Iridium datapath registers
IRIDIUM_CONFIG = 0x4A, // write 4
_4B = 0x4B, // read ; write 1
POWER_DOWN_CTRL = 0x4B, // 1-bit register, writing "1" enables power down mode
};
#define REG_TO_INDEX(reg) ((reg) - FIRST_SWATCH)
@ -259,7 +259,7 @@ private:
uint32_t swatch_config = 0xFFD;
uint32_t swatch_params[17] = {};
uint32_t timing_adjust = 0;
uint32_t _4b = 0;
uint32_t power_down_ctrl = 0;
// interrupt related state
uint32_t swatch_int_mask = 0;