diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2009-10-22 12:12:47 +0200 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2009-10-22 12:12:47 +0200 |
commit | 67254a403fe14464e25c378591b139cda8cd867f (patch) | |
tree | 032f2d6136a69a12a5343630f408cde5594c3cf4 /arch/arm/include/asm/mmu.h | |
parent | dac4338cdcdff9693f5b6bd4214ad2b1dd263b57 (diff) | |
download | barebox-67254a403fe14464e25c378591b139cda8cd867f.tar.gz barebox-67254a403fe14464e25c378591b139cda8cd867f.tar.xz |
[ARM] move include/asm-arm to arch/arm/include/asm
Move platform independent header files to arch/arm/include/asm, leaving
those in asm/arch* and asm/proc* alone.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm/include/asm/mmu.h')
-rw-r--r-- | arch/arm/include/asm/mmu.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h new file mode 100644 index 0000000000..0dd3fa826c --- /dev/null +++ b/arch/arm/include/asm/mmu.h @@ -0,0 +1,64 @@ +#ifndef __ASM_MMU_H +#define __ASM_MMU_H + +#include <asm/pgtable.h> +#include <malloc.h> + +#define PMD_SECT_DEF_UNCACHED (PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT) +#define PMD_SECT_DEF_CACHED (PMD_SECT_WB | PMD_SECT_DEF_UNCACHED) + +void mmu_init(void); +void mmu_enable(void); +void mmu_disable(void); +void arm_create_section(unsigned long virt, unsigned long phys, int size_m, + unsigned int flags); + +void setup_dma_coherent(unsigned long offset); + +#ifdef CONFIG_MMU +void *dma_alloc_coherent(size_t size); +void dma_free_coherent(void *mem); + +void dma_clean_range(const void *, const void *); +void dma_flush_range(const void *, const void *); +void dma_inv_range(const void *, const void *); +unsigned long virt_to_phys(void *virt); +void *phys_to_virt(unsigned long phys); + +#else +static inline void *dma_alloc_coherent(size_t size) +{ + return malloc(size); +} + +static inline void dma_free_coherent(void *mem) +{ + free(mem); +} + +static inline void *phys_to_virt(unsigned long phys) +{ + return (void *)phys; +} + +static inline unsigned long virt_to_phys(void *mem) +{ + return (unsigned long)mem; +} + +static inline void dma_clean_range(const void *s, const void *e) +{ +} + +static inline void dma_flush_range(const void *s, const void *e) +{ +} + +static inline void dma_inv_range(const void *s, const void *e) +{ +} + +#endif + +#endif /* __ASM_MMU_H */ + |