7 #include <linux/module.h>
8 #include <linux/types.h>
15 #define DRV_NAME "aec62xx"
68 for ( ; chipset_table->
xfer_speed ; chipset_table++)
77 for ( ; chipset_table->
xfer_speed ; chipset_table++)
91 u8 tmp0 = 0,
tmp1 = 0, tmp2 = 0;
97 pci_read_config_word(dev, 0x40|(2*drive->
dn), &d_conf);
98 tmp0 = pci_bus_clock_list(speed, bus_clock);
99 d_conf = ((tmp0 & 0xf0) << 4) | (tmp0 & 0xf);
100 pci_write_config_word(dev, 0x40|(2*drive->
dn), d_conf);
104 pci_read_config_byte(dev, 0x54, &ultra);
105 tmp1 = ((0x00 << (2*drive->
dn)) | (ultra & ~(3 << (2*drive->
dn))));
106 ultra_conf = pci_bus_clock_list_ultra(speed, bus_clock);
107 tmp2 = ((ultra_conf << (2*drive->
dn)) | (
tmp1 & ~(3 << (2*drive->
dn))));
108 pci_write_config_byte(dev, 0x54, tmp2);
115 struct ide_host *host = pci_get_drvdata(dev);
119 u8 ultra = 0, drive_conf = 0, ultra_conf = 0;
125 pci_read_config_byte(dev, 0x40|drive->
dn, &drive_conf);
126 drive_conf = pci_bus_clock_list(speed, bus_clock);
127 pci_write_config_byte(dev, 0x40|drive->
dn, drive_conf);
129 pci_read_config_byte(dev, (0x44|hwif->
channel), &ultra);
130 tmp1 = ((0x00 << (4*
unit)) | (ultra & ~(7 << (4*
unit))));
131 ultra_conf = pci_bus_clock_list_ultra(speed, bus_clock);
132 tmp2 = ((ultra_conf << (4*
unit)) | (tmp1 & ~(7 << (4*
unit))));
133 pci_write_config_byte(dev, (0x44|hwif->
channel), tmp2);
140 hwif->
port_ops->set_dma_mode(hwif, drive);
143 static int init_chipset_aec62xx(
struct pci_dev *dev)
148 u8 reg49h = 0, reg4ah = 0;
150 pci_read_config_byte(dev, 0x49, ®49h);
151 pci_write_config_byte(dev, 0x49, reg49h & ~0x30);
153 pci_read_config_byte(dev, 0x4a, ®4ah);
154 pci_write_config_byte(dev, 0x4a, reg4ah & ~0x01);
156 pci_read_config_byte(dev, 0x4a, ®4ah);
157 pci_write_config_byte(dev, 0x4a, reg4ah | 0x80);
168 pci_read_config_byte(dev, 0x49, &ata66);
174 .set_pio_mode = aec_set_pio_mode,
175 .set_dma_mode = aec6210_set_mode,
179 .set_pio_mode = aec_set_pio_mode,
180 .set_dma_mode = aec6260_set_mode,
181 .cable_detect = atp86x_cable_detect,
187 .init_chipset = init_chipset_aec62xx,
188 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
189 .port_ops = &atp850_port_ops,
200 .init_chipset = init_chipset_aec62xx,
201 .port_ops = &atp86x_port_ops,
210 .init_chipset = init_chipset_aec62xx,
211 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
212 .port_ops = &atp86x_port_ops,
221 .init_chipset = init_chipset_aec62xx,
222 .port_ops = &atp86x_port_ops,
231 .init_chipset = init_chipset_aec62xx,
232 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
233 .port_ops = &atp86x_port_ops,
258 u8 idx =
id->driver_data;
263 bus_clock = aec6xxx_33_base;
265 bus_clock = aec6xxx_34_base;
271 d = aec62xx_chipsets[
idx];
273 if (idx == 3 || idx == 4) {
276 if (
inb(dma_base + 2) & 0x10) {
278 "\n", pci_name(dev), (idx == 4) ?
"R" :
"");
306 static struct pci_driver aec62xx_pci_driver = {
307 .name =
"AEC62xx_IDE",
308 .id_table = aec62xx_pci_tbl,
309 .probe = aec62xx_init_one,
315 static int __init aec62xx_ide_init(
void)
320 static void __exit aec62xx_ide_exit(
void)