Debian Codegraph @

src/northbridge/intel/x4x/x4x.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #ifndef __NORTHBRIDGE_INTEL_X4X_H__
4 #define __NORTHBRIDGE_INTEL_X4X_H__
5
6 #include <stdint.h>
7 #include "memmap.h"
8
9 #define BOOT_PATH_NORMAL 0
10 #define BOOT_PATH_WARM_RESET 1
11 #define BOOT_PATH_RESUME 2
12
13 /*
14 * D0:F0
15 */
16 #define HOST_BRIDGE PCI_DEV(0, 0, 0)
17
18 #include "registers/host_bridge.h"
19
20 /*
21 * D1:F0 PEG
22 */
23 #define PEG_CAP 0xa2
24 #define SLOTCAP 0xb4
25 #define PEGLC 0xec
26 #define D1F0_VCCAP 0x104
27 #define D1F0_VC0RCTL 0x114
28
29 /*
30 * Graphics frequencies
31 */
32 #define GCFGC_PCIDEV PCI_DEV(0, 2, 0)
33 #define GCFGC_OFFSET 0xf0
34 #define GCFGC_CR_SHIFT 0
35 #define GCFGC_CR_MASK (0xf << GCFGC_CR_SHIFT)
36 #define GCFGC_CS_SHIFT 8
37 #define GCFGC_CS_MASK (0xf << GCFGC_CS_SHIFT)
38 #define GCFGC_CD_SHIFT 12
39 #define GCFGC_CD_MASK (0x1 << GCFGC_CD_SHIFT)
40 #define GCFGC_UPDATE_SHIFT 5
41 #define GCFGC_UPDATE (0x1 << GCFGC_UPDATE_SHIFT)
42
43 /*
44 * MCHBAR
45 */
46
47 #include <northbridge/intel/common/fixed_bars.h>
48
49 #define CHDECMISC 0x111
50 #define STACKED_MEM (1 << 1)
51
52 #define C0DRB0 0x200
53 #define C0DRB1 0x202
54 #define C0DRB2 0x204
55 #define C0DRB3 0x206
56 #define C0DRA01 0x208
57 #define C0DRA23 0x20a
58 #define C0CKECTRL 0x260
59
60 #define C1DRB0 0x600
61 #define C1DRB1 0x602
62 #define C1DRB2 0x604
63 #define C1DRB3 0x606
64 #define C1DRA01 0x608
65 #define C1DRA23 0x60a
66 #define C1CKECTRL 0x660
67
68 #define PMSTS_MCHBAR 0x0f14 /* Self refresh channel status */
69 #define PMSTS_WARM_RESET (1 << 8)
70 #define PMSTS_BOTH_SELFREFRESH (3 << 0)
71
72 #define CLKCFG_MCHBAR 0x0c00
73 #define CLKCFG_FSBCLK_SHIFT 0
74 #define CLKCFG_FSBCLK_MASK (7 << CLKCFG_FSBCLK_SHIFT)
75 #define CLKCFG_MEMCLK_SHIFT 4
76 #define CLKCFG_MEMCLK_MASK (7 << CLKCFG_MEMCLK_SHIFT)
77 #define CLKCFG_UPDATE (1 << 10)
78
79 #define SSKPD_MCHBAR 0x0c20 /* 64 bit */
80
81 /*
82 * DMIBAR
83 */
84
85 #define DMIVCECH 0x000 /* 32bit */
86 #define DMIPVCCAP1 0x004 /* 32bit */
87
88 #define DMIVC0RCAP 0x010 /* 32bit */
89 #define DMIVC0RCTL 0x014 /* 32bit */
90 #define DMIVC0RSTS 0x01a /* 16bit */
91 #define VC0NP (1 << 1)
92
93 #define DMIVC1RCAP 0x01c /* 32bit */
94 #define DMIVC1RCTL 0x020 /* 32bit */
95 #define DMIVC1RSTS 0x026 /* 16bit */
96 #define VC1NP (1 << 1)
97
98 #define DMIVCPRCAP 0x028 /* 32bit */
99 #define DMIVCPRCTL 0x02c /* 32bit */
100 #define DMIVCPRSTS 0x032 /* 16bit */
101 #define VCPNP (1 << 1)
102
103 #define DMIVCMRCAP 0x034 /* 32bit */
104 #define DMIVCMRCTL 0x038 /* 32bit */
105 #define DMIVCMRSTS 0x03e /* 16bit */
106 #define VCMNP (1 << 1)
107
108 #define DMIESD 0x044 /* 32bit */
109
110 #define DMILE1D 0x050 /* 32bit */
111 #define DMILE1A 0x058 /* 64bit */
112 #define DMILE2D 0x060 /* 32bit */
113 #define DMILE2A 0x068 /* 64bit */
114
115 #define DMILCAP 0x084 /* 32bit */
116 #define DMILCTL 0x088 /* 16bit */
117 #define DMILSTS 0x08a /* 16bit */
118
119 #define DMIUESTS 0x1c4 /* 32bit */
120 #define DMICESTS 0x1d0 /* 32bit */
121
122 /*
123 * EPBAR
124 */
125
126 #define EPPVCCAP1 0x004 /* 32bit */
127 #define EPPVCCTL 0x00c /* 32bit */
128
129 #define EPVC0RCAP 0x010 /* 32bit */
130 #define EPVC0RCTL 0x014 /* 32bit */
131 #define EPVC0RSTS 0x01a /* 16bit */
132
133 #define EPVC1RCAP 0x01c /* 32bit */
134 #define EPVC1RCTL 0x020 /* 32bit */
135 #define EPVC1RSTS 0x026 /* 16bit */
136
137 #define EPVC1MTS 0x028 /* 32bit */
138 #define EPVC1ITC 0x02c /* 32bit */
139
140 #define EPESD 0x044 /* 32bit */
141
142 #define EPLE1D 0x050 /* 32bit */
143 #define EPLE1A 0x058 /* 64bit */
144 #define EPLE2D 0x060 /* 32bit */
145 #define EPLE2A 0x068 /* 64bit */
146
147 #define EP_PORTARB(x) (0x100 + 4 * (x)) /* 256bit */
148
149 void x4x_early_init(void);
150 void x4x_late_init(void);
151 void mb_get_spd_map(u8 spd_map[4]);
152 void mb_pre_raminit_setup(int s3_resume);
153 u32 decode_igd_memory_size(u32 gms);
154 u32 decode_igd_gtt_size(u32 gsm);
155 u32 decode_tseg_size(const u32 esmramc);
156
157 #include <device/device.h>
158 struct acpi_rsdp;
159 unsigned long northbridge_write_acpi_tables(const struct device *device,
160 unsigned long start, struct acpi_rsdp *rsdp);
161
162 #endif /* __NORTHBRIDGE_INTEL_X4X_H__ */