blob: c69782bc62d61475153e2e89020f15b64590e08f [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 <device/device.h> /* device_t */
22#include <device/pci.h> /* device_operations */
23#include <device/pci_ids.h>
Kerry She991f8802011-06-01 01:56:49 +000024#include <arch/ioapic.h>
Frank Vibrans63e62b02011-02-14 18:38:14 +000025#include <device/smbus.h> /* smbus_bus_operations */
26#include <console/console.h> /* printk */
zbao9bcdbf82012-04-05 13:18:49 +080027#include <arch/acpi.h>
Frank Vibrans63e62b02011-02-14 18:38:14 +000028#include "lpc.h" /* lpc_read_resources */
29#include "SBPLATFORM.h" /* Platfrom Specific Definitions */
30#include "cfg.h" /* sb800 Cimx configuration */
efdesign9805a89ab2011-06-20 17:38:49 -070031#include "chip.h" /* struct southbridge_amd_cimx_sb800_config */
Kerry Shefeed3292011-08-18 18:03:44 +080032#include "sb_cimx.h" /* AMD CIMX wrapper entries */
Frank Vibrans63e62b02011-02-14 18:38:14 +000033
34
35/*implement in mainboard.c*/
Frank Vibrans63e62b02011-02-14 18:38:14 +000036void set_pcie_reset(void);
37void set_pcie_dereset(void);
38
39
Frank Vibrans63e62b02011-02-14 18:38:14 +000040static AMDSBCFG sb_late_cfg; //global, init in sb800_cimx_config
41static AMDSBCFG *sb_config = &sb_late_cfg;
42
43
44/**
45 * @brief Entry point of Southbridge CIMx callout
46 *
47 * prototype UINT32 (*SBCIM_HOOK_ENTRY)(UINT32 Param1, UINT32 Param2, void* pConfig)
48 *
49 * @param[in] func Southbridge CIMx Function ID.
50 * @param[in] data Southbridge Input Data.
51 * @param[in] sb_config Southbridge configuration structure pointer.
52 *
53 */
54u32 sb800_callout_entry(u32 func, u32 data, void* config)
55{
56 u32 ret = 0;
Kerry Shefeed3292011-08-18 18:03:44 +080057 printk(BIOS_DEBUG, "SB800 - Late.c - %s - Start.\n", __func__);
Frank Vibrans63e62b02011-02-14 18:38:14 +000058 switch (func) {
59 case CB_SBGPP_RESET_ASSERT:
Frank Vibrans63e62b02011-02-14 18:38:14 +000060 set_pcie_reset();
61 break;
62
63 case CB_SBGPP_RESET_DEASSERT:
Frank Vibrans63e62b02011-02-14 18:38:14 +000064 set_pcie_dereset();
65 break;
66
67 case IMC_FIRMWARE_FAIL:
68 break;
69
70 default:
71 break;
72 }
73
Kerry Shefeed3292011-08-18 18:03:44 +080074 printk(BIOS_DEBUG, "SB800 - Late.c - %s - End.\n", __func__);
Frank Vibrans63e62b02011-02-14 18:38:14 +000075 return ret;
76}
77
Kerry Sheh0e6344e2011-10-12 11:42:59 +080078#define HOST_CAP 0x00 /* host capabilities */
79#define HOST_CTL 0x04 /* global host control */
80#define HOST_IRQ_STAT 0x08 /* interrupt status */
81#define HOST_PORTS_IMPL 0x0c /* bitmap of implemented ports */
82
83#define HOST_CTL_AHCI_EN (1 << 31) /* AHCI enabled */
84static void ahci_raid_init(struct device *dev)
85{
86 u8 irq = 0;
87 u32 bar5, caps, ports, val;
88
89 val = pci_read_config16(dev, PCI_CLASS_DEVICE);
90 if (val == PCI_CLASS_STORAGE_SATA) {
91 printk(BIOS_DEBUG, "AHCI controller ");
92 } else if (val == PCI_CLASS_STORAGE_RAID) {
93 printk(BIOS_DEBUG, "RAID controller ");
94 } else {
95 printk(BIOS_WARNING, "device class:%x, neither in ahci or raid mode\n", val);
96 return;
97 }
98
99 irq = pci_read_config8(dev, PCI_INTERRUPT_LINE);
100 bar5 = pci_read_config32(dev, PCI_BASE_ADDRESS_5);
101 printk(BIOS_DEBUG, "IOMEM base: 0x%X, IRQ: 0x%X\n", bar5, irq);
102
103 caps = *(volatile u32 *)(bar5 + HOST_CAP);
104 caps = (caps & 0x1F) + 1;
105 ports= *(volatile u32 *)(bar5 + HOST_PORTS_IMPL);
106 printk(BIOS_DEBUG, "Number of Ports: 0x%x, Port implemented(bit map): 0x%x\n", caps, ports);
107
108 /* make sure ahci is enabled */
109 val = *(volatile u32 *)(bar5 + HOST_CTL);
110 if (!(val & HOST_CTL_AHCI_EN)) {
111 *(volatile u32 *)(bar5 + HOST_CTL) = val | HOST_CTL_AHCI_EN;
112 }
113
114 dev->command |= PCI_COMMAND_MASTER;
115 pci_write_config8(dev, PCI_COMMAND, dev->command);
116 printk(BIOS_DEBUG, "AHCI/RAID controller initialized\n");
117}
Frank Vibrans63e62b02011-02-14 18:38:14 +0000118
119static struct pci_operations lops_pci = {
Kerry Shefeed3292011-08-18 18:03:44 +0800120 .set_subsystem = pci_dev_set_subsystem,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000121};
122
Frank Vibrans63e62b02011-02-14 18:38:14 +0000123static struct device_operations lpc_ops = {
124 .read_resources = lpc_read_resources,
125 .set_resources = lpc_set_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800126 .enable_resources = pci_dev_enable_resources,
127 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000128 .scan_bus = scan_static_bus,
129 .ops_pci = &lops_pci,
130};
131
132static const struct pci_driver lpc_driver __pci_driver = {
133 .ops = &lpc_ops,
134 .vendor = PCI_VENDOR_ID_ATI,
135 .device = PCI_DEVICE_ID_ATI_SB800_LPC,
136};
137
Frank Vibrans63e62b02011-02-14 18:38:14 +0000138static struct device_operations sata_ops = {
139 .read_resources = pci_dev_read_resources,
140 .set_resources = pci_dev_set_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800141 .enable_resources = pci_dev_enable_resources,
Kerry Sheh0e6344e2011-10-12 11:42:59 +0800142 .init = ahci_raid_init,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000143 .scan_bus = 0,
144 .ops_pci = &lops_pci,
145};
146
Kerry Sheh0e6344e2011-10-12 11:42:59 +0800147static const struct pci_driver ahci_driver __pci_driver = {
Frank Vibrans63e62b02011-02-14 18:38:14 +0000148 .ops = &sata_ops,
149 .vendor = PCI_VENDOR_ID_ATI,
Scott Duplichanf191c722011-05-15 21:38:08 +0000150 .device = PCI_DEVICE_ID_ATI_SB800_SATA_AHCI,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000151};
152
Kerry Sheh0e6344e2011-10-12 11:42:59 +0800153static const struct pci_driver raid_driver __pci_driver = {
154 .ops = &sata_ops,
155 .vendor = PCI_VENDOR_ID_ATI,
156 .device = PCI_DEVICE_ID_ATI_SB800_SATA_RAID,
157};
158static const struct pci_driver raid5_driver __pci_driver = {
159 .ops = &sata_ops,
160 .vendor = PCI_VENDOR_ID_ATI,
161 .device = PCI_DEVICE_ID_ATI_SB800_SATA_RAID5,
162};
163
Kerry Shefeed3292011-08-18 18:03:44 +0800164#if CONFIG_USBDEBUG == 1
Frank Vibrans63e62b02011-02-14 18:38:14 +0000165static void usb_set_resources(struct device *dev)
166{
167 struct resource *res;
168 u32 base;
169 u32 old_debug;
170
Kerry Shefeed3292011-08-18 18:03:44 +0800171 printk(BIOS_DEBUG, "SB800 - Late.c - %s - Start.\n", __func__);
Frank Vibrans63e62b02011-02-14 18:38:14 +0000172 old_debug = get_ehci_debug();
173 set_ehci_debug(0);
174
175 pci_dev_set_resources(dev);
176
177 res = find_resource(dev, 0x10);
178 set_ehci_debug(old_debug);
179 if (!res)
180 return;
181 base = res->base;
182 set_ehci_base(base);
183 report_resource_stored(dev, res, "");
Kerry Shefeed3292011-08-18 18:03:44 +0800184 printk(BIOS_DEBUG, "SB800 - Late.c - %s - End.\n", __func__);
Frank Vibrans63e62b02011-02-14 18:38:14 +0000185}
186#endif
187
Frank Vibrans63e62b02011-02-14 18:38:14 +0000188static struct device_operations usb_ops = {
189 .read_resources = pci_dev_read_resources,
190#if CONFIG_USBDEBUG
191 .set_resources = usb_set_resources,
192#else
193 .set_resources = pci_dev_set_resources,
194#endif
195 .enable_resources = pci_dev_enable_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800196 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000197 .scan_bus = 0,
198 .ops_pci = &lops_pci,
199};
200
201/*
202 * The pci id of usb ctrl 0 and 1 are the same.
203 */
204static const struct pci_driver usb_ohci123_driver __pci_driver = {
205 .ops = &usb_ops,
206 .vendor = PCI_VENDOR_ID_ATI,
207 .device = PCI_DEVICE_ID_ATI_SB800_USB_18_0, /* OHCI-USB1, OHCI-USB2, OHCI-USB3 */
208};
209
210static const struct pci_driver usb_ehci123_driver __pci_driver = {
211 .ops = &usb_ops,
212 .vendor = PCI_VENDOR_ID_ATI,
213 .device = PCI_DEVICE_ID_ATI_SB800_USB_18_2, /* EHCI-USB1, EHCI-USB2, EHCI-USB3 */
214};
215
216static const struct pci_driver usb_ohci4_driver __pci_driver = {
217 .ops = &usb_ops,
218 .vendor = PCI_VENDOR_ID_ATI,
219 .device = PCI_DEVICE_ID_ATI_SB800_USB_20_5, /* OHCI-USB4 */
220};
221
222
Frank Vibrans63e62b02011-02-14 18:38:14 +0000223static struct device_operations azalia_ops = {
224 .read_resources = pci_dev_read_resources,
225 .set_resources = pci_dev_set_resources,
226 .enable_resources = pci_dev_enable_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800227 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000228 .scan_bus = 0,
229 .ops_pci = &lops_pci,
230};
231
232static const struct pci_driver azalia_driver __pci_driver = {
233 .ops = &azalia_ops,
234 .vendor = PCI_VENDOR_ID_ATI,
235 .device = PCI_DEVICE_ID_ATI_SB800_HDA,
236};
237
238
Frank Vibrans63e62b02011-02-14 18:38:14 +0000239static struct device_operations gec_ops = {
240 .read_resources = pci_dev_read_resources,
241 .set_resources = pci_dev_set_resources,
242 .enable_resources = pci_dev_enable_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800243 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000244 .scan_bus = 0,
245 .ops_pci = &lops_pci,
246};
247
248static const struct pci_driver gec_driver __pci_driver = {
249 .ops = &gec_ops,
250 .vendor = PCI_VENDOR_ID_ATI,
251 .device = PCI_DEVICE_ID_ATI_SB800_GEC,
252};
253
Kerry She3e706b62011-06-24 22:52:15 +0800254/**
255 * @brief Enable PCI Bridge
256 *
257 * PcibConfig [PM_Reg: EAh], PCIDisable [Bit0]
258 * 'PCIDisable' set to 0 to enable P2P bridge.
259 * 'PCIDisable' set to 1 to disable P2P bridge and enable PCI interface pins
260 * to function as GPIO {GPIO 35:0}.
261 */
262static void pci_init(device_t dev)
263{
264 /* PCI Bridge SHOULD be enabled by default according to SB800 rrg,
265 * but actually was disabled in some platform, so I have to enabled it.
266 */
267 RWMEM(ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEA, AccWidthUint8, ~BIT0, 0);
268}
Frank Vibrans63e62b02011-02-14 18:38:14 +0000269
Frank Vibrans63e62b02011-02-14 18:38:14 +0000270
271static struct device_operations pci_ops = {
272 .read_resources = pci_bus_read_resources,
273 .set_resources = pci_dev_set_resources,
274 .enable_resources = pci_bus_enable_resources,
Kerry She3e706b62011-06-24 22:52:15 +0800275 .init = pci_init,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000276 .scan_bus = pci_scan_bridge,
277 .reset_bus = pci_bus_reset,
278 .ops_pci = &lops_pci,
279};
280
281static const struct pci_driver pci_driver __pci_driver = {
282 .ops = &pci_ops,
283 .vendor = PCI_VENDOR_ID_ATI,
284 .device = PCI_DEVICE_ID_ATI_SB800_PCI,
285};
286
287
288struct device_operations bridge_ops = {
289 .read_resources = pci_bus_read_resources,
290 .set_resources = pci_dev_set_resources,
291 .enable_resources = pci_bus_enable_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800292 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000293 .scan_bus = pci_scan_bridge,
294 .enable = 0,
295 .reset_bus = pci_bus_reset,
296 .ops_pci = &lops_pci,
297};
298
299/* 0:15:0 PCIe PortA */
300static const struct pci_driver PORTA_driver __pci_driver = {
301 .ops = &bridge_ops,
302 .vendor = PCI_VENDOR_ID_ATI,
303 .device = PCI_DEVICE_ID_ATI_SB800_PCIEA,
304};
305
306/* 0:15:1 PCIe PortB */
307static const struct pci_driver PORTB_driver __pci_driver = {
308 .ops = &bridge_ops,
309 .vendor = PCI_VENDOR_ID_ATI,
310 .device = PCI_DEVICE_ID_ATI_SB800_PCIEB,
311};
312
313/* 0:15:2 PCIe PortC */
314static const struct pci_driver PORTC_driver __pci_driver = {
315 .ops = &bridge_ops,
316 .vendor = PCI_VENDOR_ID_ATI,
317 .device = PCI_DEVICE_ID_ATI_SB800_PCIEC,
318};
319
320/* 0:15:3 PCIe PortD */
321static const struct pci_driver PORTD_driver __pci_driver = {
322 .ops = &bridge_ops,
323 .vendor = PCI_VENDOR_ID_ATI,
324 .device = PCI_DEVICE_ID_ATI_SB800_PCIED,
325};
326
327
328/**
Kerry Shefeed3292011-08-18 18:03:44 +0800329 * South Bridge CIMx ramstage entry point wrapper.
330 */
331void sb_Before_Pci_Init(void)
332{
333 sb_config->StdHeader.Func = SB_BEFORE_PCI_INIT;
334 AmdSbDispatcher(sb_config);
335}
336
337void sb_After_Pci_Init(void)
338{
339 sb_config->StdHeader.Func = SB_AFTER_PCI_INIT;
340 AmdSbDispatcher(sb_config);
341}
342
343void sb_Mid_Post_Init(void)
344{
345 sb_config->StdHeader.Func = SB_MID_POST_INIT;
346 AmdSbDispatcher(sb_config);
347}
348
349void sb_Late_Post(void)
350{
351 sb_config->StdHeader.Func = SB_LATE_POST_INIT;
352 AmdSbDispatcher(sb_config);
353}
354
zbao9bcdbf82012-04-05 13:18:49 +0800355void sb_Before_Pci_Restore_Init(void)
356{
357 sb_config->StdHeader.Func = SB_BEFORE_PCI_RESTORE_INIT;
358 AmdSbDispatcher(sb_config);
359}
360
361void sb_After_Pci_Restore_Init(void)
362{
363 sb_config->StdHeader.Func = SB_AFTER_PCI_RESTORE_INIT;
364 AmdSbDispatcher(sb_config);
365}
Kerry Shefeed3292011-08-18 18:03:44 +0800366
367/**
Frank Vibrans63e62b02011-02-14 18:38:14 +0000368 * @brief SB Cimx entry point sbBeforePciInit wrapper
369 */
370static void sb800_enable(device_t dev)
371{
efdesign9805a89ab2011-06-20 17:38:49 -0700372 struct southbridge_amd_cimx_sb800_config *sb_chip =
373 (struct southbridge_amd_cimx_sb800_config *)(dev->chip_info);
Frank Vibrans63e62b02011-02-14 18:38:14 +0000374
Frank Vibrans63e62b02011-02-14 18:38:14 +0000375 printk(BIOS_DEBUG, "sb800_enable() ");
376
Frank Vibrans63e62b02011-02-14 18:38:14 +0000377 switch (dev->path.pci.devfn) {
378 case (0x11 << 3) | 0: /* 0:11.0 SATA */
Kerry Shefeed3292011-08-18 18:03:44 +0800379 /* the first sb800 device */
380 sb800_cimx_config(sb_config);
381
Frank Vibrans63e62b02011-02-14 18:38:14 +0000382 if (dev->enabled) {
Kerry She991f8802011-06-01 01:56:49 +0000383 sb_config->SATAMODE.SataMode.SataController = CIMX_OPTION_ENABLED;
Frank Vibrans63e62b02011-02-14 18:38:14 +0000384 if (1 == sb_chip->boot_switch_sata_ide)
385 sb_config->SATAMODE.SataMode.SataIdeCombMdPriSecOpt = 0; //0 -IDE as primary.
386 else if (0 == sb_chip->boot_switch_sata_ide)
387 sb_config->SATAMODE.SataMode.SataIdeCombMdPriSecOpt = 1; //1 -IDE as secondary.
388 } else {
Kerry She991f8802011-06-01 01:56:49 +0000389 sb_config->SATAMODE.SataMode.SataController = CIMX_OPTION_DISABLED;
Frank Vibrans63e62b02011-02-14 18:38:14 +0000390 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000391 break;
392
393 case (0x14 << 3) | 0: /* 0:14:0 SMBUS */
Kerry Shefeed3292011-08-18 18:03:44 +0800394 printk(BIOS_INFO, "sm_init().\n");
395 clear_ioapic(IO_APIC_ADDR);
396 /* I/O APIC IDs are normally limited to 4-bits. Enforce this limit. */
397#if (CONFIG_APIC_ID_OFFSET == 0 && CONFIG_MAX_CPUS * CONFIG_MAX_PHYSICAL_CPUS < 16)
398 /* Assign the ioapic ID the next available number after the processor core local APIC IDs */
399 setup_ioapic(IO_APIC_ADDR, CONFIG_MAX_CPUS * CONFIG_MAX_PHYSICAL_CPUS);
400#elif (CONFIG_APIC_ID_OFFSET > 0)
401 /* Assign the ioapic ID the value 0. Processor APIC IDs follow. */
402 setup_ioapic(IO_APIC_ADDR, 0);
403#else
404#error "The processor APIC IDs must be lifted to make room for the I/O APIC ID"
405#endif
Frank Vibrans63e62b02011-02-14 18:38:14 +0000406 break;
407
408 case (0x14 << 3) | 1: /* 0:14:1 IDE */
Frank Vibrans63e62b02011-02-14 18:38:14 +0000409 break;
410
411 case (0x14 << 3) | 2: /* 0:14:2 HDA */
412 if (dev->enabled) {
413 if (AZALIA_DISABLE == sb_config->AzaliaController) {
414 sb_config->AzaliaController = AZALIA_AUTO;
415 }
416 printk(BIOS_DEBUG, "hda enabled\n");
417 } else {
418 sb_config->AzaliaController = AZALIA_DISABLE;
419 printk(BIOS_DEBUG, "hda disabled\n");
420 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000421 break;
422
423
424 case (0x14 << 3) | 3: /* 0:14:3 LPC */
425 break;
426
427 case (0x14 << 3) | 4: /* 0:14:4 PCI */
428 break;
429
430 case (0x14 << 3) | 6: /* 0:14:6 GEC */
431 if (dev->enabled) {
432 sb_config->GecConfig = 0;
433 printk(BIOS_DEBUG, "gec enabled\n");
434 } else {
435 sb_config->GecConfig = 1;
436 printk(BIOS_DEBUG, "gec disabled\n");
437 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000438 break;
439
440 case (0x15 << 3) | 0: /* 0:15:0 PCIe PortA */
Scott Duplichan8fed77a2011-06-18 10:46:45 -0500441 {
Kerry Shefeed3292011-08-18 18:03:44 +0800442 device_t device;
443 for (device = dev; device; device = device->next) {
444 if (dev->path.type != DEVICE_PATH_PCI) continue;
445 if ((device->path.pci.devfn & ~7) != PCI_DEVFN(0x15,0)) break;
446 sb_config->PORTCONFIG[device->path.pci.devfn & 3].PortCfg.PortPresent = device->enabled;
447 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000448
Kerry Shefeed3292011-08-18 18:03:44 +0800449 /*
450 * GPP_CFGMODE_X4000: PortA Lanes[3:0]
451 * GPP_CFGMODE_X2200: PortA Lanes[1:0], PortB Lanes[3:2]
452 * GPP_CFGMODE_X2110: PortA Lanes[1:0], PortB Lane2, PortC Lane3
453 * GPP_CFGMODE_X1111: PortA Lanes0, PortB Lane1, PortC Lane2, PortD Lane3
454 */
455 sb_config->GppLinkConfig = sb_chip->gpp_configuration;
Scott Duplichan8fed77a2011-06-18 10:46:45 -0500456 }
Kerry Shefeed3292011-08-18 18:03:44 +0800457 break;
458
459 case (0x12 << 3) | 0: /* 0:12:0 OHCI-USB1 */
460 sb_config->USBMODE.UsbMode.Ohci1 = dev->enabled;
461 break;
462 case (0x12 << 3) | 2: /* 0:12:2 EHCI-USB1 */
463 sb_config->USBMODE.UsbMode.Ehci1 = dev->enabled;
464 break;
465 case (0x13 << 3) | 0: /* 0:13:0 OHCI-USB2 */
466 sb_config->USBMODE.UsbMode.Ohci2 = dev->enabled;
467 break;
468 case (0x13 << 3) | 2: /* 0:13:2 EHCI-USB2 */
469 sb_config->USBMODE.UsbMode.Ehci2 = dev->enabled;
470 break;
471 case (0x14 << 3) | 5: /* 0:14:5 OHCI-USB4 */
472 sb_config->USBMODE.UsbMode.Ohci4 = dev->enabled;
473 break;
474 case (0x16 << 3) | 0: /* 0:16:0 OHCI-USB3 */
475 sb_config->USBMODE.UsbMode.Ohci3 = dev->enabled;
476 break;
477 case (0x16 << 3) | 2: /* 0:16:2 EHCI-USB3 */
478 sb_config->USBMODE.UsbMode.Ehci3 = dev->enabled;
479
Kerry Sheh75df1062011-10-10 19:19:46 +0800480 /* call the CIMX entry at the last sb800 device,
481 * so make sure the mainboard devicetree is complete
482 */
zbao9bcdbf82012-04-05 13:18:49 +0800483#if CONFIG_HAVE_ACPI_RESUME == 1
484 if (acpi_slp_type != 3)
485 sb_Before_Pci_Init();
486 else
487 sb_Before_Pci_Restore_Init();
488#else
Kerry Shefeed3292011-08-18 18:03:44 +0800489 sb_Before_Pci_Init();
zbao9bcdbf82012-04-05 13:18:49 +0800490#endif
Kerry Shefeed3292011-08-18 18:03:44 +0800491 break;
Frank Vibrans63e62b02011-02-14 18:38:14 +0000492
493 default:
494 break;
495 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000496}
497
efdesign9805a89ab2011-06-20 17:38:49 -0700498struct chip_operations southbridge_amd_cimx_sb800_ops = {
Frank Vibrans63e62b02011-02-14 18:38:14 +0000499 CHIP_NAME("ATI SB800")
500 .enable_dev = sb800_enable,
501};