blob: d1cf6db17d63806738f0f0d13c103f379a9e34f5 [file] [log] [blame]
Angel Pons4b429832020-04-02 23:48:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Martin Roth5474eb12018-05-26 19:22:33 -06003
Kyösti Mälkkide640782019-12-03 07:30:26 +02004#include <arch/bootblock.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +02005#include <device/pci_ops.h>
Arthur Heymanse27c0132019-11-12 23:34:13 +01006#include "i945.h"
Kyösti Mälkki032c23d2013-07-01 11:21:53 +03007
Arthur Heymanse27c0132019-11-12 23:34:13 +01008void bootblock_early_northbridge_init(void)
Kyösti Mälkki032c23d2013-07-01 11:21:53 +03009{
10 uint32_t reg;
11
12 /*
13 * The "io" variant of the config access is explicitly used to
Elyes HAOUAS96184e92018-05-09 21:23:25 +020014 * setup the PCIEXBAR because CONFIG_MMCONF_SUPPORT is set to true.
15 * That way all subsequent non-explicit config accesses use
Kyösti Mälkki032c23d2013-07-01 11:21:53 +030016 * MCFG. This code also assumes that bootblock_northbridge_init() is
17 * the first thing called in the non-asm boot block code. The final
18 * assumption is that no assembly code is using the
Elyes HAOUAS0c9630e2020-01-07 20:06:08 +010019 * CONFIG_MMCONF_SUPPORT option to do PCI config accesses.
Kyösti Mälkki032c23d2013-07-01 11:21:53 +030020 *
21 * The PCIEXBAR is assumed to live in the memory mapped IO space under
22 * 4GiB.
23 */
24 reg = CONFIG_MMCONF_BASE_ADDRESS | 4 | 1; /* 64MiB - 0-63 buses. */
Arthur Heymans70a8e342017-03-09 11:30:23 +010025 pci_io_write_config32(PCI_DEV(0, 0, 0), PCIEXBAR, reg);
Kyösti Mälkki032c23d2013-07-01 11:21:53 +030026}