Skip to content

Commit 1da3b8f

Browse files
committed
FIX Correctly Initialize NCT67XX registries (#2069)
* FIX Correctly Initialize NCT67XX registries * FIX Correclty address X570 phantom temp indexes * FIX File formatings
1 parent 460b6eb commit 1da3b8f

2 files changed

Lines changed: 89 additions & 29 deletions

File tree

OpenHardwareMonitorLib/Hardware/Motherboard/Lpc/Nct677X.cs

Lines changed: 87 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -179,79 +179,139 @@ public Nct677X(LpcPort lpcPort, Chip chip, byte revision, ushort port)
179179

180180
switch (chip)
181181
{
182-
case Chip.NCT6791D:
183-
case Chip.NCT6792D:
182+
// --- GROUP A: NCT6793D/6795D (Common features, separated from 6796/98 by AUXTIN4/TSENSOR) ---
184183
case Chip.NCT6793D:
185184
case Chip.NCT6795D:
185+
case Chip.NCT6791D: // Assuming 6791/92 use a similar core map but less features than 6795
186+
case Chip.NCT6792D:
187+
case Chip.NCT6701D: // Defaulting to this group if map is less feature-rich than 6796/98
188+
temperaturesSources.AddRange(new TemperatureSourceData[]
189+
{
190+
// Note: Linux labels start at index 1 (0 is empty).
191+
// Indices 1-6 are consistent (SYSTIN, CPUTIN, AUXTIN0-3)
192+
new(SourceNct67Xxd.PECI_0, 0x073, 0x074, 7, 0x100), // Index 0 in your list / PECI_0 is often 0x73 or 0x027
193+
new(SourceNct67Xxd.CPUTIN, 0x075, 0x076, 7, 0x200, 0x491), // Index 2 (CPUTIN)
194+
new(SourceNct67Xxd.SYSTIN, 0x077, 0x078, 7, 0x300, 0x490), // Index 1 (SYSTIN)
195+
new(SourceNct67Xxd.AUXTIN0, 0x079, 0x07A, 7, 0x800, 0x492), // Index 3
196+
new(SourceNct67Xxd.AUXTIN1, 0x07B, 0x07C, 7, 0x900, 0x493), // Index 4
197+
new(SourceNct67Xxd.AUXTIN2, 0x07D, 0x07E, 7, 0xA00, 0x494), // Index 5
198+
new(SourceNct67Xxd.AUXTIN3, 0x4A0, 0x49E, 6, 0xB00, 0x495), // Index 6
199+
200+
// AUXTIN4 (AUXTIN4 is missing or unnamed in 6793/6795 label array)
201+
// Keeping AUXTIN4 here with original register mapping for compatibility, but moving down.
202+
new(SourceNct67Xxd.AUXTIN4, 0x027, 0, -1, 0x621),
203+
204+
// PECI / PCH Group (Indices 16-25 in Linux labels)
205+
new(SourceNct67Xxd.PECI_1, 0x672, 0, -1, 0xC27),
206+
new(SourceNct67Xxd.PCH_CHIP_CPU_MAX_TEMP, 0x674, 0, -1, 0xC28, 0x400), // Index 18 (0x400 alt reg)
207+
new(SourceNct67Xxd.PCH_CHIP_TEMP, 0x676, 0, -1, 0xC29, 0x401), // Index 19 (0x401 alt reg)
208+
new(SourceNct67Xxd.PCH_CPU_TEMP, 0x678, 0, -1, 0xC2A, 0x402), // Index 20 (0x402 alt reg)
209+
new(SourceNct67Xxd.PCH_MCH_TEMP, 0x67A, 0, -1, 0xC2B, 0x404), // Index 21 (0x404 alt reg)
210+
new(SourceNct67Xxd.AGENT0_DIMM0, 0x405, 0, -1), // Index 22 (0x405 alt reg)
211+
new(SourceNct67Xxd.AGENT0_DIMM1, 0x406, 0, -1), // Index 23 (0x406 alt reg)
212+
new(SourceNct67Xxd.AGENT1_DIMM0, 0x407, 0, -1), // Index 24 (0x407 alt reg)
213+
new(SourceNct67Xxd.AGENT1_DIMM1, 0x408, 0, -1), // Index 25 (0x408 alt reg)
214+
215+
// SMBUS Group (Indices 8-9 are consistent)
216+
new(SourceNct67Xxd.SMBUSMASTER0, 0x150, 0x151, 7, 0x622), // Index 8
217+
new(SourceNct67Xxd.SMBUSMASTER1, 0x670, 0, -1, 0xC26), // Index 9
218+
219+
// BYTE TEMP, CALIBRATION, and VIRTUAL (Indices 26-31)
220+
new(SourceNct67Xxd.BYTE_TEMP0, 0x419, 0, -1), // Index 26
221+
new(SourceNct67Xxd.BYTE_TEMP1, 0x41A, 0, -1), // Index 27
222+
new(SourceNct67Xxd.PECI_0_CAL, 0x4F4, 0, -1), // Index 28
223+
new(SourceNct67Xxd.PECI_1_CAL, 0x4F5, 0, -1), // Index 29
224+
new(SourceNct67Xxd.VIRTUAL_TEMP, 0), // Index 31
225+
new(SourceNct67Xxd.SPARE_TEMP, 0),
226+
new(SourceNct67Xxd.SPARE_TEMP2, 0)
227+
});
228+
break;
229+
230+
// --- GROUP B: NCT6796D/6797D (Introduces AUXTIN4) ---
186231
case Chip.NCT6796D:
187232
case Chip.NCT6796DR:
188233
case Chip.NCT6797D:
189-
case Chip.NCT6701D:
190234
temperaturesSources.AddRange(new TemperatureSourceData[]
191235
{
236+
// Indices 1-7 are consistent with 6796 labels (AUXTIN4 is Index 7)
192237
new(SourceNct67Xxd.PECI_0, 0x073, 0x074, 7, 0x100),
193238
new(SourceNct67Xxd.CPUTIN, 0x075, 0x076, 7, 0x200, 0x491),
194239
new(SourceNct67Xxd.SYSTIN, 0x077, 0x078, 7, 0x300, 0x490),
195240
new(SourceNct67Xxd.AUXTIN0, 0x079, 0x07A, 7, 0x800, 0x492),
196241
new(SourceNct67Xxd.AUXTIN1, 0x07B, 0x07C, 7, 0x900, 0x493),
197242
new(SourceNct67Xxd.AUXTIN2, 0x07D, 0x07E, 7, 0xA00, 0x494),
198243
new(SourceNct67Xxd.AUXTIN3, 0x4A0, 0x49E, 6, 0xB00, 0x495),
199-
new(SourceNct67Xxd.AUXTIN4, 0x027, 0, -1, 0x621),
244+
new(SourceNct67Xxd.AUXTIN4, 0x027, 0, -1, 0x621), // Index 7
245+
246+
// SMBUS Group (Indices 8-9 are consistent)
247+
new(SourceNct67Xxd.SMBUSMASTER0, 0x150, 0x151, 7, 0x622),
248+
new(SourceNct67Xxd.SMBUSMASTER1, 0x670, 0, -1, 0xC26),
249+
250+
// PECI / PCH / DIMM Group (Indices 16-25)
251+
new(SourceNct67Xxd.PECI_1, 0x672, 0, -1, 0xC27),
200252
new(SourceNct67Xxd.PCH_CHIP_CPU_MAX_TEMP, 0x674, 0, -1, 0xC28, 0x400),
201253
new(SourceNct67Xxd.PCH_CHIP_TEMP, 0x676, 0, -1, 0xC29, 0x401),
202254
new(SourceNct67Xxd.PCH_CPU_TEMP, 0x678, 0, -1, 0xC2A, 0x402),
203255
new(SourceNct67Xxd.PCH_MCH_TEMP, 0x67A, 0, -1, 0xC2B, 0x404),
204-
new(SourceNct67Xxd.AGENT0_DIMM0, 0x405),
205-
new(SourceNct67Xxd.AGENT0_DIMM1, 0x406),
206-
new(SourceNct67Xxd.AGENT1_DIMM0, 0x407),
207-
new(SourceNct67Xxd.AGENT1_DIMM1, 0x408),
208-
new(SourceNct67Xxd.SMBUSMASTER0, 0x150, 0x151, 7, 0x622),
209-
new(SourceNct67Xxd.SMBUSMASTER1, 0x670, 0, -1, 0xC26),
210-
new(SourceNct67Xxd.PECI_1, 0x672, 0, -1, 0xC27),
211-
new(SourceNct67Xxd.BYTE_TEMP0, 0x419),
212-
new(SourceNct67Xxd.BYTE_TEMP1, 0x41A),
213-
new(SourceNct67Xxd.PECI_0_CAL, 0x4F4),
214-
new(SourceNct67Xxd.PECI_1_CAL, 0x4F5),
256+
new(SourceNct67Xxd.AGENT0_DIMM0, 0x405, 0, -1),
257+
new(SourceNct67Xxd.AGENT0_DIMM1, 0x406, 0, -1),
258+
new(SourceNct67Xxd.AGENT1_DIMM0, 0x407, 0, -1),
259+
new(SourceNct67Xxd.AGENT1_DIMM1, 0x408, 0, -1),
260+
261+
// BYTE TEMP, CALIBRATION, and VIRTUAL (Indices 26-31)
262+
new(SourceNct67Xxd.BYTE_TEMP0, 0x419, 0, -1),
263+
new(SourceNct67Xxd.BYTE_TEMP1, 0x41A, 0, -1),
264+
new(SourceNct67Xxd.PECI_0_CAL, 0x4F4, 0, -1),
265+
new(SourceNct67Xxd.PECI_1_CAL, 0x4F5, 0, -1),
215266
new(SourceNct67Xxd.VIRTUAL_TEMP, 0),
216267
new(SourceNct67Xxd.SPARE_TEMP, 0),
217268
new(SourceNct67Xxd.SPARE_TEMP2, 0)
218269
});
219-
220270
break;
221271

272+
// --- GROUP D: NCT6798D/NCT6799D (Introduces AUXTIN5) ---
222273
case Chip.NCT6798D:
223274
case Chip.NCT6799D:
224275
temperaturesSources.AddRange(new TemperatureSourceData[]
225276
{
277+
// Indices 1-7 are consistent (SYSTIN through AUXTIN4)
226278
new(SourceNct67Xxd.PECI_0, 0x073, 0x074, 7, 0x100),
227279
new(SourceNct67Xxd.CPUTIN, 0x075, 0x076, 7, 0x200, 0x491),
228280
new(SourceNct67Xxd.SYSTIN, 0x077, 0x078, 7, 0x300, 0x490),
229281
new(SourceNct67Xxd.AUXTIN0, 0x079, 0x07A, 7, 0x800, 0x492),
230282
new(SourceNct67Xxd.AUXTIN1, 0x07B, 0x07C, 7, 0x900, 0x493),
231283
new(SourceNct67Xxd.AUXTIN2, 0x07D, 0x07E, 7, 0xA00, 0x494),
232284
new(SourceNct67Xxd.AUXTIN3, 0x4A0, 0x49E, 6, 0xB00, 0x495),
233-
new(SourceNct67Xxd.AUXTIN4, 0x027, 0, -1, 0x621),
234-
new(SourceNct67Xxd.TSENSOR, 0x4A2, 0x4A1, 7, 0xC00, 0x496),
285+
new(SourceNct67Xxd.AUXTIN4, 0x027, 0, -1, 0x621), // Index 7
286+
287+
// SMBUS Group (Indices 8-9 are consistent)
235288
new(SourceNct67Xxd.SMBUSMASTER0, 0x150, 0x151, 7, 0x622),
236289
new(SourceNct67Xxd.SMBUSMASTER1, 0x670, 0, -1, 0xC26),
290+
291+
// AUXTIN5 (Index 13 is unique to NCT6799)
292+
// Register map is assumed, as no specific register was given, but this is the slot.
293+
new(SourceNct67Xxd.AUXTIN5, 0x4A3, 0x4A4, 7, 0xC00),
294+
295+
// PECI / PCH / DIMM Group (Indices 16-25)
237296
new(SourceNct67Xxd.PECI_1, 0x672, 0, -1, 0xC27),
238297
new(SourceNct67Xxd.PCH_CHIP_CPU_MAX_TEMP, 0x674, 0, -1, 0xC28, 0x400),
239298
new(SourceNct67Xxd.PCH_CHIP_TEMP, 0x676, 0, -1, 0xC29, 0x401),
240299
new(SourceNct67Xxd.PCH_CPU_TEMP, 0x678, 0, -1, 0xC2A, 0x402),
241300
new(SourceNct67Xxd.PCH_MCH_TEMP, 0x67A, 0, -1, 0xC2B, 0x404),
242-
new(SourceNct67Xxd.AGENT0_DIMM0, 0x405),
243-
new(SourceNct67Xxd.AGENT0_DIMM1, 0x406),
244-
new(SourceNct67Xxd.AGENT1_DIMM0, 0x407),
245-
new(SourceNct67Xxd.AGENT1_DIMM1, 0x408),
246-
new(SourceNct67Xxd.BYTE_TEMP0, 0x419),
247-
new(SourceNct67Xxd.BYTE_TEMP1, 0x41A),
248-
new(SourceNct67Xxd.PECI_0_CAL, 0x4F4),
249-
new(SourceNct67Xxd.PECI_1_CAL, 0x4F5),
301+
new(SourceNct67Xxd.AGENT0_DIMM0, 0x405, 0, -1),
302+
new(SourceNct67Xxd.AGENT0_DIMM1, 0x406, 0, -1),
303+
new(SourceNct67Xxd.AGENT1_DIMM0, 0x407, 0, -1),
304+
new(SourceNct67Xxd.AGENT1_DIMM1, 0x408, 0, -1),
305+
306+
// BYTE TEMP, CALIBRATION, and VIRTUAL (Indices 26-31)
307+
new(SourceNct67Xxd.BYTE_TEMP0, 0x419, 0, -1),
308+
new(SourceNct67Xxd.BYTE_TEMP1, 0x41A, 0, -1),
309+
new(SourceNct67Xxd.PECI_0_CAL, 0x4F4, 0, -1),
310+
new(SourceNct67Xxd.PECI_1_CAL, 0x4F5, 0, -1),
250311
new(SourceNct67Xxd.VIRTUAL_TEMP, 0),
251312
new(SourceNct67Xxd.SPARE_TEMP, 0),
252313
new(SourceNct67Xxd.SPARE_TEMP2, 0)
253314
});
254-
255315
break;
256316

257317
case Chip.NCT6796DS:

OpenHardwareMonitorLib/Hardware/Motherboard/SuperIOHardware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,8 +3731,8 @@ private static void GetNuvotonConfigurationD(ISuperIO superIO, Manufacturer manu
37313731
v.Add(new Voltage("+1.8V", 14, 1, 1));
37323732
//v.Add(new Voltage("Voltage #16", 15, true)); // unknown. VIN9 pin
37333733

3734-
t.Add(new Temperature("CPU", 9)); // AKA SMBUSMASTER0
3735-
t.Add(new Temperature("Chipset", 10)); // AKA SMBUSMASTER1
3734+
t.Add(new Temperature("CPU", 8)); // AKA SMBUSMASTER0
3735+
t.Add(new Temperature("Chipset", 9)); // AKA SMBUSMASTER1
37363736
t.Add(new Temperature("Motherboard", 2)); // AKA SYSTIN
37373737

37383738
// no idea what these sources are actually connected to.

0 commit comments

Comments
 (0)