blob: 799455f620fca3c0234030049ba001cbc8e285de [file] [log] [blame]
Zheng Bao8210e892011-01-20 05:29:37 +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.
Zheng Bao8210e892011-01-20 05:29:37 +000014 */
15
Zheng Bao8210e892011-01-20 05:29:37 +000016#include <device/pci.h>
Zheng Bao8210e892011-01-20 05:29:37 +000017#include <string.h>
18#include <stdint.h>
19#include <stdlib.h>
Zheng Bao8210e892011-01-20 05:29:37 +000020#include <cpu/amd/multicore.h>
Zheng Bao8210e892011-01-20 05:29:37 +000021#include <cpu/amd/amdfam10_sysconf.h>
22
23/* Global variables for MB layouts and these will be shared by irqtable mptable
24* and acpi_tables busnum is default.
25*/
Zheng Bao8210e892011-01-20 05:29:37 +000026u32 apicid_sb800;
27
Zheng Bao8210e892011-01-20 05:29:37 +000028void get_bus_conf(void)
29{
30 u32 apicid_base;
Zheng Bao8210e892011-01-20 05:29:37 +000031
Kyösti Mälkki8803b212019-01-03 11:39:07 +020032 get_default_pci1234(1);
Zheng Bao8210e892011-01-20 05:29:37 +000033
34 sysconf.sbdn = (sysconf.hcdn[0] & 0xff);
Zheng Bao8210e892011-01-20 05:29:37 +000035
Kyösti Mälkkibf2d2272019-01-03 11:39:01 +020036 pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff;
Zheng Bao8210e892011-01-20 05:29:37 +000037
Zheng Bao8210e892011-01-20 05:29:37 +000038 /* I/O APICs: APIC ID Version State Address */
Timothy Pearsond4bbfe82015-10-27 16:48:36 -050039 if (IS_ENABLED(CONFIG_LOGICAL_CPUS))
40 apicid_base = get_apicid_base(1);
41 else
42 apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
Zheng Bao8210e892011-01-20 05:29:37 +000043 apicid_sb800 = apicid_base + 0;
44}