diff options
author | Pradeep Kumar <pgoudagunta@nvidia.com> | 2012-05-18 16:16:37 +0530 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2012-05-30 12:53:50 +0530 |
commit | 0264d2b6b6423e3604612fd718b7c9569c598c1b (patch) | |
tree | 0d9007b2d4a8e8b72cdb7ebbfc99fb5699f2bdee /arch/arm/mach-tegra/apbio.c | |
parent | 0495d045fcb6b3f0c920b08eabfc1620c009fc3d (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/arm/mach-tegra/apbio.c')
-rw-r--r-- | arch/arm/mach-tegra/apbio.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c index 6551619aa9e0..3a4505e35557 100644 --- a/arch/arm/mach-tegra/apbio.c +++ b/arch/arm/mach-tegra/apbio.c @@ -100,6 +100,8 @@ u32 tegra_apb_readl(unsigned long offset) req.source_wrap = 4; req.req_sel = TEGRA_DMA_REQ_SEL_CNTR; req.size = 4; + dma_sync_single_for_device(NULL, tegra_apb_bb_phys, + sizeof(u32), DMA_FROM_DEVICE); INIT_COMPLETION(tegra_apb_wait); @@ -113,6 +115,8 @@ u32 tegra_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); } @@ -128,6 +132,8 @@ void tegra_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; @@ -142,6 +148,8 @@ void tegra_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, |