blob: 914c3a3575625d4bc9911e7ec6384deb41f1fd59 [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Damien Zammit62477932015-05-03 21:34:38 +10002
3#ifndef NORTHBRIDGE_INTEL_PINEVIEW_H
4#define NORTHBRIDGE_INTEL_PINEVIEW_H
5
Damien Zammit62477932015-05-03 21:34:38 +10006#include <southbridge/intel/i82801gx/i82801gx.h>
7
Angel Pons24b1d8a2021-01-20 12:00:31 +01008#define DEFAULT_PMIOBAR 0x00000400
9
Damien Zammitf7060f12015-11-14 00:59:21 +110010#define BOOT_PATH_NORMAL 0
11#define BOOT_PATH_RESET 1
12#define BOOT_PATH_RESUME 2
13
Damien Zammit62477932015-05-03 21:34:38 +100014/* Device 0:0.0 PCI configuration space (Host Bridge) */
Angel Pons39ff7032020-03-09 21:39:44 +010015#define HOST_BRIDGE PCI_DEV(0, 0, 0)
Damien Zammit62477932015-05-03 21:34:38 +100016
Angel Pons0ddc2452020-07-22 11:40:46 +020017#include "hostbridge_regs.h"
Damien Zammit62477932015-05-03 21:34:38 +100018
19/* Device 0:1.0 PCI configuration space (PCI Express) */
20
Angel Pons39ff7032020-03-09 21:39:44 +010021#define PEGSTS 0x214 /* 32 bits */
Damien Zammit62477932015-05-03 21:34:38 +100022
Angel Pons39ff7032020-03-09 21:39:44 +010023/* Device 0:2.0 PCI configuration space (Integrated Graphics Device) */
24#define GMCH_IGD PCI_DEV(0, 2, 0)
Damien Zammit62477932015-05-03 21:34:38 +100025
26#define GMADR 0x18
27#define GTTADR 0x1c
28#define BSM 0x5c
Damien Zammit62477932015-05-03 21:34:38 +100029
Damien Zammitf7060f12015-11-14 00:59:21 +110030#define GPIO32(x) *((volatile u32 *)(DEFAULT_GPIOBASE + x))
Damien Zammit62477932015-05-03 21:34:38 +100031
32/*
33 * MCHBAR
34 */
35
Angel Pons24b1d8a2021-01-20 12:00:31 +010036#include <northbridge/intel/common/fixed_bars.h>
37
Angel Pons39ff7032020-03-09 21:39:44 +010038#define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and))
39#define MCHBAR16_AND(x, and) (MCHBAR16(x) = MCHBAR16(x) & (and))
40#define MCHBAR32_AND(x, and) (MCHBAR32(x) = MCHBAR32(x) & (and))
41#define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or))
42#define MCHBAR16_OR(x, or) (MCHBAR16(x) = MCHBAR16(x) | (or))
43#define MCHBAR32_OR(x, or) (MCHBAR32(x) = MCHBAR32(x) | (or))
44#define MCHBAR8_AND_OR(x, and, or) (MCHBAR8(x) = (MCHBAR8(x) & (and)) | (or))
45#define MCHBAR16_AND_OR(x, and, or) (MCHBAR16(x) = (MCHBAR16(x) & (and)) | (or))
46#define MCHBAR32_AND_OR(x, and, or) (MCHBAR32(x) = (MCHBAR32(x) & (and)) | (or))
47
48/* As there are many registers, define them on a separate file */
49
50#include "mchbar_regs.h"
Damien Zammit62477932015-05-03 21:34:38 +100051
Angel Pons39ff7032020-03-09 21:39:44 +010052void pineview_early_init(void);
Damien Zammitf7060f12015-11-14 00:59:21 +110053u32 decode_igd_memory_size(const u32 gms);
54u32 decode_igd_gtt_size(const u32 gsm);
Damien Zammitf7060f12015-11-14 00:59:21 +110055
Arthur Heymansc6ff1ac2019-01-11 16:06:19 +010056/* Mainboard romstage callback functions */
Arthur Heymansc6ff1ac2019-01-11 16:06:19 +010057void get_mb_spd_addrmap(u8 *spd_addr_map);
58void mb_pirq_setup(void); /* optional */
59
Damien Zammit62477932015-05-03 21:34:38 +100060#endif /* NORTHBRIDGE_INTEL_PINEVIEW_H */