Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 1 | /* |
| 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'Callaghan | 5ff4b08 | 2014-03-29 17:54:26 +1100 | [diff] [blame] | 20 | #include "agesawrapper.h" |
| 21 | |
Edward O'Callaghan | d309eb1 | 2014-05-30 11:35:33 +1000 | [diff] [blame] | 22 | #include <arch/ioapic.h> |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 23 | #include <console/console.h> |
Edward O'Callaghan | 5ff4b08 | 2014-03-29 17:54:26 +1100 | [diff] [blame] | 24 | #include <cpu/amd/amdfam14.h> |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 25 | #include <device/pci.h> |
| 26 | #include <device/pci_ids.h> |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 27 | #include <stdint.h> |
| 28 | #include <stdlib.h> |
Edward O'Callaghan | 5ff4b08 | 2014-03-29 17:54:26 +1100 | [diff] [blame] | 29 | #include <string.h> |
| 30 | |
Edward O'Callaghan | feebd86 | 2014-04-10 19:12:28 +1000 | [diff] [blame] | 31 | /** |
| 32 | * Global variables for mainboard layouts. These are shared by irqtable, |
| 33 | * mptable and acpi_tables where busnum is default. |
| 34 | */ |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 35 | u8 bus_sb800[6]; |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 36 | |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 37 | void get_bus_conf(void) |
| 38 | { |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 39 | device_t dev; |
Kyösti Mälkki | 53584fa | 2014-07-15 14:38:51 +0300 | [diff] [blame] | 40 | int i; |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 41 | |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 42 | |
| 43 | memset(bus_sb800, 0, sizeof(bus_sb800)); |
| 44 | |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 45 | |
| 46 | /* sb800 */ |
Kyösti Mälkki | 0c797f1 | 2014-07-21 19:35:16 +0300 | [diff] [blame] | 47 | dev = dev_find_slot(0, PCI_DEVFN(0x14, 4)); |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 48 | |
| 49 | if (dev) { |
| 50 | bus_sb800[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | for (i = 0; i < 4; i++) { |
Kyösti Mälkki | 0c797f1 | 2014-07-21 19:35:16 +0300 | [diff] [blame] | 54 | dev = dev_find_slot(0, PCI_DEVFN(0x14, i)); |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 55 | if (dev) { |
| 56 | bus_sb800[2 + i] = pci_read_config8(dev, PCI_SECONDARY_BUS); |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 57 | } |
| 58 | } |
Edward O'Callaghan | 4726a87 | 2014-01-25 07:40:39 +1100 | [diff] [blame] | 59 | } |