blob: 93653c9658be862523921ccb0c0f805af3d10b53 [file] [log] [blame]
Angel Pons4b429832020-04-02 23:48:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +01002
Angel Pons95de2312020-02-17 13:08:53 +01003#ifndef __NORTHBRIDGE_INTEL_IRONLAKE_IRONLAKE_H__
4#define __NORTHBRIDGE_INTEL_IRONLAKE_IRONLAKE_H__
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +01005
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -08006#define DEFAULT_HECIBAR ((u8 *)0xfed17000)
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +01007
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +01008#define IOMMU_BASE1 0xfed90000
9#define IOMMU_BASE2 0xfed91000
10#define IOMMU_BASE3 0xfed92000
11#define IOMMU_BASE4 0xfed93000
12
13/*
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010014 * D1:F0 PEG
15 */
Angel Ponsdd6a3d82020-06-22 17:21:23 +020016#define PEG_CAP 0xa2
17#define SLOTCAP 0xb4
18#define PEGLC 0xec
19#define D1F0_VCCAP 0x104
20#define D1F0_VC0RCTL 0x114
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010021
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010022/* Chipset types */
Angel Ponsdd6a3d82020-06-22 17:21:23 +020023#define IRONLAKE_MOBILE 0
Angel Pons95de2312020-02-17 13:08:53 +010024#define IRONLAKE_DESKTOP 1
Angel Ponsdd6a3d82020-06-22 17:21:23 +020025#define IRONLAKE_SERVER 2
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010026
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010027/* Northbridge BARs */
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080028#ifndef __ACPI__
29#define DEFAULT_MCHBAR ((u8 *)0xfed10000) /* 16 KB */
30#define DEFAULT_DMIBAR ((u8 *)0xfed18000) /* 4 KB */
31#else
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010032#define DEFAULT_MCHBAR 0xfed10000 /* 16 KB */
33#define DEFAULT_DMIBAR 0xfed18000 /* 4 KB */
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080034#endif
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010035#define DEFAULT_EPBAR 0xfed19000 /* 4 KB */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010036
37#define QUICKPATH_BUS 0xff
38
39#include <southbridge/intel/ibexpeak/pch.h>
40
41/* Everything below this line is ignored in the DSDT */
42#ifndef __ACPI__
43
44/* Device 0:0.0 PCI configuration space (Host Bridge) */
45
Angel Pons35a77422020-09-15 00:31:26 +020046#include "registers/host_bridge.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010047
Angel Ponse9d1d702020-07-22 12:47:00 +020048/*
Angel Ponsc642a0d2020-07-22 18:21:43 +020049 * Generic Non-Core Registers
50 */
51#define QPI_NON_CORE PCI_DEV(QUICKPATH_BUS, 0, 0)
52
Angel Pons9addda32020-07-22 18:37:32 +020053#define MAX_RTIDS 0x60
54#define DESIRED_CORES 0x80
55#define MIRROR_PORT_CTL 0xd0
56
Angel Ponsc642a0d2020-07-22 18:21:43 +020057/*
Angel Pons3ab19b32020-07-22 16:29:54 +020058 * SAD - System Address Decoder
Angel Ponse9d1d702020-07-22 12:47:00 +020059 */
Angel Pons3ab19b32020-07-22 16:29:54 +020060#define QPI_SAD PCI_DEV(QUICKPATH_BUS, 0, 1)
61
Angel Ponse9d1d702020-07-22 12:47:00 +020062#define QPD0F1_PAM(x) (0x40 + (x)) /* 0-6 */
Vladimir Serbinenko786c0f52014-01-02 10:16:46 +010063#define QPD0F1_SMRAM 0x4d /* System Management RAM Control */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010064
Angel Pons45008932020-07-22 16:43:48 +020065#define SAD_PCIEXBAR 0x50
66
Angel Pons67573372020-07-22 16:56:00 +020067#define SAD_DRAM_RULE(x) (0x80 + 4 * (x)) /* 0-7 */
68#define SAD_INTERLEAVE_LIST(x) (0xc0 + 4 * (x)) /* 0-7 */
69
Angel Pons93d95172020-07-22 17:30:49 +020070/*
71 * QPI Link 0
72 */
73#define QPI_LINK_0 PCI_DEV(QUICKPATH_BUS, 2, 0)
74
Angel Pons08143572020-07-22 17:47:06 +020075#define QPI_QPILCP 0x40 /* QPI Link Capability */
76#define QPI_QPILCL 0x48 /* QPI Link Control */
77#define QPI_QPILS 0x50 /* QPI Link Status */
78#define QPI_DEF_RMT_VN_CREDITS 0x58 /* Default Available Remote Credits */
79
Angel Pons10993c42020-07-22 17:49:28 +020080/*
81 * QPI Physical Layer 0
82 */
83#define QPI_PHY_0 PCI_DEV(QUICKPATH_BUS, 2, 1)
84
Angel Ponsa457e352020-07-22 18:17:33 +020085#define QPI_PLL_STATUS 0x50
86#define QPI_PLL_RATIO 0x54
87#define QPI_PHY_CAPABILITY 0x68 /* QPI Phys. Layer Capability */
88#define QPI_PHY_CONTROL 0x6c /* QPI Phys. Layer Control */
89#define QPI_PHY_INIT_STATUS 0x80 /* QPI Phys. Layer Initialization Status */
90#define QPI_PHY_PRIM_TIMEOUT 0x94 /* QPI Phys. Layer Primary Timeout Value */
91#define QPI_PHY_PWR_MGMT 0xd0 /* QPI Phys. Layer Power Management */
92#define QPI_PHY_EP_SELECT 0xe0 /* QPI Phys. Layer Electrical Parameter Select */
93#define QPI_PHY_EP_MCTR 0xf4 /* QPI Phys. Layer Electrical Parameter Misc. Control */
94
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010095/* Device 0:2.0 PCI configuration space (Graphics Device) */
96
97#define MSAC 0x62 /* Multi Size Aperture Control */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010098
99/*
100 * MCHBAR
101 */
102
Angel Ponsdd6a3d82020-06-22 17:21:23 +0200103#define MCHBAR8(x) (*((volatile u8 *)(DEFAULT_MCHBAR + (x))))
104#define MCHBAR16(x) (*((volatile u16 *)(DEFAULT_MCHBAR + (x))))
105#define MCHBAR32(x) (*((volatile u32 *)(DEFAULT_MCHBAR + (x))))
106#define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and))
107#define MCHBAR16_AND(x, and) (MCHBAR16(x) = MCHBAR16(x) & (and))
108#define MCHBAR32_AND(x, and) (MCHBAR32(x) = MCHBAR32(x) & (and))
109#define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or))
110#define MCHBAR16_OR(x, or) (MCHBAR16(x) = MCHBAR16(x) | (or))
111#define MCHBAR32_OR(x, or) (MCHBAR32(x) = MCHBAR32(x) | (or))
112#define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or))
113#define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or))
114#define MCHBAR32_AND_OR(x, and, or) (MCHBAR32(x) = (MCHBAR32(x) & (and)) | (or))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100115/*
116 * EPBAR - Egress Port Root Complex Register Block
117 */
118
Angel Ponsdd6a3d82020-06-22 17:21:23 +0200119#define EPBAR8(x) (*((volatile u8 *)(DEFAULT_EPBAR + (x))))
120#define EPBAR16(x) (*((volatile u16 *)(DEFAULT_EPBAR + (x))))
121#define EPBAR32(x) (*((volatile u32 *)(DEFAULT_EPBAR + (x))))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100122
123#define EPPVCCAP1 0x004 /* 32bit */
124#define EPPVCCAP2 0x008 /* 32bit */
125
126#define EPVC0RCAP 0x010 /* 32bit */
127#define EPVC0RCTL 0x014 /* 32bit */
128#define EPVC0RSTS 0x01a /* 16bit */
129
130#define EPVC1RCAP 0x01c /* 32bit */
131#define EPVC1RCTL 0x020 /* 32bit */
132#define EPVC1RSTS 0x026 /* 16bit */
133
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100134#define EPESD 0x044 /* 32bit */
135
136#define EPLE1D 0x050 /* 32bit */
137#define EPLE1A 0x058 /* 64bit */
138#define EPLE2D 0x060 /* 32bit */
139#define EPLE2A 0x068 /* 64bit */
140
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100141/*
142 * DMIBAR
143 */
144
Angel Ponsdd6a3d82020-06-22 17:21:23 +0200145#define DMIBAR8(x) (*((volatile u8 *)(DEFAULT_DMIBAR + (x))))
146#define DMIBAR16(x) (*((volatile u16 *)(DEFAULT_DMIBAR + (x))))
147#define DMIBAR32(x) (*((volatile u32 *)(DEFAULT_DMIBAR + (x))))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100148
149#define DMIVCECH 0x000 /* 32bit */
150#define DMIPVCCAP1 0x004 /* 32bit */
151#define DMIPVCCAP2 0x008 /* 32bit */
152
153#define DMIPVCCCTL 0x00c /* 16bit */
154
155#define DMIVC0RCAP 0x010 /* 32bit */
Felix Held00d2b912018-07-28 21:06:01 +0200156#define DMIVC0RCTL 0x014 /* 32bit */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100157#define DMIVC0RSTS 0x01a /* 16bit */
Angel Pons3b264d02020-09-15 00:25:49 +0200158#define VC0NP (1 << 1)
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100159
160#define DMIVC1RCAP 0x01c /* 32bit */
161#define DMIVC1RCTL 0x020 /* 32bit */
162#define DMIVC1RSTS 0x026 /* 16bit */
Angel Pons3b264d02020-09-15 00:25:49 +0200163#define VC1NP (1 << 1)
164
165#define DMIVCPRCAP 0x028 /* 32bit */
166#define DMIVCPRCTL 0x02c /* 32bit */
167#define DMIVCPRSTS 0x032 /* 16bit */
168#define VCPNP (1 << 1)
169
170#define DMIVCMRCAP 0x034 /* 32bit */
171#define DMIVCMRCTL 0x038 /* 32bit */
172#define DMIVCMRSTS 0x03e /* 16bit */
173#define VCMNP (1 << 1)
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100174
175#define DMILE1D 0x050 /* 32bit */
176#define DMILE1A 0x058 /* 64bit */
177#define DMILE2D 0x060 /* 32bit */
178#define DMILE2A 0x068 /* 64bit */
179
180#define DMILCAP 0x084 /* 32bit */
181#define DMILCTL 0x088 /* 16bit */
182#define DMILSTS 0x08a /* 16bit */
183
Angel Pons3b264d02020-09-15 00:25:49 +0200184#define DMIUESTS 0x1c4 /* 32bit */
185#define DMICESTS 0x1d0 /* 32bit */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100186
187#define DMICC 0x208 /* 32bit */
188
Angel Pons3b264d02020-09-15 00:25:49 +0200189#define DMILLTC 0x238 /* 32bit */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100190
191#ifndef __ASSEMBLER__
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100192
Angel Pons95de2312020-02-17 13:08:53 +0100193void intel_ironlake_finalize_smm(void);
Kyösti Mälkki82c0e7e2019-11-05 19:06:56 +0200194
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100195int bridge_silicon_revision(void);
Angel Pons95de2312020-02-17 13:08:53 +0100196void ironlake_early_initialization(int chipset_type);
197void ironlake_late_initialization(void);
Arthur Heymanscea4fd92019-10-03 08:54:35 +0200198void mainboard_pre_raminit(void);
199void mainboard_get_spd_map(u8 *spd_addrmap);
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100200
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100201#endif
202#endif
Angel Pons95de2312020-02-17 13:08:53 +0100203#endif /* __NORTHBRIDGE_INTEL_IRONLAKE_IRONLAKE_H__ */