diff options
author | Kevin Hao <haokexin@gmail.com> | 2013-12-24 02:12:09 -0500 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-01-09 18:52:17 -0500 |
commit | 813125d83372e19edecaba811d4d0dc115d36819 (patch) | |
tree | dcdb0c31b28535300eeb5f78b99c992d6ab96d23 | |
parent | b27652dd2174df1a7e0a7c5f00d1c8e3ed9287a7 (diff) |
powerpc/fsl_booke: introduce map_mem_in_cams_addr
Introduce this function so we can set both the physical and virtual
address for the map in cams. This will be used by the relocation code.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r-- | arch/powerpc/mm/fsl_booke_mmu.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c index 1d54f6d35e71..ca956c83e3a2 100644 --- a/arch/powerpc/mm/fsl_booke_mmu.c +++ b/arch/powerpc/mm/fsl_booke_mmu.c | |||
@@ -171,11 +171,10 @@ unsigned long calc_cam_sz(unsigned long ram, unsigned long virt, | |||
171 | return 1UL << camsize; | 171 | return 1UL << camsize; |
172 | } | 172 | } |
173 | 173 | ||
174 | unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx) | 174 | static unsigned long map_mem_in_cams_addr(phys_addr_t phys, unsigned long virt, |
175 | unsigned long ram, int max_cam_idx) | ||
175 | { | 176 | { |
176 | int i; | 177 | int i; |
177 | unsigned long virt = PAGE_OFFSET; | ||
178 | phys_addr_t phys = memstart_addr; | ||
179 | unsigned long amount_mapped = 0; | 178 | unsigned long amount_mapped = 0; |
180 | 179 | ||
181 | /* Calculate CAM values */ | 180 | /* Calculate CAM values */ |
@@ -195,6 +194,14 @@ unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx) | |||
195 | return amount_mapped; | 194 | return amount_mapped; |
196 | } | 195 | } |
197 | 196 | ||
197 | unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx) | ||
198 | { | ||
199 | unsigned long virt = PAGE_OFFSET; | ||
200 | phys_addr_t phys = memstart_addr; | ||
201 | |||
202 | return map_mem_in_cams_addr(phys, virt, ram, max_cam_idx); | ||
203 | } | ||
204 | |||
198 | #ifdef CONFIG_PPC32 | 205 | #ifdef CONFIG_PPC32 |
199 | 206 | ||
200 | #if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS) | 207 | #if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS) |