Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Starterware/TMS320C6748: Incorrect implementation of API "CacheEnable"

$
0
0

Part Number:TMS320C6748

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


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>