Lines Matching +full:ide +full:- +full:port
2 * TX4938 internal IDE driver
9 * (C) Copyright TOSHIBA CORPORATION 2005-2007
14 #include <linux/ide.h>
19 #include <asm/ide.h>
27 u64 cr = __raw_readq(&tx4938_ebuscptr->cr[ebus_ch]); in tx4938ide_tune_ebusc()
29 unsigned int clock = gbus_clock / (4 - sp); in tx4938ide_tune_ebusc()
34 /* Minimum DIOx- active time */ in tx4938ide_tune_ebusc()
35 wt = DIV_ROUND_UP(t->act8b, cycle) - 2; in tx4938ide_tune_ebusc()
38 /* actual wait-cycle is max(wt & ~1, 1) */ in tx4938ide_tune_ebusc()
42 /* Address-valid to DIOR/DIOW setup */ in tx4938ide_tune_ebusc()
43 shwt = DIV_ROUND_UP(t->setup, cycle); in tx4938ide_tune_ebusc()
45 /* -DIOx recovery time (SHWT * 4) and cycle time requirement */ in tx4938ide_tune_ebusc()
46 while ((shwt * 4 + wt + (wt ? 2 : 3)) * cycle < t->cycle) in tx4938ide_tune_ebusc()
56 &tx4938_ebuscptr->cr[ebus_ch]); in tx4938ide_tune_ebusc()
61 struct tx4938ide_platform_info *pdata = dev_get_platdata(hwif->dev); in tx4938ide_set_pio_mode()
62 u8 safe = drive->pio_mode - XFER_PIO_0; in tx4938ide_set_pio_mode()
67 safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0); in tx4938ide_set_pio_mode()
68 tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, safe); in tx4938ide_set_pio_mode()
77 unsigned long port = drive->hwif->io_ports.data_addr; in tx4938ide_input_data_swap() local
81 while (count--) in tx4938ide_input_data_swap()
82 *ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port)); in tx4938ide_input_data_swap()
89 unsigned long port = drive->hwif->io_ports.data_addr; in tx4938ide_output_data_swap() local
93 while (count--) { in tx4938ide_output_data_swap()
94 __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port); in tx4938ide_output_data_swap()
135 struct tx4938ide_platform_info *pdata = dev_get_platdata(&pdev->dev); in tx4938ide_probe()
142 return -ENODEV; in tx4938ide_probe()
145 return -ENODEV; in tx4938ide_probe()
147 if (!devm_request_mem_region(&pdev->dev, res->start, in tx4938ide_probe()
149 return -EBUSY; in tx4938ide_probe()
150 mapbase = (unsigned long)devm_ioremap(&pdev->dev, res->start, in tx4938ide_probe()
151 8 << pdata->ioport_shift); in tx4938ide_probe()
152 mapctl = (unsigned long)devm_ioremap(&pdev->dev, in tx4938ide_probe()
153 res->start + 0x10000 + in tx4938ide_probe()
154 (6 << pdata->ioport_shift), in tx4938ide_probe()
155 1 << pdata->ioport_shift); in tx4938ide_probe()
157 return -EBUSY; in tx4938ide_probe()
160 if (pdata->ioport_shift) { in tx4938ide_probe()
161 unsigned long port = mapbase; in tx4938ide_probe() local
164 hw.io_ports_array[0] = port; in tx4938ide_probe()
166 port++; in tx4938ide_probe()
171 port + (i << pdata->ioport_shift); in tx4938ide_probe()
176 hw.dev = &pdev->dev; in tx4938ide_probe()
178 pr_info("TX4938 IDE interface (base %#lx, ctl %#lx, irq %d)\n", in tx4938ide_probe()
180 if (pdata->gbus_clock) in tx4938ide_probe()
181 tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, 0); in tx4938ide_probe()
207 MODULE_DESCRIPTION("TX4938 internal IDE driver");