Skip to content

Commit

Permalink
Merge branch 'CR_8959_Implement_new_flush_L2_cache_method_Windsome.Ze…
Browse files Browse the repository at this point in the history
…ng' into 'jh7110-devel'

CR 8959 Use the new method in VPU to flush the entire L2 cache

See merge request sdk/soft_3rdpart!82
  • Loading branch information
andyhu-stf committed Jan 11, 2024
2 parents 819f2f5 + ee4bb83 commit fd4ac21
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion codaj12/jdi/linux/driver/jpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "jpu.h"

extern void sifive_ccache_flush_range(phys_addr_t start, size_t len);
extern void sifive_ccache_flush_entire(void);

//#define ENABLE_DEBUG_MSG
#ifdef ENABLE_DEBUG_MSG
Expand Down Expand Up @@ -205,7 +206,10 @@ static void starfive_flush_dcache(phys_addr_t start, size_t len)
#ifdef ARCH_HAS_SYNC_DMA_FOR_DEVICE
dma_sync_single_for_device(jpu_dev, start, len, DMA_FROM_DEVICE);
#else
sifive_ccache_flush_range(start, len);
if (len >= 0x80000)
sifive_ccache_flush_entire();
else
sifive_ccache_flush_range(start, len);
#endif
}

Expand Down
6 changes: 5 additions & 1 deletion wave420l/code/vdi/linux/driver/venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "vpu.h"

extern void sifive_ccache_flush_range(phys_addr_t start, size_t len);
extern void sifive_ccache_flush_entire(void);

#ifndef CONFIG_PM
#define CONFIG_PM
Expand Down Expand Up @@ -356,7 +357,10 @@ static void starfive_flush_dcache(phys_addr_t start, size_t len)
#ifdef ARCH_HAS_SYNC_DMA_FOR_DEVICE
dma_sync_single_for_device(vpu_dev, start, len, DMA_FROM_DEVICE);
#else
sifive_ccache_flush_range(start, len);
if (len >= 0x80000)
sifive_ccache_flush_entire();
else
sifive_ccache_flush_range(start, len);
#endif
}

Expand Down
6 changes: 5 additions & 1 deletion wave511/code/vdi/linux/driver/vdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "vpu.h"

extern void sifive_ccache_flush_range(phys_addr_t start, size_t len);
extern void sifive_ccache_flush_entire(void);

//#define ENABLE_DEBUG_MSG
#ifdef ENABLE_DEBUG_MSG
Expand Down Expand Up @@ -477,7 +478,10 @@ static void starfive_flush_dcache(phys_addr_t start, size_t len)
#ifdef ARCH_HAS_SYNC_DMA_FOR_DEVICE
dma_sync_single_for_device(vpu_dev, start, len, DMA_FROM_DEVICE);
#else
sifive_ccache_flush_range(start, len);
if (len >= 0x80000)
sifive_ccache_flush_entire();
else
sifive_ccache_flush_range(start, len);
#endif
}

Expand Down

0 comments on commit fd4ac21

Please sign in to comment.