Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ac2b42a authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: add IDE_HFLAG_CLEAR_SIMPLEX host flag



* Rename 'simplex_stat' variable to 'dma_stat' in ide_get_or_set_dma_base().

* Factor out code for forcing host out of "simplex" mode from
  ide_get_or_set_dma_base() to ide_pci_clear_simplex() helper.

* Add IDE_HFLAG_CLEAR_SIMPLEX host flag and set it in alim15x3 (for M5229),
  amd74xx (for AMD 7409), cmd64x (for CMD643), generic (for Netcell) and
  serverworks (for CSB5) host drivers.

* Make ide_get_or_set_dma_base() test for IDE_HFLAG_CLEAR_SIMPLEX host flag
  instead of checking dev->device (BTW the code was buggy because it didn't
  check for dev->vendor, luckily none of these PCI Device IDs was used by
  some other vendor for PCI IDE controller).

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 993da8f9
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -775,7 +775,7 @@ static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_dev
	};
	};


	struct ide_port_info d = ali15x3_chipset;
	struct ide_port_info d = ali15x3_chipset;
	u8 rev = dev->revision;
	u8 rev = dev->revision, idx = id->driver_data;


	if (pci_dev_present(ati_rs100))
	if (pci_dev_present(ati_rs100))
		printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n");
		printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n");
@@ -798,6 +798,9 @@ static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_dev
			d.udma_mask = ATA_UDMA6;
			d.udma_mask = ATA_UDMA6;
	}
	}


	if (idx == 0)
		d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX;

#if defined(CONFIG_SPARC64)
#if defined(CONFIG_SPARC64)
	d.init_hwif = init_hwif_common_ali15x3;
	d.init_hwif = init_hwif_common_ali15x3;
#endif /* CONFIG_SPARC64 */
#endif /* CONFIG_SPARC64 */
@@ -807,7 +810,7 @@ static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_dev


static const struct pci_device_id alim15x3_pci_tbl[] = {
static const struct pci_device_id alim15x3_pci_tbl[] = {
	{ PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5229), 0 },
	{ PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5229), 0 },
	{ PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5228), 0 },
	{ PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5228), 1 },
	{ 0, },
	{ 0, },
};
};
MODULE_DEVICE_TABLE(pci, alim15x3_pci_tbl);
MODULE_DEVICE_TABLE(pci, alim15x3_pci_tbl);
+1 −0
Original line number Original line Diff line number Diff line
@@ -295,6 +295,7 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_
	if (idx == 1) {
	if (idx == 1) {
		if (dev->revision <= 7)
		if (dev->revision <= 7)
			d.swdma_mask = 0;
			d.swdma_mask = 0;
		d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX;
	} else if (idx == 4) {
	} else if (idx == 4) {
		if (dev->subsystem_vendor == PCI_VENDOR_ID_AMD &&
		if (dev->subsystem_vendor == PCI_VENDOR_ID_AMD &&
		    dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
		    dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
+3 −1
Original line number Original line Diff line number Diff line
@@ -443,7 +443,9 @@ static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
		.init_chipset	= init_chipset_cmd64x,
		.init_chipset	= init_chipset_cmd64x,
		.init_hwif	= init_hwif_cmd64x,
		.init_hwif	= init_hwif_cmd64x,
		.enablebits	= {{0x00,0x00,0x00}, {0x51,0x08,0x08}},
		.enablebits	= {{0x00,0x00,0x00}, {0x51,0x08,0x08}},
		.host_flags	= IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
		.host_flags	= IDE_HFLAG_CLEAR_SIMPLEX |
				  IDE_HFLAG_ABUSE_PREFETCH |
				  IDE_HFLAG_BOOTABLE,
		.pio_mask	= ATA_PIO5,
		.pio_mask	= ATA_PIO5,
		.mwdma_mask	= ATA_MWDMA2,
		.mwdma_mask	= ATA_MWDMA2,
		.udma_mask	= 0x00, /* no udma */
		.udma_mask	= 0x00, /* no udma */
+2 −1
Original line number Original line Diff line number Diff line
@@ -104,7 +104,8 @@ static const struct ide_port_info generic_chipsets[] __devinitdata = {


	{	/* 14 */
	{	/* 14 */
		.name		= "Revolution",
		.name		= "Revolution",
		.host_flags	= IDE_HFLAG_TRUST_BIOS_FOR_DMA |
		.host_flags	= IDE_HFLAG_CLEAR_SIMPLEX |
				  IDE_HFLAG_TRUST_BIOS_FOR_DMA |
				  IDE_HFLAG_OFF_BOARD,
				  IDE_HFLAG_OFF_BOARD,
		.swdma_mask	= ATA_SWDMA2,
		.swdma_mask	= ATA_SWDMA2,
		.mwdma_mask	= ATA_MWDMA2,
		.mwdma_mask	= ATA_MWDMA2,
+3 −1
Original line number Original line Diff line number Diff line
@@ -418,7 +418,9 @@ static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device


	d = serverworks_chipsets[idx];
	d = serverworks_chipsets[idx];


	if (idx == 2 || idx == 3) {
	if (idx == 1)
		d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX;
	else if (idx == 2 || idx == 3) {
		if ((PCI_FUNC(dev->devfn) & 1) == 0) {
		if ((PCI_FUNC(dev->devfn) & 1) == 0) {
			if (pci_resource_start(dev, 0) != 0x01f1)
			if (pci_resource_start(dev, 0) != 0x01f1)
				d.host_flags &= ~IDE_HFLAG_BOOTABLE;
				d.host_flags &= ~IDE_HFLAG_BOOTABLE;
Loading