diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-05-11 12:24:51 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-05-22 12:38:17 +0200 |
commit | e01997ef6a8c5e44de72616ab8fe64ede87cc3c7 (patch) | |
tree | 0e603e657ae11d49ce0b7c265136908d2b91bc99 /arch/arm/cpu | |
parent | 73aa4001dad996e997556c5b477614b7ce49e381 (diff) | |
download | barebox-e01997ef6a8c5e44de72616ab8fe64ede87cc3c7.tar.gz barebox-e01997ef6a8c5e44de72616ab8fe64ede87cc3c7.tar.xz |
ARM: mmu32: move functions into c file
Move create_flat_mapping() and create_sections() into the c file
rather than having them as static inline functions in the header file.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/mmu_32.c | 19 | ||||
-rw-r--r-- | arch/arm/cpu/mmu_32.h | 20 |
2 files changed, 19 insertions, 20 deletions
diff --git a/arch/arm/cpu/mmu_32.c b/arch/arm/cpu/mmu_32.c index 0b46fbf236..bea5297ea2 100644 --- a/arch/arm/cpu/mmu_32.c +++ b/arch/arm/cpu/mmu_32.c @@ -318,6 +318,25 @@ int arch_remap_range(void *start, size_t size, unsigned map_type) return 0; } +static void create_sections(uint32_t *ttb, unsigned long first, + unsigned long last, unsigned int flags) +{ + unsigned long ttb_start = pgd_index(first); + unsigned long ttb_end = pgd_index(last) + 1; + unsigned int i, addr = first; + + for (i = ttb_start; i < ttb_end; i++) { + ttb[i] = addr | flags; + addr += PGDIR_SIZE; + } +} + +static void create_flat_mapping(uint32_t *ttb) +{ + /* create a flat mapping using 1MiB sections */ + create_sections(ttb, 0, 0xffffffff, attrs_uncached_mem()); +} + void *map_io_sections(unsigned long phys, void *_start, size_t size) { unsigned long start = (unsigned long)_start, sec; diff --git a/arch/arm/cpu/mmu_32.h b/arch/arm/cpu/mmu_32.h index 1499b70dd6..607d9e8608 100644 --- a/arch/arm/cpu/mmu_32.h +++ b/arch/arm/cpu/mmu_32.h @@ -56,20 +56,6 @@ static inline void set_domain(unsigned val) asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(val) /*:*/); } -static inline void -create_sections(uint32_t *ttb, unsigned long first, - unsigned long last, unsigned int flags) -{ - unsigned long ttb_start = pgd_index(first); - unsigned long ttb_end = pgd_index(last) + 1; - unsigned int i, addr = first; - - for (i = ttb_start; i < ttb_end; i++) { - ttb[i] = addr | flags; - addr += PGDIR_SIZE; - } -} - #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) @@ -83,10 +69,4 @@ static inline unsigned long attrs_uncached_mem(void) return flags; } -static inline void create_flat_mapping(uint32_t *ttb) -{ - /* create a flat mapping using 1MiB sections */ - create_sections(ttb, 0, 0xffffffff, attrs_uncached_mem()); -} - #endif /* __ARM_MMU_H */ |