summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPradeep Kumar <pgoudagunta@nvidia.com>2012-05-18 16:16:37 +0530
committerSimone Willett <swillett@nvidia.com>2012-05-21 18:47:05 -0700
commit1ad8d05518658c4cec95652de3bd020057162635 (patch)
treee3c7e7ae45af67e6078b5c9f448a3cc78928c868 /arch
parent52effd517ca3520d10311be1885f860414928e6f (diff)
arm: tegra: apbdmaio: Add dma_sync* calls
Add dma_sync* calls to make memory coherent between CPU and Device. Bug 983988 Change-Id: I40c514e01130762a12833c3ab7e0613f984870c6 Signed-off-by: Pradeep Kumar <pgoudagunta@nvidia.com> Reviewed-on: http://git-master/r/103336 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/apbio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c
index ad280d3b0840..5f3944993804 100644
--- a/arch/arm/mach-tegra/apbio.c
+++ b/arch/arm/mach-tegra/apbio.c
@@ -68,6 +68,8 @@ static inline u32 apb_readl(unsigned long offset)
req.source_wrap = 4;
req.req_sel = 0;
req.size = 4;
+ dma_sync_single_for_device(NULL, tegra_apb_bb_phys,
+ sizeof(u32), DMA_FROM_DEVICE);
INIT_COMPLETION(tegra_apb_wait);
@@ -81,6 +83,8 @@ static inline u32 apb_readl(unsigned long offset)
*(u32 *)tegra_apb_bb = 0;
}
+ dma_sync_single_for_cpu(NULL, tegra_apb_bb_phys,
+ sizeof(u32), DMA_FROM_DEVICE);
mutex_unlock(&tegra_apb_dma_lock);
return *((u32 *)tegra_apb_bb);
}
@@ -97,6 +101,8 @@ static inline void apb_writel(u32 value, unsigned long offset)
}
mutex_lock(&tegra_apb_dma_lock);
+ dma_sync_single_for_cpu(NULL, tegra_apb_bb_phys,
+ sizeof(u32), DMA_TO_DEVICE);
*((u32 *)tegra_apb_bb) = value;
req.complete = apb_dma_complete;
req.to_memory = 0;
@@ -111,6 +117,8 @@ static inline void apb_writel(u32 value, unsigned long offset)
INIT_COMPLETION(tegra_apb_wait);
+ dma_sync_single_for_device(NULL, tegra_apb_bb_phys,
+ sizeof(u32), DMA_TO_DEVICE);
tegra_dma_enqueue_req(tegra_apb_dma, &req);
ret = wait_for_completion_timeout(&tegra_apb_wait,