From ee0833c45d5a6c59b05ec34051ca84d1c66e54f2 Mon Sep 17 00:00:00 2001 From: Kazuya Hioki Date: Thu, 3 Jun 2021 06:26:10 +0900 Subject: [PATCH] boards: cxd56xx: Apply CXD56_PHYSADDR to cxd56_imageproc.c and cxd56_audio_dma.c Summary: - This commit converts data to the physical address for DMA transfer. Impact: - cxd56_imageproc.c and cxd56_audio_dma.c Testing: - Not tested Signed-off-by: Kazuya Hioki Signed-off-by: Masayuki Ishikawa --- boards/arm/cxd56xx/common/src/cxd56_imageproc.c | 17 +++++++++-------- .../arm/cxd56xx/drivers/audio/cxd56_audio_dma.c | 2 +- .../arm/cxd56xx/drivers/audio/cxd56_audio_dma.h | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c index ba2ef3f5c32..72a1112982b 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c +++ b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c @@ -37,6 +37,7 @@ #include #include +#include #include #include "chip.h" @@ -346,8 +347,8 @@ static void *set_rop_cmd(void *cmdbuf, rc->fixedcolor = patcolor; rc->srch = srcwidth - 1; rc->srcv = srcheight - 1; - rc->saddr = (uint32_t) (uintptr_t) srcaddr | MSEL; - rc->daddr = (uint32_t) (uintptr_t) destaddr | MSEL; + rc->saddr = CXD56_PHYSADDR(srcaddr) | MSEL; + rc->daddr = CXD56_PHYSADDR(destaddr) | MSEL; rc->spitch = srcpitch - 1; rc->dpitch = destpitch - 1; rc->desth = destwidth - 1; @@ -377,19 +378,19 @@ static void *set_ab_cmd(void *cmdbuf, void *srcaddr, void *destaddr, ac->mode = fixedalpha; ac->srch = srcwidth - 1; ac->srcv = srcheight - 1; - ac->saddr = (uint32_t)(uintptr_t)srcaddr | MSEL; - ac->daddr = (uint32_t)(uintptr_t)destaddr | MSEL; + ac->saddr = CXD56_PHYSADDR(srcaddr) | MSEL; + ac->daddr = CXD56_PHYSADDR(destaddr) | MSEL; ac->spitch = srcpitch - 1; ac->dpitch = destpitch - 1; ac->fixedsrc = (uint32_t)fixedsrc; if (aaddr) { - ac->aaddr = (uint32_t)(uintptr_t)aaddr | MSEL; + ac->aaddr = CXD56_PHYSADDR(aaddr) | MSEL; ac->apitch = apitch - 1; } else { - ac->aaddr = (uint32_t)(uintptr_t)destaddr | MSEL; + ac->aaddr = CXD56_PHYSADDR(destaddr) | MSEL; ac->apitch = destpitch - 1; } @@ -433,10 +434,10 @@ static void imageproc_convert_(int is_yuv2rgb, putreg32(hsize, ROT_SET_SRC_HSIZE); putreg32(vsize, ROT_SET_SRC_VSIZE); - putreg32((uint32_t) (uintptr_t) ibuf, ROT_SET_SRC_ADDRESS); + putreg32(CXD56_PHYSADDR(ibuf), ROT_SET_SRC_ADDRESS); putreg32(hsize, ROT_SET_SRC_PITCH); - putreg32((uint32_t) (uintptr_t) ibuf, ROT_SET_DST_ADDRESS); + putreg32(CXD56_PHYSADDR(ibuf), ROT_SET_DST_ADDRESS); putreg32(hsize, ROT_SET_DST_PITCH); diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c index 7aa5113ac49..d0fe9c68d00 100644 --- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c +++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c @@ -519,7 +519,7 @@ CXD56_AUDIO_ECODE cxd56_audio_dma_start(cxd56_audio_dma_t handle, return CXD56_AUDIO_ECODE_DMA_BUSY; } - cxd56_audio_bca_reg_set_start_addr(handle, addr); + cxd56_audio_bca_reg_set_start_addr(handle, CXD56_PHYSADDR(addr)); cxd56_audio_bca_reg_set_sample_no(handle, sample); if (s_work_arroud_dmac[handle]) diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h index 8a7d4683448..e9fcfa9bb23 100644 --- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h +++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h @@ -26,6 +26,7 @@ ****************************************************************************/ #include +#include /**************************************************************************** * Pre-processor Definitions