blob: 06e07716e921b2bb07a6fb450589b6f62d182160 [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
9#define IOMMU_BASE1 0xfed90000
10#define IOMMU_BASE2 0xfed91000
11#define IOMMU_BASE3 0xfed92000
12#define IOMMU_BASE4 0xfed93000
13
14/*
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010015 * D1:F0 PEG
16 */
Angel Ponsdd6a3d82020-06-22 17:21:23 +020017#define PEG_CAP 0xa2
18#define SLOTCAP 0xb4
19#define PEGLC 0xec
20#define D1F0_VCCAP 0x104
21#define D1F0_VC0RCTL 0x114
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010022
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010023/* Chipset types */
Angel Ponsdd6a3d82020-06-22 17:21:23 +020024#define IRONLAKE_MOBILE 0
Angel Pons95de2312020-02-17 13:08:53 +010025#define IRONLAKE_DESKTOP 1
Angel Ponsdd6a3d82020-06-22 17:21:23 +020026#define IRONLAKE_SERVER 2
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010027
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010028/* Northbridge BARs */
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080029#ifndef __ACPI__
30#define DEFAULT_MCHBAR ((u8 *)0xfed10000) /* 16 KB */
31#define DEFAULT_DMIBAR ((u8 *)0xfed18000) /* 4 KB */
32#else
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010033#define DEFAULT_MCHBAR 0xfed10000 /* 16 KB */
34#define DEFAULT_DMIBAR 0xfed18000 /* 4 KB */
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080035#endif
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010036#define DEFAULT_EPBAR 0xfed19000 /* 4 KB */
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080037#define DEFAULT_RCBABASE ((u8 *)0xfed1c000)
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010038
39#define QUICKPATH_BUS 0xff
40
41#include <southbridge/intel/ibexpeak/pch.h>
42
43/* Everything below this line is ignored in the DSDT */
44#ifndef __ACPI__
45
46/* Device 0:0.0 PCI configuration space (Host Bridge) */
47
Angel Ponse9d1d702020-07-22 12:47:00 +020048#include "hostbridge_regs.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010049
Angel Ponse9d1d702020-07-22 12:47:00 +020050/*
Angel Pons3ab19b32020-07-22 16:29:54 +020051 * SAD - System Address Decoder
Angel Ponse9d1d702020-07-22 12:47:00 +020052 */
Angel Pons3ab19b32020-07-22 16:29:54 +020053#define QPI_SAD PCI_DEV(QUICKPATH_BUS, 0, 1)
54
Angel Ponse9d1d702020-07-22 12:47:00 +020055#define QPD0F1_PAM(x) (0x40 + (x)) /* 0-6 */
Vladimir Serbinenko786c0f52014-01-02 10:16:46 +010056#define QPD0F1_SMRAM 0x4d /* System Management RAM Control */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010057
Angel Pons45008932020-07-22 16:43:48 +020058#define SAD_PCIEXBAR 0x50
59
Angel Pons67573372020-07-22 16:56:00 +020060#define SAD_DRAM_RULE(x) (0x80 + 4 * (x)) /* 0-7 */
61#define SAD_INTERLEAVE_LIST(x) (0xc0 + 4 * (x)) /* 0-7 */
62
Angel Pons93d95172020-07-22 17:30:49 +020063/*
64 * QPI Link 0
65 */
66#define QPI_LINK_0 PCI_DEV(QUICKPATH_BUS, 2, 0)
67
Angel Pons08143572020-07-22 17:47:06 +020068#define QPI_QPILCP 0x40 /* QPI Link Capability */
69#define QPI_QPILCL 0x48 /* QPI Link Control */
70#define QPI_QPILS 0x50 /* QPI Link Status */
71#define QPI_DEF_RMT_VN_CREDITS 0x58 /* Default Available Remote Credits */
72
Angel Pons10993c42020-07-22 17:49:28 +020073/*
74 * QPI Physical Layer 0
75 */
76#define QPI_PHY_0 PCI_DEV(QUICKPATH_BUS, 2, 1)
77
Angel Ponsa457e352020-07-22 18:17:33 +020078#define QPI_PLL_STATUS 0x50
79#define QPI_PLL_RATIO 0x54
80#define QPI_PHY_CAPABILITY 0x68 /* QPI Phys. Layer Capability */
81#define QPI_PHY_CONTROL 0x6c /* QPI Phys. Layer Control */
82#define QPI_PHY_INIT_STATUS 0x80 /* QPI Phys. Layer Initialization Status */
83#define QPI_PHY_PRIM_TIMEOUT 0x94 /* QPI Phys. Layer Primary Timeout Value */
84#define QPI_PHY_PWR_MGMT 0xd0 /* QPI Phys. Layer Power Management */
85#define QPI_PHY_EP_SELECT 0xe0 /* QPI Phys. Layer Electrical Parameter Select */
86#define QPI_PHY_EP_MCTR 0xf4 /* QPI Phys. Layer Electrical Parameter Misc. Control */
87
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010088
89/* Device 0:2.0 PCI configuration space (Graphics Device) */
90
91#define MSAC 0x62 /* Multi Size Aperture Control */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010092
93/*
94 * MCHBAR
95 */
96
Angel Ponsdd6a3d82020-06-22 17:21:23 +020097#define MCHBAR8(x) (*((volatile u8 *)(DEFAULT_MCHBAR + (x))))
98#define MCHBAR16(x) (*((volatile u16 *)(DEFAULT_MCHBAR + (x))))
99#define MCHBAR32(x) (*((volatile u32 *)(DEFAULT_MCHBAR + (x))))
100#define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and))
101#define MCHBAR16_AND(x, and) (MCHBAR16(x) = MCHBAR16(x) & (and))
102#define MCHBAR32_AND(x, and) (MCHBAR32(x) = MCHBAR32(x) & (and))
103#define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or))
104#define MCHBAR16_OR(x, or) (MCHBAR16(x) = MCHBAR16(x) | (or))
105#define MCHBAR32_OR(x, or) (MCHBAR32(x) = MCHBAR32(x) | (or))
106#define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or))
107#define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or))
108#define MCHBAR32_AND_OR(x, and, or) (MCHBAR32(x) = (MCHBAR32(x) & (and)) | (or))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100109/*
110 * EPBAR - Egress Port Root Complex Register Block
111 */
112
Angel Ponsdd6a3d82020-06-22 17:21:23 +0200113#define EPBAR8(x) (*((volatile u8 *)(DEFAULT_EPBAR + (x))))
114#define EPBAR16(x) (*((volatile u16 *)(DEFAULT_EPBAR + (x))))
115#define EPBAR32(x) (*((volatile u32 *)(DEFAULT_EPBAR + (x))))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100116
117#define EPPVCCAP1 0x004 /* 32bit */
118#define EPPVCCAP2 0x008 /* 32bit */
119
120#define EPVC0RCAP 0x010 /* 32bit */
121#define EPVC0RCTL 0x014 /* 32bit */
122#define EPVC0RSTS 0x01a /* 16bit */
123
124#define EPVC1RCAP 0x01c /* 32bit */
125#define EPVC1RCTL 0x020 /* 32bit */
126#define EPVC1RSTS 0x026 /* 16bit */
127
128#define EPVC1MTS 0x028 /* 32bit */
129#define EPVC1IST 0x038 /* 64bit */
130
131#define EPESD 0x044 /* 32bit */
132
133#define EPLE1D 0x050 /* 32bit */
134#define EPLE1A 0x058 /* 64bit */
135#define EPLE2D 0x060 /* 32bit */
136#define EPLE2A 0x068 /* 64bit */
137
138#define PORTARB 0x100 /* 256bit */
139
140/*
141 * DMIBAR
142 */
143
Angel Ponsdd6a3d82020-06-22 17:21:23 +0200144#define DMIBAR8(x) (*((volatile u8 *)(DEFAULT_DMIBAR + (x))))
145#define DMIBAR16(x) (*((volatile u16 *)(DEFAULT_DMIBAR + (x))))
146#define DMIBAR32(x) (*((volatile u32 *)(DEFAULT_DMIBAR + (x))))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100147
148#define DMIVCECH 0x000 /* 32bit */
149#define DMIPVCCAP1 0x004 /* 32bit */
150#define DMIPVCCAP2 0x008 /* 32bit */
151
152#define DMIPVCCCTL 0x00c /* 16bit */
153
154#define DMIVC0RCAP 0x010 /* 32bit */
Felix Held00d2b912018-07-28 21:06:01 +0200155#define DMIVC0RCTL 0x014 /* 32bit */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100156#define DMIVC0RSTS 0x01a /* 16bit */
157
158#define DMIVC1RCAP 0x01c /* 32bit */
159#define DMIVC1RCTL 0x020 /* 32bit */
160#define DMIVC1RSTS 0x026 /* 16bit */
161
162#define DMILE1D 0x050 /* 32bit */
163#define DMILE1A 0x058 /* 64bit */
164#define DMILE2D 0x060 /* 32bit */
165#define DMILE2A 0x068 /* 64bit */
166
167#define DMILCAP 0x084 /* 32bit */
168#define DMILCTL 0x088 /* 16bit */
169#define DMILSTS 0x08a /* 16bit */
170
171#define DMICTL1 0x0f0 /* 32bit */
172#define DMICTL2 0x0fc /* 32bit */
173
174#define DMICC 0x208 /* 32bit */
175
176#define DMIDRCCFG 0xeb4 /* 32bit */
177
178#ifndef __ASSEMBLER__
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100179
Angel Pons95de2312020-02-17 13:08:53 +0100180void intel_ironlake_finalize_smm(void);
Kyösti Mälkki82c0e7e2019-11-05 19:06:56 +0200181
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100182int bridge_silicon_revision(void);
Angel Pons95de2312020-02-17 13:08:53 +0100183void ironlake_early_initialization(int chipset_type);
184void ironlake_late_initialization(void);
Arthur Heymanscea4fd92019-10-03 08:54:35 +0200185void mainboard_pre_raminit(void);
186void mainboard_get_spd_map(u8 *spd_addrmap);
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100187
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100188#endif
189#endif
Angel Pons95de2312020-02-17 13:08:53 +0100190#endif /* __NORTHBRIDGE_INTEL_IRONLAKE_IRONLAKE_H__ */