Kyösti Mälkki | 35a7249 | 2013-07-01 11:21:53 +0300 | [diff] [blame^] | 1 | #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 | |
| 7 | static void bootblock_northbridge_init(void) |
| 8 | { |
| 9 | uint32_t reg; |
| 10 | |
| 11 | /* |
| 12 | * The "io" variant of the config access is explicitly used to |
| 13 | * setup the PCIEXBAR because CONFIG_MMCONF_SUPPORT_DEFAULT is set to |
| 14 | * 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 |
| 18 | * CONFIG_MMCONF_SUPPORT_DEFAULT option to do PCI config acceses. |
| 19 | * |
| 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 | } |