blob: 508afaafb746f7e90579d8e38f20cc671d21702f [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
Kyösti Mälkki6f66f412016-12-01 22:08:18 +020012 * setup the PCIEXBAR because CONFIG_MMCONF_SUPPORT is set to
Kyösti Mälkkifbdb0852013-07-01 11:21:53 +030013 * 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
Kyösti Mälkki6f66f412016-12-01 22:08:18 +020017 * CONFIG_MMCONF_SUPPORT option to do PCI config acceses.
Kyösti Mälkkifbdb0852013-07-01 11:21:53 +030018 *
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}