blob: 0eaa4ec3409370454c89e6676c19e24dcdefe71d [file] [log] [blame]
Angel Pons6e5aabd2020-03-23 23:44:42 +01001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauer00636b02012-04-04 00:08:51 +02002
3#ifndef __NORTHBRIDGE_INTEL_SANDYBRIDGE_SANDYBRIDGE_H__
Edward O'Callaghan089a5102015-01-06 02:48:57 +11004#define __NORTHBRIDGE_INTEL_SANDYBRIDGE_SANDYBRIDGE_H__
Stefan Reinauer00636b02012-04-04 00:08:51 +02005
Stefan Reinauer00636b02012-04-04 00:08:51 +02006/* Device ID for SandyBridge and IvyBridge */
7#define BASE_REV_SNB 0x00
8#define BASE_REV_IVB 0x50
9#define BASE_REV_MASK 0x50
10
Angel Ponsdfca1692020-09-14 16:54:42 +020011#include "memmap.h"
Nico Huberbb9469c2015-10-21 11:49:23 +020012
Stefan Reinauer00636b02012-04-04 00:08:51 +020013/* Everything below this line is ignored in the DSDT */
Elyes Haouas45d818b2022-12-12 21:14:16 +010014#ifndef __ASSEMBLER__
Angel Pons964d91f2020-12-07 13:11:17 +010015#include <types.h>
Patrick Rudolph74203de2017-11-20 11:57:01 +010016
17/* Chipset types */
18enum platform_type {
19 PLATFORM_MOBILE = 0,
20 PLATFORM_DESKTOP_SERVER,
21};
Stefan Reinauer00636b02012-04-04 00:08:51 +020022
23/* Device 0:0.0 PCI configuration space (Host Bridge) */
Angel Pons7c49cb82020-03-16 23:17:32 +010024#define HOST_BRIDGE PCI_DEV(0, 0, 0)
Stefan Reinauer00636b02012-04-04 00:08:51 +020025
Angel Pons3447db52020-09-14 18:09:46 +020026#include "registers/host_bridge.h"
Angel Pons7c49cb82020-03-16 23:17:32 +010027
Angel Pons7c49cb82020-03-16 23:17:32 +010028/* Devices 0:1.0, 0:1.1, 0:1.2, 0:6.0 PCI configuration space (PCI Express Graphics) */
29
30#define AFE_PWRON 0xc24 /* PEG Analog Front-End Power-On */
31
Stefan Reinauer00636b02012-04-04 00:08:51 +020032/* Device 0:2.0 PCI configuration space (Graphics Device) */
33
34#define MSAC 0x62 /* Multi Size Aperture Control */
Stefan Reinauer00636b02012-04-04 00:08:51 +020035
36/*
37 * MCHBAR
38 */
39
Angel Ponsd9e58dc2021-01-20 01:22:20 +010040#include <northbridge/intel/common/fixed_bars.h>
41
Angel Pons7c49cb82020-03-16 23:17:32 +010042/* As there are many registers, define them on a separate file */
Angel Pons3447db52020-09-14 18:09:46 +020043#include "registers/mchbar.h"
Stefan Reinauer00636b02012-04-04 00:08:51 +020044
45/*
46 * EPBAR - Egress Port Root Complex Register Block
47 */
48
Angel Ponsb8ebeba2020-09-14 18:11:40 +020049#include "registers/epbar.h"
Stefan Reinauer00636b02012-04-04 00:08:51 +020050
Stefan Reinauer00636b02012-04-04 00:08:51 +020051/*
52 * DMIBAR
53 */
54
Angel Ponsb8ebeba2020-09-14 18:11:40 +020055#include "registers/dmibar.h"
Stefan Reinauer00636b02012-04-04 00:08:51 +020056
Angel Pons964d91f2020-12-07 13:11:17 +010057bool is_sandybridge(void);
58
Stefan Reinauer00636b02012-04-04 00:08:51 +020059void intel_sandybridge_finalize_smm(void);
Patrick Rudolph2cdb65d2019-03-24 18:08:43 +010060void systemagent_early_init(void);
Nico Huberbb9469c2015-10-21 11:49:23 +020061void sandybridge_init_iommu(void);
Stefan Reinauer00636b02012-04-04 00:08:51 +020062void sandybridge_late_initialization(void);
Kyösti Mälkki4ce0a072021-02-17 18:10:49 +020063void northbridge_romstage_finalize(void);
Patrick Rudolph6aca7e62019-03-26 18:22:36 +010064void early_init_dmi(void);
Stefan Reinauer00636b02012-04-04 00:08:51 +020065
Angel Pons7c49cb82020-03-16 23:17:32 +010066/* mainboard_early_init: Optional callback, run after console init but before raminit. */
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +010067void mainboard_early_init(int s3resume);
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +010068void perform_raminit(int s3resume);
Angel Pons064c7992020-03-17 23:09:16 +010069void report_memory_config(void);
Patrick Rudolph74203de2017-11-20 11:57:01 +010070enum platform_type get_platform_type(void);
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +010071
Nico Huber9d9ce0d2015-10-26 12:59:49 +010072#include <device/device.h>
73
74struct acpi_rsdp;
Furquan Shaikh0f007d82020-04-24 06:41:18 -070075unsigned long northbridge_write_acpi_tables(const struct device *device, unsigned long start,
Angel Pons7c49cb82020-03-16 23:17:32 +010076 struct acpi_rsdp *rsdp);
Nico Huber9d9ce0d2015-10-26 12:59:49 +010077
Elyes Haouas45d818b2022-12-12 21:14:16 +010078#endif /* __ASSEMBLER__ */
Edward O'Callaghan089a5102015-01-06 02:48:57 +110079#endif /* __NORTHBRIDGE_INTEL_SANDYBRIDGE_SANDYBRIDGE_H__ */