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