blob: 40a18ccd4cec3e47e922240accacf380b7a6c541 [file] [log] [blame]
Frank Vibrans63e62b02011-02-14 18:38:14 +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
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20
21//#include <config.h>
22#include <stdint.h>
23#include <device/pci_ids.h>
24#include <arch/io.h> /* inl, outl */
25#include <arch/romcc_io.h> /* device_t */
26#include "SBPLATFORM.h"
27#include "SbEarly.h"
28#include "cfg.h" /*sb800_cimx_config*/
29
30
31/**
32 * @brief Get SouthBridge device number
33 * @param[in] bus target bus number
34 * @return southbridge device number
35 */
36u32 get_sbdn(u32 bus)
37{
38 device_t dev;
39
40 //dev = PCI_DEV(bus, 0x14, 0);
41 dev = pci_locate_device_on_bus(
42 PCI_ID(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SB800_SM),
43 bus);
44
45 return (dev >> 15) & 0x1f;
46}
47
48
49/**
50 * @brief South Bridge CIMx romstage entry,
51 * wrapper of sbPowerOnInit entry point.
52 */
53void sb_poweron_init(void)
54{
55 AMDSBCFG sb_early_cfg;
56
57 sb800_cimx_config(&sb_early_cfg);
58 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
59 //AmdSbDispatcher(&sb_early_cfg);
60 //TODO
61 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
62 // VerifyImage() will fail, LocateImage() take minitues to find the image.
63 sbPowerOnInit(&sb_early_cfg);
64}