blob: 241e187283c77c00876f21433a6288f76ac98776 [file] [log] [blame]
Wang Qing Pei3f901252010-08-17 11:08:31 +00001/*
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 Pei3f901252010-08-17 11:08:31 +000014 */
15
Wang Qing Pei3f901252010-08-17 11:08:31 +000016#include <device/pci.h>
Wang Qing Pei3f901252010-08-17 11:08:31 +000017#include <string.h>
18#include <stdint.h>
19#include <stdlib.h>
Wang Qing Pei3f901252010-08-17 11:08:31 +000020#include <cpu/amd/multicore.h>
Wang Qing Pei3f901252010-08-17 11:08:31 +000021
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 Pei3f901252010-08-17 11:08:31 +000027u32 apicid_sb700;
28
Wang Qing Pei3f901252010-08-17 11:08:31 +000029
Wang Qing Pei3f901252010-08-17 11:08:31 +000030void get_bus_conf(void)
31{
32 u32 apicid_base;
Wang Qing Pei3f901252010-08-17 11:08:31 +000033
Kyösti Mälkki8803b212019-01-03 11:39:07 +020034 get_default_pci1234(1);
Wang Qing Pei3f901252010-08-17 11:08:31 +000035
36 sysconf.sbdn = (sysconf.hcdn[0] & 0xff);
Kyösti Mälkkiee7e1302019-01-03 11:39:03 +020037 pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff;
Wang Qing Pei3f901252010-08-17 11:08:31 +000038
Wang Qing Pei3f901252010-08-17 11:08:31 +000039 /* I/O APICs: APIC ID Version State Address */
Julius Wernercd49cce2019-03-05 16:53:33 -080040 if (CONFIG(LOGICAL_CPUS))
Timothy Pearsond4bbfe82015-10-27 16:48:36 -050041 apicid_base = get_apicid_base(1);
42 else
43 apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
Wang Qing Pei3f901252010-08-17 11:08:31 +000044 apicid_sb700 = apicid_base + 0;
45}