From 018618939ee7726a0bfbada7cc8cbd5094f0ca70 Mon Sep 17 00:00:00 2001 From: Vandhiadevan Karunamoorthy Date: Tue, 26 Apr 2022 11:51:09 +0530 Subject: [PATCH] board: devsoc: enable dcache This changes enable dcache enable and disable support and also enable dcache command. Change-Id: I7a11a923c1f87168e9cb519c5dedfcfac2dbc610 Signed-off-by: Vandhiadevan Karunamoorthy --- board/qca/arm/devsoc/devsoc.c | 10 ++++++++++ include/configs/devsoc.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/board/qca/arm/devsoc/devsoc.c b/board/qca/arm/devsoc/devsoc.c index 7293cbdada..bd3c3d35a3 100644 --- a/board/qca/arm/devsoc/devsoc.c +++ b/board/qca/arm/devsoc/devsoc.c @@ -143,12 +143,22 @@ void board_nand_init(void) 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(); } unsigned long timer_read_counter(void) diff --git a/include/configs/devsoc.h b/include/configs/devsoc.h index 608d2f0ab2..5ac9e803a1 100644 --- a/include/configs/devsoc.h +++ b/include/configs/devsoc.h @@ -24,7 +24,6 @@ #undef CONFIG_QCA_DISABLE_SCM #define CONFIG_SPI_FLASH_CYPRESS #define CONFIG_SYS_NO_FLASH -#define CONFIG_SYS_CACHELINE_SIZE 64 #define CONFIG_IPQ_NO_RELOC #define CONFIG_SYS_VSNPRINTF @@ -213,6 +212,7 @@ 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_CMD_CACHE /* * SPI Flash Configs