Skip to content

Commit 50ee7c5

Browse files
authored
Merge pull request #61 from tlauda/topic/cache_byt_cht
cache: change in cache functions definition
2 parents c408d35 + 1e9cae2 commit 50ee7c5

3 files changed

Lines changed: 21 additions & 22 deletions

File tree

src/arch/xtensa/include/arch/cache.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,14 @@
3333

3434
#include <stdint.h>
3535
#include <stddef.h>
36+
#include <xtensa/config/core.h>
3637
#include <xtensa/hal.h>
3738

38-
#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL ||\
39-
defined CONFIG_HASWELL || defined CONFIG_BROADWELL
40-
41-
static inline void dcache_writeback_region(void *addr, size_t size) {}
42-
static inline void dcache_invalidate_region(void *addr, size_t size) {}
43-
static inline void icache_invalidate_region(void *addr, size_t size) {}
44-
static inline void dcache_writeback_invalidate_region(void *addr, size_t size) {}
45-
#else
46-
4739
static inline void dcache_writeback_region(void *addr, size_t size)
4840
{
41+
#if XCHAL_DCACHE_SIZE > 0
4942
xthal_dcache_region_writeback(addr, size);
43+
#endif
5044
}
5145

5246
static inline void dcache_writeback_all()
@@ -58,7 +52,9 @@ static inline void dcache_writeback_all()
5852

5953
static inline void dcache_invalidate_region(void *addr, size_t size)
6054
{
55+
#if XCHAL_DCACHE_SIZE > 0
6156
xthal_dcache_region_invalidate(addr, size);
57+
#endif
6258
}
6359

6460
static inline void dcache_invalidate_all()
@@ -70,7 +66,9 @@ static inline void dcache_invalidate_all()
7066

7167
static inline void icache_invalidate_region(void *addr, size_t size)
7268
{
69+
#if XCHAL_ICACHE_SIZE > 0
7370
xthal_icache_region_invalidate(addr, size);
71+
#endif
7472
}
7573

7674
static inline void icache_invalidate_all()
@@ -82,7 +80,9 @@ static inline void icache_invalidate_all()
8280

8381
static inline void dcache_writeback_invalidate_region(void *addr, size_t size)
8482
{
83+
#if XCHAL_DCACHE_SIZE > 0
8584
xthal_dcache_region_writeback_inv(addr, size);
85+
#endif
8686
}
8787

8888
static inline void dcache_writeback_invalidate_all()
@@ -93,5 +93,4 @@ static inline void dcache_writeback_invalidate_all()
9393
}
9494

9595
#endif
96-
#endif
9796

src/platform/baytrail/include/arch/xtensa/config/core-isa-byt.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,16 @@
213213
#define XCHAL_ICACHE_LINEWIDTH 7 /* log2(I line size in bytes) */
214214
#define XCHAL_DCACHE_LINEWIDTH 7 /* log2(D line size in bytes) */
215215

216-
#define XCHAL_ICACHE_SIZE 49152 /* I-cache size in bytes or 0 */
217-
#define XCHAL_DCACHE_SIZE 98304 /* D-cache size in bytes or 0 */
216+
#define XCHAL_ICACHE_SIZE 0 /* I-cache size in bytes or 0 */
217+
#define XCHAL_DCACHE_SIZE 0 /* D-cache size in bytes or 0 */
218218

219-
#define XCHAL_DCACHE_IS_WRITEBACK 1 /* writeback feature */
219+
#define XCHAL_DCACHE_IS_WRITEBACK 0 /* writeback feature */
220220
#define XCHAL_DCACHE_IS_COHERENT 0 /* MP coherence feature */
221221

222-
#define XCHAL_HAVE_PREFETCH 1 /* PREFCTL register */
222+
#define XCHAL_HAVE_PREFETCH 0 /* PREFCTL register */
223223
#define XCHAL_HAVE_PREFETCH_L1 0 /* prefetch to L1 dcache */
224-
#define XCHAL_PREFETCH_CASTOUT_LINES 1 /* dcache pref. castout bufsz */
225-
#define XCHAL_PREFETCH_ENTRIES 8 /* cache prefetch entries */
224+
#define XCHAL_PREFETCH_CASTOUT_LINES 0 /* dcache pref. castout bufsz */
225+
#define XCHAL_PREFETCH_ENTRIES 0 /* cache prefetch entries */
226226
#define XCHAL_PREFETCH_BLOCK_ENTRIES 0 /* prefetch block streams */
227227
#define XCHAL_HAVE_CACHE_BLOCKOPS 0 /* block prefetch for caches */
228228
#define XCHAL_HAVE_ICACHE_TEST 0 /* Icache test instructions */

src/platform/baytrail/include/arch/xtensa/config/core-isa-cht.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,16 @@
213213
#define XCHAL_ICACHE_LINEWIDTH 7 /* log2(I line size in bytes) */
214214
#define XCHAL_DCACHE_LINEWIDTH 7 /* log2(D line size in bytes) */
215215

216-
#define XCHAL_ICACHE_SIZE 49152 /* I-cache size in bytes or 0 */
217-
#define XCHAL_DCACHE_SIZE 98304 /* D-cache size in bytes or 0 */
216+
#define XCHAL_ICACHE_SIZE 0 /* I-cache size in bytes or 0 */
217+
#define XCHAL_DCACHE_SIZE 0 /* D-cache size in bytes or 0 */
218218

219-
#define XCHAL_DCACHE_IS_WRITEBACK 1 /* writeback feature */
219+
#define XCHAL_DCACHE_IS_WRITEBACK 0 /* writeback feature */
220220
#define XCHAL_DCACHE_IS_COHERENT 0 /* MP coherence feature */
221221

222-
#define XCHAL_HAVE_PREFETCH 1 /* PREFCTL register */
222+
#define XCHAL_HAVE_PREFETCH 0 /* PREFCTL register */
223223
#define XCHAL_HAVE_PREFETCH_L1 0 /* prefetch to L1 dcache */
224-
#define XCHAL_PREFETCH_CASTOUT_LINES 1 /* dcache pref. castout bufsz */
225-
#define XCHAL_PREFETCH_ENTRIES 8 /* cache prefetch entries */
224+
#define XCHAL_PREFETCH_CASTOUT_LINES 0 /* dcache pref. castout bufsz */
225+
#define XCHAL_PREFETCH_ENTRIES 0 /* cache prefetch entries */
226226
#define XCHAL_PREFETCH_BLOCK_ENTRIES 0 /* prefetch block streams */
227227
#define XCHAL_HAVE_CACHE_BLOCKOPS 0 /* block prefetch for caches */
228228
#define XCHAL_HAVE_ICACHE_TEST 0 /* Icache test instructions */

0 commit comments

Comments
 (0)