blob: fb939abfee72e0f111efa6523acca25e77def932 [file] [log] [blame]
Frank Vibrans69da1b62011-02-14 19:04:45 +00001/*
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
Paul Menzela46a7122013-02-23 18:37:27 +010017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Frank Vibrans69da1b62011-02-14 19:04:45 +000018 */
19
20#include <console/console.h>
21#include <device/pci.h>
22#include <device/pci_ids.h>
23#include <string.h>
24#include <stdint.h>
25#include <stdlib.h>
26#include <cpu/amd/amdfam14.h>
Kerry Sheh01f7ab92012-01-19 13:18:36 +080027#include "agesawrapper.h"
Frank Vibrans69da1b62011-02-14 19:04:45 +000028
29
30/* Global variables for MB layouts and these will be shared by irqtable mptable
Kerry Shehf03360f2012-01-19 13:25:55 +080031 * and acpi_tables busnum is default.
32 */
Kyösti Mälkki9c7d73c2013-09-09 09:23:19 +030033u8 bus_sb800[6];
Frank Vibrans69da1b62011-02-14 19:04:45 +000034
Frank Vibrans69da1b62011-02-14 19:04:45 +000035void get_bus_conf(void)
36{
Kerry Shehf03360f2012-01-19 13:25:55 +080037 device_t dev;
Kyösti Mälkki53584fa2014-07-15 14:38:51 +030038 int i;
Frank Vibrans69da1b62011-02-14 19:04:45 +000039
Frank Vibrans69da1b62011-02-14 19:04:45 +000040
Frank Vibrans69da1b62011-02-14 19:04:45 +000041
Kyösti Mälkki9c7d73c2013-09-09 09:23:19 +030042 memset(bus_sb800, 0, sizeof(bus_sb800));
Frank Vibrans69da1b62011-02-14 19:04:45 +000043
Frank Vibrans69da1b62011-02-14 19:04:45 +000044
Frank Vibrans69da1b62011-02-14 19:04:45 +000045
Kerry Shehf03360f2012-01-19 13:25:55 +080046 /* sb800 */
Kyösti Mälkki0c797f12014-07-21 19:35:16 +030047 dev = dev_find_slot(0, PCI_DEVFN(0x14, 4));
Frank Vibrans69da1b62011-02-14 19:04:45 +000048
Kerry Shehf03360f2012-01-19 13:25:55 +080049 if (dev) {
50 bus_sb800[1] = pci_read_config8(dev, PCI_SECONDARY_BUS);
Kerry Shehf03360f2012-01-19 13:25:55 +080051 }
Frank Vibrans69da1b62011-02-14 19:04:45 +000052
Kerry Shehf03360f2012-01-19 13:25:55 +080053 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));
Kerry Shehf03360f2012-01-19 13:25:55 +080055 if (dev) {
56 bus_sb800[2 + i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
Kerry Shehf03360f2012-01-19 13:25:55 +080057 }
58 }
Kerry Sheh01f7ab92012-01-19 13:18:36 +080059
Frank Vibrans69da1b62011-02-14 19:04:45 +000060}