blob: e27960e0fcf52be6ed215720119f01d3c14fc71c [file] [log] [blame]
Morgan Tsai1602dd52007-10-29 21:00:14 +00001/*
Stefan Reinauer7e61e452008-01-18 10:35:56 +00002 * This file is part of the coreboot project.
Morgan Tsai1602dd52007-10-29 21:00:14 +00003 *
4 * Copyright (C) 2004 Tyan Computer
5 * Written by Yinghai Lu <yhlu@tyan.com> for Tyan Computer.
6 * Copyright (C) 2006,2007 AMD
7 * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD.
8 * Copyright (C) 2007 Silicon Integrated Systems Corp. (SiS)
9 * Written by Morgan Tsai <my_tsai@sis.com> for SiS.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
Morgan Tsai1602dd52007-10-29 21:00:14 +000020 */
21
22#include <console/console.h>
23#include <device/device.h>
24#include <device/pci.h>
25#include <device/pci_ids.h>
26#include <device/pci_ops.h>
27#include "sis966.h"
28
29static void pcie_init(struct device *dev)
30{
31
32 /* Enable pci error detecting */
33 uint32_t dword;
34
35 /* System error enable */
36 dword = pci_read_config32(dev, 0x04);
37 dword |= (1<<8); /* System error enable */
38 dword |= (1<<30); /* Clear possible errors */
39 pci_write_config32(dev, 0x04, dword);
40
41}
42
43static struct pci_operations lops_pci = {
44 .set_subsystem = 0,
45};
46
47static struct device_operations pcie_ops = {
48 .read_resources = pci_bus_read_resources,
49 .set_resources = pci_dev_set_resources,
50 .enable_resources = pci_bus_enable_resources,
51 .init = pcie_init,
52 .scan_bus = pci_scan_bridge,
53// .enable = sis966_enable,
54 .ops_pci = &lops_pci,
55};
56
Stefan Reinauer83b52e72007-10-30 02:17:49 +000057static const struct pci_driver pciebc_driver __pci_driver = {
Morgan Tsai1602dd52007-10-29 21:00:14 +000058 .ops = &pcie_ops,
59 .vendor = PCI_VENDOR_ID_SIS,
Morgan Tsai31e805d2007-11-14 01:34:02 +000060 .device = PCI_DEVICE_ID_SIS_SIS966_PCIE,
Morgan Tsai1602dd52007-10-29 21:00:14 +000061};