Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71746
b: refs/heads/master
c: 8acf28c
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 19, 2007
1 parent 03931a2 commit 59d585f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 528a572daea90aa41db92683e5a8756acef514c4
refs/heads/master: 8acf28c090f0e5e049f56b27bdd7cf1fb40c6b98
27 changes: 6 additions & 21 deletions trunk/drivers/ide/pci/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,13 @@ __setup("all-generic-ide", ide_generic_all_on);
module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");

static void __devinit init_hwif_generic (ide_hwif_t *hwif)
{
switch(hwif->pci_dev->device) {
case PCI_DEVICE_ID_UMC_UM8673F:
case PCI_DEVICE_ID_UMC_UM8886A:
case PCI_DEVICE_ID_UMC_UM8886BF:
hwif->irq = hwif->channel ? 15 : 14;
break;
default:
break;
}
}
#define IDE_HFLAGS_UMC (IDE_HFLAG_NO_DMA | IDE_HFLAG_FORCE_LEGACY_IRQS)

#define DECLARE_GENERIC_PCI_DEV(name_str, dma_setting) \
#define DECLARE_GENERIC_PCI_DEV(name_str, extra_flags) \
{ \
.name = name_str, \
.init_hwif = init_hwif_generic, \
.host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \
dma_setting | \
extra_flags | \
IDE_HFLAG_BOOTABLE, \
.swdma_mask = ATA_SWDMA2, \
.mwdma_mask = ATA_MWDMA2, \
Expand All @@ -84,7 +72,6 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {

{ /* 1 */
.name = "NS87410",
.init_hwif = init_hwif_generic,
.enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
.host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
IDE_HFLAG_BOOTABLE,
Expand All @@ -95,16 +82,15 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {

/* 2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI", 0),
/* 3 */ DECLARE_GENERIC_PCI_DEV("HT6565", 0),
/* 4 */ DECLARE_GENERIC_PCI_DEV("UM8673F", IDE_HFLAG_NO_DMA),
/* 5 */ DECLARE_GENERIC_PCI_DEV("UM8886A", IDE_HFLAG_NO_DMA),
/* 6 */ DECLARE_GENERIC_PCI_DEV("UM8886BF", IDE_HFLAG_NO_DMA),
/* 4 */ DECLARE_GENERIC_PCI_DEV("UM8673F", IDE_HFLAGS_UMC),
/* 5 */ DECLARE_GENERIC_PCI_DEV("UM8886A", IDE_HFLAGS_UMC),
/* 6 */ DECLARE_GENERIC_PCI_DEV("UM8886BF", IDE_HFLAGS_UMC),
/* 7 */ DECLARE_GENERIC_PCI_DEV("HINT_IDE", 0),
/* 8 */ DECLARE_GENERIC_PCI_DEV("VIA_IDE", IDE_HFLAG_NO_AUTODMA),
/* 9 */ DECLARE_GENERIC_PCI_DEV("OPTI621V", IDE_HFLAG_NO_AUTODMA),

{ /* 10 */
.name = "VIA8237SATA",
.init_hwif = init_hwif_generic,
.host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
IDE_HFLAG_OFF_BOARD,
.swdma_mask = ATA_SWDMA2,
Expand All @@ -118,7 +104,6 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {

{ /* 14 */
.name = "Revolution",
.init_hwif = init_hwif_generic,
.host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
IDE_HFLAG_OFF_BOARD,
.swdma_mask = ATA_SWDMA2,
Expand Down
20 changes: 11 additions & 9 deletions trunk/drivers/ide/pci/via82cxxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
hwif->set_pio_mode = &via_set_pio_mode;
hwif->set_dma_mode = &via_set_drive;

#ifdef CONFIG_PPC_CHRP
if(machine_is(chrp) && _chrp_type == _CHRP_Pegasos) {
hwif->irq = hwif->channel ? 15 : 14;
}
#endif

for (i = 0; i < 2; i++) {
hwif->drives[i].io_32bit = 1;
hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
Expand All @@ -442,8 +436,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
if (!hwif->dma_base)
return;

hwif->ultra_mask = vdev->via_config->udma_mask;

if (hwif->cbl != ATA_CBL_PATA40_SHORT)
hwif->cbl = via82cxxx_cable_detect(hwif);
}
Expand Down Expand Up @@ -479,8 +471,10 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {

static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &via82cxxx_chipsets[id->driver_data];
struct pci_dev *isa = NULL;
struct via_isa_bridge *via_config;

/*
* Find the ISA bridge and check we know what it is.
*/
Expand All @@ -490,7 +484,15 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n");
return -ENODEV;
}
return ide_setup_pci_device(dev, &via82cxxx_chipsets[id->driver_data]);

#ifdef CONFIG_PPC_CHRP
if (machine_is(chrp) && _chrp_type == _CHRP_Pegasos)
d->host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;
#endif

d->udma_mask = via_config->udma_mask;

return ide_setup_pci_device(dev, d);
}

static const struct pci_device_id via_pci_tbl[] = {
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/ide/setup-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0)
ide_hwif_setup_dma(dev, d, hwif);

if ((d->host_flags & IDE_HFLAG_LEGACY_IRQS) && hwif->irq == 0)
if ((!hwif->irq && (d->host_flags & IDE_HFLAG_LEGACY_IRQS)) ||
(d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS))
hwif->irq = port ? 15 : 14;

hwif->host_flags = d->host_flags;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,8 @@ enum {
IDE_HFLAG_SERIALIZE = (1 << 20),
/* use legacy IRQs */
IDE_HFLAG_LEGACY_IRQS = (1 << 21),
/* force use of legacy IRQs */
IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22),
};

#ifdef CONFIG_BLK_DEV_OFFBOARD
Expand Down

0 comments on commit 59d585f

Please sign in to comment.