12 #include <linux/module.h>
13 #include <linux/types.h>
22 static void tx4938ide_tune_ebusc(
unsigned int ebus_ch,
23 unsigned int gbus_clock,
28 unsigned int sp = (cr >> 4) & 3;
29 unsigned int clock = gbus_clock / (4 -
sp);
39 if (wt > 2 && (wt & 1))
46 while ((shwt * 4 + wt + (wt ? 2 : 3)) * cycle < t->cycle)
49 pr_warning(
"tx4938ide: SHWT violation (%d)\n", shwt);
52 pr_debug(
"tx4938ide: ebus %d, bus cycle %dns, WT %d, SHWT %d\n",
53 ebus_ch, cycle, wt, shwt);
65 pair = ide_get_pair_dev(drive);
75 void *
buf,
unsigned int len)
77 unsigned long port = drive->
hwif->io_ports.data_addr;
79 unsigned int count = (len + 1) / 2;
83 __ide_flush_dcache_range((
unsigned long)buf,
roundup(len, 2));
87 void *buf,
unsigned int len)
89 unsigned long port = drive->
hwif->io_ports.data_addr;
90 unsigned short *ptr =
buf;
91 unsigned int count = (len + 1) / 2;
97 __ide_flush_dcache_range((
unsigned long)buf,
roundup(len, 2));
100 static const struct ide_tp_ops tx4938ide_tp_ops = {
110 .input_data = tx4938ide_input_data_swap,
111 .output_data = tx4938ide_output_data_swap,
117 .set_pio_mode = tx4938ide_set_pio_mode,
121 .port_ops = &tx4938ide_port_ops,
123 .tp_ops = &tx4938ide_tp_ops,
137 unsigned long mapbase, mapctl;
148 resource_size(res),
"tx4938ide"))
153 res->
start + 0x10000 +
156 if (!mapbase || !mapctl)
161 unsigned long port = mapbase;
162 unsigned long ctl = mapctl;
164 hw.io_ports_array[0] =
port;
169 for (i = 1; i <= 7; i++)
170 hw.io_ports_array[i] =
172 hw.io_ports.ctl_addr =
ctl;
174 ide_std_init_ports(&
hw, mapbase, mapctl);
178 pr_info(
"TX4938 IDE interface (base %#lx, ctl %#lx, irq %d)\n",
179 mapbase, mapctl,
hw.
irq);
186 platform_set_drvdata(pdev, host);
192 struct ide_host *host = platform_get_drvdata(pdev);
203 .remove =
__exit_p(tx4938ide_remove),
206 static int __init tx4938ide_init(
void)
211 static void __exit tx4938ide_exit(
void)