sata_mv.c (a44253d24a97ec3efe601267274a5fb64d8696c1) sata_mv.c (96e2c487933e5f69e98fffdcae2c35c78a671c07)
1/*
2 * sata_mv.c - Marvell SATA support
3 *
4 * Copyright 2008: Marvell Corporation, all rights reserved.
5 * Copyright 2005: EMC Corporation, all rights reserved.
6 * Copyright 2005 Red Hat, Inc. All rights reserved.
7 *
8 * Please ALWAYS copy linux-ide@vger.kernel.org on emails.

--- 444 unchanged lines hidden (view full) ---

453
454struct mv_port_signal {
455 u32 amps;
456 u32 pre;
457};
458
459struct mv_host_priv {
460 u32 hp_flags;
1/*
2 * sata_mv.c - Marvell SATA support
3 *
4 * Copyright 2008: Marvell Corporation, all rights reserved.
5 * Copyright 2005: EMC Corporation, all rights reserved.
6 * Copyright 2005 Red Hat, Inc. All rights reserved.
7 *
8 * Please ALWAYS copy linux-ide@vger.kernel.org on emails.

--- 444 unchanged lines hidden (view full) ---

453
454struct mv_port_signal {
455 u32 amps;
456 u32 pre;
457};
458
459struct mv_host_priv {
460 u32 hp_flags;
461 u32 main_irq_mask;
461 struct mv_port_signal signal[8];
462 const struct mv_hw_ops *ops;
463 int n_ports;
464 void __iomem *base;
465 void __iomem *main_irq_cause_addr;
466 void __iomem *main_irq_mask_addr;
467 u32 irq_cause_ofs;
468 u32 irq_mask_ofs;

--- 369 unchanged lines hidden (view full) ---

838}
839
840static void mv_set_main_irq_mask(struct ata_host *host,
841 u32 disable_bits, u32 enable_bits)
842{
843 struct mv_host_priv *hpriv = host->private_data;
844 u32 old_mask, new_mask;
845
462 struct mv_port_signal signal[8];
463 const struct mv_hw_ops *ops;
464 int n_ports;
465 void __iomem *base;
466 void __iomem *main_irq_cause_addr;
467 void __iomem *main_irq_mask_addr;
468 u32 irq_cause_ofs;
469 u32 irq_mask_ofs;

--- 369 unchanged lines hidden (view full) ---

839}
840
841static void mv_set_main_irq_mask(struct ata_host *host,
842 u32 disable_bits, u32 enable_bits)
843{
844 struct mv_host_priv *hpriv = host->private_data;
845 u32 old_mask, new_mask;
846
846 old_mask = readl(hpriv->main_irq_mask_addr);
847 old_mask = hpriv->main_irq_mask;
847 new_mask = (old_mask & ~disable_bits) | enable_bits;
848 new_mask = (old_mask & ~disable_bits) | enable_bits;
848 if (new_mask != old_mask)
849 if (new_mask != old_mask) {
850 hpriv->main_irq_mask = new_mask;
849 writelfl(new_mask, hpriv->main_irq_mask_addr);
851 writelfl(new_mask, hpriv->main_irq_mask_addr);
852 }
850}
851
852static void mv_enable_port_irqs(struct ata_port *ap,
853 unsigned int port_bits)
854{
855 unsigned int shift, hardport, port = ap->port_no;
856 u32 disable_bits, enable_bits;
857

--- 1337 unchanged lines hidden (view full) ---

2195 * This routine holds the host lock while processing pending
2196 * interrupts.
2197 */
2198static irqreturn_t mv_interrupt(int irq, void *dev_instance)
2199{
2200 struct ata_host *host = dev_instance;
2201 struct mv_host_priv *hpriv = host->private_data;
2202 unsigned int handled = 0;
853}
854
855static void mv_enable_port_irqs(struct ata_port *ap,
856 unsigned int port_bits)
857{
858 unsigned int shift, hardport, port = ap->port_no;
859 u32 disable_bits, enable_bits;
860

--- 1337 unchanged lines hidden (view full) ---

2198 * This routine holds the host lock while processing pending
2199 * interrupts.
2200 */
2201static irqreturn_t mv_interrupt(int irq, void *dev_instance)
2202{
2203 struct ata_host *host = dev_instance;
2204 struct mv_host_priv *hpriv = host->private_data;
2205 unsigned int handled = 0;
2203 u32 main_irq_cause, main_irq_mask, pending_irqs;
2206 u32 main_irq_cause, pending_irqs;
2204
2205 spin_lock(&host->lock);
2206 main_irq_cause = readl(hpriv->main_irq_cause_addr);
2207
2208 spin_lock(&host->lock);
2209 main_irq_cause = readl(hpriv->main_irq_cause_addr);
2207 main_irq_mask = readl(hpriv->main_irq_mask_addr);
2208 pending_irqs = main_irq_cause & main_irq_mask;
2210 pending_irqs = main_irq_cause & hpriv->main_irq_mask;
2209 /*
2210 * Deal with cases where we either have nothing pending, or have read
2211 * a bogus register value which can indicate HW removal or PCI fault.
2212 */
2213 if (pending_irqs && main_irq_cause != 0xffffffffU) {
2214 if (unlikely((pending_irqs & PCI_ERR) && HAS_PCI(host)))
2215 handled = mv_pci_error(host, hpriv->base);
2216 else

--- 1253 unchanged lines hidden ---
2211 /*
2212 * Deal with cases where we either have nothing pending, or have read
2213 * a bogus register value which can indicate HW removal or PCI fault.
2214 */
2215 if (pending_irqs && main_irq_cause != 0xffffffffU) {
2216 if (unlikely((pending_irqs & PCI_ERR) && HAS_PCI(host)))
2217 handled = mv_pci_error(host, hpriv->base);
2218 else

--- 1253 unchanged lines hidden ---