ide: add ->chipset field to ide_pci_device_t

Add ->chipset field to ide_pci_device_t and use it in ide_hwif_configure()
to set hwif->chipset.  Convert cmd64x, cy82c693, rz1000 and trm290 host
drivers to use this new ability.

While at it define hwif_chipset_t as u8 to save some space in hw_regs_t,
ide_hwif_t and ide_pci_device_t instances.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 44a59ad5
...@@ -506,9 +506,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif) ...@@ -506,9 +506,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
hwif->set_pio_mode = &cmd64x_set_pio_mode; hwif->set_pio_mode = &cmd64x_set_pio_mode;
hwif->set_dma_mode = &cmd64x_set_dma_mode; hwif->set_dma_mode = &cmd64x_set_dma_mode;
if (dev->device == PCI_DEVICE_ID_CMD_646)
hwif->chipset = ide_cmd646;
if (!hwif->dma_base) if (!hwif->dma_base)
return; return;
...@@ -575,6 +572,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { ...@@ -575,6 +572,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
.init_chipset = init_chipset_cmd64x, .init_chipset = init_chipset_cmd64x,
.init_hwif = init_hwif_cmd64x, .init_hwif = init_hwif_cmd64x,
.enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
.chipset = ide_cmd646,
.host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
.pio_mask = ATA_PIO5, .pio_mask = ATA_PIO5,
.mwdma_mask = ATA_MWDMA2, .mwdma_mask = ATA_MWDMA2,
......
...@@ -428,7 +428,6 @@ static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const c ...@@ -428,7 +428,6 @@ static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const c
*/ */
static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif) static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
{ {
hwif->chipset = ide_cy82c693;
hwif->set_pio_mode = &cy82c693_set_pio_mode; hwif->set_pio_mode = &cy82c693_set_pio_mode;
if (hwif->dma_base == 0) if (hwif->dma_base == 0)
...@@ -454,6 +453,7 @@ static ide_pci_device_t cy82c693_chipset __devinitdata = { ...@@ -454,6 +453,7 @@ static ide_pci_device_t cy82c693_chipset __devinitdata = {
.init_chipset = init_chipset_cy82c693, .init_chipset = init_chipset_cy82c693,
.init_iops = init_iops_cy82c693, .init_iops = init_iops_cy82c693,
.init_hwif = init_hwif_cy82c693, .init_hwif = init_hwif_cy82c693,
.chipset = ide_cy82c693,
.host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA | .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA |
IDE_HFLAG_BOOTABLE, IDE_HFLAG_BOOTABLE,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
......
...@@ -35,7 +35,6 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif) ...@@ -35,7 +35,6 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
u16 reg; u16 reg;
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
hwif->chipset = ide_rz1000;
if (!pci_read_config_word (dev, 0x40, &reg) && if (!pci_read_config_word (dev, 0x40, &reg) &&
!pci_write_config_word(dev, 0x40, reg & 0xdfff)) { !pci_write_config_word(dev, 0x40, reg & 0xdfff)) {
printk(KERN_INFO "%s: disabled chipset read-ahead " printk(KERN_INFO "%s: disabled chipset read-ahead "
...@@ -53,6 +52,7 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif) ...@@ -53,6 +52,7 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
static ide_pci_device_t rz1000_chipset __devinitdata = { static ide_pci_device_t rz1000_chipset __devinitdata = {
.name = "RZ100x", .name = "RZ100x",
.init_hwif = init_hwif_rz1000, .init_hwif = init_hwif_rz1000,
.chipset = ide_rz1000,
.host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_BOOTABLE, .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_BOOTABLE,
}; };
......
...@@ -250,7 +250,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) ...@@ -250,7 +250,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
u8 reg = 0; u8 reg = 0;
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
hwif->chipset = ide_trm290;
cfgbase = pci_resource_start(dev, 4); cfgbase = pci_resource_start(dev, 4);
if ((dev->class & 5) && cfgbase) { if ((dev->class & 5) && cfgbase) {
hwif->config_data = cfgbase; hwif->config_data = cfgbase;
...@@ -323,6 +322,7 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) ...@@ -323,6 +322,7 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
static ide_pci_device_t trm290_chipset __devinitdata = { static ide_pci_device_t trm290_chipset __devinitdata = {
.name = "TRM290", .name = "TRM290",
.init_hwif = init_hwif_trm290, .init_hwif = init_hwif_trm290,
.chipset = ide_trm290,
.host_flags = IDE_HFLAG_NO_ATAPI_DMA | .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
#if 0 /* play it safe for now */ #if 0 /* play it safe for now */
IDE_HFLAG_TRUST_BIOS_FOR_DMA | IDE_HFLAG_TRUST_BIOS_FOR_DMA |
......
...@@ -397,7 +397,7 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d, ...@@ -397,7 +397,7 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
} }
hwif->chipset = ide_pci; hwif->chipset = d->chipset ? d->chipset : ide_pci;
hwif->pci_dev = dev; hwif->pci_dev = dev;
hwif->cds = (struct ide_pci_device_s *) d; hwif->cds = (struct ide_pci_device_s *) d;
hwif->channel = port; hwif->channel = port;
......
...@@ -200,14 +200,16 @@ typedef int (ide_ack_intr_t)(struct hwif_s *); ...@@ -200,14 +200,16 @@ typedef int (ide_ack_intr_t)(struct hwif_s *);
* hwif_chipset_t is used to keep track of the specific hardware * hwif_chipset_t is used to keep track of the specific hardware
* chipset used by each IDE interface, if known. * chipset used by each IDE interface, if known.
*/ */
typedef enum { ide_unknown, ide_generic, ide_pci, enum { ide_unknown, ide_generic, ide_pci,
ide_cmd640, ide_dtc2278, ide_ali14xx, ide_cmd640, ide_dtc2278, ide_ali14xx,
ide_qd65xx, ide_umc8672, ide_ht6560b, ide_qd65xx, ide_umc8672, ide_ht6560b,
ide_rz1000, ide_trm290, ide_rz1000, ide_trm290,
ide_cmd646, ide_cy82c693, ide_4drives, ide_cmd646, ide_cy82c693, ide_4drives,
ide_pmac, ide_etrax100, ide_acorn, ide_pmac, ide_etrax100, ide_acorn,
ide_au1xxx, ide_forced ide_au1xxx, ide_forced
} hwif_chipset_t; };
typedef u8 hwif_chipset_t;
/* /*
* Structure to hold all information about the location of this port * Structure to hold all information about the location of this port
...@@ -1277,6 +1279,7 @@ typedef struct ide_pci_device_s { ...@@ -1277,6 +1279,7 @@ typedef struct ide_pci_device_s {
void (*init_dma)(ide_hwif_t *, unsigned long); void (*init_dma)(ide_hwif_t *, unsigned long);
void (*fixup)(ide_hwif_t *); void (*fixup)(ide_hwif_t *);
ide_pci_enablebit_t enablebits[2]; ide_pci_enablebit_t enablebits[2];
hwif_chipset_t chipset;
unsigned int extra; unsigned int extra;
u32 host_flags; u32 host_flags;
u8 pio_mask; u8 pio_mask;
......
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