2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include <console/console.h>
23 #include <arch/acpi.h>
24 #include <arch/acpigen.h>
25 #include <device/device.h>
26 #include <device/pci.h>
27 #include <device/pci_ids.h>
29 unsigned long acpi_fill_mcfg(unsigned long current)
36 dev = dev_find_device(0x8086, 0x27a0, 0);
40 pciexbar_reg = pci_read_config32(dev, 0x48);
42 /* MMCFG not supported or not enabled. */
43 if (!(pciexbar_reg & (1 << 0)))
46 switch ((pciexbar_reg >> 1) & 3) {
48 pciexbar = pciexbar_reg & ((1 << 31) | (1 << 30) | (1 << 29) |
53 pciexbar = pciexbar_reg & ((1 << 31) | (1 << 30) | (1 << 29) |
54 (1 << 28) | (1 << 27));
58 pciexbar = pciexbar_reg & ((1 << 31) | (1 << 30) | (1 << 29) |
59 (1 << 28) | (1 << 27) | (1 << 26));
69 #if CONFIG_GENERATE_ACPI_TABLES
70 current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *) current,
71 pciexbar, 0x0, 0x0, max_buses - 1);