blob: a5bef59958a0d6f02dc4de74e76e694648b2a6d4 [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
Angel Ponsd25e2f62020-09-15 00:48:16 +02006#include <northbridge/intel/pineview/memmap.h>
Damien Zammit62477932015-05-03 21:34:38 +10007#include <southbridge/intel/i82801gx/i82801gx.h>
8
Damien Zammitf7060f12015-11-14 00:59:21 +11009#define BOOT_PATH_NORMAL 0
10#define BOOT_PATH_RESET 1
11#define BOOT_PATH_RESUME 2
12
Damien Zammit62477932015-05-03 21:34:38 +100013/* Device 0:0.0 PCI configuration space (Host Bridge) */
Angel Pons39ff7032020-03-09 21:39:44 +010014#define HOST_BRIDGE PCI_DEV(0, 0, 0)
Damien Zammit62477932015-05-03 21:34:38 +100015
Angel Pons0ddc2452020-07-22 11:40:46 +020016#include "hostbridge_regs.h"
Damien Zammit62477932015-05-03 21:34:38 +100017
18/* Device 0:1.0 PCI configuration space (PCI Express) */
19
Angel Pons39ff7032020-03-09 21:39:44 +010020#define PEGSTS 0x214 /* 32 bits */
Damien Zammit62477932015-05-03 21:34:38 +100021
Angel Pons39ff7032020-03-09 21:39:44 +010022/* Device 0:2.0 PCI configuration space (Integrated Graphics Device) */
23#define GMCH_IGD PCI_DEV(0, 2, 0)
Damien Zammit62477932015-05-03 21:34:38 +100024
25#define GMADR 0x18
26#define GTTADR 0x1c
27#define BSM 0x5c
Damien Zammit62477932015-05-03 21:34:38 +100028
Damien Zammitf7060f12015-11-14 00:59:21 +110029#define GPIO32(x) *((volatile u32 *)(DEFAULT_GPIOBASE + x))
Damien Zammit62477932015-05-03 21:34:38 +100030
31/*
32 * MCHBAR
33 */
34
Angel Pons39ff7032020-03-09 21:39:44 +010035#define MCHBAR8(x) (*((volatile u8 *)(DEFAULT_MCHBAR + (x))))
36#define MCHBAR16(x) (*((volatile u16 *)(DEFAULT_MCHBAR + (x))))
Angel Ponsf1f56052021-01-20 11:06:26 +010037#define MCHBAR32(x) (*((volatile u32 *)(DEFAULT_MCHBAR + (x))))
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
52/*
53 * EPBAR - Egress Port Root Complex Register Block
54 */
55
Angel Ponsf1f56052021-01-20 11:06:26 +010056#define EPBAR8(x) (*((volatile u8 *)(DEFAULT_EPBAR + (x))))
57#define EPBAR16(x) (*((volatile u16 *)(DEFAULT_EPBAR + (x))))
58#define EPBAR32(x) (*((volatile u32 *)(DEFAULT_EPBAR + (x))))
Damien Zammit62477932015-05-03 21:34:38 +100059
60/*
61 * DMIBAR
62 */
63
Angel Ponsf1f56052021-01-20 11:06:26 +010064#define DMIBAR8(x) (*((volatile u8 *)(DEFAULT_DMIBAR + (x))))
65#define DMIBAR16(x) (*((volatile u16 *)(DEFAULT_DMIBAR + (x))))
66#define DMIBAR32(x) (*((volatile u32 *)(DEFAULT_DMIBAR + (x))))
Damien Zammit62477932015-05-03 21:34:38 +100067
Angel Pons39ff7032020-03-09 21:39:44 +010068void pineview_early_init(void);
Damien Zammitf7060f12015-11-14 00:59:21 +110069u32 decode_igd_memory_size(const u32 gms);
70u32 decode_igd_gtt_size(const u32 gsm);
Damien Zammitf7060f12015-11-14 00:59:21 +110071
Arthur Heymansc6ff1ac2019-01-11 16:06:19 +010072/* Mainboard romstage callback functions */
Arthur Heymansc6ff1ac2019-01-11 16:06:19 +010073void get_mb_spd_addrmap(u8 *spd_addr_map);
74void mb_pirq_setup(void); /* optional */
75
Damien Zammit62477932015-05-03 21:34:38 +100076#endif /* NORTHBRIDGE_INTEL_PINEVIEW_H */