diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-16 16:29:56 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-16 16:29:56 -0400 |
commit | c58e79dd44243ec919d789193ffb35a220c54695 (patch) | |
tree | 66b76ed3fe5dc996dcf0756e173d53f5bb017d9d /drivers/ide/setup-pci.c | |
parent | 9cbcc5e3c5d2d0355fed22d00762fd764c81a383 (diff) |
ide: remove CONFIG_BLK_DEV_IDEDMA_FORCED
This code doesn't use pci_assign_resource() and ide_get_or_set_dma_base() uses
pci_resource_start() to get DMA base address so it has no chance of working.
Moreover this belongs to PCI quirks (in case somebody would like to fix it).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r-- | drivers/ide/setup-pci.c | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 1129f8c30840..f620da42e157 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -145,27 +145,13 @@ static int ide_setup_pci_baseregs (struct pci_dev *dev, const char *name) | |||
145 | } | 145 | } |
146 | 146 | ||
147 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 147 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
148 | |||
149 | #ifdef CONFIG_BLK_DEV_IDEDMA_FORCED | ||
150 | /* | ||
151 | * Long lost data from 2.0.34 that is now in 2.0.39 | ||
152 | * | ||
153 | * This was used in ./drivers/block/triton.c to do DMA Base address setup | ||
154 | * when PnP failed. Oh the things we forget. I believe this was part | ||
155 | * of SFF-8038i that has been withdrawn from public access... :-(( | ||
156 | */ | ||
157 | #define DEFAULT_BMIBA 0xe800 /* in case BIOS did not init it */ | ||
158 | #define DEFAULT_BMCRBA 0xcc00 /* VIA's default value */ | ||
159 | #define DEFAULT_BMALIBA 0xd400 /* ALI's default value */ | ||
160 | #endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ | ||
161 | |||
162 | /** | 148 | /** |
163 | * ide_get_or_set_dma_base - setup BMIBA | 149 | * ide_get_or_set_dma_base - setup BMIBA |
164 | * @hwif: Interface | 150 | * @hwif: Interface |
165 | * | 151 | * |
166 | * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space: | 152 | * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space. |
167 | * If need be we set up the DMA base. Where a device has a partner that | 153 | * Where a device has a partner that is already in DMA mode we check |
168 | * is already in DMA mode we check and enforce IDE simplex rules. | 154 | * and enforce IDE simplex rules. |
169 | */ | 155 | */ |
170 | 156 | ||
171 | static unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif) | 157 | static unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif) |
@@ -173,12 +159,6 @@ static unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif) | |||
173 | unsigned long dma_base = 0; | 159 | unsigned long dma_base = 0; |
174 | struct pci_dev *dev = hwif->pci_dev; | 160 | struct pci_dev *dev = hwif->pci_dev; |
175 | 161 | ||
176 | #ifdef CONFIG_BLK_DEV_IDEDMA_FORCED | ||
177 | int second_chance = 0; | ||
178 | |||
179 | second_chance_to_dma: | ||
180 | #endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ | ||
181 | |||
182 | if (hwif->mmio) | 162 | if (hwif->mmio) |
183 | return hwif->dma_base; | 163 | return hwif->dma_base; |
184 | 164 | ||
@@ -192,26 +172,6 @@ second_chance_to_dma: | |||
192 | } | 172 | } |
193 | } | 173 | } |
194 | 174 | ||
195 | #ifdef CONFIG_BLK_DEV_IDEDMA_FORCED | ||
196 | /* FIXME - should use pci_assign_resource surely */ | ||
197 | if ((!dma_base) && (!second_chance)) { | ||
198 | unsigned long set_bmiba = 0; | ||
199 | second_chance++; | ||
200 | switch(dev->vendor) { | ||
201 | case PCI_VENDOR_ID_AL: | ||
202 | set_bmiba = DEFAULT_BMALIBA; break; | ||
203 | case PCI_VENDOR_ID_VIA: | ||
204 | set_bmiba = DEFAULT_BMCRBA; break; | ||
205 | case PCI_VENDOR_ID_INTEL: | ||
206 | set_bmiba = DEFAULT_BMIBA; break; | ||
207 | default: | ||
208 | return dma_base; | ||
209 | } | ||
210 | pci_write_config_dword(dev, 0x20, set_bmiba|1); | ||
211 | goto second_chance_to_dma; | ||
212 | } | ||
213 | #endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ | ||
214 | |||
215 | if (dma_base) { | 175 | if (dma_base) { |
216 | u8 simplex_stat = 0; | 176 | u8 simplex_stat = 0; |
217 | dma_base += hwif->channel ? 8 : 0; | 177 | dma_base += hwif->channel ? 8 : 0; |