diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-08-14 13:39:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 14:41:41 -0400 |
commit | 04023afcce2eaff4f66d19ca21b106512fffabe7 (patch) | |
tree | 85b196fad65ddadde0081f14948e0ad5fe7897eb /drivers/ssb | |
parent | 292121dce2af63dab371102097a887de7cf24233 (diff) |
ssb: fix DMA translation for some specific boards
Signed-off-by: Michael Buesch <m@bues.ch>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb')
-rw-r--r-- | drivers/ssb/main.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index 29c7d4f9d1ae..d0cbdb0cf9d5 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -1260,16 +1260,34 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags) | |||
1260 | } | 1260 | } |
1261 | EXPORT_SYMBOL(ssb_device_disable); | 1261 | EXPORT_SYMBOL(ssb_device_disable); |
1262 | 1262 | ||
1263 | /* Some chipsets need routing known for PCIe and 64-bit DMA */ | ||
1264 | static bool ssb_dma_translation_special_bit(struct ssb_device *dev) | ||
1265 | { | ||
1266 | u16 chip_id = dev->bus->chip_id; | ||
1267 | |||
1268 | if (dev->id.coreid == SSB_DEV_80211) { | ||
1269 | return (chip_id == 0x4322 || chip_id == 43221 || | ||
1270 | chip_id == 43231 || chip_id == 43222); | ||
1271 | } | ||
1272 | |||
1273 | return 0; | ||
1274 | } | ||
1275 | |||
1263 | u32 ssb_dma_translation(struct ssb_device *dev) | 1276 | u32 ssb_dma_translation(struct ssb_device *dev) |
1264 | { | 1277 | { |
1265 | switch (dev->bus->bustype) { | 1278 | switch (dev->bus->bustype) { |
1266 | case SSB_BUSTYPE_SSB: | 1279 | case SSB_BUSTYPE_SSB: |
1267 | return 0; | 1280 | return 0; |
1268 | case SSB_BUSTYPE_PCI: | 1281 | case SSB_BUSTYPE_PCI: |
1269 | if (ssb_read32(dev, SSB_TMSHIGH) & SSB_TMSHIGH_DMA64) | 1282 | if (pci_is_pcie(dev->bus->host_pci) && |
1283 | ssb_read32(dev, SSB_TMSHIGH) & SSB_TMSHIGH_DMA64) { | ||
1270 | return SSB_PCIE_DMA_H32; | 1284 | return SSB_PCIE_DMA_H32; |
1271 | else | 1285 | } else { |
1272 | return SSB_PCI_DMA; | 1286 | if (ssb_dma_translation_special_bit(dev)) |
1287 | return SSB_PCIE_DMA_H32; | ||
1288 | else | ||
1289 | return SSB_PCI_DMA; | ||
1290 | } | ||
1273 | default: | 1291 | default: |
1274 | __ssb_dma_not_implemented(dev); | 1292 | __ssb_dma_not_implemented(dev); |
1275 | } | 1293 | } |