blob: 8abc3fcb9ac6a27c233aeda51f1f1b7f72ea0a30 [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 */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010028#define DEFAULT_MCHBAR 0xfed10000 /* 16 KB */
29#define DEFAULT_DMIBAR 0xfed18000 /* 4 KB */
30#define DEFAULT_EPBAR 0xfed19000 /* 4 KB */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010031
32#define QUICKPATH_BUS 0xff
33
34#include <southbridge/intel/ibexpeak/pch.h>
35
36/* Everything below this line is ignored in the DSDT */
37#ifndef __ACPI__
38
39/* Device 0:0.0 PCI configuration space (Host Bridge) */
40
Angel Pons35a77422020-09-15 00:31:26 +020041#include "registers/host_bridge.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010042
Angel Ponse9d1d702020-07-22 12:47:00 +020043/*
Angel Ponsc642a0d2020-07-22 18:21:43 +020044 * Generic Non-Core Registers
45 */
46#define QPI_NON_CORE PCI_DEV(QUICKPATH_BUS, 0, 0)
47
Angel Pons9addda32020-07-22 18:37:32 +020048#define MAX_RTIDS 0x60
49#define DESIRED_CORES 0x80
50#define MIRROR_PORT_CTL 0xd0
51
Angel Ponsc642a0d2020-07-22 18:21:43 +020052/*
Angel Pons3ab19b32020-07-22 16:29:54 +020053 * SAD - System Address Decoder
Angel Ponse9d1d702020-07-22 12:47:00 +020054 */
Angel Pons3ab19b32020-07-22 16:29:54 +020055#define QPI_SAD PCI_DEV(QUICKPATH_BUS, 0, 1)
56
Angel Ponse9d1d702020-07-22 12:47:00 +020057#define QPD0F1_PAM(x) (0x40 + (x)) /* 0-6 */
Vladimir Serbinenko786c0f52014-01-02 10:16:46 +010058#define QPD0F1_SMRAM 0x4d /* System Management RAM Control */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010059
Angel Pons45008932020-07-22 16:43:48 +020060#define SAD_PCIEXBAR 0x50
61
Angel Pons67573372020-07-22 16:56:00 +020062#define SAD_DRAM_RULE(x) (0x80 + 4 * (x)) /* 0-7 */
63#define SAD_INTERLEAVE_LIST(x) (0xc0 + 4 * (x)) /* 0-7 */
64
Angel Pons93d95172020-07-22 17:30:49 +020065/*
66 * QPI Link 0
67 */
68#define QPI_LINK_0 PCI_DEV(QUICKPATH_BUS, 2, 0)
69
Angel Pons08143572020-07-22 17:47:06 +020070#define QPI_QPILCP 0x40 /* QPI Link Capability */
71#define QPI_QPILCL 0x48 /* QPI Link Control */
72#define QPI_QPILS 0x50 /* QPI Link Status */
73#define QPI_DEF_RMT_VN_CREDITS 0x58 /* Default Available Remote Credits */
74
Angel Pons10993c42020-07-22 17:49:28 +020075/*
76 * QPI Physical Layer 0
77 */
78#define QPI_PHY_0 PCI_DEV(QUICKPATH_BUS, 2, 1)
79
Angel Ponsa457e352020-07-22 18:17:33 +020080#define QPI_PLL_STATUS 0x50
81#define QPI_PLL_RATIO 0x54
82#define QPI_PHY_CAPABILITY 0x68 /* QPI Phys. Layer Capability */
83#define QPI_PHY_CONTROL 0x6c /* QPI Phys. Layer Control */
84#define QPI_PHY_INIT_STATUS 0x80 /* QPI Phys. Layer Initialization Status */
85#define QPI_PHY_PRIM_TIMEOUT 0x94 /* QPI Phys. Layer Primary Timeout Value */
86#define QPI_PHY_PWR_MGMT 0xd0 /* QPI Phys. Layer Power Management */
87#define QPI_PHY_EP_SELECT 0xe0 /* QPI Phys. Layer Electrical Parameter Select */
88#define QPI_PHY_EP_MCTR 0xf4 /* QPI Phys. Layer Electrical Parameter Misc. Control */
89
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010090/* Device 0:2.0 PCI configuration space (Graphics Device) */
91
92#define MSAC 0x62 /* Multi Size Aperture Control */
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +010093
94/*
95 * MCHBAR
96 */
97
Angel Pons1110b2f2020-09-15 00:03:35 +020098#define MCHBAR8(x) (*((volatile u8 *)((u8 *)DEFAULT_MCHBAR + (x))))
99#define MCHBAR16(x) (*((volatile u16 *)((u8 *)DEFAULT_MCHBAR + (x))))
100#define MCHBAR32(x) (*((volatile u32 *)((u8 *)DEFAULT_MCHBAR + (x))))
Angel Ponsdd6a3d82020-06-22 17:21:23 +0200101#define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and))
102#define MCHBAR16_AND(x, and) (MCHBAR16(x) = MCHBAR16(x) & (and))
103#define MCHBAR32_AND(x, and) (MCHBAR32(x) = MCHBAR32(x) & (and))
104#define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or))
105#define MCHBAR16_OR(x, or) (MCHBAR16(x) = MCHBAR16(x) | (or))
106#define MCHBAR32_OR(x, or) (MCHBAR32(x) = MCHBAR32(x) | (or))
107#define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or))
108#define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or))
109#define MCHBAR32_AND_OR(x, and, or) (MCHBAR32(x) = (MCHBAR32(x) & (and)) | (or))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100110/*
111 * EPBAR - Egress Port Root Complex Register Block
112 */
113
Angel Pons1110b2f2020-09-15 00:03:35 +0200114#define EPBAR8(x) (*((volatile u8 *)((u8 *)DEFAULT_EPBAR + (x))))
115#define EPBAR16(x) (*((volatile u16 *)((u8 *)DEFAULT_EPBAR + (x))))
116#define EPBAR32(x) (*((volatile u32 *)((u8 *)DEFAULT_EPBAR + (x))))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100117
Angel Pons58769982020-09-15 00:36:15 +0200118#include "registers/epbar.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100119
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100120/*
121 * DMIBAR
122 */
123
Angel Pons1110b2f2020-09-15 00:03:35 +0200124#define DMIBAR8(x) (*((volatile u8 *)((u8 *)DEFAULT_DMIBAR + (x))))
125#define DMIBAR16(x) (*((volatile u16 *)((u8 *)DEFAULT_DMIBAR + (x))))
126#define DMIBAR32(x) (*((volatile u32 *)((u8 *)DEFAULT_DMIBAR + (x))))
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100127
Angel Pons58769982020-09-15 00:36:15 +0200128#include "registers/dmibar.h"
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100129
130#ifndef __ASSEMBLER__
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100131
Angel Pons95de2312020-02-17 13:08:53 +0100132void intel_ironlake_finalize_smm(void);
Kyösti Mälkki82c0e7e2019-11-05 19:06:56 +0200133
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100134int bridge_silicon_revision(void);
Angel Pons95de2312020-02-17 13:08:53 +0100135void ironlake_early_initialization(int chipset_type);
136void ironlake_late_initialization(void);
Arthur Heymanscea4fd92019-10-03 08:54:35 +0200137void mainboard_pre_raminit(void);
138void mainboard_get_spd_map(u8 *spd_addrmap);
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100139
Vladimir Serbinenkoc6f6be02013-11-12 22:32:08 +0100140#endif
141#endif
Angel Pons95de2312020-02-17 13:08:53 +0100142#endif /* __NORTHBRIDGE_INTEL_IRONLAKE_IRONLAKE_H__ */