Thread (6 messages) read the whole thread 6 messages, 3 authors, 2014-09-23

[PATCH] dmaengine: fsl-edma: fixup reg offset and hw S/G support in big-endian model

From: Russell King - ARM Linux <hidden>
Date: 2014-09-23 10:37:36
Also in: lkml

On Tue, Sep 23, 2014 at 05:15:19PM +0800, Jingchang Lu wrote:
 static u16 edma_readw(struct fsl_edma_engine *edma, void __iomem *addr)
 {
-	if (edma->big_endian)
-		return ioread16be(addr);
-	else
+	u32 dst;
This should be unsigned long, if it needs to exist.
+	/* swap the reg offset for these in big-endian mode */
+	if (edma->big_endian) {
+		dst = ((u32)addr & ~0x3) | (((u32)addr & 0x3) ^ 0x2);
This can be simplified to:

		addr = (void __iomem *)((unsigned long)addr ^ 2);

Ditto for all the other cases.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help