19 #include <linux/kernel.h>
20 #include <linux/module.h>
26 #define DRV_NAME "pata_ixp4xx_cf"
27 #define DRV_VERSION "0.2"
43 static unsigned int ixp4xx_mmio_data_xfer(
struct ata_device *
dev,
47 unsigned int words = buflen >> 1;
50 void __iomem *mmio = ap->ioaddr.data_addr;
61 for (i = 0; i < words; i++)
62 buf16[i] =
readw(mmio);
64 for (i = 0; i < words; i++)
69 u16 align_buf[1] = { 0 };
70 unsigned char *trailing_buf = buf + buflen - 1;
73 align_buf[0] =
readw(mmio);
74 memcpy(trailing_buf, align_buf, 1);
76 memcpy(align_buf, trailing_buf, 1);
77 writew(align_buf[0], mmio);
94 .sff_data_xfer = ixp4xx_mmio_data_xfer,
96 .set_mode = ixp4xx_set_mode,
99 static void ixp4xx_setup_port(
struct ata_port *ap,
101 unsigned long raw_cs0,
unsigned long raw_cs1)
103 struct ata_ioports *ioaddr = &ap->ioaddr;
104 unsigned long raw_cmd = raw_cs0;
105 unsigned long raw_ctl = raw_cs1 + 0x06;
107 ioaddr->cmd_addr = data->
cs0;
108 ioaddr->altstatus_addr = data->
cs1 + 0x06;
109 ioaddr->ctl_addr = data->
cs1 + 0x06;
119 *(
unsigned long *)&ioaddr->data_addr ^= 0x02;
120 *(
unsigned long *)&ioaddr->cmd_addr ^= 0x03;
121 *(
unsigned long *)&ioaddr->altstatus_addr ^= 0x03;
122 *(
unsigned long *)&ioaddr->ctl_addr ^= 0x03;
123 *(
unsigned long *)&ioaddr->error_addr ^= 0x03;
124 *(
unsigned long *)&ioaddr->feature_addr ^= 0x03;
125 *(
unsigned long *)&ioaddr->nsect_addr ^= 0x03;
126 *(
unsigned long *)&ioaddr->lbal_addr ^= 0x03;
127 *(
unsigned long *)&ioaddr->lbam_addr ^= 0x03;
128 *(
unsigned long *)&ioaddr->lbah_addr ^= 0x03;
129 *(
unsigned long *)&ioaddr->device_addr ^= 0x03;
130 *(
unsigned long *)&ioaddr->status_addr ^= 0x03;
131 *(
unsigned long *)&ioaddr->command_addr ^= 0x03;
165 if (!data->
cs0 || !data->
cs1)
178 ap->
ops = &ixp4xx_port_ops;
182 ixp4xx_setup_port(ap, data, cs0->
start, cs1->
start);
192 struct ata_host *host = platform_get_drvdata(dev);
204 .probe = ixp4xx_pata_probe,