1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
5 #include <device/pci_ops.h>
8 static void ide_init(struct device *dev)
11 /* Enable ide devices so the linux ide driver will work */
14 /* Enable IDE devices */
15 pci_write_config16(dev, 0x40, 0x0a307);
16 pci_write_config16(dev, 0x42, 0x0a307);
17 pci_write_config8(dev, 0x48, 0x05);
18 pci_write_config16(dev, 0x4a, 0x0101);
19 pci_write_config16(dev, 0x54, 0x5055);
22 word = pci_read_config16(dev, 0x40);
24 pci_write_config16(dev, 0x40, word);
25 word = pci_read_config16(dev, 0x42);
27 pci_write_config16(dev, 0x42, word);
29 printk_debug("IDE Enabled\n");
32 static void esb6300_ide_set_subsystem(device_t dev, unsigned vendor, unsigned device)
34 /* This value is also visible in uchi[0-2] and smbus functions */
35 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
36 ((device & 0xffff) << 16) | (vendor & 0xffff));
39 static struct pci_operations lops_pci = {
40 .set_subsystem = esb6300_ide_set_subsystem,
42 static struct device_operations ide_ops = {
43 .read_resources = pci_dev_read_resources,
44 .set_resources = pci_dev_set_resources,
45 .enable_resources = pci_dev_enable_resources,
51 static const struct pci_driver ide_driver __pci_driver = {
53 .vendor = PCI_VENDOR_ID_INTEL,
54 .device = PCI_DEVICE_ID_INTEL_6300ESB_IDE,