Lines Matching +full:drive +full:- +full:mode

12  *  modes. In pass through mode then it is an IDE controller. In its smart
13 * mode its actually quite a capable hardware raid controller disguised
14 * as an IDE controller. Smart mode only understands DMA read/write and
16 * in other respects but lacks the raid mode.
24 * o If you write LBA48 sized I/O's (ie > 256 sector) in smart mode
26 * o Smart mode without RAID doesn't clear all the necessary identify
30 * - In pass through mode we do all the work you would expect
31 * - In smart mode the clocking set up is done by the controller generally
33 * - There are a few extra vendor commands that actually talk to the
36 * Vendor areas of the identify block in smart mode are used for the
37 * timing and policy set up. Each HDD in raid mode also has a serial
41 * In Linux the driver supports pass through mode as if the device was
42 * just another IDE controller. If the smart mode is running then
44 * is a raid volume. Even more cute - the controller can do automated
52 * matters in smart mode. ATAPI DMA is not currently supported.
54 * It seems the smart mode is a win for RAID1/RAID10 but otherwise not.
57 * - ATAPI UDMA is ok but not MWDMA it seems
58 * - RAID configuration ioctls
59 * - Move to libata once it grows up
75 unsigned int smart:1, /* Are we in smart raid mode */
78 u8 want[2][2]; /* Mode/Pri log for master slave */
83 u16 udma[2]; /* Cached UDMA values (per drive) */
95 * We allow users to force the card into non raid mode without
104 * it821x_program - program the PIO/MWDMA registers
105 * @drive: drive to tune
112 static void it821x_program(ide_drive_t *drive, u16 timing) in it821x_program() argument
114 ide_hwif_t *hwif = drive->hwif; in it821x_program()
115 struct pci_dev *dev = to_pci_dev(hwif->dev); in it821x_program()
117 int channel = hwif->channel; in it821x_program()
121 if(itdev->clock_mode == ATA_66) in it821x_program()
130 * it821x_program_udma - program the UDMA registers
131 * @drive: drive to tune
134 * Program the UDMA timing for this drive according to the
138 static void it821x_program_udma(ide_drive_t *drive, u16 timing) in it821x_program_udma() argument
140 ide_hwif_t *hwif = drive->hwif; in it821x_program_udma()
141 struct pci_dev *dev = to_pci_dev(hwif->dev); in it821x_program_udma()
143 int channel = hwif->channel; in it821x_program_udma()
144 u8 unit = drive->dn & 1, conf; in it821x_program_udma()
147 if(itdev->clock_mode == ATA_66) in it821x_program_udma()
152 if (itdev->timing10 == 0) in it821x_program_udma()
162 * @drive: drive to set up
168 static void it821x_clock_strategy(ide_drive_t *drive) in it821x_clock_strategy() argument
170 ide_hwif_t *hwif = drive->hwif; in it821x_clock_strategy()
171 struct pci_dev *dev = to_pci_dev(hwif->dev); in it821x_clock_strategy()
173 ide_drive_t *pair = ide_get_pair_dev(drive); in it821x_clock_strategy()
175 u8 unit = drive->dn & 1, v; in it821x_clock_strategy()
177 if(itdev->want[0][0] > itdev->want[1][0]) { in it821x_clock_strategy()
178 clock = itdev->want[0][1]; in it821x_clock_strategy()
179 altclock = itdev->want[1][1]; in it821x_clock_strategy()
181 clock = itdev->want[1][1]; in it821x_clock_strategy()
182 altclock = itdev->want[0][1]; in it821x_clock_strategy()
186 * if both clocks can be used for the mode with the higher priority in it821x_clock_strategy()
187 * use the clock needed by the mode with the lower priority in it821x_clock_strategy()
192 /* Nobody cares - keep the same clock */ in it821x_clock_strategy()
196 if(clock == itdev->clock_mode) in it821x_clock_strategy()
201 itdev->clock_mode = ATA_66; in it821x_clock_strategy()
203 itdev->clock_mode = ATA_50; in it821x_clock_strategy()
208 v &= ~(1 << (1 + hwif->channel)); in it821x_clock_strategy()
209 v |= sel << (1 + hwif->channel); in it821x_clock_strategy()
213 * Reprogram the UDMA/PIO of the pair drive for the switch in it821x_clock_strategy()
216 if(pair && itdev->udma[1-unit] != UDMA_OFF) { in it821x_clock_strategy()
217 it821x_program_udma(pair, itdev->udma[1-unit]); in it821x_clock_strategy()
218 it821x_program(pair, itdev->pio[1-unit]); in it821x_clock_strategy()
221 * Reprogram the UDMA/PIO of our drive for the switch. in it821x_clock_strategy()
224 if(itdev->udma[unit] != UDMA_OFF) { in it821x_clock_strategy()
225 it821x_program_udma(drive, itdev->udma[unit]); in it821x_clock_strategy()
226 it821x_program(drive, itdev->pio[unit]); in it821x_clock_strategy()
231 * it821x_set_pio_mode - set host controller for PIO mode
233 * @drive: drive
235 * Tune the host to the desired PIO mode taking into the consideration
236 * the maximum PIO mode supported by the other device on the cable.
239 static void it821x_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) in it821x_set_pio_mode() argument
242 ide_drive_t *pair = ide_get_pair_dev(drive); in it821x_set_pio_mode()
243 const u8 pio = drive->pio_mode - XFER_PIO_0; in it821x_set_pio_mode()
244 u8 unit = drive->dn & 1, set_pio = pio; in it821x_set_pio_mode()
251 * Compute the best PIO mode we can for a given device. We must in it821x_set_pio_mode()
256 u8 pair_pio = pair->pio_mode - XFER_PIO_0; in it821x_set_pio_mode()
262 /* We prefer 66Mhz clock for PIO 0-3, don't care for PIO4 */ in it821x_set_pio_mode()
263 itdev->want[unit][1] = pio_want[set_pio]; in it821x_set_pio_mode()
264 itdev->want[unit][0] = 1; /* PIO is lowest priority */ in it821x_set_pio_mode()
265 itdev->pio[unit] = pio_timings[set_pio]; in it821x_set_pio_mode()
266 it821x_clock_strategy(drive); in it821x_set_pio_mode()
267 it821x_program(drive, itdev->pio[unit]); in it821x_set_pio_mode()
271 * it821x_tune_mwdma - tune a channel for MWDMA
272 * @drive: drive to set up
273 * @mode_wanted: the target operating mode
275 * Load the timing settings for this device mode into the
276 * controller when doing MWDMA in pass through mode. The caller
281 static void it821x_tune_mwdma(ide_drive_t *drive, u8 mode_wanted) in it821x_tune_mwdma() argument
283 ide_hwif_t *hwif = drive->hwif; in it821x_tune_mwdma()
284 struct pci_dev *dev = to_pci_dev(hwif->dev); in it821x_tune_mwdma()
286 u8 unit = drive->dn & 1, channel = hwif->channel, conf; in it821x_tune_mwdma()
291 itdev->want[unit][1] = mwdma_want[mode_wanted]; in it821x_tune_mwdma()
292 itdev->want[unit][0] = 2; /* MWDMA is low priority */ in it821x_tune_mwdma()
293 itdev->mwdma[unit] = dma[mode_wanted]; in it821x_tune_mwdma()
294 itdev->udma[unit] = UDMA_OFF; in it821x_tune_mwdma()
296 /* UDMA bits off - Revision 0x10 do them in pairs */ in it821x_tune_mwdma()
298 if (itdev->timing10) in it821x_tune_mwdma()
304 it821x_clock_strategy(drive); in it821x_tune_mwdma()
306 /* it821x_program(drive, itdev->mwdma[unit]); */ in it821x_tune_mwdma()
310 * it821x_tune_udma - tune a channel for UDMA
311 * @drive: drive to set up
312 * @mode_wanted: the target operating mode
314 * Load the timing settings for this device mode into the
318 static void it821x_tune_udma(ide_drive_t *drive, u8 mode_wanted) in it821x_tune_udma() argument
320 ide_hwif_t *hwif = drive->hwif; in it821x_tune_udma()
321 struct pci_dev *dev = to_pci_dev(hwif->dev); in it821x_tune_udma()
323 u8 unit = drive->dn & 1, channel = hwif->channel, conf; in it821x_tune_udma()
328 itdev->want[unit][1] = udma_want[mode_wanted]; in it821x_tune_udma()
329 itdev->want[unit][0] = 3; /* UDMA is high priority */ in it821x_tune_udma()
330 itdev->mwdma[unit] = MWDMA_OFF; in it821x_tune_udma()
331 itdev->udma[unit] = udma[mode_wanted]; in it821x_tune_udma()
333 itdev->udma[unit] |= 0x8080; /* UDMA 5/6 select on */ in it821x_tune_udma()
337 if (itdev->timing10) in it821x_tune_udma()
343 it821x_clock_strategy(drive); in it821x_tune_udma()
344 it821x_program_udma(drive, itdev->udma[unit]); in it821x_tune_udma()
349 * it821x_dma_read - DMA hook
350 * @drive: drive for DMA
361 static void it821x_dma_start(ide_drive_t *drive) in it821x_dma_start() argument
363 ide_hwif_t *hwif = drive->hwif; in it821x_dma_start()
365 u8 unit = drive->dn & 1; in it821x_dma_start()
367 if(itdev->mwdma[unit] != MWDMA_OFF) in it821x_dma_start()
368 it821x_program(drive, itdev->mwdma[unit]); in it821x_dma_start()
369 else if(itdev->udma[unit] != UDMA_OFF && itdev->timing10) in it821x_dma_start()
370 it821x_program_udma(drive, itdev->udma[unit]); in it821x_dma_start()
371 ide_dma_start(drive); in it821x_dma_start()
375 * it821x_dma_write - DMA hook
376 * @drive: drive for DMA stop
383 static int it821x_dma_end(ide_drive_t *drive) in it821x_dma_end() argument
385 ide_hwif_t *hwif = drive->hwif; in it821x_dma_end()
387 int ret = ide_dma_end(drive); in it821x_dma_end()
388 u8 unit = drive->dn & 1; in it821x_dma_end()
390 if(itdev->mwdma[unit] != MWDMA_OFF) in it821x_dma_end()
391 it821x_program(drive, itdev->pio[unit]); in it821x_dma_end()
396 * it821x_set_dma_mode - set host controller for DMA mode
398 * @drive: drive
400 * Tune the ITE chipset for the desired DMA mode.
403 static void it821x_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) in it821x_set_dma_mode() argument
405 const u8 speed = drive->dma_mode; in it821x_set_dma_mode()
413 it821x_tune_udma(drive, speed - XFER_UDMA_0); in it821x_set_dma_mode()
415 it821x_tune_mwdma(drive, speed - XFER_MW_DMA_0); in it821x_set_dma_mode()
419 * it821x_cable_detect - cable detection
434 * it821x_quirkproc - post init callback
435 * @drive: drive
437 * This callback is run after the drive has been probed but
442 static void it821x_quirkproc(ide_drive_t *drive) in it821x_quirkproc() argument
444 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif); in it821x_quirkproc()
445 u16 *id = drive->id; in it821x_quirkproc()
447 if (!itdev->smart) { in it821x_quirkproc()
449 * If we are in pass through mode then not much in it821x_quirkproc()
454 drive->dev_flags |= IDE_DFLAG_UNMASK; in it821x_quirkproc()
457 * Perform fixups on smart mode. We need to "lose" some in it821x_quirkproc()
460 * in RAID mode. in it821x_quirkproc()
466 /* In raid mode the ident block is slightly buggy in it821x_quirkproc()
474 drive->name, id[147] ? "Bootable " : "", in it821x_quirkproc()
495 drive->name); in it821x_quirkproc()
499 * Set MWDMA0 mode as enabled/support - just to tell in it821x_quirkproc()
501 * takes care of DMA mode programming). in it821x_quirkproc()
505 drive->current_speed = XFER_MW_DMA_0; in it821x_quirkproc()
523 * init_hwif_it821x - set up hwif structs
533 struct pci_dev *dev = to_pci_dev(hwif->dev); in init_hwif_it821x()
535 struct it821x_dev *itdevs = host->host_priv; in init_hwif_it821x()
536 struct it821x_dev *idev = itdevs + hwif->channel; in init_hwif_it821x()
543 idev->smart = 1; in init_hwif_it821x()
544 hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; in init_hwif_it821x()
547 hwif->rqsize = 256; in init_hwif_it821x()
551 if (conf & (1 << (1 + hwif->channel))) in init_hwif_it821x()
552 idev->clock_mode = ATA_50; in init_hwif_it821x()
554 idev->clock_mode = ATA_66; in init_hwif_it821x()
556 idev->want[0][1] = ATA_ANY; in init_hwif_it821x()
557 idev->want[1][1] = ATA_ANY; in init_hwif_it821x()
564 if (dev->revision == 0x10) { in init_hwif_it821x()
565 idev->timing10 = 1; in init_hwif_it821x()
566 hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; in init_hwif_it821x()
567 if (idev->smart == 0) in init_hwif_it821x()
572 if (idev->smart == 0) { in init_hwif_it821x()
573 /* MWDMA/PIO clock switching for pass through mode */ in init_hwif_it821x()
574 hwif->dma_ops = &it821x_pass_through_dma_ops; in init_hwif_it821x()
576 hwif->host_flags |= IDE_HFLAG_NO_SET_MODE; in init_hwif_it821x()
578 if (hwif->dma_base == 0) in init_hwif_it821x()
581 hwif->ultra_mask = ATA_UDMA6; in init_hwif_it821x()
582 hwif->mwdma_mask = ATA_MWDMA2; in init_hwif_it821x()
584 /* Vortex86SX quirk: prevent Ultra-DMA mode to fix BadCRC issue */ in init_hwif_it821x()
585 if (idev->quirks & QUIRK_VORTEX86) { in init_hwif_it821x()
586 if (dev->revision == 0x11) in init_hwif_it821x()
587 hwif->ultra_mask = 0; in init_hwif_it821x()
596 /* Set to bypass mode, and reset PCI bus */ in it8212_disable_raid()
611 static char *mode[2] = { "pass through", "smart" }; in init_chipset_it821x() local
613 /* Force the card into bypass mode if so requested */ in init_chipset_it821x()
615 printk(KERN_INFO DRV_NAME " %s: forcing bypass mode\n", in init_chipset_it821x()
620 printk(KERN_INFO DRV_NAME " %s: controller in %s mode\n", in init_chipset_it821x()
621 pci_name(dev), mode[conf & 1]); in init_chipset_it821x()
626 /* it821x_set_{pio,dma}_mode() are only used in pass-through mode */
642 * it821x_init_one - pci layer discovery entry
658 return -ENOMEM; in it821x_init_one()
661 itdevs->quirks = id->driver_data; in it821x_init_one()
673 struct it821x_dev *itdevs = host->host_priv; in it821x_remove()
711 MODULE_PARM_DESC(noraid, "Force card into bypass mode");