blob: 9dd8e311be77e49b224851da93dfe64544f2965c [file] [log] [blame]
Damien Zammit62477932015-05-03 21:34:38 +10001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007-2009 coresystems GmbH
5 * Copyright (C) 2015 Damien Zammit <damien@zamaudio.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; version 2 of
10 * the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <arch/acpigen.h>
19#include <arch/acpi.h>
20#include <device/device.h>
21#include <device/pci.h>
22#include <northbridge/intel/pineview/pineview.h>
23#include <types.h>
24
25unsigned long acpi_fill_mcfg(unsigned long current)
26{
Damien Zammitf7060f12015-11-14 00:59:21 +110027 u32 length = 0;
Damien Zammit62477932015-05-03 21:34:38 +100028 u32 pciexbar = 0;
Damien Zammit62477932015-05-03 21:34:38 +100029 int max_buses;
Damien Zammit62477932015-05-03 21:34:38 +100030
Damien Zammitf7060f12015-11-14 00:59:21 +110031 if (!decode_pciebar(&pciexbar, &length))
Damien Zammit62477932015-05-03 21:34:38 +100032 return current;
33
Damien Zammitf7060f12015-11-14 00:59:21 +110034 max_buses = length >> 20;
Damien Zammit62477932015-05-03 21:34:38 +100035 current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *) current,
36 pciexbar, 0x0, 0x0, max_buses - 1);
37
38 return current;
39}