Kyösti Mälkki | fbdb085 | 2013-07-01 11:21:53 +0300 | [diff] [blame] | 1 | #include <arch/io.h> |
| 2 | |
| 3 | /* Just re-define this instead of including sandybridge.h. It blows up romcc. */ |
| 4 | #define PCIEXBAR 0x60 |
| 5 | |
| 6 | static 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älkki | 6f66f41 | 2016-12-01 22:08:18 +0200 | [diff] [blame] | 12 | * setup the PCIEXBAR because CONFIG_MMCONF_SUPPORT is set to |
Kyösti Mälkki | fbdb085 | 2013-07-01 11:21:53 +0300 | [diff] [blame] | 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 |
Kyösti Mälkki | 6f66f41 | 2016-12-01 22:08:18 +0200 | [diff] [blame] | 17 | * CONFIG_MMCONF_SUPPORT option to do PCI config acceses. |
Kyösti Mälkki | fbdb085 | 2013-07-01 11:21:53 +0300 | [diff] [blame] | 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 | } |