ide: add IDE_HFLAG_NO_{IO32_BIT,UNMASK_IRQS} host flags

* Use the same bit for IDE_HFLAG_CS5520 and IDE_HFLAG_VDMA host flags
  (both are used only by cs5520 host driver currently).

* Add IDE_HFLAG_NO_IO32_BIT host flag and use it instead of ->no_io_32bit
  ide_hwif_t field.

* Add IDE_HFLAG_NO_UNMASK_IRQS host flag, then convert dtc2278 and rz1000
  host drivers to use it.

There should be no functionality changes caused by this patch.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 7704ca2a
...@@ -822,7 +822,7 @@ static void ide_port_tune_devices(ide_hwif_t *hwif) ...@@ -822,7 +822,7 @@ static void ide_port_tune_devices(ide_hwif_t *hwif)
for (unit = 0; unit < MAX_DRIVES; ++unit) { for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit]; ide_drive_t *drive = &hwif->drives[unit];
if (hwif->no_io_32bit) if (hwif->host_flags & IDE_HFLAG_NO_IO_32BIT)
drive->no_io_32bit = 1; drive->no_io_32bit = 1;
else else
drive->no_io_32bit = drive->id->dword_io ? 1 : 0; drive->no_io_32bit = drive->id->dword_io ? 1 : 0;
...@@ -1300,6 +1300,8 @@ static void ide_port_init_devices(ide_hwif_t *hwif) ...@@ -1300,6 +1300,8 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
drive->io_32bit = 1; drive->io_32bit = 1;
if (hwif->host_flags & IDE_HFLAG_UNMASK_IRQS) if (hwif->host_flags & IDE_HFLAG_UNMASK_IRQS)
drive->unmask = 1; drive->unmask = 1;
if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS)
drive->no_unmask = 1;
if ((hwif->host_flags & IDE_HFLAG_NO_AUTOTUNE) == 0) if ((hwif->host_flags & IDE_HFLAG_NO_AUTOTUNE) == 0)
drive->autotune = 1; drive->autotune = 1;
} }
......
...@@ -89,7 +89,10 @@ static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio) ...@@ -89,7 +89,10 @@ static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
static const struct ide_port_info dtc2278_port_info __initdata = { static const struct ide_port_info dtc2278_port_info __initdata = {
.chipset = ide_dtc2278, .chipset = ide_dtc2278,
.host_flags = IDE_HFLAG_SERIALIZE | .host_flags = IDE_HFLAG_SERIALIZE |
IDE_HFLAG_NO_UNMASK_IRQS |
IDE_HFLAG_IO_32BIT | IDE_HFLAG_IO_32BIT |
/* disallow ->io_32bit changes */
IDE_HFLAG_NO_IO_32BIT |
IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_DMA |
IDE_HFLAG_NO_AUTOTUNE, IDE_HFLAG_NO_AUTOTUNE,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
...@@ -125,14 +128,7 @@ static int __init dtc2278_probe(void) ...@@ -125,14 +128,7 @@ static int __init dtc2278_probe(void)
#endif #endif
local_irq_restore(flags); local_irq_restore(flags);
hwif->no_io_32bit = 1; /* disallow ->io_32bit changes */
hwif->set_pio_mode = &dtc2278_set_pio_mode; hwif->set_pio_mode = &dtc2278_set_pio_mode;
hwif->drives[0].no_unmask = 1;
hwif->drives[1].no_unmask = 1;
mate->no_io_32bit = 1;
mate->drives[0].no_unmask = 1;
mate->drives[1].no_unmask = 1;
ide_device_add(idx, &dtc2278_port_info); ide_device_add(idx, &dtc2278_port_info);
......
...@@ -551,6 +551,7 @@ static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif) ...@@ -551,6 +551,7 @@ static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif)
static const struct ide_port_info au1xxx_port_info = { static const struct ide_port_info au1xxx_port_info = {
.host_flags = IDE_HFLAG_POST_SET_MODE | .host_flags = IDE_HFLAG_POST_SET_MODE |
IDE_HFLAG_NO_DMA | /* no SFF-style DMA */ IDE_HFLAG_NO_DMA | /* no SFF-style DMA */
IDE_HFLAG_NO_IO_32BIT |
IDE_HFLAG_UNMASK_IRQS, IDE_HFLAG_UNMASK_IRQS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
...@@ -649,8 +650,6 @@ static int au_ide_probe(struct device *dev) ...@@ -649,8 +650,6 @@ static int au_ide_probe(struct device *dev)
hwif->select_data = 0; /* no chipset-specific code */ hwif->select_data = 0; /* no chipset-specific code */
hwif->config_data = 0; /* no chipset-specific code */ hwif->config_data = 0; /* no chipset-specific code */
hwif->no_io_32bit = 1;
auide_hwif.hwif = hwif; auide_hwif.hwif = hwif;
hwif->hwif_data = &auide_hwif; hwif->hwif_data = &auide_hwif;
......
...@@ -33,8 +33,7 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif) ...@@ -33,8 +33,7 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
} else { } else {
if (hwif->mate) if (hwif->mate)
hwif->mate->serialized = hwif->serialized = 1; hwif->mate->serialized = hwif->serialized = 1;
hwif->drives[0].no_unmask = 1; hwif->host_flags |= IDE_HFLAG_NO_UNMASK_IRQS;
hwif->drives[1].no_unmask = 1;
printk(KERN_INFO "%s: serialized, disabled unmasking " printk(KERN_INFO "%s: serialized, disabled unmasking "
"(buggy RZ1000/RZ1001)\n", hwif->name); "(buggy RZ1000/RZ1001)\n", hwif->name);
} }
......
...@@ -607,7 +607,6 @@ typedef struct hwif_s { ...@@ -607,7 +607,6 @@ typedef struct hwif_s {
unsigned reset : 1; /* reset after probe */ unsigned reset : 1; /* reset after probe */
unsigned auto_poll : 1; /* supports nop auto-poll */ unsigned auto_poll : 1; /* supports nop auto-poll */
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
unsigned mmio : 1; /* host uses MMIO */ unsigned mmio : 1; /* host uses MMIO */
struct device gendev; struct device gendev;
...@@ -1065,7 +1064,7 @@ enum { ...@@ -1065,7 +1064,7 @@ enum {
IDE_HFLAG_NO_SET_MODE = (1 << 9), IDE_HFLAG_NO_SET_MODE = (1 << 9),
/* trust BIOS for programming chipset/device for DMA */ /* trust BIOS for programming chipset/device for DMA */
IDE_HFLAG_TRUST_BIOS_FOR_DMA = (1 << 10), IDE_HFLAG_TRUST_BIOS_FOR_DMA = (1 << 10),
/* host uses VDMA */ /* host uses VDMA (tied with IDE_HFLAG_CS5520 for now) */
IDE_HFLAG_VDMA = (1 << 11), IDE_HFLAG_VDMA = (1 << 11),
/* ATAPI DMA is unsupported */ /* ATAPI DMA is unsupported */
IDE_HFLAG_NO_ATAPI_DMA = (1 << 12), IDE_HFLAG_NO_ATAPI_DMA = (1 << 12),
...@@ -1075,8 +1074,10 @@ enum { ...@@ -1075,8 +1074,10 @@ enum {
IDE_HFLAG_NO_DMA = (1 << 14), IDE_HFLAG_NO_DMA = (1 << 14),
/* check if host is PCI IDE device before allowing DMA */ /* check if host is PCI IDE device before allowing DMA */
IDE_HFLAG_NO_AUTODMA = (1 << 15), IDE_HFLAG_NO_AUTODMA = (1 << 15),
/* don't autotune PIO */
IDE_HFLAG_NO_AUTOTUNE = (1 << 16),
/* host is CS5510/CS5520 */ /* host is CS5510/CS5520 */
IDE_HFLAG_CS5520 = (1 << 16), IDE_HFLAG_CS5520 = IDE_HFLAG_VDMA,
/* no LBA48 */ /* no LBA48 */
IDE_HFLAG_NO_LBA48 = (1 << 17), IDE_HFLAG_NO_LBA48 = (1 << 17),
/* no LBA48 DMA */ /* no LBA48 DMA */
...@@ -1102,8 +1103,10 @@ enum { ...@@ -1102,8 +1103,10 @@ enum {
IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28), IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28),
/* DSC overlap is unsupported */ /* DSC overlap is unsupported */
IDE_HFLAG_NO_DSC = (1 << 29), IDE_HFLAG_NO_DSC = (1 << 29),
/* don't autotune PIO */ /* never use 32-bit I/O ops */
IDE_HFLAG_NO_AUTOTUNE = (1 << 30), IDE_HFLAG_NO_IO_32BIT = (1 << 30),
/* never unmask IRQs */
IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31),
}; };
#ifdef CONFIG_BLK_DEV_OFFBOARD #ifdef CONFIG_BLK_DEV_OFFBOARD
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment