blob: 606ea23bc0d418783ba212526c026c5e4c17733c [file] [log] [blame]
Angel Pons32859fc2020-04-02 23:48:27 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Marc Jones8ae8c882007-12-19 01:32:08 +00002
Elyes HAOUAS400ce552018-10-12 10:54:30 +02003/* This file applies to AMD64 products.
4 * The definitions come from the AMD64 Programmers Manual vol2
5 * Revision 3.30 and/or the device's BKDG.
6 */
7
Stefan Reinauer991f1842015-11-22 23:40:29 +01008#ifndef CPU_AMD_MSR_H
9#define CPU_AMD_MSR_H
Marc Jones8ae8c882007-12-19 01:32:08 +000010
Patrick Georgi3d5bb232010-05-09 21:15:13 +000011#include <cpu/x86/msr.h>
12
Elyes HAOUAS400ce552018-10-12 10:54:30 +020013#define CPUID_EXT_PM 0x80000007
14#define CPUID_MODEL 1
15#define MC4_MISC0 0x00000413
16#define MC4_MISC1 0xC0000408
17#define MC4_MISC2 0xC0000409
18#define FS_Base 0xC0000100
19#define HWCR_MSR 0xC0010015
20#define NB_CFG_MSR 0xC001001f
21#define FidVidStatus 0xC0010042
22#define MC1_CTL_MASK 0xC0010045
23#define MC4_CTL_MASK 0xC0010048
24#define MSR_INTPEND 0xC0010055
25#define MMIO_CONF_BASE 0xC0010058
26#define MMIO_RANGE_EN (1 << 0)
Marshall Dawson914e6b42019-07-01 09:56:12 -050027#define MMIO_BUS_RANGE_SHIFT 2
Elyes HAOUAS400ce552018-10-12 10:54:30 +020028 /* P-state Current Limit Register */
29#define PS_LIM_REG 0xC0010061
30 /* P-state Maximum Value shift position */
31#define PS_MAX_VAL_SHFT 4
32 /* P-state Control Register */
33#define PS_CTL_REG 0xC0010062
34 /* P-state Control Register CMD Mask OFF */
35#define PS_CMD_MASK_OFF ~(7)
36 /* P-state Status Mask */
37#define PS_STS_MASK 7
38 /* P-state Status Register */
39#define PS_STS_REG 0xC0010063
40#define PSTATE_0_MSR 0xC0010064
41#define PSTATE_1_MSR 0xC0010065
42#define PSTATE_2_MSR 0xC0010066
43#define PSTATE_3_MSR 0xC0010067
44#define PSTATE_4_MSR 0xC0010068
45
Elyes HAOUAS1a5f1c82018-10-31 08:06:12 +010046#define MSR_PATCH_LOADER 0xC0010020
47
Elyes HAOUAS400ce552018-10-12 10:54:30 +020048#define MSR_COFVID_STS 0xC0010071
49#define MSR_CSTATE_ADDRESS 0xC0010073
50#define OSVW_ID_Length 0xC0010140
51#define OSVW_Status 0xC0010141
52
Rudolf Marekb5b3b3b2011-07-02 16:36:17 +020053#define SMM_BASE_MSR 0xC0010111
54#define SMM_ADDR_MSR 0xC0010112
55#define SMM_MASK_MSR 0xC0010113
Elyes HAOUAS400ce552018-10-12 10:54:30 +020056#define SMM_LOCK (1 << 0)
57#define SMM_TSEG_VALID (1 << 1)
58#define SMM_TSEG_WB (6 << 12)
Rudolf Marekb5b3b3b2011-07-02 16:36:17 +020059
Elyes HAOUAS400ce552018-10-12 10:54:30 +020060#define CPU_ID_FEATURES_MSR 0xC0011004
61#define CPU_ID_EXT_FEATURES_MSR 0xC0011005
62#define CPU_ID_HYPER_EXT_FEATURES 0xC001100d
63#define LOGICAL_CPUS_NUM_MSR 0xC001100d
Marc Jones8ae8c882007-12-19 01:32:08 +000064#define LS_CFG_MSR 0xC0011020
65#define IC_CFG_MSR 0xC0011021
66#define DC_CFG_MSR 0xC0011022
67#define BU_CFG_MSR 0xC0011023
Timothy Pearson730a0432015-10-16 13:51:51 -050068#define FP_CFG_MSR 0xC0011028
69#define DE_CFG_MSR 0xC0011029
Marco Schmidtc263b442009-06-06 11:21:52 +000070#define BU_CFG2_MSR 0xC001102A
Timothy Pearson730a0432015-10-16 13:51:51 -050071#define BU_CFG3_MSR 0xC001102B
72#define EX_CFG_MSR 0xC001102C
73#define LS_CFG2_MSR 0xC001102D
74#define IBS_OP_DATA3_MSR 0xC0011037
Marc Jones8ae8c882007-12-19 01:32:08 +000075
Zheng Baoa4098c72020-06-09 09:13:24 +080076#define MSR_PATCH_LEVEL 0x0000008B
Elyes HAOUAS400ce552018-10-12 10:54:30 +020077#define CORE_PERF_BOOST_CTRL 0x15c
Marc Jones8ae8c882007-12-19 01:32:08 +000078
Stefan Reinauer991f1842015-11-22 23:40:29 +010079#endif /* CPU_AMD_MSR_H */