# HG changeset patch # User moel.mich # Date 1378541231 0 # Node ID 47f5dcaf8e9fe7883b9c0b9547ae557753f29790 # Parent 0fe7d6e91094fc42c26bb5b240b20a877cf6f809 Fixed an issue with the Nuvoton NCT6791D (hardware monitor i/o space lock wasn't disabled before attempting to read data). diff -r 0fe7d6e91094 -r 47f5dcaf8e9f Hardware/LPC/LPCIO.cs --- a/Hardware/LPC/LPCIO.cs Sun Aug 25 19:13:35 2013 +0000 +++ b/Hardware/LPC/LPCIO.cs Sat Sep 07 08:07:11 2013 +0000 @@ -39,6 +39,11 @@ return Ring0.ReadIoPort(valuePort); } + private void WriteByte(byte register, byte value) { + Ring0.WriteIoPort(registerPort, register); + Ring0.WriteIoPort(valuePort, value); + } + private ushort ReadWord(byte register) { return (ushort)((ReadByte(register) << 8) | ReadByte((byte)(register + 1))); @@ -71,6 +76,8 @@ private const byte F71858_HARDWARE_MONITOR_LDN = 0x02; private const byte FINTEK_HARDWARE_MONITOR_LDN = 0x04; + private const byte NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK = 0x28; + private void WinbondNuvotonFintekEnter() { Ring0.WriteIoPort(registerPort, 0x87); Ring0.WriteIoPort(registerPort, 0x87); @@ -246,6 +253,19 @@ ushort vendorID = ReadWord(FINTEK_VENDOR_ID_REGISTER); + // disable the hardware monitor i/o space lock on NCT6791D chips + if (address == verify && chip == Chip.NCT6791D) { + byte options = ReadByte(NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK); + + // if the i/o space lock is enabled + if ((options & 0x10) > 0) { + + // disable the i/o space lock + WriteByte(NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK, + (byte)(options & ~0x10)); + } + } + WinbondNuvotonFintekExit(); if (address != verify) { diff -r 0fe7d6e91094 -r 47f5dcaf8e9f Properties/AssemblyVersion.cs --- a/Properties/AssemblyVersion.cs Sun Aug 25 19:13:35 2013 +0000 +++ b/Properties/AssemblyVersion.cs Sat Sep 07 08:07:11 2013 +0000 @@ -10,5 +10,5 @@ using System.Reflection; -[assembly: AssemblyVersion("0.6.0.10")] -[assembly: AssemblyInformationalVersion("0.6.0.10 Alpha")] \ No newline at end of file +[assembly: AssemblyVersion("0.6.0.11")] +[assembly: AssemblyInformationalVersion("0.6.0.11 Alpha")] \ No newline at end of file