Added experimental support for AMD family 15h model 1Xh and family 16h CPUs.
authormoel.mich
Sat, 29 Jun 2013 16:12:40 +0000
changeset 407c9dfdbd59bf8
parent 406 3890d78140c2
child 408 bbeb9004c491
Added experimental support for AMD family 15h model 1Xh and family 16h CPUs.
Hardware/CPU/AMD10CPU.cs
Hardware/CPU/CPUGroup.cs
Properties/AssemblyVersion.cs
     1.1 --- a/Hardware/CPU/AMD10CPU.cs	Tue Jun 25 20:34:29 2013 +0000
     1.2 +++ b/Hardware/CPU/AMD10CPU.cs	Sat Jun 29 16:12:40 2013 +0000
     1.3 @@ -4,7 +4,7 @@
     1.4    License, v. 2.0. If a copy of the MPL was not distributed with this
     1.5    file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.6   
     1.7 -  Copyright (C) 2009-2011 Michael Möller <mmoeller@openhardwaremonitor.org>
     1.8 +  Copyright (C) 2009-2013 Michael Möller <mmoeller@openhardwaremonitor.org>
     1.9  	
    1.10  */
    1.11  
    1.12 @@ -13,7 +13,6 @@
    1.13  using System.Diagnostics;
    1.14  using System.Globalization;
    1.15  using System.IO;
    1.16 -using System.Runtime.InteropServices;
    1.17  using System.Text;
    1.18  using System.Threading;
    1.19  
    1.20 @@ -36,7 +35,10 @@
    1.21      private const ushort FAMILY_11H_MISCELLANEOUS_CONTROL_DEVICE_ID = 0x1303;
    1.22      private const ushort FAMILY_12H_MISCELLANEOUS_CONTROL_DEVICE_ID = 0x1703;
    1.23      private const ushort FAMILY_14H_MISCELLANEOUS_CONTROL_DEVICE_ID = 0x1703;
    1.24 -    private const ushort FAMILY_15H_MISCELLANEOUS_CONTROL_DEVICE_ID = 0x1603; 
    1.25 +    private const ushort FAMILY_15H_MODEL_00_MISC_CONTROL_DEVICE_ID = 0x1603;
    1.26 +    private const ushort FAMILY_15H_MODEL_10_MISC_CONTROL_DEVICE_ID = 0x1403;
    1.27 +    private const ushort FAMILY_16H_MODEL_00_MISC_CONTROL_DEVICE_ID = 0x1533;
    1.28 +
    1.29      private const uint REPORTED_TEMPERATURE_CONTROL_REGISTER = 0xA4;
    1.30      private const uint CLOCK_POWER_TIMING_CONTROL_0_REGISTER = 0xD4;
    1.31  
    1.32 @@ -67,8 +69,20 @@
    1.33            FAMILY_12H_MISCELLANEOUS_CONTROL_DEVICE_ID; break;
    1.34          case 0x14: miscellaneousControlDeviceId = 
    1.35            FAMILY_14H_MISCELLANEOUS_CONTROL_DEVICE_ID; break;
    1.36 -        case 0x15: miscellaneousControlDeviceId =
    1.37 -          FAMILY_15H_MISCELLANEOUS_CONTROL_DEVICE_ID; break;
    1.38 +        case 0x15:
    1.39 +          switch (model & 0xF0) {
    1.40 +            case 0x00: miscellaneousControlDeviceId =
    1.41 +              FAMILY_15H_MODEL_00_MISC_CONTROL_DEVICE_ID; break;
    1.42 +            case 0x10: miscellaneousControlDeviceId =
    1.43 +              FAMILY_15H_MODEL_10_MISC_CONTROL_DEVICE_ID; break;
    1.44 +            default: miscellaneousControlDeviceId = 0; break;
    1.45 +          } break;
    1.46 +        case 0x16:
    1.47 +          switch (model & 0xF0) {
    1.48 +            case 0x00: miscellaneousControlDeviceId =
    1.49 +              FAMILY_16H_MODEL_00_MISC_CONTROL_DEVICE_ID; break;            
    1.50 +            default: miscellaneousControlDeviceId = 0; break;
    1.51 +          } break;
    1.52          default: miscellaneousControlDeviceId = 0; break;
    1.53        }
    1.54  
    1.55 @@ -220,7 +234,8 @@
    1.56        switch (family) {
    1.57          case 0x10:
    1.58          case 0x11: 
    1.59 -        case 0x15: {
    1.60 +        case 0x15: 
    1.61 +        case 0x16: {
    1.62              // 8:6 CpuDid: current core divisor ID
    1.63              // 5:0 CpuFid: current core frequency ID
    1.64              uint cpuDid = (cofvidEax >> 6) & 7;
    1.65 @@ -286,8 +301,17 @@
    1.66            if (Ring0.ReadPciConfig(miscellaneousControlAddress,
    1.67              REPORTED_TEMPERATURE_CONTROL_REGISTER, out value)) {
    1.68              if (family == 0x15 && (value & 0x30000) == 0x30000) {
    1.69 -              coreTemperature.Value = ((value >> 21) & 0x7FC) / 8.0f +
    1.70 -                coreTemperature.Parameters[0].Value - 49;
    1.71 +              if ((model & 0xF0) == 0x00) {
    1.72 +                coreTemperature.Value = ((value >> 21) & 0x7FC) / 8.0f +
    1.73 +                  coreTemperature.Parameters[0].Value - 49;
    1.74 +              } else {
    1.75 +                coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f +
    1.76 +                  coreTemperature.Parameters[0].Value - 49;
    1.77 +              }
    1.78 +            } else if (family == 0x16 && 
    1.79 +              ((value & 0x30000) == 0x30000 || (value & 0x80000) == 0x80000)) {
    1.80 +                coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f +
    1.81 +                  coreTemperature.Parameters[0].Value - 49;
    1.82              } else {
    1.83                coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f +
    1.84                  coreTemperature.Parameters[0].Value;
     2.1 --- a/Hardware/CPU/CPUGroup.cs	Tue Jun 25 20:34:29 2013 +0000
     2.2 +++ b/Hardware/CPU/CPUGroup.cs	Sat Jun 29 16:12:40 2013 +0000
     2.3 @@ -4,7 +4,7 @@
     2.4    License, v. 2.0. If a copy of the MPL was not distributed with this
     2.5    file, You can obtain one at http://mozilla.org/MPL/2.0/.
     2.6   
     2.7 -  Copyright (C) 2009-2011 Michael Möller <mmoeller@openhardwaremonitor.org>
     2.8 +  Copyright (C) 2009-2013 Michael Möller <mmoeller@openhardwaremonitor.org>
     2.9  	
    2.10  */
    2.11  
    2.12 @@ -101,6 +101,7 @@
    2.13                case 0x12:
    2.14                case 0x14:
    2.15                case 0x15:
    2.16 +              case 0x16:
    2.17                  hardware.Add(new AMD10CPU(index, coreThreads, settings));
    2.18                  break;
    2.19                default:
     3.1 --- a/Properties/AssemblyVersion.cs	Tue Jun 25 20:34:29 2013 +0000
     3.2 +++ b/Properties/AssemblyVersion.cs	Sat Jun 29 16:12:40 2013 +0000
     3.3 @@ -10,5 +10,5 @@
     3.4  
     3.5  using System.Reflection;
     3.6  
     3.7 -[assembly: AssemblyVersion("0.5.1.16")]
     3.8 -[assembly: AssemblyInformationalVersion("0.5.1.16 Alpha")]
     3.9 \ No newline at end of file
    3.10 +[assembly: AssemblyVersion("0.5.1.18")]
    3.11 +[assembly: AssemblyInformationalVersion("0.5.1.18 Alpha")]
    3.12 \ No newline at end of file