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 sata_init(struct device *dev)
13 int enable_c=1, enable_d=1;
16 //Enable Serial ATA port
17 byte = pci_read_config8(dev,0x90);
19 byte |= ICH5_SATA_ADDRESS_MAP & 7;
20 pci_write_config8(dev,0x90,byte);
22 // for(i=0;i<10;i++) {
23 word = pci_read_config16(dev,0x92);
25 // if( (word & 0x0003) == 0x0003) break;
26 word |= 0x0003; // enable P0/P1
27 pci_write_config16(dev,0x92,word);
30 // for(i=0;i<10;i++) {
32 word = pci_read_config16(dev, 0x40);
35 // if( (word & 0x8000) == 0x0000) break;
39 // if( (word & 0x8000) == 0x8000) break;
42 pci_write_config16(dev, 0x40, word);
45 // for(i=0;i<10;i++) {
46 word = pci_read_config16(dev, 0x42);
49 // if( (word & 0x8000) == 0x0000) break;
53 // if( (word & 0x8000) == 0x8000) break;
56 pci_write_config16(dev, 0x42, word);
61 static struct device_operations sata_ops = {
62 .read_resources = pci_dev_read_resources,
63 .set_resources = pci_dev_set_resources,
64 .enable_resources = pci_dev_enable_resources,
67 .enable = i82801dbm_enable,
70 static struct pci_driver stat_driver __pci_driver = {
72 .vendor = PCI_VENDOR_ID_INTEL,
73 .device = PCI_DEVICE_ID_INTEL_82801ER_1F2_R,