AMD SB800: Drop component prefix from filenames.
[coreboot.git] / src / southbridge / amd / cimx_wrapper / sb800 / early.c
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.
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 //#include <config.h>
21 #include <stdint.h>
22 #include <device/pci_ids.h>
23 #include <arch/io.h>
24 #include <arch/romcc_io.h>
25 #include <southbridge/amd/cimx_wrapper/sb800/SBPLATFORM.h>
26 #include <southbridge/amd/cimx_wrapper/sb800/SbEarly.h>
27 #include <southbridge/amd/cimx_wrapper/sb800/cfg.h>
28
29 /**
30  * @brief Get SouthBridge device number
31  * @param[in] bus target bus number
32  * @return southbridge device number
33  */
34 u32 get_sbdn(u32 bus)
35 {
36         device_t dev;
37
38         //dev = PCI_DEV(bus, 0x14, 0);
39         dev = pci_locate_device_on_bus(
40                         PCI_ID(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SB800_SM),
41                         bus);
42
43         return (dev >> 15) & 0x1f;
44 }
45
46 /**
47  * @brief South Bridge CIMx romstage entry,
48  *        wrapper of sbPowerOnInit entry point.
49  */
50 void sb_poweron_init(void)
51 {
52         AMDSBCFG sb_early_cfg;
53
54         sb800_cimx_config(&sb_early_cfg);
55         //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
56         //AmdSbDispatcher(&sb_early_cfg);
57         //TODO
58         //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
59         // VerifyImage() will fail, LocateImage() take minitues to find the image.
60         sbPowerOnInit(&sb_early_cfg);
61 }