Tiny style fix for consistency (trivial).
[coreboot.git] / src / southbridge / intel / i82801db / i82801db_ide.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (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, MA  02110-1301 USA
17  */
18
19 #include <console/console.h>
20 #include <device/device.h>
21 #include <device/pci.h>
22 #include <device/pci_ids.h>
23 #include <device/pci_ops.h>
24 #include "i82801db.h"
25
26 static void ide_init(struct device *dev)
27 {
28         /* Enable IDE devices and timmings */
29         uint8_t byte;
30
31         pci_write_config16(dev, 0x40, 0x8000);
32         /*
33         pci_write_config16(dev, 0x40, 0xa307);
34         pci_write_config16(dev, 0x42, 0xa307);
35         pci_write_config8(dev, 0x48, 0x05);
36         pci_write_config16(dev, 0x4a, 0x0101);
37         pci_write_config16(dev, 0x54, 0x5055);
38         */
39         
40         /*
41         byte = pci_read_config8(dev, 0x09);
42         byte |= 0x0f;
43         pci_write_config8(dev, 0x09, byte);
44         */
45         /* force irq into compat mode
46         pci_write_config32(dev, 0x10, 0x0);
47         pci_write_config32(dev, 0x14, 0x0);
48         pci_write_config32(dev, 0x18, 0x0);
49         pci_write_config32(dev, 0x1c, 0x0);
50         
51
52         pci_write_config8(dev, 0x3d, 00);
53         */
54         pci_write_config8(dev, 0x3c, 0xff);
55         
56
57
58         printk_debug("IDE Enabled\n");
59 }
60
61 static struct device_operations ide_ops  = {
62         .read_resources   = pci_dev_read_resources,
63         .set_resources    = pci_dev_set_resources,
64         .enable_resources = pci_dev_enable_resources,
65         .enable           = 0,
66         .init             = ide_init,
67         .scan_bus         = 0,
68 };
69
70 static const struct pci_driver ide_driver __pci_driver = {
71         .ops    = &ide_ops,
72         .vendor = PCI_VENDOR_ID_INTEL,
73         .device = PCI_DEVICE_ID_INTEL_82801DB_IDE,
74 };
75