+ * BIOS and Kernel Developer’s Guide for AMD NPT Family 0Fh Processors
+ * 32559 Rev. 3.16 November 2009
*/
-#define AMDTEMP_THERMTP_STAT 0xe4
-#define AMDTEMP_TTSR_SELCORE 0x04
-#define AMDTEMP_TTSR_SELSENSOR 0x40
+/* D18F3xE4 Thermtrip Status Register */
+#define AMD_REG_THERMTRIP_STAT 0xe4
+union reg_amd_thermtrip_status_desc
+{
+ uint32_t u32;
+ struct reg_amd_thermtrip_status_bits
+ {
+ uint32_t r0:1; /* 0 Reserved. */
+ uint32_t Thermtp:1; /* 1 ro The processor has entered the THERMTRIP state. */
+ uint32_t ThermSenseCoreSel:1; /* 2 rw */
+ uint32_t ThermtpSense0:1; /* 3 ro */
+ uint32_t ThermtpSense1:1; /* 4 ro */
+ uint32_t ThermtpEn:1; /* 5 ro The THERMTRIP state is supported by the processor. */
+ uint32_t ThermSenseSel:1; /* 6 rw */
+ uint32_t r1:1; /* 7 Reserved. */
+ uint32_t DiodeOffset:6; /* 13:8 ro Thermal diode offset is used to correct the measurement made by an external temperature sensor. */
+ uint32_t CurTmp:10; /* 23:14 ro This field returns the current value of the internal thermal sensor. */
+ uint32_t TjOffset:5; /* 28:24 ro This field is the offset from CurTmp used to normalize to Tcontrol. */
+ uint32_t r2:2; /* 30:29 Reserved. */
+ uint32_t SwThermtp:1; /* 31 rw */
+ } __packed bits;
+};
+
+/* DRAM Configuration High Register */
+#define AMD_REG_DRAM_CONF_HIGH 0x94 /* Function 2 */
+#define AMD_REG_DRAM_MODE_DDR3 0x0100
+
/*
- * DRAM Configuration High Register
+ * The default value of the HTC temperature threshold (Tctl_max) is specified
+ * in the AMD Family 14h Processor Power and Thermal Datasheet.
*/
-#define AMDTEMP_DRAM_CONF_HIGH 0x94 /* Function 2 */
-#define AMDTEMP_DRAM_MODE_DDR3 0x0100
+/* D18F3x64 Hardware Thermal Control (HTC) */
+#define AMD_REG_HTC_CTRL 0x64
+union reg_amd_htc_desc
+{
+ uint32_t u32;
+ struct reg_amd_htc_bits
+ {
+ uint32_t HtcEn:1; /* 0 rw 1=HTC is enabled; the processor is capable of entering the HTC-active state. */
+ uint32_t r0:3; /* 3:1 Reserved. */
+ uint32_t HtcAct:1; /* 4 ro 1=The processor is currently in the HTC-active state. */
+ uint32_t HtcActSts:1; /* 5 ro Read; set-by-hardware; write-1-to-clear. Reset: 0. This bit is set by hardware when the processor enters the HTC-active state. It is cleared by writing a 1 to it. */
+ uint32_t HtcHystLmt:4; /* 27:24 rw HTC hysteresis. The processor exits the HTC active state when the temperature selected by HtcSlewSel is less than the HTC temperature limit (HtcTmpLmt) minus the HTC hysteresis (HtcHystLmt). */