blob: 1c1d49214b7534f32230ee8e72a796c507f3f28a [file] [log] [blame]
Kyösti Mälkkifbdb0852013-07-01 11:21:53 +03001#include <arch/io.h>
2
3/* Just re-define this instead of including sandybridge.h. It blows up romcc. */
4#define PCIEXBAR 0x60
5
6static void bootblock_northbridge_init(void)
7{
8 uint32_t reg;
9
10 /*
11 * The "io" variant of the config access is explicitly used to
12 * setup the PCIEXBAR because CONFIG_MMCONF_SUPPORT_DEFAULT is set to
13 * to true. That way all subsequent non-explicit config accesses use
14 * MCFG. This code also assumes that bootblock_northbridge_init() is
15 * the first thing called in the non-asm boot block code. The final
16 * assumption is that no assembly code is using the
17 * CONFIG_MMCONF_SUPPORT_DEFAULT option to do PCI config acceses.
18 *
19 * The PCIEXBAR is assumed to live in the memory mapped IO space under
20 * 4GiB.
21 */
22 reg = 0;
23 pci_io_write_config32(PCI_DEV(0,0,0), PCIEXBAR + 4, reg);
24 reg = CONFIG_MMCONF_BASE_ADDRESS | 4 | 1; /* 64MiB - 0-63 buses. */
25 pci_io_write_config32(PCI_DEV(0,0,0), PCIEXBAR, reg);
26}