Merge remote-tracking branch 'remotes/tegra/android-tegra-2.6.36-honeycomb-mr1' into...
[firefly-linux-kernel-4.4.55.git] / arch / arm / common / pl330.c
index 5ebbab6242a78ccb1c23d649cb9a4ee608e2ed3c..234ed88e6829ccf09a5738c828748a6db3297002 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
 
+#include <asm/unaligned.h>
 #include <asm/hardware/pl330.h>
 
 /* Register and Bit field Definitions */
 
 #define        PART            0x330
 #define DESIGNER       0x41
-#define REVISION       0x0
+#define REVISION       0x1
 #define INTEG_CFG      0x0
 #define PERIPH_ID_VAL  ((PART << 0) | (DESIGNER << 12) \
                          | (REVISION << 20) | (INTEG_CFG << 24))
@@ -394,7 +395,7 @@ static inline u32 _emit_ADDH(unsigned dry_run, u8 buf[],
 
        buf[0] = CMD_DMAADDH;
        buf[0] |= (da << 1);
-       *((u16 *)&buf[1]) = val;
+       put_unaligned(val, (u16 *)&buf[1]);     //*((u16 *)&buf[1]) = val;
 
        PL330_DBGCMD_DUMP(SZ_DMAADDH, "\tDMAADDH %s %u\n",
                da == 1 ? "DA" : "SA", val);
@@ -548,7 +549,7 @@ static inline u32 _emit_MOV(unsigned dry_run, u8 buf[],
 
        buf[0] = CMD_DMAMOV;
        buf[1] = dst;
-       *((u32 *)&buf[2]) = val;
+       put_unaligned(val, (u32 *)&buf[2]);     //*((u32 *)&buf[2]) = val;
 
        PL330_DBGCMD_DUMP(SZ_DMAMOV, "\tDMAMOV %s 0x%x\n",
                dst == SAR ? "SAR" : (dst == DAR ? "DAR" : "CCR"), val);
@@ -726,7 +727,7 @@ static inline u32 _emit_GO(unsigned dry_run, u8 buf[],
 
        buf[1] = chan & 0x7;
 
-       *((u32 *)&buf[2]) = addr;
+       put_unaligned(addr, (u32 *)&buf[2]);    //*((u32 *)&buf[2]) = addr;
 
        return SZ_DMAGO;
 }
@@ -991,10 +992,10 @@ static inline int _ldst_devtomem(unsigned dry_run, u8 buf[],
        int off = 0;
 
        while (cyc--) {
-               off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->r->peri);
-               off += _emit_LDP(dry_run, &buf[off], SINGLE, pxs->r->peri);
+               off += _emit_WFP(dry_run, &buf[off], BURST, pxs->r->peri);
+               off += _emit_LDP(dry_run, &buf[off], BURST, pxs->r->peri);
                off += _emit_ST(dry_run, &buf[off], ALWAYS);
-               off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri);
+               //off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri);
        }
 
        return off;
@@ -1006,10 +1007,10 @@ static inline int _ldst_memtodev(unsigned dry_run, u8 buf[],
        int off = 0;
 
        while (cyc--) {
-               off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->r->peri);
+               off += _emit_WFP(dry_run, &buf[off], BURST, pxs->r->peri);
                off += _emit_LD(dry_run, &buf[off], ALWAYS);
-               off += _emit_STP(dry_run, &buf[off], SINGLE, pxs->r->peri);
-               off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri);
+               off += _emit_STP(dry_run, &buf[off], BURST, pxs->r->peri);
+               //off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri);
        }
 
        return off;