Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added AM5 chipset fan reading support (NCT6799D) #166

Merged
merged 4 commits into from Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions AMDRyzenCPUPowerManagement/SuperIO/ISSuperIONCT67XXFamily.cpp
Expand Up @@ -22,6 +22,10 @@ ISSuperIONCT67XXFamily::ISSuperIONCT67XXFamily(int psel, uint16_t addr, uint16_t
activeFansOnSystem = 7;
break;

case CHIP_NCT6799D:
activeFansOnSystem = 7;
break;

default:
activeFansOnSystem = 6;
break;
Expand Down Expand Up @@ -71,8 +75,13 @@ ISSuperIONCT67XXFamily* ISSuperIONCT67XXFamily::getDevice(uint16_t *chipIntel){
IOLog("NCT67XX chip identified\n");
break;

default:
case CHIP_NCT6799D:
found = true;
IOLog("NCT67XX chip identified\n");
break;

default:
IOLog("NCT67XX chip not identified\n");
break;
}

Expand Down Expand Up @@ -112,6 +121,13 @@ ISSuperIONCT67XXFamily* ISSuperIONCT67XXFamily::getDevice(uint16_t *chipIntel){
case CHIP_NCT6796DR:
case CHIP_NCT6797D:
case CHIP_NCT6798D:
conf = ISLPCPort::readByte(portSel, CHIP_IO_SPACE_LOCK);
if(conf & 0x10){
ISLPCPort::writeByte(portSel, CHIP_IO_SPACE_LOCK, conf & ~0x10);
}
break;

case CHIP_NCT6799D:
conf = ISLPCPort::readByte(portSel, CHIP_IO_SPACE_LOCK);
if(conf & 0x10){
ISLPCPort::writeByte(portSel, CHIP_IO_SPACE_LOCK, conf & ~0x10);
Expand Down Expand Up @@ -175,7 +191,7 @@ void ISSuperIONCT67XXFamily::updateFanRPMS(){
for (int i = 0; i < activeFansOnSystem; i++) {
int v = (int)readWord(kFAN_RPM_REGS[i]);
fanRPMs[i] = v;
// IOLog("fan %d: %d\n", i, (int)v);
//IOLog("fan %d: %d\n", i, (int)v);
}
}

Expand Down
Expand Up @@ -29,6 +29,7 @@
#define CHIP_NCT6796DR 0xD42A
#define CHIP_NCT6797D 0xD451
#define CHIP_NCT6798D 0xD42B
#define CHIP_NCT6799D 0xD802

#define NCT67XX_MAX_NUMFAN 7

Expand Down