3dbb797646a5edca40fe57eb6a5327d866cbee52
[coreboot.git] / src / southbridge / ti / pci7420 / pci7420_firewire.c
1 /*
2  * (C) Copyright 2008-2009 coresystems GmbH
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  */
19
20 #include <arch/io.h>
21 #include <device/device.h>
22 #include <device/pci.h>
23 #include <device/pci_ops.h>
24 #include <device/pci_ids.h>
25 #include <console/console.h>
26 #include <device/cardbus.h>
27 #include "pci7420.h"
28 #include "chip.h"
29
30 static void pci7420_firewire_init(device_t dev)
31 {
32         u8 reg8;
33
34         printk_debug("TI PCI7420/7620 FireWire init\n");
35
36 #ifdef ODD_IRQ_FIXUP
37         /* This is a workaround for buggy kernels. This should
38          * probably be read from the device tree, but as long
39          * as only one mainboard is using this bridge it does
40          * not matter
41          */
42         pci_write_config8(dev, PCI_INTERRUPT_PIN, INTC);
43 #endif
44 }
45
46 static struct device_operations ti_pci7420_firewire_ops = {
47         .read_resources   = pci_dev_read_resources,
48         .set_resources    = pci_dev_set_resources,
49         .enable_resources = pci_dev_enable_resources,
50         .init             = pci7420_firewire_init,
51 };
52
53 static const struct pci_driver ti_pci7420_driver __pci_driver = {
54         .ops    = &ti_pci7420_firewire_ops,
55         .vendor = 0x104c,
56         .device = 0x802e,
57 };
58
59 static void ti_pci7420_firewire_enable_dev(device_t dev)
60 {
61         /* Nothing here yet */
62 }
63
64 struct chip_operations southbridge_ti_pci7420_firewire_ops = {
65         CHIP_NAME("Texas Instruments PCI7420/7620 FireWire (IEEE 1394)")
66         .enable_dev    = ti_pci7420_firewire_enable_dev,
67 };