Fixed an issue with the Nuvoton NCT6791D (hardware monitor i/o space lock wasn't disabled before attempting to read data).
authormoel.mich
Sat, 07 Sep 2013 08:07:11 +0000
changeset 42347f5dcaf8e9f
parent 422 0fe7d6e91094
child 424 427fc32e589f
Fixed an issue with the Nuvoton NCT6791D (hardware monitor i/o space lock wasn't disabled before attempting to read data).
Hardware/LPC/LPCIO.cs
Properties/AssemblyVersion.cs
     1.1 --- a/Hardware/LPC/LPCIO.cs	Sun Aug 25 19:13:35 2013 +0000
     1.2 +++ b/Hardware/LPC/LPCIO.cs	Sat Sep 07 08:07:11 2013 +0000
     1.3 @@ -39,6 +39,11 @@
     1.4        return Ring0.ReadIoPort(valuePort);
     1.5      }
     1.6  
     1.7 +    private void WriteByte(byte register, byte value) {
     1.8 +      Ring0.WriteIoPort(registerPort, register);
     1.9 +      Ring0.WriteIoPort(valuePort, value);
    1.10 +    }
    1.11 +
    1.12      private ushort ReadWord(byte register) {
    1.13        return (ushort)((ReadByte(register) << 8) |
    1.14          ReadByte((byte)(register + 1)));
    1.15 @@ -71,6 +76,8 @@
    1.16      private const byte F71858_HARDWARE_MONITOR_LDN = 0x02;
    1.17      private const byte FINTEK_HARDWARE_MONITOR_LDN = 0x04;
    1.18  
    1.19 +    private const byte NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK = 0x28;
    1.20 +
    1.21      private void WinbondNuvotonFintekEnter() {
    1.22        Ring0.WriteIoPort(registerPort, 0x87);
    1.23        Ring0.WriteIoPort(registerPort, 0x87);
    1.24 @@ -246,6 +253,19 @@
    1.25  
    1.26          ushort vendorID = ReadWord(FINTEK_VENDOR_ID_REGISTER);
    1.27  
    1.28 +        // disable the hardware monitor i/o space lock on NCT6791D chips
    1.29 +        if (address == verify && chip == Chip.NCT6791D) {
    1.30 +          byte options = ReadByte(NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK);
    1.31 +
    1.32 +          // if the i/o space lock is enabled
    1.33 +          if ((options & 0x10) > 0) {
    1.34 +
    1.35 +            // disable the i/o space lock
    1.36 +            WriteByte(NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK,
    1.37 +              (byte)(options & ~0x10));
    1.38 +          }
    1.39 +        }
    1.40 +
    1.41          WinbondNuvotonFintekExit();
    1.42  
    1.43          if (address != verify) {
     2.1 --- a/Properties/AssemblyVersion.cs	Sun Aug 25 19:13:35 2013 +0000
     2.2 +++ b/Properties/AssemblyVersion.cs	Sat Sep 07 08:07:11 2013 +0000
     2.3 @@ -10,5 +10,5 @@
     2.4  
     2.5  using System.Reflection;
     2.6  
     2.7 -[assembly: AssemblyVersion("0.6.0.10")]
     2.8 -[assembly: AssemblyInformationalVersion("0.6.0.10 Alpha")]
     2.9 \ No newline at end of file
    2.10 +[assembly: AssemblyVersion("0.6.0.11")]
    2.11 +[assembly: AssemblyInformationalVersion("0.6.0.11 Alpha")]
    2.12 \ No newline at end of file