1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39#include <common.h>
40#include <ata.h>
41#include <ide.h>
42#include <pci.h>
43
44extern ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS];
45
46int ide_preinit (void)
47{
48 int status;
49 pci_dev_t devbusfn;
50 int l;
51
52 status = 1;
53 for (l = 0; l < CONFIG_SYS_IDE_MAXBUS; l++) {
54 ide_bus_offset[l] = -ATA_STATUS;
55 }
56 devbusfn = pci_find_device (0x1095, 0x0680, 0);
57 if (devbusfn != -1) {
58 status = 0;
59
60 pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
61 (u32 *) &ide_bus_offset[0]);
62 ide_bus_offset[0] &= 0xfffffff8;
63 ide_bus_offset[0] += CONFIG_SYS_PCI0_IO_SPACE;
64 pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_2,
65 (u32 *) &ide_bus_offset[1]);
66 ide_bus_offset[1] &= 0xfffffff8;
67 ide_bus_offset[1] += CONFIG_SYS_PCI0_IO_SPACE;
68
69
70 pci_write_config_byte(devbusfn, 0x80, 0x00);
71 pci_write_config_byte(devbusfn, 0x84, 0x00);
72
73 pci_write_config_byte(devbusfn, 0xA1, 0x02);
74 pci_write_config_word(devbusfn, 0xA2, 0x328A);
75 pci_write_config_dword(devbusfn, 0xA4, 0x62DD62DD);
76 pci_write_config_dword(devbusfn, 0xA8, 0x43924392);
77 pci_write_config_dword(devbusfn, 0xAC, 0x40094009);
78
79 pci_write_config_byte(devbusfn, 0xB1, 0x02);
80 pci_write_config_word(devbusfn, 0xB2, 0x328A);
81 pci_write_config_dword(devbusfn, 0xB4, 0x62DD62DD);
82 pci_write_config_dword(devbusfn, 0xB8, 0x43924392);
83 pci_write_config_dword(devbusfn, 0xBC, 0x40094009);
84 }
85 return (status);
86}
87
88void ide_set_reset (int flag) {
89 return;
90}
91