blob: a37238fef76b96aaf2c509cf4824786e3f996b40 [file] [log] [blame]
Angel Pons4b429832020-04-02 23:48:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Aaron Durbin76c37002012-10-30 09:03:43 -05002
3#ifndef __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__
Edward O'Callaghan089a5102015-01-06 02:48:57 +11004#define __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__
Aaron Durbin76c37002012-10-30 09:03:43 -05005
6/* Chipset types */
7#define HASWELL_MOBILE 0
8#define HASWELL_DESKTOP 1
9#define HASWELL_SERVER 2
10
Angel Ponsa3cb3222020-09-14 13:15:19 +020011#include "memmap.h"
Matt DeVilliera51e3792018-03-04 01:44:15 -060012
Aaron Durbin76c37002012-10-30 09:03:43 -050013/* Everything below this line is ignored in the DSDT */
14#ifndef __ACPI__
15
16/* Device 0:0.0 PCI configuration space (Host Bridge) */
Angel Pons1db5bc72020-01-15 00:49:03 +010017#define HOST_BRIDGE PCI_DEV(0, 0, 0)
Aaron Durbin76c37002012-10-30 09:03:43 -050018
Angel Ponse4156c32020-09-14 15:47:59 +020019#include "registers/host_bridge.h"
Matt DeVilliera51e3792018-03-04 01:44:15 -060020
Angel Pons76b8bc22020-07-23 02:32:27 +020021/* Device 0:1.0 PCI configuration space (PCIe Graphics) */
22
Angel Ponsae999502020-11-05 01:58:34 +010023#define PEG_CAP 0xa2
24#define PEG_DCAP 0xa4
25
26#define PEG_LCAP 0xac
27
28#define PEG_DSTS 0xaa
29
30#define PEG_SLOTCAP 0xb4
31
Angel Pons76b8bc22020-07-23 02:32:27 +020032#define PEG_DCAP2 0xc4 /* 32bit */
33
Angel Ponsae999502020-11-05 01:58:34 +010034#define PEG_LCTL2 0xd0
35
36#define PEG_VC0RCTL 0x114
37
Angel Pons76b8bc22020-07-23 02:32:27 +020038#define PEG_ESD 0x144 /* 32bit */
39#define PEG_LE1D 0x150 /* 32bit */
40#define PEG_LE1A 0x158 /* 64bit */
41
Angel Ponsae999502020-11-05 01:58:34 +010042#define PEG_UESTS 0x1c4
43#define PEG_UESEV 0x1cc
44#define PEG_CESTS 0x1d0
45
46#define PEG_L0SLAT 0x22c
47
48#define PEG_AFE_PM_TMR 0xc28
49
Aaron Durbin76c37002012-10-30 09:03:43 -050050/* Device 0:2.0 PCI configuration space (Graphics Device) */
51
52#define MSAC 0x62 /* Multi Size Aperture Control */
Aaron Durbin76c37002012-10-30 09:03:43 -050053
54/*
55 * MCHBAR
56 */
57
Angel Ponsf95b9b42021-01-20 01:10:48 +010058#include <northbridge/intel/common/fixed_bars.h>
59
Angel Pons1db5bc72020-01-15 00:49:03 +010060#define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and))
61#define MCHBAR16_AND(x, and) (MCHBAR16(x) = MCHBAR16(x) & (and))
62#define MCHBAR32_AND(x, and) (MCHBAR32(x) = MCHBAR32(x) & (and))
63#define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or))
64#define MCHBAR16_OR(x, or) (MCHBAR16(x) = MCHBAR16(x) | (or))
65#define MCHBAR32_OR(x, or) (MCHBAR32(x) = MCHBAR32(x) | (or))
66#define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or))
67#define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or))
68#define MCHBAR32_AND_OR(x, and, or) (MCHBAR32(x) = (MCHBAR32(x) & (and)) | (or))
Aaron Durbin76c37002012-10-30 09:03:43 -050069
Angel Pons1db5bc72020-01-15 00:49:03 +010070/* As there are many registers, define them on a separate file */
Angel Ponse4156c32020-09-14 15:47:59 +020071#include "registers/mchbar.h"
Duncan Lauriec70353f2013-06-28 14:40:38 -070072
Angel Ponse220e312020-07-22 00:55:38 +020073#define ARCHDIS 0xff0 /* DMA Remap Engine Policy Control */
74#define DMAR_LCKDN (1 << 31)
75#define SPCAPCTRL (1 << 25)
76#define L3HIT2PEND_DIS (1 << 20)
77#define PRSCAPDIS (1 << 2)
78#define GLBIOTLBINV (1 << 1)
79#define GLBCTXTINV (1 << 0)
80
Aaron Durbin76c37002012-10-30 09:03:43 -050081/*
82 * EPBAR - Egress Port Root Complex Register Block
83 */
84
Angel Pons75594e92020-09-14 14:04:50 +020085#include "registers/epbar.h"
Aaron Durbin76c37002012-10-30 09:03:43 -050086
Aaron Durbin76c37002012-10-30 09:03:43 -050087/*
88 * DMIBAR
89 */
90
Angel Pons75594e92020-09-14 14:04:50 +020091#include "registers/dmibar.h"
Angel Pons598ec6a2020-07-23 02:37:12 +020092
Aaron Durbin76c37002012-10-30 09:03:43 -050093#ifndef __ASSEMBLER__
Aaron Durbin76c37002012-10-30 09:03:43 -050094
Angel Pons73fa0352020-07-03 12:29:03 +020095void mb_late_romstage_setup(void); /* optional */
Angel Pons2e25ac62020-07-03 12:06:04 +020096
Angel Ponse8168292020-07-03 11:42:22 +020097void haswell_early_initialization(void);
Aaron Durbin76c37002012-10-30 09:03:43 -050098void haswell_late_initialization(void);
Tristan Corrick334be322018-12-17 22:10:21 +130099void haswell_unhide_peg(void);
Aaron Durbin76c37002012-10-30 09:03:43 -0500100
Aaron Durbin76c37002012-10-30 09:03:43 -0500101void report_platform_info(void);
Aaron Durbin76c37002012-10-30 09:03:43 -0500102
Matt DeVillier85d98d92018-03-04 01:41:23 -0600103#include <device/device.h>
104
105struct acpi_rsdp;
Furquan Shaikh0f007d82020-04-24 06:41:18 -0700106unsigned long northbridge_write_acpi_tables(const struct device *device, unsigned long start,
Angel Pons1db5bc72020-01-15 00:49:03 +0100107 struct acpi_rsdp *rsdp);
Matt DeVillier85d98d92018-03-04 01:41:23 -0600108
Angel Pons1db5bc72020-01-15 00:49:03 +0100109#endif /* __ASSEMBLER__ */
110#endif /* __ACPI__ */
Edward O'Callaghan089a5102015-01-06 02:48:57 +1100111#endif /* __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__ */