blob: 382e0806d9c65f15f01c084b32ea4c906e37059c [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/*
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +01009 * D1:F0 PEG
10 */
Angel Ponsdd6a3d82020-06-22 17:21:23 +020011#define PEG_CAP 0xa2
12#define SLOTCAP 0xb4
13#define PEGLC 0xec
14#define D1F0_VCCAP 0x104
15#define D1F0_VC0RCTL 0x114
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010016
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010017/* Chipset types */
Angel Ponsdd6a3d82020-06-22 17:21:23 +020018#define IRONLAKE_MOBILE 0
Angel Pons95de2312020-02-17 13:08:53 +010019#define IRONLAKE_DESKTOP 1
Angel Ponsdd6a3d82020-06-22 17:21:23 +020020#define IRONLAKE_SERVER 2
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010021
Angel Ponscdd9db32020-09-15 00:11:27 +020022#include "memmap.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010023
24#define QUICKPATH_BUS 0xff
25
26#include <southbridge/intel/ibexpeak/pch.h>
27
28/* Everything below this line is ignored in the DSDT */
29#ifndef __ACPI__
30
31/* Device 0:0.0 PCI configuration space (Host Bridge) */
32
Angel Pons35a77422020-09-15 00:31:26 +020033#include "registers/host_bridge.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010034
Angel Ponse9d1d702020-07-22 12:47:00 +020035/*
Angel Ponsc642a0d2020-07-22 18:21:43 +020036 * Generic Non-Core Registers
37 */
38#define QPI_NON_CORE PCI_DEV(QUICKPATH_BUS, 0, 0)
39
Angel Pons9addda32020-07-22 18:37:32 +020040#define MAX_RTIDS 0x60
41#define DESIRED_CORES 0x80
42#define MIRROR_PORT_CTL 0xd0
43
Angel Ponsc642a0d2020-07-22 18:21:43 +020044/*
Angel Pons3ab19b32020-07-22 16:29:54 +020045 * SAD - System Address Decoder
Angel Ponse9d1d702020-07-22 12:47:00 +020046 */
Angel Pons3ab19b32020-07-22 16:29:54 +020047#define QPI_SAD PCI_DEV(QUICKPATH_BUS, 0, 1)
48
Angel Ponse9d1d702020-07-22 12:47:00 +020049#define QPD0F1_PAM(x) (0x40 + (x)) /* 0-6 */
Vladimir Serbinenko786c0f52014-01-02 10:16:46 +010050#define QPD0F1_SMRAM 0x4d /* System Management RAM Control */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010051
Angel Pons45008932020-07-22 16:43:48 +020052#define SAD_PCIEXBAR 0x50
53
Angel Pons67573372020-07-22 16:56:00 +020054#define SAD_DRAM_RULE(x) (0x80 + 4 * (x)) /* 0-7 */
55#define SAD_INTERLEAVE_LIST(x) (0xc0 + 4 * (x)) /* 0-7 */
56
Angel Pons93d95172020-07-22 17:30:49 +020057/*
58 * QPI Link 0
59 */
60#define QPI_LINK_0 PCI_DEV(QUICKPATH_BUS, 2, 0)
61
Angel Pons08143572020-07-22 17:47:06 +020062#define QPI_QPILCP 0x40 /* QPI Link Capability */
63#define QPI_QPILCL 0x48 /* QPI Link Control */
64#define QPI_QPILS 0x50 /* QPI Link Status */
65#define QPI_DEF_RMT_VN_CREDITS 0x58 /* Default Available Remote Credits */
66
Angel Pons10993c42020-07-22 17:49:28 +020067/*
68 * QPI Physical Layer 0
69 */
70#define QPI_PHY_0 PCI_DEV(QUICKPATH_BUS, 2, 1)
71
Angel Ponsa457e352020-07-22 18:17:33 +020072#define QPI_PLL_STATUS 0x50
73#define QPI_PLL_RATIO 0x54
74#define QPI_PHY_CAPABILITY 0x68 /* QPI Phys. Layer Capability */
75#define QPI_PHY_CONTROL 0x6c /* QPI Phys. Layer Control */
76#define QPI_PHY_INIT_STATUS 0x80 /* QPI Phys. Layer Initialization Status */
77#define QPI_PHY_PRIM_TIMEOUT 0x94 /* QPI Phys. Layer Primary Timeout Value */
78#define QPI_PHY_PWR_MGMT 0xd0 /* QPI Phys. Layer Power Management */
79#define QPI_PHY_EP_SELECT 0xe0 /* QPI Phys. Layer Electrical Parameter Select */
80#define QPI_PHY_EP_MCTR 0xf4 /* QPI Phys. Layer Electrical Parameter Misc. Control */
81
Angel Ponscdd9db32020-09-15 00:11:27 +020082
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010083/* Device 0:2.0 PCI configuration space (Graphics Device) */
84
85#define MSAC 0x62 /* Multi Size Aperture Control */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010086
87/*
88 * MCHBAR
89 */
90
Angel Pons1110b2f2020-09-15 00:03:35 +020091#define MCHBAR8(x) (*((volatile u8 *)((u8 *)DEFAULT_MCHBAR + (x))))
92#define MCHBAR16(x) (*((volatile u16 *)((u8 *)DEFAULT_MCHBAR + (x))))
93#define MCHBAR32(x) (*((volatile u32 *)((u8 *)DEFAULT_MCHBAR + (x))))
Angel Ponsdd6a3d82020-06-22 17:21:23 +020094#define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and))
95#define MCHBAR16_AND(x, and) (MCHBAR16(x) = MCHBAR16(x) & (and))
96#define MCHBAR32_AND(x, and) (MCHBAR32(x) = MCHBAR32(x) & (and))
97#define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or))
98#define MCHBAR16_OR(x, or) (MCHBAR16(x) = MCHBAR16(x) | (or))
99#define MCHBAR32_OR(x, or) (MCHBAR32(x) = MCHBAR32(x) | (or))
100#define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or))
101#define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or))
102#define MCHBAR32_AND_OR(x, and, or) (MCHBAR32(x) = (MCHBAR32(x) & (and)) | (or))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100103/*
104 * EPBAR - Egress Port Root Complex Register Block
105 */
106
Angel Pons1110b2f2020-09-15 00:03:35 +0200107#define EPBAR8(x) (*((volatile u8 *)((u8 *)DEFAULT_EPBAR + (x))))
108#define EPBAR16(x) (*((volatile u16 *)((u8 *)DEFAULT_EPBAR + (x))))
109#define EPBAR32(x) (*((volatile u32 *)((u8 *)DEFAULT_EPBAR + (x))))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100110
Angel Pons58769982020-09-15 00:36:15 +0200111#include "registers/epbar.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100112
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100113/*
114 * DMIBAR
115 */
116
Angel Pons1110b2f2020-09-15 00:03:35 +0200117#define DMIBAR8(x) (*((volatile u8 *)((u8 *)DEFAULT_DMIBAR + (x))))
118#define DMIBAR16(x) (*((volatile u16 *)((u8 *)DEFAULT_DMIBAR + (x))))
119#define DMIBAR32(x) (*((volatile u32 *)((u8 *)DEFAULT_DMIBAR + (x))))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100120
Angel Pons58769982020-09-15 00:36:15 +0200121#include "registers/dmibar.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100122
123#ifndef __ASSEMBLER__
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100124
Angel Pons95de2312020-02-17 13:08:53 +0100125void intel_ironlake_finalize_smm(void);
Kyösti Mälkki82c0e7e2019-11-05 19:06:56 +0200126
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100127int bridge_silicon_revision(void);
Angel Pons95de2312020-02-17 13:08:53 +0100128void ironlake_early_initialization(int chipset_type);
129void ironlake_late_initialization(void);
Arthur Heymanscea4fd92019-10-03 08:54:35 +0200130void mainboard_pre_raminit(void);
131void mainboard_get_spd_map(u8 *spd_addrmap);
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100132
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100133#endif
134#endif
Angel Pons95de2312020-02-17 13:08:53 +0100135#endif /* __NORTHBRIDGE_INTEL_IRONLAKE_IRONLAKE_H__ */