Add Intel vendor ID to DRAM SMBus check

This commit is contained in:
Adam Honse 2020-09-14 19:29:28 -05:00
parent d41e817253
commit 9b2315234f
2 changed files with 29 additions and 2 deletions

View file

@ -530,7 +530,27 @@ void i2c_smbus_i801_detect(std::vector<i2c_smbus_interface*> &busses)
{
unsigned int IORangeStart = std::stoi(matches[1].str());
bus = new i2c_smbus_i801();
std::string pnp_str = i["DeviceID"];
std::size_t ven_loc = pnp_str.find("VEN_");
std::size_t dev_loc = pnp_str.find("DEV_");
std::size_t sub_loc = pnp_str.find("SUBSYS_");
std::string ven_str = pnp_str.substr(ven_loc + 4, 4);
std::string dev_str = pnp_str.substr(dev_loc + 4, 4);
std::string sbv_str = pnp_str.substr(sub_loc + 11, 4);
std::string sbd_str = pnp_str.substr(sub_loc + 7, 4);
int ven_id = (int)std::stoul(ven_str, nullptr, 16);
int dev_id = (int)std::stoul(dev_str, nullptr, 16);
int sbv_id = (int)std::stoul(sbv_str, nullptr, 16);
int sbd_id = (int)std::stoul(sbd_str, nullptr, 16);
bus = new i2c_smbus_i801();
bus->pci_vendor = ven_id;
bus->pci_device = dev_id;
bus->pci_subsystem_vendor = sbv_id;
bus->pci_subsystem_device = sbd_id;
strcpy(bus->device_name, i["Description"].c_str());
((i2c_smbus_i801 *)bus)->i801_smba = IORangeStart;
busses.push_back(bus);

View file

@ -3,6 +3,7 @@
\*---------------------------------------------------------*/
#define AMD_VEN 0x1022
#define AMD_GPU_VEN 0x1002
#define INTEL_VEN 0x8086
#define NVIDIA_VEN 0x10DE
/*-----------------------------------------------------*\
@ -15,6 +16,11 @@
\*-----------------------------------------------------*/
#define AMD_RX580_DEV 0x67DF
/*-----------------------------------------------------*\
| Intel Device IDs |
\*-----------------------------------------------------*/
#define INTEL_ICH10_SMBUS_DEV 0x3A30
/*-----------------------------------------------------*\
| nVidia Device IDs |
\*-----------------------------------------------------*/
@ -32,6 +38,7 @@
\*---------------------------------------------------------*/
#define ASUS_SUB_VEN 0x1043
#define EVGA_SUB_VEN 0x3842
#define GIGABYTE_SUB_VEN 0x1458
#define MSI_SUB_VEN 0x1462
#define SAPPHIRE_SUB_VEN 0x1DA2
@ -67,4 +74,4 @@
| PCI ID Macros |
\*---------------------------------------------------------*/
#define IF_DRAM_SMBUS(ven, dev) \
if((ven == AMD_VEN) && (dev == AMD_FCH_SMBUS_DEV))
if((ven == AMD_VEN) || (ven == INTEL_VEN))