721f5bf1557f8002fc5f63f46496ea8ec92fb8ee
[coreboot.git] / src / southbridge / intel / i82801bx / i82801bx_usb.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 Corey Osgood <corey.osgood@gmail.com>
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; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19  */
20
21 /* This code should work for all ICH* southbridges with USB. */
22
23 #include <console/console.h>
24 #include <device/device.h>
25 #include <device/pci.h>
26 #include <device/pci_ids.h>
27 #include "i82801bx.h"
28
29 static void usb_init(struct device *dev)
30 {
31         /* TODO: Any init needed? Some ports have it, others don't. */
32 }
33
34 static struct device_operations usb_ops = {
35         .read_resources         = pci_dev_read_resources,
36         .set_resources          = pci_dev_set_resources,
37         .enable_resources       = pci_dev_enable_resources,
38         .init                   = usb_init,
39         .scan_bus               = 0,
40         .enable                 = i82801bx_enable,
41 };
42
43 /* 82801AA (ICH) */
44 static const struct pci_driver i82801aa_usb1 __pci_driver = {
45         .ops    = &usb_ops,
46         .vendor = PCI_VENDOR_ID_INTEL,
47         .device = PCI_DEVICE_ID_INTEL_82801AA_USB,
48 };
49
50 /* 82801AB (ICH0) */
51 static const struct pci_driver i82801ab_usb1 __pci_driver = {
52         .ops    = &usb_ops,
53         .vendor = PCI_VENDOR_ID_INTEL,
54         .device = PCI_DEVICE_ID_INTEL_82801AB_USB,
55 };
56
57 /* 82801BA/BAM (ICH2/ICH2-M) */
58 static const struct pci_driver i82801ba_usb1 __pci_driver = {
59         .ops    = &usb_ops,
60         .vendor = PCI_VENDOR_ID_INTEL,
61         .device = PCI_DEVICE_ID_INTEL_82801BA_USB1,
62 };
63
64 static const struct pci_driver i82801ba_usb2 __pci_driver = {
65         .ops    = &usb_ops,
66         .vendor = PCI_VENDOR_ID_INTEL,
67         .device = PCI_DEVICE_ID_INTEL_82801BA_USB2,
68 };
69
70 /* 82801CA/CAM (ICH3-S/ICH3-M) */
71 static const struct pci_driver i82801ca_usb1 __pci_driver = {
72         .ops    = &usb_ops,
73         .vendor = PCI_VENDOR_ID_INTEL,
74         .device = PCI_DEVICE_ID_INTEL_82801CA_USB1,
75 };
76
77 static const struct pci_driver i82801ca_usb2 __pci_driver = {
78         .ops    = &usb_ops,
79         .vendor = PCI_VENDOR_ID_INTEL,
80         .device = PCI_DEVICE_ID_INTEL_82801CA_USB2,
81 };
82
83 static const struct pci_driver i82801ca_usb3 __pci_driver = {
84         .ops    = &usb_ops,
85         .vendor = PCI_VENDOR_ID_INTEL,
86         .device = PCI_DEVICE_ID_INTEL_82801CA_USB3,
87 };
88
89 /* 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) */
90 static const struct pci_driver i82801db_usb1 __pci_driver = {
91         .ops    = &usb_ops,
92         .vendor = PCI_VENDOR_ID_INTEL,
93         .device = PCI_DEVICE_ID_INTEL_82801DB_USB1,
94 };
95
96 static const struct pci_driver i82801db_usb2 __pci_driver = {
97         .ops    = &usb_ops,
98         .vendor = PCI_VENDOR_ID_INTEL,
99         .device = PCI_DEVICE_ID_INTEL_82801DB_USB2,
100 };
101
102 static const struct pci_driver i82801db_usb3 __pci_driver = {
103         .ops    = &usb_ops,
104         .vendor = PCI_VENDOR_ID_INTEL,
105         .device = PCI_DEVICE_ID_INTEL_82801DB_USB3,
106 };
107
108 /* 82801EB/ER (ICH5/ICH5R) */
109 static const struct pci_driver i82801eb_usb1 __pci_driver = {
110         .ops    = &usb_ops,
111         .vendor = PCI_VENDOR_ID_INTEL,
112         .device = PCI_DEVICE_ID_INTEL_82801EB_USB1,
113 };
114
115 static const struct pci_driver i82801eb_usb2 __pci_driver = {
116         .ops    = &usb_ops,
117         .vendor = PCI_VENDOR_ID_INTEL,
118         .device = PCI_DEVICE_ID_INTEL_82801EB_USB2,
119 };
120
121 static const struct pci_driver i82801eb_usb3 __pci_driver = {
122         .ops    = &usb_ops,
123         .vendor = PCI_VENDOR_ID_INTEL,
124         .device = PCI_DEVICE_ID_INTEL_82801EB_USB3,
125 };
126
127 static const struct pci_driver i82801eb_usb4 __pci_driver = {
128         .ops    = &usb_ops,
129         .vendor = PCI_VENDOR_ID_INTEL,
130         .device = PCI_DEVICE_ID_INTEL_82801EB_USB4,
131 };
132
133 /* 82801FB/FR/FW/FRW/FBM (ICH6/ICH6R/ICH6W/ICH6RW/ICH6-M) */
134 static const struct pci_driver i82801fb_usb1 __pci_driver = {
135         .ops    = &usb_ops,
136         .vendor = PCI_VENDOR_ID_INTEL,
137         .device = PCI_DEVICE_ID_INTEL_82801FB_USB1,
138 };
139
140 static const struct pci_driver i82801fb_usb2 __pci_driver = {
141         .ops    = &usb_ops,
142         .vendor = PCI_VENDOR_ID_INTEL,
143         .device = PCI_DEVICE_ID_INTEL_82801FB_USB2,
144 };
145
146 static const struct pci_driver i82801fb_usb3 __pci_driver = {
147         .ops    = &usb_ops,
148         .vendor = PCI_VENDOR_ID_INTEL,
149         .device = PCI_DEVICE_ID_INTEL_82801FB_USB3,
150 };
151
152 static const struct pci_driver i82801fb_usb4 __pci_driver = {
153         .ops    = &usb_ops,
154         .vendor = PCI_VENDOR_ID_INTEL,
155         .device = PCI_DEVICE_ID_INTEL_82801FB_USB4,
156 };
157
158 /* 82801E (C-ICH) */
159 static const struct pci_driver i82801e_usb __pci_driver = {
160         .ops    = &usb_ops,
161         .vendor = PCI_VENDOR_ID_INTEL,
162         .device = PCI_DEVICE_ID_INTEL_82801E_USB,
163 };