aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
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 /include/asm-powerpc
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 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/mmu-hash32.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h
index 6e21ca618ec..f39ff983b38 100644
--- a/include/asm-powerpc/mmu-hash32.h
+++ b/include/asm-powerpc/mmu-hash32.h
@@ -28,6 +28,15 @@
28#define BPP_RW 0x02 /* Read/write */ 28#define BPP_RW 0x02 /* Read/write */
29 29
30#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
31/* Contort a phys_addr_t into the right format/bits for a BAT */
32#ifdef CONFIG_PHYS_64BIT
33#define BAT_PHYS_ADDR(x) ((u32)((x & 0x00000000fffe0000ULL) | \
34 ((x & 0x0000000e00000000ULL) >> 24) | \
35 ((x & 0x0000000100000000ULL) >> 30)))
36#else
37#define BAT_PHYS_ADDR(x) (x)
38#endif
39
31struct ppc_bat { 40struct ppc_bat {
32 struct { 41 struct {
33 unsigned long bepi:15; /* Effective page index (virtual address) */ 42 unsigned long bepi:15; /* Effective page index (virtual address) */