~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

Viewing changes to drivers/ata/pata_via.c

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
361
361
        if (config->id == PCI_DEVICE_ID_VIA_82C586_0) {
362
362
                ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
363
363
                if (strcmp(model_num, "TS64GSSD25-M") == 0) {
364
 
                        ata_dev_printk(dev, KERN_WARNING,
365
 
        "disabling UDMA mode due to reported lockups with this device.\n");
 
364
                        ata_dev_warn(dev,
 
365
        "disabling UDMA mode due to reported lockups with this device\n");
366
366
                        mask &= ~ ATA_MASK_UDMA;
367
367
                }
368
368
        }
369
369
 
370
370
        if (dev->class == ATA_DEV_ATAPI &&
371
371
            dmi_check_system(no_atapi_dma_dmi_table)) {
372
 
                ata_dev_printk(dev, KERN_WARNING, "controller locks up on ATAPI DMA, forcing PIO\n");
 
372
                ata_dev_warn(dev, "controller locks up on ATAPI DMA, forcing PIO\n");
373
373
                mask &= ATA_MASK_PIO;
374
374
        }
375
375
 
509
509
        }
510
510
}
511
511
 
 
512
static void via_fixup(struct pci_dev *pdev, const struct via_isa_bridge *config)
 
513
{
 
514
        u32 timing;
 
515
 
 
516
        /* Initialise the FIFO for the enabled channels. */
 
517
        via_config_fifo(pdev, config->flags);
 
518
 
 
519
        if (config->udma_mask == ATA_UDMA4) {
 
520
                /* The 66 MHz devices require we enable the clock */
 
521
                pci_read_config_dword(pdev, 0x50, &timing);
 
522
                timing |= 0x80008;
 
523
                pci_write_config_dword(pdev, 0x50, timing);
 
524
        }
 
525
        if (config->flags & VIA_BAD_CLK66) {
 
526
                /* Disable the 66MHz clock on problem devices */
 
527
                pci_read_config_dword(pdev, 0x50, &timing);
 
528
                timing &= ~0x80008;
 
529
                pci_write_config_dword(pdev, 0x50, timing);
 
530
        }
 
531
}
 
532
 
512
533
/**
513
534
 *      via_init_one            -       discovery callback
514
535
 *      @pdev: PCI device
569
590
        const struct ata_port_info *ppi[] = { NULL, NULL };
570
591
        struct pci_dev *isa;
571
592
        const struct via_isa_bridge *config;
572
 
        static int printed_version;
573
593
        u8 enable;
574
 
        u32 timing;
575
594
        unsigned long flags = id->driver_data;
576
595
        int rc;
577
596
 
578
 
        if (!printed_version++)
579
 
                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
 
597
        ata_print_version_once(&pdev->dev, DRV_VERSION);
580
598
 
581
599
        rc = pcim_enable_device(pdev);
582
600
        if (rc)
611
629
                        return -ENODEV;
612
630
        }
613
631
 
614
 
        /* Initialise the FIFO for the enabled channels. */
615
 
        via_config_fifo(pdev, config->flags);
616
 
 
617
632
        /* Clock set up */
618
633
        switch (config->udma_mask) {
619
634
        case 0x00:
639
654
                return -ENODEV;
640
655
        }
641
656
 
642
 
        if (config->flags & VIA_BAD_CLK66) {
643
 
                /* Disable the 66MHz clock on problem devices */
644
 
                pci_read_config_dword(pdev, 0x50, &timing);
645
 
                timing &= ~0x80008;
646
 
                pci_write_config_dword(pdev, 0x50, timing);
647
 
        }
 
657
        via_fixup(pdev, config);
648
658
 
649
659
        /* We have established the device type, now fire it up */
650
660
        return ata_pci_bmdma_init_one(pdev, ppi, &via_sht, (void *)config, 0);
663
673
 
664
674
static int via_reinit_one(struct pci_dev *pdev)
665
675
{
666
 
        u32 timing;
667
676
        struct ata_host *host = dev_get_drvdata(&pdev->dev);
668
 
        const struct via_isa_bridge *config = host->private_data;
669
677
        int rc;
670
678
 
671
679
        rc = ata_pci_device_do_resume(pdev);
672
680
        if (rc)
673
681
                return rc;
674
682
 
675
 
        via_config_fifo(pdev, config->flags);
676
 
 
677
 
        if (config->udma_mask == ATA_UDMA4) {
678
 
                /* The 66 MHz devices require we enable the clock */
679
 
                pci_read_config_dword(pdev, 0x50, &timing);
680
 
                timing |= 0x80008;
681
 
                pci_write_config_dword(pdev, 0x50, timing);
682
 
        }
683
 
        if (config->flags & VIA_BAD_CLK66) {
684
 
                /* Disable the 66MHz clock on problem devices */
685
 
                pci_read_config_dword(pdev, 0x50, &timing);
686
 
                timing &= ~0x80008;
687
 
                pci_write_config_dword(pdev, 0x50, timing);
688
 
        }
 
683
        via_fixup(pdev, host->private_data);
689
684
 
690
685
        ata_host_resume(host);
691
686
        return 0;