2 * This file is part of the coreboot project.
4 * Copyright (C) 2011 Advanced Micro Devices, Inc.
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.
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.
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
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"
28 #include <console/console.h>
29 #include <console/loglevel.h>
34 * @brief Get SouthBridge device number
35 * @param[in] bus target bus number
36 * @return southbridge device number
42 printk(BIOS_INFO, "SB900 - Early.c - get_sbdn - Start.\n");
43 //dev = PCI_DEV(bus, 0x14, 0);
44 dev = pci_locate_device_on_bus(
45 PCI_ID(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_ATI_SB900_SM),
48 printk(BIOS_INFO, "SB900 - Early.c - get_sbdn - End.\n");
49 return (dev >> 15) & 0x1f;
54 * @brief South Bridge CIMx romstage entry,
55 * wrapper of sbPowerOnInit entry point.
57 void sb_poweron_init(void)
59 AMDSBCFG sb_early_cfg;
62 printk(BIOS_INFO, "SB900 - Early.c - sb_poweron_init - Start.\n");
64 //Enable/Disable PCI Bridge Device 14 Function 4.
68 if(!CONFIG_PCIB_ENABLE) {
73 SbPowerOnInit_Config(&sb_early_cfg);
74 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
75 //AmdSbDispatcher(&sb_early_cfg);
77 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
78 // VerifyImage() will fail, LocateImage() take minitues to find the image.
79 sbPowerOnInit(&sb_early_cfg);
80 printk(BIOS_INFO, "SB900 - Early.c - sb_poweron_init - End.\n");
84 * @brief South Bridge CIMx romstage entry,
85 * wrapper of sbPowerOnInit entry point.
87 void sb_before_pci_init(void)
89 AMDSBCFG sb_early_cfg;
91 printk(BIOS_INFO, "SB900 - Early.c - sb_before_pci_init - Start.\n");
92 sb900_cimx_config(&sb_early_cfg);
93 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
94 //AmdSbDispatcher(&sb_early_cfg);
96 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
97 // VerifyImage() will fail, LocateImage() take minitues to find the image.
98 sbBeforePciInit(&sb_early_cfg);
99 printk(BIOS_INFO, "SB900 - Early.c - sb_before_pci_init - End.\n");
102 void sb_After_Pci_Init(void)
104 AMDSBCFG sb_early_cfg;
106 printk(BIOS_INFO, "SB900 - Early.c - sb_After_Pci_Init - Start.\n");
107 sb900_cimx_config(&sb_early_cfg);
108 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
109 //AmdSbDispatcher(&sb_early_cfg);
111 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
112 // VerifyImage() will fail, LocateImage() take minitues to find the image.
113 sbAfterPciInit(&sb_early_cfg);
114 printk(BIOS_INFO, "SB900 - Early.c - sb_After_Pci_Init - End.\n");
117 void sb_Mid_Post_Init(void)
119 AMDSBCFG sb_early_cfg;
121 printk(BIOS_INFO, "SB900 - Early.c - sb_Mid_Post_Init - Start.\n");
122 sb900_cimx_config(&sb_early_cfg);
123 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
124 //AmdSbDispatcher(&sb_early_cfg);
126 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
127 // VerifyImage() will fail, LocateImage() take minitues to find the image.
128 sbMidPostInit(&sb_early_cfg);
129 printk(BIOS_INFO, "SB900 - Early.c - sb_Mid_Post_Init - End.\n");
132 void sb_Late_Post(void)
134 AMDSBCFG sb_early_cfg;
137 printk(BIOS_INFO, "SB900 - Early.c - sb_Late_Post - Start.\n");
138 sb900_cimx_config(&sb_early_cfg);
139 //sb_early_cfg.StdHeader.Func = SB_POWERON_INIT;
140 //AmdSbDispatcher(&sb_early_cfg);
142 //AMD_IMAGE_HEADER was missing, when using AmdSbDispatcher,
143 // VerifyImage() will fail, LocateImage() take minitues to find the image.
144 sbLatePost(&sb_early_cfg);
146 //Set ACPI SCI IRQ to 0x9.
147 data = CONFIG_ACPI_SCI_IRQ;
155 data |= (1 << (CONFIG_ACPI_SCI_IRQ - 8));
159 data |= (1 << (CONFIG_ACPI_SCI_IRQ));
163 printk(BIOS_INFO, "SB900 - Early.c - sb_Late_Post - End.\n");