Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2010 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. |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 16 | #include <device/pci.h> |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 17 | #include <string.h> |
| 18 | #include <stdint.h> |
| 19 | #include <stdlib.h> |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 20 | #include <cpu/amd/multicore.h> |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 21 | |
| 22 | #include <cpu/amd/amdfam10_sysconf.h> |
| 23 | |
| 24 | /* Global variables for MB layouts and these will be shared by irqtable mptable |
| 25 | * and acpi_tables busnum is default. |
| 26 | */ |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 27 | u32 apicid_sb700; |
| 28 | |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 29 | void get_bus_conf(void) |
| 30 | { |
| 31 | u32 apicid_base; |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 32 | |
Kyösti Mälkki | 8803b21 | 2019-01-03 11:39:07 +0200 | [diff] [blame] | 33 | get_default_pci1234(1); |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 34 | |
| 35 | sysconf.sbdn = (sysconf.hcdn[0] & 0xff); |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 36 | |
Kyösti Mälkki | ee7e130 | 2019-01-03 11:39:03 +0200 | [diff] [blame] | 37 | pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 38 | |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 39 | /* I/O APICs: APIC ID Version State Address */ |
Timothy Pearson | d4bbfe8 | 2015-10-27 16:48:36 -0500 | [diff] [blame] | 40 | if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) |
| 41 | apicid_base = get_apicid_base(1); |
| 42 | else |
| 43 | apicid_base = CONFIG_MAX_PHYSICAL_CPUS; |
Wang Qing Pei | 931d6f3 | 2010-08-17 11:22:40 +0000 | [diff] [blame] | 44 | apicid_sb700 = apicid_base + 0; |
| 45 | } |