Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 2 | |
| 3 | #ifndef __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__ |
Edward O'Callaghan | 089a510 | 2015-01-06 02:48:57 +1100 | [diff] [blame] | 4 | #define __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 5 | |
| 6 | /* Chipset types */ |
| 7 | #define HASWELL_MOBILE 0 |
| 8 | #define HASWELL_DESKTOP 1 |
| 9 | #define HASWELL_SERVER 2 |
| 10 | |
Angel Pons | a3cb322 | 2020-09-14 13:15:19 +0200 | [diff] [blame] | 11 | #include "memmap.h" |
Matt DeVillier | a51e379 | 2018-03-04 01:44:15 -0600 | [diff] [blame] | 12 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 13 | /* Everything below this line is ignored in the DSDT */ |
| 14 | #ifndef __ACPI__ |
| 15 | |
| 16 | /* Device 0:0.0 PCI configuration space (Host Bridge) */ |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 17 | #define HOST_BRIDGE PCI_DEV(0, 0, 0) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 18 | |
Angel Pons | e4156c3 | 2020-09-14 15:47:59 +0200 | [diff] [blame] | 19 | #include "registers/host_bridge.h" |
Matt DeVillier | a51e379 | 2018-03-04 01:44:15 -0600 | [diff] [blame] | 20 | |
Angel Pons | 76b8bc2 | 2020-07-23 02:32:27 +0200 | [diff] [blame] | 21 | /* Device 0:1.0 PCI configuration space (PCIe Graphics) */ |
| 22 | |
Angel Pons | ae99950 | 2020-11-05 01:58:34 +0100 | [diff] [blame] | 23 | #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 Pons | 76b8bc2 | 2020-07-23 02:32:27 +0200 | [diff] [blame] | 32 | #define PEG_DCAP2 0xc4 /* 32bit */ |
| 33 | |
Angel Pons | ae99950 | 2020-11-05 01:58:34 +0100 | [diff] [blame] | 34 | #define PEG_LCTL2 0xd0 |
| 35 | |
| 36 | #define PEG_VC0RCTL 0x114 |
| 37 | |
Angel Pons | 76b8bc2 | 2020-07-23 02:32:27 +0200 | [diff] [blame] | 38 | #define PEG_ESD 0x144 /* 32bit */ |
| 39 | #define PEG_LE1D 0x150 /* 32bit */ |
| 40 | #define PEG_LE1A 0x158 /* 64bit */ |
| 41 | |
Angel Pons | ae99950 | 2020-11-05 01:58:34 +0100 | [diff] [blame] | 42 | #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 Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 50 | /* Device 0:2.0 PCI configuration space (Graphics Device) */ |
| 51 | |
| 52 | #define MSAC 0x62 /* Multi Size Aperture Control */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 53 | |
| 54 | /* |
| 55 | * MCHBAR |
| 56 | */ |
| 57 | |
Angel Pons | f95b9b4 | 2021-01-20 01:10:48 +0100 | [diff] [blame] | 58 | #include <northbridge/intel/common/fixed_bars.h> |
| 59 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 60 | #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 Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 69 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 70 | /* As there are many registers, define them on a separate file */ |
Angel Pons | e4156c3 | 2020-09-14 15:47:59 +0200 | [diff] [blame] | 71 | #include "registers/mchbar.h" |
Duncan Laurie | c70353f | 2013-06-28 14:40:38 -0700 | [diff] [blame] | 72 | |
Angel Pons | e220e31 | 2020-07-22 00:55:38 +0200 | [diff] [blame] | 73 | #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 Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 81 | /* |
| 82 | * EPBAR - Egress Port Root Complex Register Block |
| 83 | */ |
| 84 | |
Angel Pons | 75594e9 | 2020-09-14 14:04:50 +0200 | [diff] [blame] | 85 | #include "registers/epbar.h" |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 86 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 87 | /* |
| 88 | * DMIBAR |
| 89 | */ |
| 90 | |
Angel Pons | 75594e9 | 2020-09-14 14:04:50 +0200 | [diff] [blame] | 91 | #include "registers/dmibar.h" |
Angel Pons | 598ec6a | 2020-07-23 02:37:12 +0200 | [diff] [blame] | 92 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 93 | #ifndef __ASSEMBLER__ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 94 | |
Angel Pons | 73fa035 | 2020-07-03 12:29:03 +0200 | [diff] [blame] | 95 | void mb_late_romstage_setup(void); /* optional */ |
Angel Pons | 2e25ac6 | 2020-07-03 12:06:04 +0200 | [diff] [blame] | 96 | |
Angel Pons | e816829 | 2020-07-03 11:42:22 +0200 | [diff] [blame] | 97 | void haswell_early_initialization(void); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 98 | void haswell_late_initialization(void); |
Tristan Corrick | 334be32 | 2018-12-17 22:10:21 +1300 | [diff] [blame] | 99 | void haswell_unhide_peg(void); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 100 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 101 | void report_platform_info(void); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 102 | |
Matt DeVillier | 85d98d9 | 2018-03-04 01:41:23 -0600 | [diff] [blame] | 103 | #include <device/device.h> |
| 104 | |
| 105 | struct acpi_rsdp; |
Furquan Shaikh | 0f007d8 | 2020-04-24 06:41:18 -0700 | [diff] [blame] | 106 | unsigned long northbridge_write_acpi_tables(const struct device *device, unsigned long start, |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 107 | struct acpi_rsdp *rsdp); |
Matt DeVillier | 85d98d9 | 2018-03-04 01:41:23 -0600 | [diff] [blame] | 108 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 109 | #endif /* __ASSEMBLER__ */ |
| 110 | #endif /* __ACPI__ */ |
Edward O'Callaghan | 089a510 | 2015-01-06 02:48:57 +1100 | [diff] [blame] | 111 | #endif /* __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__ */ |