Added support for Fintek F71858 chips. Corrected the number of fans for Fintek.
1.1 --- a/Hardware/LPC/Chip.cs Mon Mar 01 22:12:29 2010 +0000
1.2 +++ b/Hardware/LPC/Chip.cs Tue Mar 02 20:32:24 2010 +0000
1.3 @@ -19,6 +19,7 @@
1.4 W83667HG = 0xA510,
1.5 W83667HGB = 0xB350,
1.6 W83687THF = 0x8541,
1.7 + F71858 = 0x0507,
1.8 F71862 = 0x0601,
1.9 F71869 = 0x0814,
1.10 F71882 = 0x0541,
2.1 --- a/Hardware/LPC/F718XX.cs Mon Mar 01 22:12:29 2010 +0000
2.2 +++ b/Hardware/LPC/F718XX.cs Tue Mar 02 20:32:24 2010 +0000
2.3 @@ -56,7 +56,8 @@
2.4
2.5 // Hardware Monitor Registers
2.6 private const byte VOLTAGE_BASE_REG = 0x20;
2.7 - private const byte TEMPERATURE_BASE_REG = 0x72;
2.8 + private const byte TEMPERATURE_CONFIG_REG = 0x69;
2.9 + private const byte TEMPERATURE_BASE_REG = 0x70;
2.10 private byte[] FAN_TACHOMETER_REG = new byte[] { 0xA0, 0xB0, 0xC0, 0xD0 };
2.11
2.12 private byte ReadByte(byte register) {
2.13 @@ -75,16 +76,27 @@
2.14 new ParameterDescription("Offset", "Temperature offset.", 0)
2.15 });
2.16
2.17 - fans = new Sensor[4];
2.18 + fans = new Sensor[chip == Chip.F71882 ? 4 : 3];
2.19 for (int i = 0; i < fans.Length; i++)
2.20 fans[i] = new Sensor("Fan #" + (i + 1), i, SensorType.Fan, this);
2.21
2.22 - voltageGains = new float[] { 1, 0.5f, 1, 1, 1, 1, 1, 1, 1 };
2.23 - voltages = new Sensor[4];
2.24 - voltages[0] = new Sensor("VCC3V", 0, SensorType.Voltage, this);
2.25 - voltages[1] = new Sensor("CPU VCore", 1, SensorType.Voltage, this);
2.26 - voltages[2] = new Sensor("VSB3V", 7, SensorType.Voltage, this);
2.27 - voltages[3] = new Sensor("Battery", 8, SensorType.Voltage, this);
2.28 + switch (chip) {
2.29 + case Chip.F71858:
2.30 + voltageGains = new float[] { 1, 1, 1 };
2.31 + voltages = new Sensor[3];
2.32 + voltages[0] = new Sensor("VCC3V", 0, SensorType.Voltage, this);
2.33 + voltages[1] = new Sensor("VSB3V", 1, SensorType.Voltage, this);
2.34 + voltages[2] = new Sensor("Battery", 2, SensorType.Voltage, this);
2.35 + break;
2.36 + default:
2.37 + voltageGains = new float[] { 1, 0.5f, 1, 1, 1, 1, 1, 1, 1 };
2.38 + voltages = new Sensor[4];
2.39 + voltages[0] = new Sensor("VCC3V", 0, SensorType.Voltage, this);
2.40 + voltages[1] = new Sensor("CPU VCore", 1, SensorType.Voltage, this);
2.41 + voltages[2] = new Sensor("VSB3V", 7, SensorType.Voltage, this);
2.42 + voltages[3] = new Sensor("Battery", 8, SensorType.Voltage, this);
2.43 + break;
2.44 + }
2.45 }
2.46
2.47 public string GetReport() {
2.48 @@ -121,15 +133,42 @@
2.49 else
2.50 DeactivateSensor(sensor);
2.51 }
2.52 -
2.53 +
2.54 foreach (Sensor sensor in temperatures) {
2.55 - sbyte value = (sbyte)ReadByte((byte)(
2.56 - TEMPERATURE_BASE_REG + 2 * sensor.Index));
2.57 - sensor.Value = value + sensor.Parameters[0].Value;
2.58 - if (value < sbyte.MaxValue && value > 0)
2.59 - ActivateSensor(sensor);
2.60 - else
2.61 - DeactivateSensor(sensor);
2.62 + switch (chip) {
2.63 + case Chip.F71858: {
2.64 + int tableMode = 0x3 & ReadByte((byte)(TEMPERATURE_CONFIG_REG));
2.65 + int high =
2.66 + ReadByte((byte)(TEMPERATURE_BASE_REG + 2 * sensor.Index));
2.67 + int low =
2.68 + ReadByte((byte)(TEMPERATURE_BASE_REG + 2 * sensor.Index + 1));
2.69 + if (high != 0xbb && high != 0xcc) {
2.70 + int bits = 0;
2.71 + switch (tableMode) {
2.72 + case 0: bits = 0; break;
2.73 + case 1: bits = 0; break;
2.74 + case 2: bits = (high & 0x80) << 8; break;
2.75 + case 3: bits = (low & 0x01) << 15; break;
2.76 + }
2.77 + bits |= high << 7;
2.78 + bits |= (low & 0xe0) >> 1;
2.79 + short value = (short)(bits & 0xfff0);
2.80 + sensor.Value = value / 128.0f;
2.81 + ActivateSensor(sensor);
2.82 + } else {
2.83 + DeactivateSensor(sensor);
2.84 + }
2.85 + } break;
2.86 + default: {
2.87 + sbyte value = (sbyte)ReadByte((byte)(
2.88 + TEMPERATURE_BASE_REG + 2 * (sensor.Index + 1)));
2.89 + sensor.Value = value + sensor.Parameters[0].Value;
2.90 + if (value < sbyte.MaxValue && value > 0)
2.91 + ActivateSensor(sensor);
2.92 + else
2.93 + DeactivateSensor(sensor);
2.94 + } break;
2.95 + }
2.96 }
2.97
2.98 foreach (Sensor sensor in fans) {
3.1 --- a/Hardware/LPC/LPCGroup.cs Mon Mar 01 22:12:29 2010 +0000
3.2 +++ b/Hardware/LPC/LPCGroup.cs Tue Mar 02 20:32:24 2010 +0000
3.3 @@ -137,6 +137,10 @@
3.4 switch (id) {
3.5 case 0x05:
3.6 switch (revision) {
3.7 + case 0x07:
3.8 + chip = Chip.F71858;
3.9 + logicalDeviceNumber = F71858_HARDWARE_MONITOR_LDN;
3.10 + break;
3.11 case 0x41:
3.12 chip = Chip.F71882;
3.13 logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
3.14 @@ -235,9 +239,10 @@
3.15 ushort address = ReadWord(BASE_ADDRESS_REGISTER);
3.16 Thread.Sleep(1);
3.17 ushort verify = ReadWord(BASE_ADDRESS_REGISTER);
3.18 -
3.19 - ushort vendorID = 0;
3.20 - if (chip == Chip.F71862 || chip == Chip.F71882 || chip == Chip.F71889)
3.21 +
3.22 + ushort vendorID = FINTEK_VENDOR_ID;
3.23 + if (chip == Chip.F71858 || chip == Chip.F71862 ||
3.24 + chip == Chip.F71882 || chip == Chip.F71889)
3.25 vendorID = ReadWord(FINTEK_VENDOR_ID_REGISTER);
3.26
3.27 WinbondFintekExit();
3.28 @@ -280,12 +285,10 @@
3.29 if (w836XX.IsAvailable)
3.30 hardware.Add(w836XX);
3.31 break;
3.32 + case Chip.F71858:
3.33 case Chip.F71862:
3.34 case Chip.F71882:
3.35 case Chip.F71889:
3.36 - if (vendorID == FINTEK_VENDOR_ID)
3.37 - hardware.Add(new F718XX(chip, address));
3.38 - break;
3.39 case Chip.F71869:
3.40 hardware.Add(new F718XX(chip, address));
3.41 break;
4.1 --- a/Hardware/LPC/LPCHardware.cs Mon Mar 01 22:12:29 2010 +0000
4.2 +++ b/Hardware/LPC/LPCHardware.cs Tue Mar 02 20:32:24 2010 +0000
4.3 @@ -51,6 +51,7 @@
4.4 this.icon = Utilities.EmbeddedResources.GetImage("chip.png");
4.5
4.6 switch (chip) {
4.7 + case Chip.F71858: name = "Fintek F71858"; break;
4.8 case Chip.F71862: name = "Fintek F71862"; break;
4.9 case Chip.F71869: name = "Fintek F71869"; break;
4.10 case Chip.F71882: name = "Fintek F71882"; break;