]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/mmu-hash32.h
i2c: Convert the pca9539 driver to a new-style i2c driver
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / mmu-hash32.h
index 6e21ca618ec352874e472a2f59b6da40cea22ae4..16b1a1e77e64e5b5adeaba606db3aee1047f29c1 100644 (file)
 #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) */
-               unsigned long :4;       /* Unused */
-               unsigned long bl:11;    /* Block size mask */
-               unsigned long vs:1;     /* Supervisor valid */
-               unsigned long vp:1;     /* User valid */
-       } batu;                 /* Upper register */
-       struct {
-               unsigned long brpn:15;  /* Real page index (physical address) */
-               unsigned long :10;      /* Unused */
-               unsigned long w:1;      /* Write-thru cache */
-               unsigned long i:1;      /* Cache inhibit */
-               unsigned long m:1;      /* Memory coherence */
-               unsigned long g:1;      /* Guarded (MBZ in IBAT) */
-               unsigned long :1;       /* Unused */
-               unsigned long pp:2;     /* Page access protections */
-       } batl;                 /* Lower register */
+       u32 batu;
+       u32 batl;
 };
 #endif /* !__ASSEMBLY__ */