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 | |
| 23 | #define PEG_DCAP2 0xc4 /* 32bit */ |
| 24 | |
| 25 | #define PEG_ESD 0x144 /* 32bit */ |
| 26 | #define PEG_LE1D 0x150 /* 32bit */ |
| 27 | #define PEG_LE1A 0x158 /* 64bit */ |
| 28 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 29 | /* Device 0:2.0 PCI configuration space (Graphics Device) */ |
| 30 | |
| 31 | #define MSAC 0x62 /* Multi Size Aperture Control */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 32 | |
| 33 | /* |
| 34 | * MCHBAR |
| 35 | */ |
| 36 | |
Angel Pons | f95b9b4 | 2021-01-20 01:10:48 +0100 | [diff] [blame^] | 37 | #include <northbridge/intel/common/fixed_bars.h> |
| 38 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 39 | #define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and)) |
| 40 | #define MCHBAR16_AND(x, and) (MCHBAR16(x) = MCHBAR16(x) & (and)) |
| 41 | #define MCHBAR32_AND(x, and) (MCHBAR32(x) = MCHBAR32(x) & (and)) |
| 42 | #define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or)) |
| 43 | #define MCHBAR16_OR(x, or) (MCHBAR16(x) = MCHBAR16(x) | (or)) |
| 44 | #define MCHBAR32_OR(x, or) (MCHBAR32(x) = MCHBAR32(x) | (or)) |
| 45 | #define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or)) |
| 46 | #define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or)) |
| 47 | #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] | 48 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 49 | /* As there are many registers, define them on a separate file */ |
Angel Pons | e4156c3 | 2020-09-14 15:47:59 +0200 | [diff] [blame] | 50 | #include "registers/mchbar.h" |
Duncan Laurie | c70353f | 2013-06-28 14:40:38 -0700 | [diff] [blame] | 51 | |
Angel Pons | e220e31 | 2020-07-22 00:55:38 +0200 | [diff] [blame] | 52 | #define ARCHDIS 0xff0 /* DMA Remap Engine Policy Control */ |
| 53 | #define DMAR_LCKDN (1 << 31) |
| 54 | #define SPCAPCTRL (1 << 25) |
| 55 | #define L3HIT2PEND_DIS (1 << 20) |
| 56 | #define PRSCAPDIS (1 << 2) |
| 57 | #define GLBIOTLBINV (1 << 1) |
| 58 | #define GLBCTXTINV (1 << 0) |
| 59 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 60 | /* |
| 61 | * EPBAR - Egress Port Root Complex Register Block |
| 62 | */ |
| 63 | |
Angel Pons | f95b9b4 | 2021-01-20 01:10:48 +0100 | [diff] [blame^] | 64 | #define EPBAR64(x) (*((volatile u64 *)((uintptr_t)CONFIG_FIXED_EPBAR_MMIO_BASE + (x)))) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 65 | |
Angel Pons | 75594e9 | 2020-09-14 14:04:50 +0200 | [diff] [blame] | 66 | #include "registers/epbar.h" |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 67 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 68 | /* |
| 69 | * DMIBAR |
| 70 | */ |
| 71 | |
Angel Pons | f95b9b4 | 2021-01-20 01:10:48 +0100 | [diff] [blame^] | 72 | #define DMIBAR64(x) (*((volatile u64 *)((uintptr_t)CONFIG_FIXED_DMIBAR_MMIO_BASE + (x)))) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 73 | |
Angel Pons | 75594e9 | 2020-09-14 14:04:50 +0200 | [diff] [blame] | 74 | #include "registers/dmibar.h" |
Angel Pons | 598ec6a | 2020-07-23 02:37:12 +0200 | [diff] [blame] | 75 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 76 | #ifndef __ASSEMBLER__ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 77 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 78 | void intel_northbridge_haswell_finalize_smm(void); |
Kyösti Mälkki | d7205be | 2019-09-27 07:24:17 +0300 | [diff] [blame] | 79 | |
Angel Pons | 73fa035 | 2020-07-03 12:29:03 +0200 | [diff] [blame] | 80 | void mb_late_romstage_setup(void); /* optional */ |
Angel Pons | 2e25ac6 | 2020-07-03 12:06:04 +0200 | [diff] [blame] | 81 | |
Angel Pons | e816829 | 2020-07-03 11:42:22 +0200 | [diff] [blame] | 82 | void haswell_early_initialization(void); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 83 | void haswell_late_initialization(void); |
Tristan Corrick | 334be32 | 2018-12-17 22:10:21 +1300 | [diff] [blame] | 84 | void haswell_unhide_peg(void); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 85 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 86 | void report_platform_info(void); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 87 | |
Matt DeVillier | 85d98d9 | 2018-03-04 01:41:23 -0600 | [diff] [blame] | 88 | #include <device/device.h> |
| 89 | |
| 90 | struct acpi_rsdp; |
Furquan Shaikh | 0f007d8 | 2020-04-24 06:41:18 -0700 | [diff] [blame] | 91 | 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] | 92 | struct acpi_rsdp *rsdp); |
Matt DeVillier | 85d98d9 | 2018-03-04 01:41:23 -0600 | [diff] [blame] | 93 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 94 | #endif /* __ASSEMBLER__ */ |
| 95 | #endif /* __ACPI__ */ |
Edward O'Callaghan | 089a510 | 2015-01-06 02:48:57 +1100 | [diff] [blame] | 96 | #endif /* __NORTHBRIDGE_INTEL_HASWELL_HASWELL_H__ */ |