Lines Matching refs:pmif
400 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_selectproc() local
402 if (pmif == NULL) in pmac_ide_selectproc()
406 writel(pmif->timings[1], in pmac_ide_selectproc()
409 writel(pmif->timings[0], in pmac_ide_selectproc()
417 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_kauai_selectproc() local
419 if (pmif == NULL) in pmac_ide_kauai_selectproc()
423 writel(pmif->timings[1], in pmac_ide_kauai_selectproc()
425 writel(pmif->timings[3], in pmac_ide_kauai_selectproc()
428 writel(pmif->timings[0], in pmac_ide_kauai_selectproc()
430 writel(pmif->timings[2], in pmac_ide_kauai_selectproc()
439 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_do_update_timings() local
441 if (pmif == NULL) in pmac_ide_do_update_timings()
444 if (pmif->kind == controller_un_ata6) in pmac_ide_do_update_timings()
541 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_tuneproc() local
543 if (pmif == NULL) in pmac_ide_tuneproc()
547 timings = &pmif->timings[drive->select.b.unit & 0x01]; in pmac_ide_tuneproc()
551 switch (pmif->kind) { in pmac_ide_tuneproc()
788 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_tune_chipset() local
791 if (pmif == NULL) in pmac_ide_tune_chipset()
794 timings = &pmif->timings[unit]; in pmac_ide_tune_chipset()
795 timings2 = &pmif->timings[unit+2]; in pmac_ide_tune_chipset()
800 if (pmif->kind != controller_un_ata6) in pmac_ide_tune_chipset()
809 if (pmif->kind == controller_kl_ata4) in pmac_ide_tune_chipset()
811 else if (pmif->kind == controller_un_ata6) in pmac_ide_tune_chipset()
819 ret = set_timings_mdma(pmif->kind, timings, timings2, speed, 0); in pmac_ide_tune_chipset()
850 sanitize_timings(pmac_ide_hwif_t *pmif) in sanitize_timings() argument
854 switch(pmif->kind) { in sanitize_timings()
871 pmif->timings[0] = pmif->timings[1] = value; in sanitize_timings()
872 pmif->timings[2] = pmif->timings[3] = value2; in sanitize_timings()
988 struct pmac_ide_hwif* pmif; in pmac_ide_probe() local
1088 pmif = &pmac_ide[i]; in pmac_ide_probe()
1090 pmif->mapbase = base; in pmac_ide_probe()
1091 pmif->regbase = regbase; in pmac_ide_probe()
1092 pmif->irq = irq; in pmac_ide_probe()
1093 pmif->node = np; in pmac_ide_probe()
1094 pmif->cable_80 = 0; in pmac_ide_probe()
1096 pmif->kind = controller_un_ata6; in pmac_ide_probe()
1097 pci_set_drvdata(pdev, pmif); in pmac_ide_probe()
1100 pmif->kind = controller_kl_ata4; in pmac_ide_probe()
1102 pmif->kind = controller_kl_ata3; in pmac_ide_probe()
1104 pmif->kind = controller_heathrow; in pmac_ide_probe()
1106 pmif->kind = controller_ohare; in pmac_ide_probe()
1109 pmif->aapl_bus_id = bidp ? *bidp : 0; in pmac_ide_probe()
1112 if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6) { in pmac_ide_probe()
1115 pmif->cable_80 = 1; in pmac_ide_probe()
1119 sanitize_timings(pmif); in pmac_ide_probe()
1128 pmif->aapl_bus_id = 1; in pmac_ide_probe()
1129 } else if (pmif->kind == controller_ohare) { in pmac_ide_probe()
1137 ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1); in pmac_ide_probe()
1138 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1); in pmac_ide_probe()
1140 ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0); in pmac_ide_probe()
1149 hwif->hwif_data = pmif; in pmac_ide_probe()
1155 hwif->udma_four = pmif->cable_80; in pmac_ide_probe()
1160 if (pmif->kind == controller_un_ata6) in pmac_ide_probe()
1167 i, model_name[pmif->kind], pmif->aapl_bus_id, in pmac_ide_probe()
1176 if (np->n_addrs >= 2 || pmif->kind == controller_un_ata6) { in pmac_ide_probe()
1181 switch(pmif->kind) { in pmac_ide_probe()
1183 hwif->ultra_mask = pmif->cable_80 ? 0x3f : 0x07; in pmac_ide_probe()
1188 hwif->ultra_mask = pmif->cable_80 ? 0x1f : 0x07; in pmac_ide_probe()
1217 pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)hwif->hwif_data; in pmac_ide_build_sglist() local
1219 struct scatterlist *sg = pmif->sg_table; in pmac_ide_build_sglist()
1226 pmif->sg_dma_direction = data_dir; in pmac_ide_build_sglist()
1276 pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)hwif->hwif_data; in pmac_ide_raw_build_sglist() local
1284 pmif->sg_dma_direction = PCI_DMA_TODEVICE; in pmac_ide_raw_build_sglist()
1286 pmif->sg_dma_direction = PCI_DMA_FROMDEVICE; in pmac_ide_raw_build_sglist()
1301 return pci_map_sg(hwif->pci_dev, sg, nents, pmif->sg_dma_direction); in pmac_ide_raw_build_sglist()
1314 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; in pmac_ide_build_dmatable() local
1315 volatile struct dbdma_regs *dma = pmif->dma_regs; in pmac_ide_build_dmatable()
1319 table = (struct dbdma_cmd *) pmif->dma_table_cpu; in pmac_ide_build_dmatable()
1328 pmif->sg_nents = i = pmac_ide_raw_build_sglist(hwif, rq); in pmac_ide_build_dmatable()
1330 pmif->sg_nents = i = pmac_ide_build_sglist(hwif, rq, ddir); in pmac_ide_build_dmatable()
1335 sg = pmif->sg_table; in pmac_ide_build_dmatable()
1374 writel(pmif->dma_table_dma, &dma->cmdptr); in pmac_ide_build_dmatable()
1381 pmif->sg_table, in pmac_ide_build_dmatable()
1382 pmif->sg_nents, in pmac_ide_build_dmatable()
1383 pmif->sg_dma_direction); in pmac_ide_build_dmatable()
1393 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_destroy_dmatable() local
1394 struct scatterlist *sg = pmif->sg_table; in pmac_ide_destroy_dmatable()
1395 int nents = pmif->sg_nents; in pmac_ide_destroy_dmatable()
1398 pci_unmap_sg(dev, sg, nents, pmif->sg_dma_direction); in pmac_ide_destroy_dmatable()
1399 pmif->sg_nents = 0; in pmac_ide_destroy_dmatable()
1409 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; in pmac_ide_mdma_enable() local
1417 timings = &pmif->timings[drive->select.b.unit & 0x01]; in pmac_ide_mdma_enable()
1418 timings2 = &pmif->timings[(drive->select.b.unit & 0x01) + 2]; in pmac_ide_mdma_enable()
1431 ret = set_timings_mdma( pmif->kind, in pmac_ide_mdma_enable()
1464 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; in pmac_ide_udma_enable() local
1470 timings = &pmif->timings[drive->select.b.unit & 0x01]; in pmac_ide_udma_enable()
1471 timings2 = &pmif->timings[(drive->select.b.unit & 0x01) + 2]; in pmac_ide_udma_enable()
1478 if (pmif->kind == controller_un_ata6) in pmac_ide_udma_enable()
1512 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; in pmac_ide_dma_check() local
1517 if (pmif == NULL) in pmac_ide_dma_check()
1532 if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6) { in pmac_ide_dma_check()
1534 if (pmif->cable_80) { in pmac_ide_dma_check()
1536 if (pmif->kind == controller_un_ata6) in pmac_ide_dma_check()
1556 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; in pmac_ide_dma_read() local
1564 if (pmif == NULL) in pmac_ide_dma_read()
1567 ata4 = (pmif->kind == controller_kl_ata4); in pmac_ide_dma_read()
1574 if (ata4 && (pmif->timings[unit] & TR_66_UDMA_EN)) { in pmac_ide_dma_read()
1575 writel(pmif->timings[unit]+0x00800000UL, in pmac_ide_dma_read()
1608 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; in pmac_ide_dma_write() local
1616 if (pmif == NULL) in pmac_ide_dma_write()
1619 ata4 = (pmif->kind == controller_kl_ata4); in pmac_ide_dma_write()
1626 if (ata4 && (pmif->timings[unit] & TR_66_UDMA_EN)) { in pmac_ide_dma_write()
1627 writel(pmif->timings[unit], in pmac_ide_dma_write()
1666 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_dma_begin() local
1669 if (pmif == NULL) in pmac_ide_dma_begin()
1671 dma = pmif->dma_regs; in pmac_ide_dma_begin()
1682 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_dma_end() local
1686 if (pmif == NULL) in pmac_ide_dma_end()
1688 dma = pmif->dma_regs; in pmac_ide_dma_end()
1705 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_dma_test_irq() local
1709 if (pmif == NULL) in pmac_ide_dma_test_irq()
1711 dma = pmif->dma_regs; in pmac_ide_dma_test_irq()
1771 pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; in pmac_ide_dma_lostirq() local
1775 if (pmif == NULL) in pmac_ide_dma_lostirq()
1777 dma = pmif->dma_regs; in pmac_ide_dma_lostirq()
1787 struct pmac_ide_hwif *pmif = &pmac_ide[ix]; in pmac_ide_setup_dma() local
1790 pmif->dma_regs = (volatile struct dbdma_regs*)(pmif->mapbase + 0x1000); in pmac_ide_setup_dma()
1796 pmif->dma_regs = in pmac_ide_setup_dma()
1805 pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent( in pmac_ide_setup_dma()
1808 &pmif->dma_table_dma); in pmac_ide_setup_dma()
1809 if (pmif->dma_table_cpu == NULL) { in pmac_ide_setup_dma()
1815 pmif->sg_table = kmalloc(sizeof(struct scatterlist) * MAX_DCMDS, in pmac_ide_setup_dma()
1817 if (pmif->sg_table == NULL) { in pmac_ide_setup_dma()
1820 pmif->dma_table_cpu, pmif->dma_table_dma); in pmac_ide_setup_dma()
1927 idepmac_sleep_interface(pmac_ide_hwif_t *pmif, unsigned base, int mediabay) in idepmac_sleep_interface() argument
1929 struct device_node* np = pmif->node; in idepmac_sleep_interface()
1932 pmif->timings[0] = 0; in idepmac_sleep_interface()
1933 pmif->timings[1] = 0; in idepmac_sleep_interface()
1940 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 0); in idepmac_sleep_interface()
1944 idepmac_wake_interface(pmac_ide_hwif_t *pmif, unsigned long base, int mediabay) in idepmac_wake_interface() argument
1946 struct device_node* np = pmif->node; in idepmac_wake_interface()
1950 ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1); in idepmac_wake_interface()
1951 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1); in idepmac_wake_interface()
1953 ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0); in idepmac_wake_interface()