blob: 7286a6d16df0a224463e43ff3c40980e55acdaf2 [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 */
zbao366f0fc2012-08-03 16:58:53 +080026#include <pc80/mc146818rtc.h>
Frank Vibrans63e62b02011-02-14 18:38:14 +000027#include <console/console.h> /* printk */
zbao9bcdbf82012-04-05 13:18:49 +080028#include <arch/acpi.h>
Frank Vibrans63e62b02011-02-14 18:38:14 +000029#include "lpc.h" /* lpc_read_resources */
30#include "SBPLATFORM.h" /* Platfrom Specific Definitions */
31#include "cfg.h" /* sb800 Cimx configuration */
efdesign9805a89ab2011-06-20 17:38:49 -070032#include "chip.h" /* struct southbridge_amd_cimx_sb800_config */
Kerry Shefeed3292011-08-18 18:03:44 +080033#include "sb_cimx.h" /* AMD CIMX wrapper entries */
Frank Vibrans63e62b02011-02-14 18:38:14 +000034
35
36/*implement in mainboard.c*/
Frank Vibrans63e62b02011-02-14 18:38:14 +000037void set_pcie_reset(void);
38void set_pcie_dereset(void);
39
40
Frank Vibrans63e62b02011-02-14 18:38:14 +000041static AMDSBCFG sb_late_cfg; //global, init in sb800_cimx_config
42static AMDSBCFG *sb_config = &sb_late_cfg;
43
44
45/**
46 * @brief Entry point of Southbridge CIMx callout
47 *
48 * prototype UINT32 (*SBCIM_HOOK_ENTRY)(UINT32 Param1, UINT32 Param2, void* pConfig)
49 *
50 * @param[in] func Southbridge CIMx Function ID.
51 * @param[in] data Southbridge Input Data.
52 * @param[in] sb_config Southbridge configuration structure pointer.
53 *
54 */
55u32 sb800_callout_entry(u32 func, u32 data, void* config)
56{
57 u32 ret = 0;
Kerry Shefeed3292011-08-18 18:03:44 +080058 printk(BIOS_DEBUG, "SB800 - Late.c - %s - Start.\n", __func__);
Frank Vibrans63e62b02011-02-14 18:38:14 +000059 switch (func) {
60 case CB_SBGPP_RESET_ASSERT:
Frank Vibrans63e62b02011-02-14 18:38:14 +000061 set_pcie_reset();
62 break;
63
64 case CB_SBGPP_RESET_DEASSERT:
Frank Vibrans63e62b02011-02-14 18:38:14 +000065 set_pcie_dereset();
66 break;
67
68 case IMC_FIRMWARE_FAIL:
69 break;
70
71 default:
72 break;
73 }
74
Kerry Shefeed3292011-08-18 18:03:44 +080075 printk(BIOS_DEBUG, "SB800 - Late.c - %s - End.\n", __func__);
Frank Vibrans63e62b02011-02-14 18:38:14 +000076 return ret;
77}
78
Kerry Sheh0e6344e2011-10-12 11:42:59 +080079#define HOST_CAP 0x00 /* host capabilities */
80#define HOST_CTL 0x04 /* global host control */
81#define HOST_IRQ_STAT 0x08 /* interrupt status */
82#define HOST_PORTS_IMPL 0x0c /* bitmap of implemented ports */
83
84#define HOST_CTL_AHCI_EN (1 << 31) /* AHCI enabled */
85static void ahci_raid_init(struct device *dev)
86{
87 u8 irq = 0;
88 u32 bar5, caps, ports, val;
89
90 val = pci_read_config16(dev, PCI_CLASS_DEVICE);
91 if (val == PCI_CLASS_STORAGE_SATA) {
92 printk(BIOS_DEBUG, "AHCI controller ");
93 } else if (val == PCI_CLASS_STORAGE_RAID) {
94 printk(BIOS_DEBUG, "RAID controller ");
95 } else {
96 printk(BIOS_WARNING, "device class:%x, neither in ahci or raid mode\n", val);
97 return;
98 }
99
100 irq = pci_read_config8(dev, PCI_INTERRUPT_LINE);
101 bar5 = pci_read_config32(dev, PCI_BASE_ADDRESS_5);
102 printk(BIOS_DEBUG, "IOMEM base: 0x%X, IRQ: 0x%X\n", bar5, irq);
103
104 caps = *(volatile u32 *)(bar5 + HOST_CAP);
105 caps = (caps & 0x1F) + 1;
106 ports= *(volatile u32 *)(bar5 + HOST_PORTS_IMPL);
107 printk(BIOS_DEBUG, "Number of Ports: 0x%x, Port implemented(bit map): 0x%x\n", caps, ports);
108
109 /* make sure ahci is enabled */
110 val = *(volatile u32 *)(bar5 + HOST_CTL);
111 if (!(val & HOST_CTL_AHCI_EN)) {
112 *(volatile u32 *)(bar5 + HOST_CTL) = val | HOST_CTL_AHCI_EN;
113 }
114
115 dev->command |= PCI_COMMAND_MASTER;
116 pci_write_config8(dev, PCI_COMMAND, dev->command);
117 printk(BIOS_DEBUG, "AHCI/RAID controller initialized\n");
118}
Frank Vibrans63e62b02011-02-14 18:38:14 +0000119
120static struct pci_operations lops_pci = {
Kerry Shefeed3292011-08-18 18:03:44 +0800121 .set_subsystem = pci_dev_set_subsystem,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000122};
123
zbao366f0fc2012-08-03 16:58:53 +0800124static void lpc_init(device_t dev)
125{
126 printk(BIOS_DEBUG, "SB800 - Late.c - lpc_init - Start.\n");
127
128 rtc_check_update_cmos_date(RTC_HAS_ALTCENTURY);
129
130 printk(BIOS_DEBUG, "SB800 - Late.c - lpc_init - End.\n");
131}
132
Frank Vibrans63e62b02011-02-14 18:38:14 +0000133static struct device_operations lpc_ops = {
134 .read_resources = lpc_read_resources,
135 .set_resources = lpc_set_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800136 .enable_resources = pci_dev_enable_resources,
zbao366f0fc2012-08-03 16:58:53 +0800137 .init = lpc_init,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000138 .scan_bus = scan_static_bus,
139 .ops_pci = &lops_pci,
140};
141
142static const struct pci_driver lpc_driver __pci_driver = {
143 .ops = &lpc_ops,
144 .vendor = PCI_VENDOR_ID_ATI,
145 .device = PCI_DEVICE_ID_ATI_SB800_LPC,
146};
147
Frank Vibrans63e62b02011-02-14 18:38:14 +0000148static struct device_operations sata_ops = {
149 .read_resources = pci_dev_read_resources,
150 .set_resources = pci_dev_set_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800151 .enable_resources = pci_dev_enable_resources,
Kerry Sheh0e6344e2011-10-12 11:42:59 +0800152 .init = ahci_raid_init,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000153 .scan_bus = 0,
154 .ops_pci = &lops_pci,
155};
156
Kerry Sheh0e6344e2011-10-12 11:42:59 +0800157static const struct pci_driver ahci_driver __pci_driver = {
Frank Vibrans63e62b02011-02-14 18:38:14 +0000158 .ops = &sata_ops,
159 .vendor = PCI_VENDOR_ID_ATI,
Scott Duplichanf191c722011-05-15 21:38:08 +0000160 .device = PCI_DEVICE_ID_ATI_SB800_SATA_AHCI,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000161};
162
Kerry Sheh0e6344e2011-10-12 11:42:59 +0800163static const struct pci_driver raid_driver __pci_driver = {
164 .ops = &sata_ops,
165 .vendor = PCI_VENDOR_ID_ATI,
166 .device = PCI_DEVICE_ID_ATI_SB800_SATA_RAID,
167};
168static const struct pci_driver raid5_driver __pci_driver = {
169 .ops = &sata_ops,
170 .vendor = PCI_VENDOR_ID_ATI,
171 .device = PCI_DEVICE_ID_ATI_SB800_SATA_RAID5,
172};
173
Patrick Georgie1667822012-05-05 15:29:32 +0200174#if CONFIG_USBDEBUG
Frank Vibrans63e62b02011-02-14 18:38:14 +0000175static void usb_set_resources(struct device *dev)
176{
177 struct resource *res;
178 u32 base;
179 u32 old_debug;
180
Kerry Shefeed3292011-08-18 18:03:44 +0800181 printk(BIOS_DEBUG, "SB800 - Late.c - %s - Start.\n", __func__);
Frank Vibrans63e62b02011-02-14 18:38:14 +0000182 old_debug = get_ehci_debug();
183 set_ehci_debug(0);
184
185 pci_dev_set_resources(dev);
186
187 res = find_resource(dev, 0x10);
188 set_ehci_debug(old_debug);
189 if (!res)
190 return;
191 base = res->base;
192 set_ehci_base(base);
193 report_resource_stored(dev, res, "");
Kerry Shefeed3292011-08-18 18:03:44 +0800194 printk(BIOS_DEBUG, "SB800 - Late.c - %s - End.\n", __func__);
Frank Vibrans63e62b02011-02-14 18:38:14 +0000195}
196#endif
197
Frank Vibrans63e62b02011-02-14 18:38:14 +0000198static struct device_operations usb_ops = {
199 .read_resources = pci_dev_read_resources,
200#if CONFIG_USBDEBUG
201 .set_resources = usb_set_resources,
202#else
203 .set_resources = pci_dev_set_resources,
204#endif
205 .enable_resources = pci_dev_enable_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800206 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000207 .scan_bus = 0,
208 .ops_pci = &lops_pci,
209};
210
211/*
212 * The pci id of usb ctrl 0 and 1 are the same.
213 */
214static const struct pci_driver usb_ohci123_driver __pci_driver = {
215 .ops = &usb_ops,
216 .vendor = PCI_VENDOR_ID_ATI,
217 .device = PCI_DEVICE_ID_ATI_SB800_USB_18_0, /* OHCI-USB1, OHCI-USB2, OHCI-USB3 */
218};
219
220static const struct pci_driver usb_ehci123_driver __pci_driver = {
221 .ops = &usb_ops,
222 .vendor = PCI_VENDOR_ID_ATI,
223 .device = PCI_DEVICE_ID_ATI_SB800_USB_18_2, /* EHCI-USB1, EHCI-USB2, EHCI-USB3 */
224};
225
226static const struct pci_driver usb_ohci4_driver __pci_driver = {
227 .ops = &usb_ops,
228 .vendor = PCI_VENDOR_ID_ATI,
229 .device = PCI_DEVICE_ID_ATI_SB800_USB_20_5, /* OHCI-USB4 */
230};
231
232
Frank Vibrans63e62b02011-02-14 18:38:14 +0000233static struct device_operations azalia_ops = {
234 .read_resources = pci_dev_read_resources,
235 .set_resources = pci_dev_set_resources,
236 .enable_resources = pci_dev_enable_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800237 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000238 .scan_bus = 0,
239 .ops_pci = &lops_pci,
240};
241
242static const struct pci_driver azalia_driver __pci_driver = {
243 .ops = &azalia_ops,
244 .vendor = PCI_VENDOR_ID_ATI,
245 .device = PCI_DEVICE_ID_ATI_SB800_HDA,
246};
247
248
Frank Vibrans63e62b02011-02-14 18:38:14 +0000249static struct device_operations gec_ops = {
250 .read_resources = pci_dev_read_resources,
251 .set_resources = pci_dev_set_resources,
252 .enable_resources = pci_dev_enable_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800253 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000254 .scan_bus = 0,
255 .ops_pci = &lops_pci,
256};
257
258static const struct pci_driver gec_driver __pci_driver = {
259 .ops = &gec_ops,
260 .vendor = PCI_VENDOR_ID_ATI,
261 .device = PCI_DEVICE_ID_ATI_SB800_GEC,
262};
263
Kerry She3e706b62011-06-24 22:52:15 +0800264/**
265 * @brief Enable PCI Bridge
266 *
267 * PcibConfig [PM_Reg: EAh], PCIDisable [Bit0]
268 * 'PCIDisable' set to 0 to enable P2P bridge.
269 * 'PCIDisable' set to 1 to disable P2P bridge and enable PCI interface pins
270 * to function as GPIO {GPIO 35:0}.
271 */
272static void pci_init(device_t dev)
273{
274 /* PCI Bridge SHOULD be enabled by default according to SB800 rrg,
275 * but actually was disabled in some platform, so I have to enabled it.
276 */
277 RWMEM(ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEA, AccWidthUint8, ~BIT0, 0);
278}
Frank Vibrans63e62b02011-02-14 18:38:14 +0000279
Frank Vibrans63e62b02011-02-14 18:38:14 +0000280
281static struct device_operations pci_ops = {
282 .read_resources = pci_bus_read_resources,
283 .set_resources = pci_dev_set_resources,
284 .enable_resources = pci_bus_enable_resources,
Kerry She3e706b62011-06-24 22:52:15 +0800285 .init = pci_init,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000286 .scan_bus = pci_scan_bridge,
287 .reset_bus = pci_bus_reset,
288 .ops_pci = &lops_pci,
289};
290
291static const struct pci_driver pci_driver __pci_driver = {
292 .ops = &pci_ops,
293 .vendor = PCI_VENDOR_ID_ATI,
294 .device = PCI_DEVICE_ID_ATI_SB800_PCI,
295};
296
297
298struct device_operations bridge_ops = {
299 .read_resources = pci_bus_read_resources,
300 .set_resources = pci_dev_set_resources,
301 .enable_resources = pci_bus_enable_resources,
Kerry Shefeed3292011-08-18 18:03:44 +0800302 .init = 0,
Frank Vibrans63e62b02011-02-14 18:38:14 +0000303 .scan_bus = pci_scan_bridge,
304 .enable = 0,
305 .reset_bus = pci_bus_reset,
306 .ops_pci = &lops_pci,
307};
308
309/* 0:15:0 PCIe PortA */
310static const struct pci_driver PORTA_driver __pci_driver = {
311 .ops = &bridge_ops,
312 .vendor = PCI_VENDOR_ID_ATI,
313 .device = PCI_DEVICE_ID_ATI_SB800_PCIEA,
314};
315
316/* 0:15:1 PCIe PortB */
317static const struct pci_driver PORTB_driver __pci_driver = {
318 .ops = &bridge_ops,
319 .vendor = PCI_VENDOR_ID_ATI,
320 .device = PCI_DEVICE_ID_ATI_SB800_PCIEB,
321};
322
323/* 0:15:2 PCIe PortC */
324static const struct pci_driver PORTC_driver __pci_driver = {
325 .ops = &bridge_ops,
326 .vendor = PCI_VENDOR_ID_ATI,
327 .device = PCI_DEVICE_ID_ATI_SB800_PCIEC,
328};
329
330/* 0:15:3 PCIe PortD */
331static const struct pci_driver PORTD_driver __pci_driver = {
332 .ops = &bridge_ops,
333 .vendor = PCI_VENDOR_ID_ATI,
334 .device = PCI_DEVICE_ID_ATI_SB800_PCIED,
335};
336
337
338/**
Kerry Shefeed3292011-08-18 18:03:44 +0800339 * South Bridge CIMx ramstage entry point wrapper.
340 */
341void sb_Before_Pci_Init(void)
342{
343 sb_config->StdHeader.Func = SB_BEFORE_PCI_INIT;
344 AmdSbDispatcher(sb_config);
345}
346
347void sb_After_Pci_Init(void)
348{
349 sb_config->StdHeader.Func = SB_AFTER_PCI_INIT;
350 AmdSbDispatcher(sb_config);
351}
352
353void sb_Mid_Post_Init(void)
354{
355 sb_config->StdHeader.Func = SB_MID_POST_INIT;
356 AmdSbDispatcher(sb_config);
357}
358
359void sb_Late_Post(void)
360{
361 sb_config->StdHeader.Func = SB_LATE_POST_INIT;
362 AmdSbDispatcher(sb_config);
363}
364
zbao9bcdbf82012-04-05 13:18:49 +0800365void sb_Before_Pci_Restore_Init(void)
366{
367 sb_config->StdHeader.Func = SB_BEFORE_PCI_RESTORE_INIT;
368 AmdSbDispatcher(sb_config);
369}
370
371void sb_After_Pci_Restore_Init(void)
372{
373 sb_config->StdHeader.Func = SB_AFTER_PCI_RESTORE_INIT;
374 AmdSbDispatcher(sb_config);
375}
Kerry Shefeed3292011-08-18 18:03:44 +0800376
377/**
Frank Vibrans63e62b02011-02-14 18:38:14 +0000378 * @brief SB Cimx entry point sbBeforePciInit wrapper
379 */
380static void sb800_enable(device_t dev)
381{
efdesign9805a89ab2011-06-20 17:38:49 -0700382 struct southbridge_amd_cimx_sb800_config *sb_chip =
383 (struct southbridge_amd_cimx_sb800_config *)(dev->chip_info);
Frank Vibrans63e62b02011-02-14 18:38:14 +0000384
Frank Vibrans63e62b02011-02-14 18:38:14 +0000385 printk(BIOS_DEBUG, "sb800_enable() ");
386
Frank Vibrans63e62b02011-02-14 18:38:14 +0000387 switch (dev->path.pci.devfn) {
388 case (0x11 << 3) | 0: /* 0:11.0 SATA */
Kerry Shefeed3292011-08-18 18:03:44 +0800389 /* the first sb800 device */
390 sb800_cimx_config(sb_config);
391
Frank Vibrans63e62b02011-02-14 18:38:14 +0000392 if (dev->enabled) {
Kerry She991f8802011-06-01 01:56:49 +0000393 sb_config->SATAMODE.SataMode.SataController = CIMX_OPTION_ENABLED;
Frank Vibrans63e62b02011-02-14 18:38:14 +0000394 if (1 == sb_chip->boot_switch_sata_ide)
395 sb_config->SATAMODE.SataMode.SataIdeCombMdPriSecOpt = 0; //0 -IDE as primary.
396 else if (0 == sb_chip->boot_switch_sata_ide)
397 sb_config->SATAMODE.SataMode.SataIdeCombMdPriSecOpt = 1; //1 -IDE as secondary.
398 } else {
Kerry She991f8802011-06-01 01:56:49 +0000399 sb_config->SATAMODE.SataMode.SataController = CIMX_OPTION_DISABLED;
Frank Vibrans63e62b02011-02-14 18:38:14 +0000400 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000401 break;
402
403 case (0x14 << 3) | 0: /* 0:14:0 SMBUS */
Kerry Shefeed3292011-08-18 18:03:44 +0800404 printk(BIOS_INFO, "sm_init().\n");
405 clear_ioapic(IO_APIC_ADDR);
406 /* I/O APIC IDs are normally limited to 4-bits. Enforce this limit. */
407#if (CONFIG_APIC_ID_OFFSET == 0 && CONFIG_MAX_CPUS * CONFIG_MAX_PHYSICAL_CPUS < 16)
408 /* Assign the ioapic ID the next available number after the processor core local APIC IDs */
409 setup_ioapic(IO_APIC_ADDR, CONFIG_MAX_CPUS * CONFIG_MAX_PHYSICAL_CPUS);
410#elif (CONFIG_APIC_ID_OFFSET > 0)
411 /* Assign the ioapic ID the value 0. Processor APIC IDs follow. */
412 setup_ioapic(IO_APIC_ADDR, 0);
413#else
414#error "The processor APIC IDs must be lifted to make room for the I/O APIC ID"
415#endif
Frank Vibrans63e62b02011-02-14 18:38:14 +0000416 break;
417
418 case (0x14 << 3) | 1: /* 0:14:1 IDE */
Frank Vibrans63e62b02011-02-14 18:38:14 +0000419 break;
420
421 case (0x14 << 3) | 2: /* 0:14:2 HDA */
422 if (dev->enabled) {
423 if (AZALIA_DISABLE == sb_config->AzaliaController) {
424 sb_config->AzaliaController = AZALIA_AUTO;
425 }
426 printk(BIOS_DEBUG, "hda enabled\n");
427 } else {
428 sb_config->AzaliaController = AZALIA_DISABLE;
429 printk(BIOS_DEBUG, "hda disabled\n");
430 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000431 break;
432
433
434 case (0x14 << 3) | 3: /* 0:14:3 LPC */
435 break;
436
437 case (0x14 << 3) | 4: /* 0:14:4 PCI */
438 break;
439
440 case (0x14 << 3) | 6: /* 0:14:6 GEC */
441 if (dev->enabled) {
442 sb_config->GecConfig = 0;
443 printk(BIOS_DEBUG, "gec enabled\n");
444 } else {
445 sb_config->GecConfig = 1;
446 printk(BIOS_DEBUG, "gec disabled\n");
447 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000448 break;
449
450 case (0x15 << 3) | 0: /* 0:15:0 PCIe PortA */
Scott Duplichan8fed77a2011-06-18 10:46:45 -0500451 {
Kerry Shefeed3292011-08-18 18:03:44 +0800452 device_t device;
453 for (device = dev; device; device = device->next) {
454 if (dev->path.type != DEVICE_PATH_PCI) continue;
455 if ((device->path.pci.devfn & ~7) != PCI_DEVFN(0x15,0)) break;
456 sb_config->PORTCONFIG[device->path.pci.devfn & 3].PortCfg.PortPresent = device->enabled;
457 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000458
Kerry Shefeed3292011-08-18 18:03:44 +0800459 /*
460 * GPP_CFGMODE_X4000: PortA Lanes[3:0]
461 * GPP_CFGMODE_X2200: PortA Lanes[1:0], PortB Lanes[3:2]
462 * GPP_CFGMODE_X2110: PortA Lanes[1:0], PortB Lane2, PortC Lane3
463 * GPP_CFGMODE_X1111: PortA Lanes0, PortB Lane1, PortC Lane2, PortD Lane3
464 */
465 sb_config->GppLinkConfig = sb_chip->gpp_configuration;
Scott Duplichan8fed77a2011-06-18 10:46:45 -0500466 }
Kerry Shefeed3292011-08-18 18:03:44 +0800467 break;
468
469 case (0x12 << 3) | 0: /* 0:12:0 OHCI-USB1 */
470 sb_config->USBMODE.UsbMode.Ohci1 = dev->enabled;
471 break;
472 case (0x12 << 3) | 2: /* 0:12:2 EHCI-USB1 */
473 sb_config->USBMODE.UsbMode.Ehci1 = dev->enabled;
474 break;
475 case (0x13 << 3) | 0: /* 0:13:0 OHCI-USB2 */
476 sb_config->USBMODE.UsbMode.Ohci2 = dev->enabled;
477 break;
478 case (0x13 << 3) | 2: /* 0:13:2 EHCI-USB2 */
479 sb_config->USBMODE.UsbMode.Ehci2 = dev->enabled;
480 break;
481 case (0x14 << 3) | 5: /* 0:14:5 OHCI-USB4 */
482 sb_config->USBMODE.UsbMode.Ohci4 = dev->enabled;
483 break;
484 case (0x16 << 3) | 0: /* 0:16:0 OHCI-USB3 */
485 sb_config->USBMODE.UsbMode.Ohci3 = dev->enabled;
486 break;
487 case (0x16 << 3) | 2: /* 0:16:2 EHCI-USB3 */
488 sb_config->USBMODE.UsbMode.Ehci3 = dev->enabled;
489
Kerry Sheh75df1062011-10-10 19:19:46 +0800490 /* call the CIMX entry at the last sb800 device,
491 * so make sure the mainboard devicetree is complete
492 */
Patrick Georgie1667822012-05-05 15:29:32 +0200493#if CONFIG_HAVE_ACPI_RESUME
zbao9bcdbf82012-04-05 13:18:49 +0800494 if (acpi_slp_type != 3)
495 sb_Before_Pci_Init();
496 else
497 sb_Before_Pci_Restore_Init();
498#else
Kerry Shefeed3292011-08-18 18:03:44 +0800499 sb_Before_Pci_Init();
zbao9bcdbf82012-04-05 13:18:49 +0800500#endif
Kerry Shefeed3292011-08-18 18:03:44 +0800501 break;
Frank Vibrans63e62b02011-02-14 18:38:14 +0000502
503 default:
504 break;
505 }
Frank Vibrans63e62b02011-02-14 18:38:14 +0000506}
507
efdesign9805a89ab2011-06-20 17:38:49 -0700508struct chip_operations southbridge_amd_cimx_sb800_ops = {
Frank Vibrans63e62b02011-02-14 18:38:14 +0000509 CHIP_NAME("ATI SB800")
510 .enable_dev = sb800_enable,
511};