blob: 2cfc5c699b639fe20264016b52c3194a9d753e2b [file] [log] [blame]
Edward O'Callaghan4726a872014-01-25 07:40:39 +11001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Advanced Micro Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
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.
14 *
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
18 */
19
Edward O'Callaghan5ff4b082014-03-29 17:54:26 +110020#include "agesawrapper.h"
21
Edward O'Callaghand309eb12014-05-30 11:35:33 +100022#include <arch/ioapic.h>
Edward O'Callaghan4726a872014-01-25 07:40:39 +110023#include <console/console.h>
Edward O'Callaghan5ff4b082014-03-29 17:54:26 +110024#include <cpu/amd/amdfam14.h>
Edward O'Callaghan4726a872014-01-25 07:40:39 +110025#include <device/pci.h>
26#include <device/pci_ids.h>
Edward O'Callaghan4726a872014-01-25 07:40:39 +110027#include <stdint.h>
28#include <stdlib.h>
Edward O'Callaghan5ff4b082014-03-29 17:54:26 +110029#include <string.h>
30
Edward O'Callaghanfeebd862014-04-10 19:12:28 +100031/**
32 * Global variables for mainboard layouts. These are shared by irqtable,
33 * mptable and acpi_tables where busnum is default.
34 */
Edward O'Callaghan4726a872014-01-25 07:40:39 +110035u8 bus_sb800[6];
Edward O'Callaghan4726a872014-01-25 07:40:39 +110036
Edward O'Callaghan4726a872014-01-25 07:40:39 +110037void get_bus_conf(void)
38{
Edward O'Callaghan4726a872014-01-25 07:40:39 +110039 device_t dev;
Kyösti Mälkki53584fa2014-07-15 14:38:51 +030040 int i;
Edward O'Callaghan4726a872014-01-25 07:40:39 +110041
Edward O'Callaghan4726a872014-01-25 07:40:39 +110042
43 memset(bus_sb800, 0, sizeof(bus_sb800));
44
Edward O'Callaghan4726a872014-01-25 07:40:39 +110045
46 /* sb800 */
Kyösti Mälkki0c797f12014-07-21 19:35:16 +030047 dev = dev_find_slot(0, PCI_DEVFN(0x14, 4));
Edward O'Callaghan4726a872014-01-25 07:40:39 +110048
49 if (dev) {
50 bus_sb800[1] = pci_read_config8(dev, PCI_SECONDARY_BUS);
Edward O'Callaghan4726a872014-01-25 07:40:39 +110051 }
52
53 for (i = 0; i < 4; i++) {
Kyösti Mälkki0c797f12014-07-21 19:35:16 +030054 dev = dev_find_slot(0, PCI_DEVFN(0x14, i));
Edward O'Callaghan4726a872014-01-25 07:40:39 +110055 if (dev) {
56 bus_sb800[2 + i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
Edward O'Callaghan4726a872014-01-25 07:40:39 +110057 }
58 }
Edward O'Callaghan4726a872014-01-25 07:40:39 +110059}