aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/ppc_mmu_32.c
diff options
context:
space:
mode:
authorBecky Bruce <becky.bruce@freescale.com>2008-06-13 19:41:42 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 08:31:03 -0400
commit7c5c4325d2d911fe54db3bc14149bfa558ae0acb (patch)
tree97c02e9d03bbbb1fff89e9e44eef1e53762e823e /arch/powerpc/mm/ppc_mmu_32.c
parentbf2737f74ffd36f43c6ed11cd2c0826e1d59ad48 (diff)
powerpc: Change BAT code to use phys_addr_t
Currently, the physical address is an unsigned long, but it should be phys_addr_t in set_bat, [v/p]_mapped_by_bat. Also, create a macro that can convert a large physical address into the correct format for programming the BAT registers. Signed-off-by: Becky Bruce <becky.bruce@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/mm/ppc_mmu_32.c')
-rw-r--r--arch/powerpc/mm/ppc_mmu_32.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index cef9f156874..55ec17ed8d7 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -46,13 +46,13 @@ union ubat { /* BAT register values to be loaded */
46struct batrange { /* stores address ranges mapped by BATs */ 46struct batrange { /* stores address ranges mapped by BATs */
47 unsigned long start; 47 unsigned long start;
48 unsigned long limit; 48 unsigned long limit;
49 unsigned long phys; 49 phys_addr_t phys;
50} bat_addrs[8]; 50} bat_addrs[8];
51 51
52/* 52/*
53 * Return PA for this VA if it is mapped by a BAT, or 0 53 * Return PA for this VA if it is mapped by a BAT, or 0
54 */ 54 */
55unsigned long v_mapped_by_bats(unsigned long va) 55phys_addr_t v_mapped_by_bats(unsigned long va)
56{ 56{
57 int b; 57 int b;
58 for (b = 0; b < 4; ++b) 58 for (b = 0; b < 4; ++b)
@@ -64,7 +64,7 @@ unsigned long v_mapped_by_bats(unsigned long va)
64/* 64/*
65 * Return VA for a given PA or 0 if not mapped 65 * Return VA for a given PA or 0 if not mapped
66 */ 66 */
67unsigned long p_mapped_by_bats(unsigned long pa) 67unsigned long p_mapped_by_bats(phys_addr_t pa)
68{ 68{
69 int b; 69 int b;
70 for (b = 0; b < 4; ++b) 70 for (b = 0; b < 4; ++b)
@@ -119,7 +119,7 @@ unsigned long __init mmu_mapin_ram(void)
119 * The parameters are not checked; in particular size must be a power 119 * The parameters are not checked; in particular size must be a power
120 * of 2 between 128k and 256M. 120 * of 2 between 128k and 256M.
121 */ 121 */
122void __init setbat(int index, unsigned long virt, unsigned long phys, 122void __init setbat(int index, unsigned long virt, phys_addr_t phys,
123 unsigned int size, int flags) 123 unsigned int size, int flags)
124{ 124{
125 unsigned int bl; 125 unsigned int bl;
@@ -138,7 +138,7 @@ void __init setbat(int index, unsigned long virt, unsigned long phys,
138 | _PAGE_COHERENT | _PAGE_GUARDED); 138 | _PAGE_COHERENT | _PAGE_GUARDED);
139 wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX; 139 wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
140 bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */ 140 bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
141 bat[1].word[1] = phys | wimgxpp; 141 bat[1].word[1] = BAT_PHYS_ADDR(phys) | wimgxpp;
142#ifndef CONFIG_KGDB /* want user access for breakpoints */ 142#ifndef CONFIG_KGDB /* want user access for breakpoints */
143 if (flags & _PAGE_USER) 143 if (flags & _PAGE_USER)
144#endif 144#endif