Lines Matching +full:ide +full:- +full:port
2 * Copyright (C) 1998-2000 Michel Aubry, Maintainer
3 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer
4 * Copyright (C) 1999-2000 CJ, cjtsai@ali.com.tw, Maintainer
6 * Copyright (C) 1998-2000 Andre Hedrick (andre@linux-ide.org)
11 * Copyright (C) 2007-2010 Bartlomiej Zolnierkiewicz
16 * 9/7/99 --Parts from the above author are included and need to be
34 #include <linux/ide.h>
53 struct pci_dev *pdev = to_pci_dev(hwif->dev); in ali_fifo_control()
54 int pio_fifo = 0x54 + hwif->channel; in ali_fifo_control()
56 int shift = 4 * (drive->dn & 1); in ali_fifo_control()
67 struct pci_dev *dev = to_pci_dev(hwif->dev); in ali_program_timings()
68 int port = hwif->channel ? 0x5c : 0x58; in ali_program_timings() local
69 int udmat = 0x56 + hwif->channel; in ali_program_timings()
70 u8 unit = drive->dn & 1, udma; in ali_program_timings()
82 t->setup = clamp_val(t->setup, 1, 8) & 7; in ali_program_timings()
83 t->act8b = clamp_val(t->act8b, 1, 8) & 7; in ali_program_timings()
84 t->rec8b = clamp_val(t->rec8b, 1, 16) & 15; in ali_program_timings()
85 t->active = clamp_val(t->active, 1, 8) & 7; in ali_program_timings()
86 t->recover = clamp_val(t->recover, 1, 16) & 15; in ali_program_timings()
88 pci_write_config_byte(dev, port, t->setup); in ali_program_timings()
89 pci_write_config_byte(dev, port + 1, (t->act8b << 4) | t->rec8b); in ali_program_timings()
90 pci_write_config_byte(dev, port + unit + 2, in ali_program_timings()
91 (t->active << 4) | t->recover); in ali_program_timings()
95 * ali_set_pio_mode - set host controller for PIO mode
96 * @hwif: port
109 ide_timing_compute(drive, drive->pio_mode, &t, T, 1); in ali_set_pio_mode()
113 ide_timing_compute(pair, pair->pio_mode, &p, T, 1); in ali_set_pio_mode()
116 if (pair->dma_mode) { in ali_set_pio_mode()
117 ide_timing_compute(pair, pair->dma_mode, &p, T, 1); in ali_set_pio_mode()
126 ali_fifo_control(hwif, drive, (drive->media == ide_disk) ? 0x05 : 0x00); in ali_set_pio_mode()
132 * ali_udma_filter - compute UDMA mask
133 * @drive: IDE device
140 * Not WDC drives on M1543C-E (?)
146 if (drive->media != ide_disk) in ali_udma_filter()
149 strstr((char *)&drive->id[ATA_ID_PROD], "WDC ")) in ali_udma_filter()
153 return drive->hwif->ultra_mask; in ali_udma_filter()
157 * ali_set_dma_mode - set host controller for DMA mode
158 * @hwif: port
161 * Configure the hardware for the desired IDE transfer mode.
167 struct pci_dev *dev = to_pci_dev(hwif->dev); in ali_set_dma_mode()
171 const u8 speed = drive->dma_mode; in ali_set_dma_mode()
176 ide_timing_compute(drive, drive->dma_mode, &t, T, 1); in ali_set_dma_mode()
180 ide_timing_compute(pair, pair->pio_mode, &p, T, 1); in ali_set_dma_mode()
183 if (pair->dma_mode) { in ali_set_dma_mode()
184 ide_timing_compute(pair, pair->dma_mode, in ali_set_dma_mode()
193 udma_timing[speed - XFER_UDMA_0]); in ali_set_dma_mode()
203 * ali_dma_check - DMA check
212 if (m5229_revision < 0xC2 && drive->media != ide_disk) { in ali_dma_check()
213 if (cmd->tf_flags & IDE_TFLAG_WRITE) in ali_dma_check()
220 * init_chipset_ali15x3 - Initialise an ALi IDE controller
223 * This function initializes the ALI IDE controller and where
231 struct pci_dev *north = pci_get_slot(dev->bus, PCI_DEVFN(0,0)); in init_chipset_ali15x3()
233 m5229_revision = dev->revision; in init_chipset_ali15x3()
241 * revision 0x20 (1543-E, 1543-F) in init_chipset_ali15x3()
242 * revision 0xC0, 0xC1 (1543C-C, 1543C-D, 1543C-E) in init_chipset_ali15x3()
243 * clear CD-ROM DMA write bit, m5229, 0x4b, bit 7 in init_chipset_ali15x3()
261 * 1543C-B?, 1535, 1535D, 1553 in init_chipset_ali15x3()
280 if (north && north->vendor != PCI_VENDOR_ID_AL) in init_chipset_ali15x3()
286 * set south-bridge's enable bit, m1533, 0x79 in init_chipset_ali15x3()
292 * 1543C-B0 (m1533, 0x79, bit 2) in init_chipset_ali15x3()
311 * 0x53 changes meaning on later revs - we must no touch in init_chipset_ali15x3()
340 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
341 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
345 .ident = "Toshiba Satellite S1800-814",
348 DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
357 if (pdev->subsystem_vendor == 0x10CF && in ali_cable_override()
358 pdev->subsystem_device == 0x10AF) in ali_cable_override()
361 /* Mitac 8317 (Winbook-A) and relatives */ in ali_cable_override()
362 if (pdev->subsystem_vendor == 0x1071 && in ali_cable_override()
363 pdev->subsystem_device == 0x8317) in ali_cable_override()
374 * ali_cable_detect - cable detection
375 * @hwif: IDE interface
383 struct pci_dev *dev = to_pci_dev(hwif->dev); in ali_cable_detect()
388 * m5229 80-pin cable detection (from Host View) in ali_cable_detect()
390 * 0x4a bit0 is 0 => primary channel has 80-pin in ali_cable_detect()
391 * 0x4a bit1 is 0 => secondary channel has 80-pin in ali_cable_detect()
400 if ((tmpbyte & (1 << hwif->channel)) == 0) in ali_cable_detect()
410 * init_hwif_ali15x3 - Initialize the ALI IDE x86 stuff
413 * Obtain the IRQ tables for an ALi based IDE solution on the PC
421 s8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6, in init_hwif_ali15x3()
423 int irq = -1; in init_hwif_ali15x3()
427 * read IDE interface control in init_hwif_ali15x3()
434 /* get IRQ for IDE Controller */ in init_hwif_ali15x3()
435 if ((hwif->channel && ideic == 0x03) || in init_hwif_ali15x3()
436 (!hwif->channel && !ideic)) { in init_hwif_ali15x3()
443 } else if (hwif->channel && !(ideic & 0x01)) { in init_hwif_ali15x3()
452 hwif->irq = irq; in init_hwif_ali15x3()
460 * init_dma_ali15x3 - set up DMA on ALi15x3
461 * @hwif: IDE interface
462 * @d: IDE port info
469 struct pci_dev *dev = to_pci_dev(hwif->dev); in init_dma_ali15x3()
473 return -1; in init_dma_ali15x3()
475 hwif->dma_base = base; in init_dma_ali15x3()
478 return -1; in init_dma_ali15x3()
480 if (ide_pci_set_master(dev, d->name) < 0) in init_dma_ali15x3()
481 return -1; in init_dma_ali15x3()
483 if (!hwif->channel) in init_dma_ali15x3()
486 printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n", in init_dma_ali15x3()
487 hwif->name, base, base + 7); in init_dma_ali15x3()
490 return -1; in init_dma_ali15x3()
527 * alim15x3_init_one - set up an ALi15x3 IDE controller
538 u8 rev = dev->revision, idx = id->driver_data; in alim15x3_init_one()
601 MODULE_DESCRIPTION("PCI driver module for ALi 15x3 IDE");