summaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorBecky Bruce <becky.bruce@freescale.com>2008-06-14 09:41:42 +1000
committerPaul Mackerras <paulus@samba.org>2008-06-30 22:31:03 +1000
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 @@
#define BPP_RW 0x02 /* Read/write */
#ifndef __ASSEMBLY__
+/* Contort a phys_addr_t into the right format/bits for a BAT */
+#ifdef CONFIG_PHYS_64BIT
+#define BAT_PHYS_ADDR(x) ((u32)((x & 0x00000000fffe0000ULL) | \
+ ((x & 0x0000000e00000000ULL) >> 24) | \
+ ((x & 0x0000000100000000ULL) >> 30)))
+#else
+#define BAT_PHYS_ADDR(x) (x)
+#endif
+
struct ppc_bat {
struct {
unsigned long bepi:15; /* Effective page index (virtual address) */