Tool/software: Starterware
Hello,
While using C6748 StarterWare version 1.20.04 in our product, we found incorrect implementation of CacheEnable API which configures L1P, L1D and L2 cache configuration.
File: \system_config\c674x\cache.c
Line: 154
Cause: "memCfg" value is not properly used, it should be shifted to get correct value for L1P
Refactoring:
/* Enable L1P Cache */
HWREG(SOC_CACHE_0_REGS + DSPCACHE_L1PCFG) =
(HWREG(SOC_CACHE_0_REGS + DSPCACHE_L1PCFG) &
~DSPCACHE_L1PCFG_L1PMODE) | ((memCfg >> ((L1P_MEM_UNIQUE >> 1) * 4)) & DSPCACHE_L1PCFG_L1PMODE);
Line: 166
Cause: "memCfg" value is not properly used, it should be shifted to get correct value for L1D
Refactoring:
/* Enable L1D Cache */
HWREG(SOC_CACHE_0_REGS + DSPCACHE_L1DCFG) =
(HWREG(SOC_CACHE_0_REGS + DSPCACHE_L1DCFG) &
~DSPCACHE_L1DCFG_L1DMODE) | ((memCfg >> ((L1D_MEM_UNIQUE >> 1) * 4)) & DSPCACHE_L1DCFG_L1DMODE);
Line: 178
Cause: "memCfg" value is not properly used, it should be shifted to get correct value for L2
Refactoring:
/* Enable L2 Cache */
HWREG(SOC_CACHE_0_REGS + DSPCACHE_L2CFG) =
(HWREG(SOC_CACHE_0_REGS + DSPCACHE_L2CFG) &
~DSPCACHE_L2CFG_L2MODE) | ((memCfg >> ((L2_MEM_UNIQUE >> 1) * 4)) & DSPCACHE_L2CFG_L2MODE);
Thanks
Shrikrishna