diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-03-25 14:56:05 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-15 10:03:49 -0400 |
commit | a2227120eead4ea7d2ea04d8ce0947f1dd23dedf (patch) | |
tree | 42b8ef27585c8f4cac294594659f52833037a577 /arch/arm/mm/mmu.c | |
parent | ceb683d3bc36f213aeef0c5d79e6fbb1e16bd459 (diff) |
ARM: Move memory mapping into mmu.c
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r-- | arch/arm/mm/mmu.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 91547196915c..69852003675f 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -600,7 +600,7 @@ static void __init create_36bit_mapping(struct map_desc *md, | |||
600 | * offsets, and we take full advantage of sections and | 600 | * offsets, and we take full advantage of sections and |
601 | * supersections. | 601 | * supersections. |
602 | */ | 602 | */ |
603 | void __init create_mapping(struct map_desc *md) | 603 | static void __init create_mapping(struct map_desc *md) |
604 | { | 604 | { |
605 | unsigned long phys, addr, length, end; | 605 | unsigned long phys, addr, length, end; |
606 | const struct mem_type *type; | 606 | const struct mem_type *type; |
@@ -1014,6 +1014,32 @@ static void __init kmap_init(void) | |||
1014 | #endif | 1014 | #endif |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | static inline void map_memory_bank(struct membank *bank) | ||
1018 | { | ||
1019 | struct map_desc map; | ||
1020 | |||
1021 | map.pfn = bank_pfn_start(bank); | ||
1022 | map.virtual = __phys_to_virt(bank_phys_start(bank)); | ||
1023 | map.length = bank_phys_size(bank); | ||
1024 | map.type = MT_MEMORY; | ||
1025 | |||
1026 | create_mapping(&map); | ||
1027 | } | ||
1028 | |||
1029 | static void __init map_lowmem(void) | ||
1030 | { | ||
1031 | struct meminfo *mi = &meminfo; | ||
1032 | int i; | ||
1033 | |||
1034 | /* Map all the lowmem memory banks. */ | ||
1035 | for (i = 0; i < mi->nr_banks; i++) { | ||
1036 | struct membank *bank = &mi->bank[i]; | ||
1037 | |||
1038 | if (!bank->highmem) | ||
1039 | map_memory_bank(bank); | ||
1040 | } | ||
1041 | } | ||
1042 | |||
1017 | static int __init meminfo_cmp(const void *_a, const void *_b) | 1043 | static int __init meminfo_cmp(const void *_a, const void *_b) |
1018 | { | 1044 | { |
1019 | const struct membank *a = _a, *b = _b; | 1045 | const struct membank *a = _a, *b = _b; |
@@ -1034,6 +1060,7 @@ void __init paging_init(struct machine_desc *mdesc) | |||
1034 | build_mem_type_table(); | 1060 | build_mem_type_table(); |
1035 | sanity_check_meminfo(); | 1061 | sanity_check_meminfo(); |
1036 | prepare_page_table(); | 1062 | prepare_page_table(); |
1063 | map_lowmem(); | ||
1037 | bootmem_init(); | 1064 | bootmem_init(); |
1038 | devicemaps_init(mdesc); | 1065 | devicemaps_init(mdesc); |
1039 | kmap_init(); | 1066 | kmap_init(); |