diff options
Diffstat (limited to 'arch/arm/mach-ux500/dcache.c')
-rw-r--r-- | arch/arm/mach-ux500/dcache.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/arch/arm/mach-ux500/dcache.c b/arch/arm/mach-ux500/dcache.c index b1c3942c181..b117d4e8283 100644 --- a/arch/arm/mach-ux500/dcache.c +++ b/arch/arm/mach-ux500/dcache.c @@ -9,7 +9,6 @@ * License terms: GNU General Public License (GPL), version 2. */ -#include <linux/hwmem.h> #include <linux/dma-mapping.h> #include <asm/pgtable.h> @@ -91,75 +90,6 @@ static void flush_inner_dcache_all(void); static bool is_cache_exclusive(void); -enum hwmem_alloc_flags cachi_get_cache_settings( - enum hwmem_alloc_flags requested_cache_settings) -{ - static const u32 CACHE_ON_FLAGS_MASK = HWMEM_ALLOC_HINT_CACHED | - HWMEM_ALLOC_HINT_CACHE_WB | HWMEM_ALLOC_HINT_CACHE_WT | - HWMEM_ALLOC_HINT_CACHE_NAOW | HWMEM_ALLOC_HINT_CACHE_AOW | - HWMEM_ALLOC_HINT_INNER_AND_OUTER_CACHE | - HWMEM_ALLOC_HINT_INNER_CACHE_ONLY; - - enum hwmem_alloc_flags cache_settings; - - if (!(requested_cache_settings & CACHE_ON_FLAGS_MASK) && - requested_cache_settings & (HWMEM_ALLOC_HINT_NO_WRITE_COMBINE | - HWMEM_ALLOC_HINT_UNCACHED | HWMEM_ALLOC_HINT_WRITE_COMBINE)) - /* - * We never use uncached as it's extremely slow and there is - * no scenario where it would be better than buffered memory. - */ - return HWMEM_ALLOC_HINT_WRITE_COMBINE; - - /* - * The user has specified cached or nothing at all, both are treated as - * cached. - */ - cache_settings = (requested_cache_settings & - ~(HWMEM_ALLOC_HINT_UNCACHED | - HWMEM_ALLOC_HINT_NO_WRITE_COMBINE | - HWMEM_ALLOC_HINT_INNER_CACHE_ONLY | - HWMEM_ALLOC_HINT_CACHE_NAOW)) | - HWMEM_ALLOC_HINT_WRITE_COMBINE | HWMEM_ALLOC_HINT_CACHED | - HWMEM_ALLOC_HINT_CACHE_AOW | - HWMEM_ALLOC_HINT_INNER_AND_OUTER_CACHE; - if (!(cache_settings & (HWMEM_ALLOC_HINT_CACHE_WB | - HWMEM_ALLOC_HINT_CACHE_WT))) - cache_settings |= HWMEM_ALLOC_HINT_CACHE_WB; - /* - * On ARMv7 "alloc on write" is just a hint so we need to assume the - * worst case ie "alloc on write". We would however like to remember - * the requested "alloc on write" setting so that we can pass it on to - * the hardware, we use the reserved bit in the alloc flags to do that. - */ - if (requested_cache_settings & HWMEM_ALLOC_HINT_CACHE_AOW) - cache_settings |= HWMEM_ALLOC_RESERVED_CHI; - else - cache_settings &= ~HWMEM_ALLOC_RESERVED_CHI; - - return cache_settings; -} - -void cachi_set_pgprot_cache_options(enum hwmem_alloc_flags cache_settings, - pgprot_t *pgprot) -{ - if (cache_settings & HWMEM_ALLOC_HINT_CACHED) { - if (cache_settings & HWMEM_ALLOC_HINT_CACHE_WT) - *pgprot = __pgprot_modify(*pgprot, L_PTE_MT_MASK, - L_PTE_MT_WRITETHROUGH); - else { - if (cache_settings & HWMEM_ALLOC_RESERVED_CHI) - *pgprot = __pgprot_modify(*pgprot, - L_PTE_MT_MASK, L_PTE_MT_WRITEALLOC); - else - *pgprot = __pgprot_modify(*pgprot, - L_PTE_MT_MASK, L_PTE_MT_WRITEBACK); - } - } else { - *pgprot = pgprot_writecombine(*pgprot); - } -} - void drain_cpu_write_buf(void) { dsb(); |