qca: cache: Enabled dcache on board initialization

dcache is enabled only during boot from flash.
During JTAG recovery, dcache_enable is skipped
to avoid cache issues in recovery environment.

Change-Id: Ie3003f67c787cbc6b88dc42017aeb2a9508d2ff9
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
This commit is contained in:
Gokul Sriram Palanisamy 2018-02-14 15:57:12 +05:30 committed by Gerrit - the friendly Code Review server
parent 4a788032d8
commit 19a90604e9
4 changed files with 16 additions and 1 deletions

View file

@ -294,12 +294,24 @@ void report_l2err(u32 l2esr)
void enable_caches(void)
{
qca_smem_flash_info_t *sfi = &qca_smem_flash_info;
smem_get_boot_flash(&sfi->flash_type,
&sfi->flash_index,
&sfi->flash_chip_select,
&sfi->flash_block_size,
&sfi->flash_density);
icache_enable();
/*Skips dcache_enable during JTAG recovery */
if (sfi->flash_type)
dcache_enable();
}
void disable_caches(void)
{
icache_disable();
dcache_disable();
}
__weak void clear_l2cache_err(void)

View file

@ -174,6 +174,7 @@ typedef struct {
* size is configured to 64 */
#define CONFIG_SYS_CACHELINE_SIZE 64
#define CONFIG_SYS_DCACHE_OFF
#define CONFIG_CMD_CACHE
#define CONFIG_QCA_BAM 1
/*

View file

@ -332,6 +332,7 @@ typedef struct {
* size is configured to 64 */
#define CONFIG_SYS_CACHELINE_SIZE 64
#define CONFIG_SYS_DCACHE_OFF
#define CONFIG_CMD_CACHE
/* Enabling this flag will report any L2 errors.
* By default we are disabling it */

View file

@ -325,7 +325,8 @@ extern loff_t board_env_size;
* Cache flush and invalidation based on L1 cache, so the cache line
* size is configured to 64 */
#define CONFIG_SYS_CACHELINE_SIZE 64
/*#define CONFIG_SYS_DCACHE_OFF*/
#define CONFIG_SYS_DCACHE_OFF
#define CONFIG_CMD_CACHE
/* Enabling this flag will report any L2 errors.
* By default we are disabling it */