HyperX controller to use DIMM_DETECTOR
This commit is contained in:
parent
560ff5ab33
commit
a2867e151d
5 changed files with 72 additions and 80 deletions
|
|
@ -111,6 +111,15 @@ uint16_t DDR4Accessor::jedec_id()
|
|||
return((this->at(0x140) << 8) + (this->at(0x141) & 0x7f) - 1);
|
||||
}
|
||||
|
||||
uint8_t DDR4Accessor::manufacturer_data(uint16_t index)
|
||||
{
|
||||
if(index > 28)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return this->at(0x161 + index);
|
||||
}
|
||||
|
||||
DDR5Accessor::DDR5Accessor(i2c_smbus_interface *bus, uint8_t spd_addr)
|
||||
: SPDAccessor(bus, spd_addr)
|
||||
{
|
||||
|
|
@ -129,3 +138,12 @@ uint16_t DDR5Accessor::jedec_id()
|
|||
{
|
||||
return((this->at(0x200) << 8) + (this->at(0x201) & 0x7f) - 1);
|
||||
}
|
||||
|
||||
uint8_t DDR5Accessor::manufacturer_data(uint16_t index)
|
||||
{
|
||||
if(index > 84)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return this->at(0x22B + index);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class SPDAccessor
|
|||
|
||||
virtual SPDMemoryType memory_type() = 0;
|
||||
virtual uint16_t jedec_id() = 0;
|
||||
virtual uint8_t manufacturer_data(uint16_t index) = 0;
|
||||
|
||||
virtual SPDAccessor *copy() = 0;
|
||||
|
||||
|
|
@ -42,6 +43,7 @@ class DDR4Accessor : public SPDAccessor
|
|||
virtual ~DDR4Accessor();
|
||||
virtual SPDMemoryType memory_type();
|
||||
virtual uint16_t jedec_id();
|
||||
virtual uint8_t manufacturer_data(uint16_t index);
|
||||
};
|
||||
|
||||
class DDR5Accessor : public SPDAccessor
|
||||
|
|
@ -51,4 +53,5 @@ class DDR5Accessor : public SPDAccessor
|
|||
virtual ~DDR5Accessor();
|
||||
virtual SPDMemoryType memory_type();
|
||||
virtual uint16_t jedec_id();
|
||||
virtual uint8_t manufacturer_data(uint16_t index);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -52,6 +52,15 @@ uint16_t SPDWrapper::jedec_id()
|
|||
return accessor->jedec_id();
|
||||
}
|
||||
|
||||
uint8_t SPDWrapper::manufacturer_data(uint16_t index)
|
||||
{
|
||||
if(accessor == nullptr)
|
||||
{
|
||||
return 0x00;
|
||||
}
|
||||
return accessor->manufacturer_data(index);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Helper functions for easier collection handling. |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class SPDWrapper
|
|||
SPDMemoryType memory_type();
|
||||
int index();
|
||||
uint16_t jedec_id();
|
||||
uint8_t manufacturer_data(uint16_t index);
|
||||
|
||||
private:
|
||||
SPDAccessor *accessor = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue