# HG changeset patch # User moel.mich # Date 1274714866 0 # Node ID 2354fdb91ac4b5215acaa7811ae3d707658f4ff4 # Parent b1278888d9a96af0e74421110f204eec052720ff Extended the ITE super I/O voltage reading by adding hidden voltage sensors for unknown channels. Added a few known DFI and Gigabyte mainboard voltage configurations. diff -r b1278888d9a9 -r 2354fdb91ac4 GUI/MainForm.cs --- a/GUI/MainForm.cs Sat May 22 15:51:59 2010 +0000 +++ b/GUI/MainForm.cs Mon May 24 15:27:46 2010 +0000 @@ -158,10 +158,8 @@ // Hide the system tray and auto startup menu items on Unix int p = (int)System.Environment.OSVersion.Platform; if ((p == 4) || (p == 128)) { - startMinMenuItem.Visible = false; minTrayMenuItem.Visible = false; startupMenuItem.Visible = false; - separatorMenuItem.Visible = false; } if (startMinMenuItem.Checked) { diff -r b1278888d9a9 -r 2354fdb91ac4 GUI/SensorNode.cs --- a/GUI/SensorNode.cs Sat May 22 15:51:59 2010 +0000 +++ b/GUI/SensorNode.cs Mon May 24 15:27:46 2010 +0000 @@ -73,7 +73,7 @@ bool hidden = Config.Get(new Identifier(sensor.Identifier, "hidden").ToString(), sensor.IsDefaultHidden); - IsVisible = !hidden; + base.IsVisible = !hidden; } public override string Text { diff -r b1278888d9a9 -r 2354fdb91ac4 Hardware/ATI/ATIGPU.cs --- a/Hardware/ATI/ATIGPU.cs Sat May 22 15:51:59 2010 +0000 +++ b/Hardware/ATI/ATIGPU.cs Mon May 24 15:27:46 2010 +0000 @@ -135,7 +135,7 @@ ActivateSensor(coreVoltage); } - coreLoad.Value = adlp.ActivityPercent; + coreLoad.Value = Math.Min(adlp.ActivityPercent, 100); ActivateSensor(coreLoad); } else { DeactivateSensor(coreClock); diff -r b1278888d9a9 -r 2354fdb91ac4 Hardware/LPC/IT87XX.cs --- a/Hardware/LPC/IT87XX.cs Sat May 22 15:51:59 2010 +0000 +++ b/Hardware/LPC/IT87XX.cs Mon May 24 15:27:46 2010 +0000 @@ -49,10 +49,9 @@ private readonly ushort addressReg; private readonly ushort dataReg; - private Sensor[] temperatures; + private List voltages = new List(9); + private List temperatures = new List(3); private Sensor[] fans; - private Sensor[] voltages; - private float[] voltageGains; // Consts private const byte ITE_VENDOR_ID = 0x90; @@ -79,7 +78,8 @@ return value; } - public IT87XX(Chip chip, ushort address) : base (chip) { + public IT87XX(Chip chip, ushort address, Mainboard.Manufacturer + mainboardManufacturer, Mainboard.Model mainboardModel) : base (chip) { this.address = address; this.addressReg = (ushort)(address + ADDRESS_REGISTER_OFFSET); @@ -97,23 +97,125 @@ if (!valid) return; - temperatures = new Sensor[3]; - for (int i = 0; i < temperatures.Length; i++) - temperatures[i] = new Sensor("Temperature #" + (i + 1), i, null, - SensorType.Temperature, this, new ParameterDescription[] { + string[] temperatureLabels; + List voltageConfigs = new List(); + switch (mainboardManufacturer) { + case Mainboard.Manufacturer.DFI: + switch (mainboardModel) { + case Mainboard.Model.LP_BI_P45_T2RS_Elite: + voltageConfigs.Add(new Voltage("CPU VCore", 0)); + voltageConfigs.Add(new Voltage("FSB VTT", 1)); + voltageConfigs.Add(new Voltage("+3.3V", 2)); + voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0)); + voltageConfigs.Add(new Voltage("+12V", 4, 30, 10, 0)); + voltageConfigs.Add(new Voltage("NB Core", 5)); + voltageConfigs.Add(new Voltage("VDIMM", 6)); + voltageConfigs.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0)); + voltageConfigs.Add(new Voltage("VBat", 8)); + temperatureLabels = new string[] { + "CPU", "System", "Chipset" }; + break; + case Mainboard.Model.LP_DK_P55_T3eH9: + voltageConfigs.Add(new Voltage("CPU VCore", 0)); + voltageConfigs.Add(new Voltage("VTT", 1)); + voltageConfigs.Add(new Voltage("+3.3V", 2)); + voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0)); + voltageConfigs.Add(new Voltage("+12V", 4, 30, 10, 0)); + voltageConfigs.Add(new Voltage("CPU PLL", 5)); + voltageConfigs.Add(new Voltage("DRAM", 6)); + voltageConfigs.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0)); + voltageConfigs.Add(new Voltage("VBat", 8)); + temperatureLabels = new string[] { + "Chipset", "CPU PWM", "CPU" }; + break; + default: + voltageConfigs.Add(new Voltage("CPU VCore", 0)); + voltageConfigs.Add(new Voltage("VTT", 1, true)); + voltageConfigs.Add(new Voltage("+3.3V", 2, true)); + voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true)); + voltageConfigs.Add(new Voltage("+12V", 4, 30, 10, 0, true)); + voltageConfigs.Add(new Voltage("Voltage #6", 5, true)); + voltageConfigs.Add(new Voltage("DRAM", 6, true)); + voltageConfigs.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true)); + voltageConfigs.Add(new Voltage("VBat", 8)); + temperatureLabels = new string[] { + "Temperature #1", "Temperature #2", "Temperature #3" }; + break; + } + break; + + case Mainboard.Manufacturer.Gigabyte: + switch (mainboardModel) { + case Mainboard.Model.EP45_DS3R: + case Mainboard.Model.P35_DS3: + voltageConfigs.Add(new Voltage("CPU VCore", 0)); + voltageConfigs.Add(new Voltage("DRAM", 1)); + voltageConfigs.Add(new Voltage("+3.3V", 2)); + voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0)); + voltageConfigs.Add(new Voltage("+12V", 7, 27, 9.1f, 0)); + voltageConfigs.Add(new Voltage("VBat", 8)); + break; + case Mainboard.Model.GA_MA785GMT_UD2H: + voltageConfigs.Add(new Voltage("CPU VCore", 0)); + voltageConfigs.Add(new Voltage("DRAM", 1)); + voltageConfigs.Add(new Voltage("+3.3V", 2)); + voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0)); + voltageConfigs.Add(new Voltage("+12V", 4, 27, 9.1f, 0)); + voltageConfigs.Add(new Voltage("VBat", 8)); + break; + default: + voltageConfigs.Add(new Voltage("CPU VCore", 0)); + voltageConfigs.Add(new Voltage("DRAM", 1, true)); + voltageConfigs.Add(new Voltage("+3.3V", 2, true)); + voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true)); + voltageConfigs.Add(new Voltage("Voltage #5", 4, true)); + voltageConfigs.Add(new Voltage("Voltage #6", 5, true)); + voltageConfigs.Add(new Voltage("Voltage #7", 6, true)); + voltageConfigs.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true)); + voltageConfigs.Add(new Voltage("VBat", 8)); + break; + } + temperatureLabels = new string[] { "System", "CPU" }; + break; + + default: + voltageConfigs.Add(new Voltage("CPU VCore", 0)); + voltageConfigs.Add(new Voltage("Voltage #2", 1, true)); + voltageConfigs.Add(new Voltage("Voltage #3", 2, true)); + voltageConfigs.Add(new Voltage("Voltage #4", 3, true)); + voltageConfigs.Add(new Voltage("Voltage #5", 4, true)); + voltageConfigs.Add(new Voltage("Voltage #6", 5, true)); + voltageConfigs.Add(new Voltage("Voltage #7", 6, true)); + voltageConfigs.Add(new Voltage("Voltage #8", 7, true)); + voltageConfigs.Add(new Voltage("VBat", 8)); + temperatureLabels = new string[] { + "Temperature #1", "Temperature #2", "Temperature #3" }; + break; + } + + string formula = "Voltage = value + (value - Vf) * Ri / Rf."; + foreach (Voltage voltage in voltageConfigs) + voltages.Add(new Sensor(voltage.Name, voltage.Index, voltage.Hidden, + null, SensorType.Voltage, this, new ParameterDescription[] { + new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + + formula, voltage.Ri), + new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + + formula, voltage.Rf), + new ParameterDescription("Vf [V]", "Reference voltage.\n" + + formula, voltage.Vf) + })); + + for (int i = 0; i < temperatureLabels.Length; i++) + if (temperatureLabels[i] != null) { + temperatures.Add(new Sensor(temperatureLabels[i], i, null, + SensorType.Temperature, this, new ParameterDescription[] { new ParameterDescription("Offset [°C]", "Temperature offset.", 0) - }); + })); + } fans = new Sensor[5]; for (int i = 0; i < fans.Length; i++) - fans[i] = new Sensor("Fan #" + (i + 1), i, SensorType.Fan, this); - - voltageGains = new float[] { - 1, 1, 1, (6.8f / 10 + 1), 1, 1, 1, 1, 1 }; - - voltages = new Sensor[2]; - voltages[0] = new Sensor("CPU VCore", 0, SensorType.Voltage, this); - voltages[1] = new Sensor("Battery", 8, SensorType.Voltage, this); + fans[i] = new Sensor("Fan #" + (i + 1), i, SensorType.Fan, this); available = true; } @@ -158,13 +260,14 @@ foreach (Sensor sensor in voltages) { bool valid; - int value = ReadByte( - (byte)(VOLTAGE_BASE_REG + sensor.Index), out valid); + float value = 0.001f * ((int)ReadByte( + (byte)(VOLTAGE_BASE_REG + sensor.Index), out valid) << 4); if (!valid) continue; - sensor.Value = voltageGains[sensor.Index] * 0.001f * (value << 4); - if (sensor.Value > 0) + sensor.Value = value + (value - sensor.Parameters[2].Value) * + sensor.Parameters[0].Value / sensor.Parameters[1].Value; + if (value > 0) ActivateSensor(sensor); } @@ -197,6 +300,35 @@ sensor.Value = null; } } - } + } + + private class Voltage { + public readonly string Name; + public readonly int Index; + public readonly float Ri; + public readonly float Rf; + public readonly float Vf; + public readonly bool Hidden; + + public Voltage(string name, int index) : + this(name, index, 0, 1, 0, false) { } + + public Voltage(string name, int index, bool hidden) : + this(name, index, 0, 1, 0, hidden) { } + + public Voltage(string name, int index, float ri, float rf, float vf) : + this(name, index, ri, rf, vf, false) { } + + public Voltage(string name, int index, float ri, float rf, float vf, + bool hidden) + { + this.Name = name; + this.Index = index; + this.Ri = ri; + this.Rf = rf; + this.Vf = vf; + this.Hidden = hidden; + } + } } } diff -r b1278888d9a9 -r 2354fdb91ac4 Hardware/LPC/LPCIO.cs --- a/Hardware/LPC/LPCIO.cs Sat May 22 15:51:59 2010 +0000 +++ b/Hardware/LPC/LPCIO.cs Mon May 24 15:27:46 2010 +0000 @@ -119,7 +119,9 @@ WinRing0.WriteIoPortByte(registerPort, 0xAA); } - public LPCIO() { + public LPCIO(Mainboard.Manufacturer mainboardManufacturer, + Mainboard.Model mainboardModel) + { if (!WinRing0.IsAvailable) return; @@ -351,7 +353,8 @@ return; } - IT87XX it87 = new IT87XX(chip, address); + IT87XX it87 = new IT87XX(chip, address, mainboardManufacturer, + mainboardModel); if (it87.IsAvailable) hardware.Add(it87); diff -r b1278888d9a9 -r 2354fdb91ac4 Hardware/Mainboard/Mainboard.cs --- a/Hardware/Mainboard/Mainboard.cs Sat May 22 15:51:59 2010 +0000 +++ b/Hardware/Mainboard/Mainboard.cs Mon May 24 15:27:46 2010 +0000 @@ -55,7 +55,7 @@ if (smbios.Board != null) { if (smbios.Board.ProductName != null && smbios.Board.ProductName != "") { - if (smbios.Board.Manufacturer == Manufacturer.Unkown) + if (smbios.Board.Manufacturer == Manufacturer.Unknown) this.name = smbios.Board.ProductName; else this.name = smbios.Board.Manufacturer + " " + @@ -64,11 +64,13 @@ this.name = smbios.Board.Manufacturer.ToString(); } } else { - this.name = Manufacturer.Unkown.ToString(); + this.name = Manufacturer.Unknown.ToString(); } this.icon = Utilities.EmbeddedResources.GetImage("mainboard.png"); - this.lpcGroup = new LPCIO(); + this.lpcGroup = new LPCIO( + smbios.Board != null ? smbios.Board.Manufacturer : Manufacturer.Unknown, + smbios.Board != null ? smbios.Board.Model : Model.Unknown); } public string Name { diff -r b1278888d9a9 -r 2354fdb91ac4 Hardware/Mainboard/Manufacturer.cs --- a/Hardware/Mainboard/Manufacturer.cs Sat May 22 15:51:59 2010 +0000 +++ b/Hardware/Mainboard/Manufacturer.cs Mon May 24 15:27:46 2010 +0000 @@ -47,7 +47,7 @@ Gigabyte, IBM, MSI, - Unkown + Unknown } } diff -r b1278888d9a9 -r 2354fdb91ac4 Hardware/Mainboard/Model.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Hardware/Mainboard/Model.cs Mon May 24 15:27:46 2010 +0000 @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenHardwareMonitor.Hardware.Mainboard { + + public enum Model { + // DFI + LP_BI_P45_T2RS_Elite, + LP_DK_P55_T3eH9, + + // Gigabyte + EP45_DS3R, + GA_MA785GMT_UD2H, + P35_DS3, + + // Unknown + Unknown + } +} diff -r b1278888d9a9 -r 2354fdb91ac4 Hardware/Mainboard/SMBIOS.cs --- a/Hardware/Mainboard/SMBIOS.cs Sat May 22 15:51:59 2010 +0000 +++ b/Hardware/Mainboard/SMBIOS.cs Mon May 24 15:27:46 2010 +0000 @@ -193,6 +193,7 @@ private string version; private string serialNumber; private Manufacturer manufacturer; + private Model model; public BaseBoardInformation(byte type, ushort handle, byte[] data, string[] strings) @@ -219,7 +220,22 @@ case "MICRO-STAR INTERNATIONAL CO.,LTD": manufacturer = Manufacturer.MSI; break; default: - manufacturer = Manufacturer.Unkown; break; + manufacturer = Manufacturer.Unknown; break; + } + + switch (productName) { + case "LP BI P45-T2RS Elite": + model = Model.LP_BI_P45_T2RS_Elite; break; + case "LP DK P55-T3eH9": + model = Model.LP_DK_P55_T3eH9; break; + case "EP45-DS3R": + model = Model.EP45_DS3R; break; + case "GA-MA785GMT-UD2H": + model = Model.GA_MA785GMT_UD2H; break; + case "P35-DS3": + model = Model.P35_DS3; break; + default: + model = Model.Unknown; break; } } @@ -233,6 +249,8 @@ public Manufacturer Manufacturer { get { return manufacturer; } } + public Model Model { get { return model; } } + } } } diff -r b1278888d9a9 -r 2354fdb91ac4 OpenHardwareMonitor.csproj --- a/OpenHardwareMonitor.csproj Sat May 22 15:51:59 2010 +0000 +++ b/OpenHardwareMonitor.csproj Mon May 24 15:27:46 2010 +0000 @@ -99,6 +99,7 @@ +