H A D | pmac.c | 419 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_apply_timings() local 422 writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG)); pmac_ide_apply_timings() 424 writel(pmif->timings[0], PMAC_IDE_REG(IDE_TIMING_CONFIG)); pmac_ide_apply_timings() 436 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_kauai_apply_timings() local 439 writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG)); pmac_ide_kauai_apply_timings() 440 writel(pmif->timings[3], PMAC_IDE_REG(IDE_KAUAI_ULTRA_CONFIG)); pmac_ide_kauai_apply_timings() 442 writel(pmif->timings[0], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG)); pmac_ide_kauai_apply_timings() 443 writel(pmif->timings[2], PMAC_IDE_REG(IDE_KAUAI_ULTRA_CONFIG)); pmac_ide_kauai_apply_timings() 455 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_do_update_timings() local 457 if (pmif->kind == controller_sh_ata6 || pmac_ide_do_update_timings() 458 pmif->kind == controller_un_ata6 || pmac_ide_do_update_timings() 459 pmif->kind == controller_k2_ata6) pmac_ide_do_update_timings() 500 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_set_pio_mode() local 509 timings = &pmif->timings[drive->dn & 1]; pmac_ide_set_pio_mode() 514 switch (pmif->kind) { pmac_ide_set_pio_mode() 780 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_set_dma_mode() local 786 timings = &pmif->timings[unit]; pmac_ide_set_dma_mode() 787 timings2 = &pmif->timings[unit+2]; pmac_ide_set_dma_mode() 794 if (pmif->kind == controller_kl_ata4) pmac_ide_set_dma_mode() 796 else if (pmif->kind == controller_un_ata6 pmac_ide_set_dma_mode() 797 || pmif->kind == controller_k2_ata6) pmac_ide_set_dma_mode() 799 else if (pmif->kind == controller_sh_ata6) pmac_ide_set_dma_mode() 804 set_timings_mdma(drive, pmif->kind, &tl[0], &tl[1], speed); pmac_ide_set_dma_mode() 821 sanitize_timings(pmac_ide_hwif_t *pmif) sanitize_timings() argument 825 switch(pmif->kind) { sanitize_timings() 847 pmif->timings[0] = pmif->timings[1] = value; sanitize_timings() 848 pmif->timings[2] = pmif->timings[3] = value2; sanitize_timings() 851 static int on_media_bay(pmac_ide_hwif_t *pmif) on_media_bay() argument 853 return pmif->mdev && pmif->mdev->media_bay != NULL; on_media_bay() 859 static int pmac_ide_do_suspend(pmac_ide_hwif_t *pmif) pmac_ide_do_suspend() argument 862 pmif->timings[0] = 0; pmac_ide_do_suspend() 863 pmif->timings[1] = 0; pmac_ide_do_suspend() 865 disable_irq(pmif->irq); pmac_ide_do_suspend() 868 if (on_media_bay(pmif)) pmac_ide_do_suspend() 872 if (pmif->kauai_fcr) { pmac_ide_do_suspend() 873 u32 fcr = readl(pmif->kauai_fcr); pmac_ide_do_suspend() 875 writel(fcr, pmif->kauai_fcr); pmac_ide_do_suspend() 879 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, pmac_ide_do_suspend() 888 static int pmac_ide_do_resume(pmac_ide_hwif_t *pmif) pmac_ide_do_resume() argument 891 if (!on_media_bay(pmif)) { pmac_ide_do_resume() 892 ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 1); pmac_ide_do_resume() 893 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1); pmac_ide_do_resume() 895 ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0); pmac_ide_do_resume() 898 if (pmif->kauai_fcr) { pmac_ide_do_resume() 899 u32 fcr = readl(pmif->kauai_fcr); pmac_ide_do_resume() 901 writel(fcr, pmif->kauai_fcr); pmac_ide_do_resume() 908 sanitize_timings(pmif); pmac_ide_do_resume() 910 enable_irq(pmif->irq); pmac_ide_do_resume() 917 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_cable_detect() local 918 struct device_node *np = pmif->node; pmac_ide_cable_detect() 948 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_init_dev() local 950 if (on_media_bay(pmif)) { pmac_ide_init_dev() 951 if (check_media_bay(pmif->mdev->media_bay) == MB_CD) { pmac_ide_init_dev() 1021 static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, struct ide_hw *hw) pmac_ide_setup_device() argument 1023 struct device_node *np = pmif->node; pmac_ide_setup_device() 1031 pmif->broken_dma = pmif->broken_dma_warn = 0; pmac_ide_setup_device() 1033 pmif->kind = controller_sh_ata6; pmac_ide_setup_device() 1038 pmif->kind = controller_un_ata6; pmac_ide_setup_device() 1043 pmif->kind = controller_k2_ata6; pmac_ide_setup_device() 1049 pmif->kind = controller_kl_ata4; pmac_ide_setup_device() 1053 pmif->kind = controller_kl_ata3; pmac_ide_setup_device() 1055 pmif->kind = controller_heathrow; pmac_ide_setup_device() 1057 pmif->kind = controller_ohare; pmac_ide_setup_device() 1058 pmif->broken_dma = 1; pmac_ide_setup_device() 1062 pmif->aapl_bus_id = bidp ? *bidp : 0; pmac_ide_setup_device() 1065 if (pmif->kauai_fcr) pmac_ide_setup_device() 1068 KAUAI_FCR_UATA_ENABLE, pmif->kauai_fcr); pmac_ide_setup_device() 1071 sanitize_timings(pmif); pmac_ide_setup_device() 1074 if (pmif->mdev) pmac_ide_setup_device() 1075 lock_media_bay(pmif->mdev->media_bay); pmac_ide_setup_device() 1082 hwif = pmif->hwif = host->ports[0]; pmac_ide_setup_device() 1084 if (on_media_bay(pmif)) { pmac_ide_setup_device() 1087 pmif->aapl_bus_id = 1; pmac_ide_setup_device() 1088 } else if (pmif->kind == controller_ohare) { pmac_ide_setup_device() 1096 ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1); pmac_ide_setup_device() 1097 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1); pmac_ide_setup_device() 1099 ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0); pmac_ide_setup_device() 1104 "bus ID %d%s, irq %d\n", model_name[pmif->kind], pmac_ide_setup_device() 1105 pmif->mdev ? "macio" : "PCI", pmif->aapl_bus_id, pmac_ide_setup_device() 1106 on_media_bay(pmif) ? " (mediabay)" : "", hw->irq); pmac_ide_setup_device() 1110 pmif->hwif = NULL; pmac_ide_setup_device() 1112 if (pmif->mdev) pmac_ide_setup_device() 1113 unlock_media_bay(pmif->mdev->media_bay); pmac_ide_setup_device() 1139 pmac_ide_hwif_t *pmif; pmac_ide_macio_attach() local 1143 pmif = kzalloc(sizeof(*pmif), GFP_KERNEL); pmac_ide_macio_attach() 1144 if (pmif == NULL) pmac_ide_macio_attach() 1177 pmif->mdev = mdev; pmac_ide_macio_attach() 1178 pmif->node = mdev->ofdev.dev.of_node; pmac_ide_macio_attach() 1179 pmif->regbase = regbase; pmac_ide_macio_attach() 1180 pmif->irq = irq; pmac_ide_macio_attach() 1181 pmif->kauai_fcr = NULL; pmac_ide_macio_attach() 1189 pmif->dma_regs = ioremap(macio_resource_start(mdev, 1), 0x1000); pmac_ide_macio_attach() 1191 pmif->dma_regs = NULL; pmac_ide_macio_attach() 1193 dev_set_drvdata(&mdev->ofdev.dev, pmif); pmac_ide_macio_attach() 1196 pmac_ide_init_ports(&hw, pmif->regbase); pmac_ide_macio_attach() 1201 rc = pmac_ide_setup_device(pmif, &hw); pmac_ide_macio_attach() 1206 if (pmif->dma_regs) { pmac_ide_macio_attach() 1207 iounmap(pmif->dma_regs); pmac_ide_macio_attach() 1211 kfree(pmif); pmac_ide_macio_attach() 1217 kfree(pmif); pmac_ide_macio_attach() 1224 pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); pmac_ide_macio_suspend() local 1229 rc = pmac_ide_do_suspend(pmif); pmac_ide_macio_suspend() 1240 pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); pmac_ide_macio_resume() local 1244 rc = pmac_ide_do_resume(pmif); pmac_ide_macio_resume() 1259 pmac_ide_hwif_t *pmif; pmac_ide_pci_attach() local 1271 pmif = kzalloc(sizeof(*pmif), GFP_KERNEL); pmac_ide_pci_attach() 1272 if (pmif == NULL) pmac_ide_pci_attach() 1290 pmif->mdev = NULL; pmac_ide_pci_attach() 1291 pmif->node = np; pmac_ide_pci_attach() 1297 pmif->regbase = (unsigned long) base + 0x2000; pmac_ide_pci_attach() 1298 pmif->dma_regs = base + 0x1000; pmac_ide_pci_attach() 1299 pmif->kauai_fcr = base; pmac_ide_pci_attach() 1300 pmif->irq = pdev->irq; pmac_ide_pci_attach() 1302 pci_set_drvdata(pdev, pmif); pmac_ide_pci_attach() 1305 pmac_ide_init_ports(&hw, pmif->regbase); pmac_ide_pci_attach() 1309 rc = pmac_ide_setup_device(pmif, &hw); pmac_ide_pci_attach() 1314 kfree(pmif); pmac_ide_pci_attach() 1320 kfree(pmif); pmac_ide_pci_attach() 1327 pmac_ide_hwif_t *pmif = pci_get_drvdata(pdev); pmac_ide_pci_suspend() local 1332 rc = pmac_ide_do_suspend(pmif); pmac_ide_pci_suspend() 1343 pmac_ide_hwif_t *pmif = pci_get_drvdata(pdev); pmac_ide_pci_resume() local 1347 rc = pmac_ide_do_resume(pmif); pmac_ide_pci_resume() 1358 pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); pmac_ide_macio_mb_event() local 1362 if (!pmif->hwif->present) pmac_ide_macio_mb_event() 1363 ide_port_scan(pmif->hwif); pmac_ide_macio_mb_event() 1366 if (pmif->hwif->present) pmac_ide_macio_mb_event() 1367 ide_port_unregister_devices(pmif->hwif); pmac_ide_macio_mb_event() 1460 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_build_dmatable() local 1462 volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; pmac_ide_build_dmatable() 1468 table = (struct dbdma_cmd *) pmif->dma_table_cpu; pmac_ide_build_dmatable() 1484 if (pmif->broken_dma && cur_addr & (L1_CACHE_BYTES - 1)) { pmac_ide_build_dmatable() 1485 if (pmif->broken_dma_warn == 0) { pmac_ide_build_dmatable() 1488 pmif->broken_dma_warn = 1; pmac_ide_build_dmatable() 1537 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_dma_setup() local 1538 u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4); pmac_ide_dma_setup() 1545 if (ata4 && (pmif->timings[unit] & TR_66_UDMA_EN)) { pmac_ide_dma_setup() 1546 writel(pmif->timings[unit] + (write ? 0 : 0x00800000UL), pmac_ide_dma_setup() 1562 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_dma_start() local 1565 dma = pmif->dma_regs; pmac_ide_dma_start() 1579 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_dma_end() local 1580 volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; pmac_ide_dma_end() 1603 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_dma_test_irq() local 1604 volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; pmac_ide_dma_test_irq() 1657 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_dma_lost_irq() local 1658 volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; pmac_ide_dma_lost_irq() 1679 pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); pmac_ide_init_dma() local 1685 if (dev == NULL || pmif->dma_regs == 0) pmac_ide_init_dma() 1692 pmif->dma_table_cpu = dma_alloc_coherent(&dev->dev, pmac_ide_init_dma() 1695 if (pmif->dma_table_cpu == NULL) { pmac_ide_init_dma()
|