Lines Matching +full:host +full:- +full:port
12 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
20 * as Documentation/driver-api/libata.rst
183 * port_mmio - Get the MMIO address of PDC2027x extended registers
184 * @ap: Port
189 return ap->host->iomap[PDC_MMIO_BAR] + ap->port_no * 0x100 + offset; in port_mmio()
193 * dev_mmio - Get the MMIO address of PDC2027x extended registers
194 * @ap: Port
200 u8 adj = (adev->devno) ? 0x08 : 0x00; in dev_mmio()
205 * pdc2027x_pata_cable_detect - Probe host controller cable detect info
206 * @ap: Port for which cable detect info is desired
223 PDPRINTK("No cable or 80-conductor cable on port %d\n", ap->port_no); in pdc2027x_cable_detect()
227 printk(KERN_INFO DRV_NAME ": 40-conductor cable detected on port %d\n", ap->port_no); in pdc2027x_cable_detect()
232 * pdc2027x_port_enabled - Check PDC ATA control register to see whether the port is enabled.
233 * @ap: Port to check
241 * pdc2027x_prereset - prereset for PATA host controller
253 /* Check whether port enabled */ in pdc2027x_prereset()
254 if (!pdc2027x_port_enabled(link->ap)) in pdc2027x_prereset()
255 return -ENOENT; in pdc2027x_prereset()
260 * pdc2720x_mode_filter - mode selection filter
272 if (adev->class != ATA_DEV_ATA || adev->devno == 0 || pair == NULL) in pdc2027x_mode_filter()
276 ata_id_c_string(pair->id, model_num, ATA_ID_PROD, in pdc2027x_mode_filter()
279 if (strstr(model_num, "Maxtor") == NULL && pair->dma_mode == XFER_UDMA_6) in pdc2027x_mode_filter()
286 * pdc2027x_set_piomode - Initialize host controller PATA PIO timings
287 * @ap: Port to configure
298 unsigned int pio = adev->pio_mode - XFER_PIO_0; in pdc2027x_set_piomode()
301 PDPRINTK("adev->pio_mode[%X]\n", adev->pio_mode); in pdc2027x_set_piomode()
330 * pdc2027x_set_dmamode - Initialize host controller PATA UDMA timings
331 * @ap: Port to configure
341 unsigned int dma_mode = adev->dma_mode; in pdc2027x_set_dmamode()
394 * pdc2027x_set_mode - Set the timing registers back to correct values.
404 struct ata_port *ap = link->ap; in pdc2027x_set_mode()
418 if (dev->xfer_shift == ATA_SHIFT_PIO) { in pdc2027x_set_mode()
432 * pdc2027x_check_atapi_dma - Check whether ATAPI DMA can be supported for this command
443 struct scsi_cmnd *cmd = qc->scsicmd; in pdc2027x_check_atapi_dma()
444 u8 *scsicmd = cmd->cmnd; in pdc2027x_check_atapi_dma()
473 * pdc_read_counter - Read the ctr counter
474 * @host: target ATA host
477 static long pdc_read_counter(struct ata_host *host) in pdc_read_counter() argument
479 void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR]; in pdc_read_counter()
498 * The 30-bit decreasing counter are read by 2 pieces. in pdc_read_counter()
503 retry--; in pdc_read_counter()
512 * adjust_pll - Adjust the PLL input clock in Hz.
515 * @host: target ATA host
518 static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int board_idx) in pdc_adjust_pll() argument
520 void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR]; in pdc_adjust_pll()
565 F = (ratio * (R+2)) / 1000 - 2; in pdc_adjust_pll()
599 * detect_pll_input_clock - Detect the PLL input clock in Hz.
600 * @host: target ATA host
604 static long pdc_detect_pll_input_clock(struct ata_host *host) in pdc_detect_pll_input_clock() argument
606 void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR]; in pdc_detect_pll_input_clock()
619 start_count = pdc_read_counter(host); in pdc_detect_pll_input_clock()
626 end_count = pdc_read_counter(host); in pdc_detect_pll_input_clock()
638 pll_clock = ((start_count - end_count) & 0x3fffffff) / 100 * in pdc_detect_pll_input_clock()
648 * pdc_hardware_init - Initialize the hardware.
649 * @host: target ATA host
652 static void pdc_hardware_init(struct ata_host *host, unsigned int board_idx) in pdc_hardware_init() argument
658 * On some system, where PCI bus is running at non-standard clock rate. in pdc_hardware_init()
662 pll_clock = pdc_detect_pll_input_clock(host); in pdc_hardware_init()
664 dev_info(host->dev, "PLL input clock %ld kHz\n", pll_clock/1000); in pdc_hardware_init()
667 pdc_adjust_pll(host, pll_clock, board_idx); in pdc_hardware_init()
671 * pdc_ata_setup_port - setup the mmio address
672 * @port: ata ioports to setup
675 static void pdc_ata_setup_port(struct ata_ioports *port, void __iomem *base) in pdc_ata_setup_port() argument
677 port->cmd_addr = in pdc_ata_setup_port()
678 port->data_addr = base; in pdc_ata_setup_port()
679 port->feature_addr = in pdc_ata_setup_port()
680 port->error_addr = base + 0x05; in pdc_ata_setup_port()
681 port->nsect_addr = base + 0x0a; in pdc_ata_setup_port()
682 port->lbal_addr = base + 0x0f; in pdc_ata_setup_port()
683 port->lbam_addr = base + 0x10; in pdc_ata_setup_port()
684 port->lbah_addr = base + 0x15; in pdc_ata_setup_port()
685 port->device_addr = base + 0x1a; in pdc_ata_setup_port()
686 port->command_addr = in pdc_ata_setup_port()
687 port->status_addr = base + 0x1f; in pdc_ata_setup_port()
688 port->altstatus_addr = in pdc_ata_setup_port()
689 port->ctl_addr = base + 0x81a; in pdc_ata_setup_port()
693 * pdc2027x_init_one - PCI probe function
707 unsigned int board_idx = (unsigned int) ent->driver_data; in pdc2027x_init_one()
710 struct ata_host *host; in pdc2027x_init_one() local
714 ata_print_version_once(&pdev->dev, DRV_VERSION); in pdc2027x_init_one()
716 /* alloc host */ in pdc2027x_init_one()
717 host = ata_host_alloc_pinfo(&pdev->dev, ppi, 2); in pdc2027x_init_one()
718 if (!host) in pdc2027x_init_one()
719 return -ENOMEM; in pdc2027x_init_one()
721 /* acquire resources and fill host */ in pdc2027x_init_one()
729 host->iomap = pcim_iomap_table(pdev); in pdc2027x_init_one()
731 rc = dma_set_mask(&pdev->dev, ATA_DMA_MASK); in pdc2027x_init_one()
735 rc = dma_set_coherent_mask(&pdev->dev, ATA_DMA_MASK); in pdc2027x_init_one()
739 mmio_base = host->iomap[PDC_MMIO_BAR]; in pdc2027x_init_one()
742 struct ata_port *ap = host->ports[i]; in pdc2027x_init_one()
744 pdc_ata_setup_port(&ap->ioaddr, mmio_base + cmd_offset[i]); in pdc2027x_init_one()
745 ap->ioaddr.bmdma_addr = mmio_base + bmdma_offset[i]; in pdc2027x_init_one()
747 ata_port_pbar_desc(ap, PDC_MMIO_BAR, -1, "mmio"); in pdc2027x_init_one()
754 pdc_hardware_init(host, board_idx); in pdc2027x_init_one()
757 return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, in pdc2027x_init_one()
764 struct ata_host *host = pci_get_drvdata(pdev); in pdc2027x_reinit_one() local
772 if (pdev->device == PCI_DEVICE_ID_PROMISE_20268 || in pdc2027x_reinit_one()
773 pdev->device == PCI_DEVICE_ID_PROMISE_20270) in pdc2027x_reinit_one()
778 pdc_hardware_init(host, board_idx); in pdc2027x_reinit_one()
780 ata_host_resume(host); in pdc2027x_reinit_one()