aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2015-11-06 15:24:01 -0500
committerVinod Koul <vinod.koul@intel.com>2015-11-15 22:40:46 -0500
commitd3cd63f91b84c60e0b30ee8a45b8f291dac7bbff (patch)
tree18cb39d1871cea7d59f2ee8753dde34660c4106b
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
dmaengine: IOATDMA: Cleanup pre v3.0 chansts register reads
Remove pre-3.0 channel status reads. 3.0 and later chansts register is 64bit and can be read 64bit. This was clarified with the hardware architects and since the driver now only support 3.0+ we don't need the legacy support Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/ioat/dma.h34
-rw-r--r--drivers/dma/ioat/registers.h16
2 files changed, 4 insertions, 46 deletions
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index 8f4e607d5817..b8f48074789f 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -235,43 +235,11 @@ ioat_chan_by_index(struct ioatdma_device *ioat_dma, int index)
235 return ioat_dma->idx[index]; 235 return ioat_dma->idx[index];
236} 236}
237 237
238static inline u64 ioat_chansts_32(struct ioatdma_chan *ioat_chan)
239{
240 u8 ver = ioat_chan->ioat_dma->version;
241 u64 status;
242 u32 status_lo;
243
244 /* We need to read the low address first as this causes the
245 * chipset to latch the upper bits for the subsequent read
246 */
247 status_lo = readl(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET_LOW(ver));
248 status = readl(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET_HIGH(ver));
249 status <<= 32;
250 status |= status_lo;
251
252 return status;
253}
254
255#if BITS_PER_LONG == 64
256
257static inline u64 ioat_chansts(struct ioatdma_chan *ioat_chan) 238static inline u64 ioat_chansts(struct ioatdma_chan *ioat_chan)
258{ 239{
259 u8 ver = ioat_chan->ioat_dma->version; 240 return readq(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET);
260 u64 status;
261
262 /* With IOAT v3.3 the status register is 64bit. */
263 if (ver >= IOAT_VER_3_3)
264 status = readq(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET(ver));
265 else
266 status = ioat_chansts_32(ioat_chan);
267
268 return status;
269} 241}
270 242
271#else
272#define ioat_chansts ioat_chansts_32
273#endif
274
275static inline u64 ioat_chansts_to_addr(u64 status) 243static inline u64 ioat_chansts_to_addr(u64 status)
276{ 244{
277 return status & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR; 245 return status & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR;
diff --git a/drivers/dma/ioat/registers.h b/drivers/dma/ioat/registers.h
index 909352f74c89..4994a3623aee 100644
--- a/drivers/dma/ioat/registers.h
+++ b/drivers/dma/ioat/registers.h
@@ -99,19 +99,9 @@
99#define IOAT_DMA_COMP_V1 0x0001 /* Compatibility with DMA version 1 */ 99#define IOAT_DMA_COMP_V1 0x0001 /* Compatibility with DMA version 1 */
100#define IOAT_DMA_COMP_V2 0x0002 /* Compatibility with DMA version 2 */ 100#define IOAT_DMA_COMP_V2 0x0002 /* Compatibility with DMA version 2 */
101 101
102 102/* IOAT1 define left for i7300_idle driver to not fail compiling */
103#define IOAT1_CHANSTS_OFFSET 0x04 /* 64-bit Channel Status Register */ 103#define IOAT1_CHANSTS_OFFSET 0x04
104#define IOAT2_CHANSTS_OFFSET 0x08 /* 64-bit Channel Status Register */ 104#define IOAT_CHANSTS_OFFSET 0x08 /* 64-bit Channel Status Register */
105#define IOAT_CHANSTS_OFFSET(ver) ((ver) < IOAT_VER_2_0 \
106 ? IOAT1_CHANSTS_OFFSET : IOAT2_CHANSTS_OFFSET)
107#define IOAT1_CHANSTS_OFFSET_LOW 0x04
108#define IOAT2_CHANSTS_OFFSET_LOW 0x08
109#define IOAT_CHANSTS_OFFSET_LOW(ver) ((ver) < IOAT_VER_2_0 \
110 ? IOAT1_CHANSTS_OFFSET_LOW : IOAT2_CHANSTS_OFFSET_LOW)
111#define IOAT1_CHANSTS_OFFSET_HIGH 0x08
112#define IOAT2_CHANSTS_OFFSET_HIGH 0x0C
113#define IOAT_CHANSTS_OFFSET_HIGH(ver) ((ver) < IOAT_VER_2_0 \
114 ? IOAT1_CHANSTS_OFFSET_HIGH : IOAT2_CHANSTS_OFFSET_HIGH)
115#define IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR (~0x3fULL) 105#define IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR (~0x3fULL)
116#define IOAT_CHANSTS_SOFT_ERR 0x10ULL 106#define IOAT_CHANSTS_SOFT_ERR 0x10ULL
117#define IOAT_CHANSTS_UNAFFILIATED_ERR 0x8ULL 107#define IOAT_CHANSTS_UNAFFILIATED_ERR 0x8ULL