diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-07-29 11:20:11 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-03 09:11:10 +0200 |
commit | 3100ea14668853aeedae85ec83e3536b59ba7728 (patch) | |
tree | 0fa218f88a470a9948eec79aa9aa0d65017d5c16 /arch/arm/include | |
parent | f9f35ee93821048bbace895c5c688bafbda2c3f3 (diff) | |
download | barebox-3100ea14668853aeedae85ec83e3536b59ba7728.tar.gz barebox-3100ea14668853aeedae85ec83e3536b59ba7728.tar.xz |
ARM: rework MMU support
In barebox we used 1MiB sections to map our SDRAM cachable. This
has the drawback that we have to map our sdram twice: cached for
normal sdram and uncached for DMA operations. As address space gets
sparse on newer systems we are sometines unable to find a suitably
big enough area for the dma coherent space.
This patch changes the MMU code to use second level page tables.
With it we can implement dma_alloc_coherent as normal malloc, we
just have to remap the allocated area uncached afterwards and map
it cached again after free().
This makes arm_create_section(), setup_dma_coherent() and mmu_enable()
noops.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/mmu.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index 9ebc2cd4c1..b1aa781c38 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h @@ -3,19 +3,29 @@ #include <asm/pgtable.h> #include <malloc.h> +#include <errno.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); +struct arm_memory; + +static inline void mmu_enable(void) +{ +} void mmu_disable(void); -void arm_create_section(unsigned long virt, unsigned long phys, int size_m, - unsigned int flags); +static inline void arm_create_section(unsigned long virt, unsigned long phys, int size_m, + unsigned int flags) +{ +} -void setup_dma_coherent(unsigned long offset); +static inline void setup_dma_coherent(unsigned long offset) +{ +} #ifdef CONFIG_MMU +int mmu_init(void); + void *dma_alloc_coherent(size_t size); void dma_free_coherent(void *mem, size_t size); |