e6f9d81b83ceac63833140ef4c9d72f1de777201
[coreboot.git] / src / northbridge / amd / agesa / family10 / amdfam10.h
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2011 Advanced Micro Devices, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20 #ifndef AMDFAM10_H
21 #define AMDFAM10_H
22
23 #include <cpu/x86/msr.h>
24
25 #define HWCR_MSR                        0xC0010015
26 #define NB_CFG_MSR                      0xC001001f
27 #define LS_CFG_MSR                      0xC0011020
28 #define IC_CFG_MSR                      0xC0011021
29 #define DC_CFG_MSR                      0xC0011022
30 #define BU_CFG_MSR                      0xC0011023
31 #define BU_CFG2_MSR                     0xC001102A
32
33 #define CPU_ID_FEATURES_MSR             0xC0011004
34 #define CPU_ID_EXT_FEATURES_MSR         0xC0011005
35
36 /* Definitions of various FAM10 registers */
37 /* Function 0 */
38 #define HT_TRANSACTION_CONTROL 0x68
39 #define  HTTC_DIS_RD_B_P                (1 << 0)
40 #define  HTTC_DIS_RD_DW_P               (1 << 1)
41 #define  HTTC_DIS_WR_B_P                (1 << 2)
42 #define  HTTC_DIS_WR_DW_P               (1 << 3)
43 #define  HTTC_DIS_MTS                   (1 << 4)
44 #define  HTTC_CPU1_EN                   (1 << 5)
45 #define  HTTC_CPU_REQ_PASS_PW           (1 << 6)
46 #define  HTTC_CPU_RD_RSP_PASS_PW        (1 << 7)
47 #define  HTTC_DIS_P_MEM_C               (1 << 8)
48 #define  HTTC_DIS_RMT_MEM_C             (1 << 9)
49 #define  HTTC_DIS_FILL_P                (1 << 10)
50 #define  HTTC_RSP_PASS_PW               (1 << 11)
51 #define  HTTC_BUF_REL_PRI_SHIFT 13
52 #define  HTTC_BUF_REL_PRI_MASK          3
53 #define   HTTC_BUF_REL_PRI_64           0
54 #define   HTTC_BUF_REL_PRI_16           1
55 #define   HTTC_BUF_REL_PRI_8            2
56 #define   HTTC_BUF_REL_PRI_2            3
57 #define  HTTC_LIMIT_CLDT_CFG            (1 << 15)
58 #define  HTTC_LINT_EN                   (1 << 16)
59 #define  HTTC_APIC_EXT_BRD_CST          (1 << 17)
60 #define  HTTC_APIC_EXT_ID               (1 << 18)
61 #define  HTTC_APIC_EXT_SPUR             (1 << 19)
62 #define  HTTC_SEQ_ID_SRC_NODE_EN        (1 << 20)
63 #define  HTTC_DS_NP_REQ_LIMIT_SHIFT     21
64 #define  HTTC_DS_NP_REQ_LIMIT_MASK      3
65 #define   HTTC_DS_NP_REQ_LIMIT_NONE     0
66 #define   HTTC_DS_NP_REQ_LIMIT_1        1
67 #define   HTTC_DS_NP_REQ_LIMIT_4        2
68 #define   HTTC_DS_NP_REQ_LIMIT_8        3
69
70 /* Function 1 */
71
72 /* Function 2 */
73
74 /* Function 3 */
75
76
77 /* Function 5 for FBDIMM */
78 #define LinkConnected           (1 << 0)
79 #define InitComplete            (1 << 1)
80 #define NonCoherent             (1 << 2)
81 #define ConnectionPending       (1 << 4)
82
83 #if CONFIG_MAX_PHYSICAL_CPUS > 8
84         #if CONFIG_MAX_PHYSICAL_CPUS > 32
85                 #define NODE_NUMS 64
86         #else
87                 #define NODE_NUMS 32
88         #endif
89 #else
90         #define NODE_NUMS 8
91 #endif
92
93 #ifdef __PRE_RAM__
94 #if NODE_NUMS==64
95          #define NODE_PCI(x, fn) ((x<32)?(PCI_DEV(CONFIG_CBB,(CONFIG_CDB+x),fn)):(PCI_DEV((CONFIG_CBB-1),(CONFIG_CDB+x-32),fn)))
96 #else
97          #define NODE_PCI(x, fn) PCI_DEV(CONFIG_CBB,(CONFIG_CDB+x),fn)
98 #endif
99 #endif
100
101 #endif /* AMDFAM10_H */