diff options
Diffstat (limited to 'arch/powerpc/platforms/ps3/htab.c')
-rw-r--r-- | arch/powerpc/platforms/ps3/htab.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c index a1409e450c70..5d2e176a1b18 100644 --- a/arch/powerpc/platforms/ps3/htab.c +++ b/arch/powerpc/platforms/ps3/htab.c | |||
@@ -29,12 +29,12 @@ | |||
29 | #include "platform.h" | 29 | #include "platform.h" |
30 | 30 | ||
31 | #if defined(DEBUG) | 31 | #if defined(DEBUG) |
32 | #define DBG(fmt...) udbg_printf(fmt) | 32 | #define DBG udbg_printf |
33 | #else | 33 | #else |
34 | #define DBG(fmt...) do{if(0)printk(fmt);}while(0) | 34 | #define DBG pr_debug |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | static hpte_t *htab; | 37 | static struct hash_pte *htab; |
38 | static unsigned long htab_addr; | 38 | static unsigned long htab_addr; |
39 | static unsigned char *bolttab; | 39 | static unsigned char *bolttab; |
40 | static unsigned char *inusetab; | 40 | static unsigned char *inusetab; |
@@ -44,8 +44,8 @@ static DEFINE_SPINLOCK(ps3_bolttab_lock); | |||
44 | #define debug_dump_hpte(_a, _b, _c, _d, _e, _f, _g) \ | 44 | #define debug_dump_hpte(_a, _b, _c, _d, _e, _f, _g) \ |
45 | _debug_dump_hpte(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__) | 45 | _debug_dump_hpte(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__) |
46 | static void _debug_dump_hpte(unsigned long pa, unsigned long va, | 46 | static void _debug_dump_hpte(unsigned long pa, unsigned long va, |
47 | unsigned long group, unsigned long bitmap, hpte_t lhpte, int psize, | 47 | unsigned long group, unsigned long bitmap, struct hash_pte lhpte, |
48 | unsigned long slot, const char* func, int line) | 48 | int psize, unsigned long slot, const char* func, int line) |
49 | { | 49 | { |
50 | DBG("%s:%d: pa = %lxh\n", func, line, pa); | 50 | DBG("%s:%d: pa = %lxh\n", func, line, pa); |
51 | DBG("%s:%d: lpar = %lxh\n", func, line, | 51 | DBG("%s:%d: lpar = %lxh\n", func, line, |
@@ -63,7 +63,7 @@ static long ps3_hpte_insert(unsigned long hpte_group, unsigned long va, | |||
63 | unsigned long pa, unsigned long rflags, unsigned long vflags, int psize) | 63 | unsigned long pa, unsigned long rflags, unsigned long vflags, int psize) |
64 | { | 64 | { |
65 | unsigned long slot; | 65 | unsigned long slot; |
66 | hpte_t lhpte; | 66 | struct hash_pte lhpte; |
67 | int secondary = 0; | 67 | int secondary = 0; |
68 | unsigned long result; | 68 | unsigned long result; |
69 | unsigned long bitmap; | 69 | unsigned long bitmap; |
@@ -234,10 +234,17 @@ static void ps3_hpte_invalidate(unsigned long slot, unsigned long va, | |||
234 | 234 | ||
235 | static void ps3_hpte_clear(void) | 235 | static void ps3_hpte_clear(void) |
236 | { | 236 | { |
237 | /* Make sure to clean up the frame buffer device first */ | 237 | int result; |
238 | ps3fb_cleanup(); | ||
239 | 238 | ||
240 | lv1_unmap_htab(htab_addr); | 239 | DBG(" -> %s:%d\n", __func__, __LINE__); |
240 | |||
241 | result = lv1_unmap_htab(htab_addr); | ||
242 | BUG_ON(result); | ||
243 | |||
244 | ps3_mm_shutdown(); | ||
245 | ps3_mm_vas_destroy(); | ||
246 | |||
247 | DBG(" <- %s:%d\n", __func__, __LINE__); | ||
241 | } | 248 | } |
242 | 249 | ||
243 | void __init ps3_hpte_init(unsigned long htab_size) | 250 | void __init ps3_hpte_init(unsigned long htab_size) |
@@ -255,7 +262,7 @@ void __init ps3_hpte_init(unsigned long htab_size) | |||
255 | 262 | ||
256 | ppc64_pft_size = __ilog2(htab_size); | 263 | ppc64_pft_size = __ilog2(htab_size); |
257 | 264 | ||
258 | bitmap_size = htab_size / sizeof(hpte_t) / 8; | 265 | bitmap_size = htab_size / sizeof(struct hash_pte) / 8; |
259 | 266 | ||
260 | bolttab = __va(lmb_alloc(bitmap_size, 1)); | 267 | bolttab = __va(lmb_alloc(bitmap_size, 1)); |
261 | inusetab = __va(lmb_alloc(bitmap_size, 1)); | 268 | inusetab = __va(lmb_alloc(bitmap_size, 1)); |
@@ -273,8 +280,8 @@ void __init ps3_map_htab(void) | |||
273 | 280 | ||
274 | result = lv1_map_htab(0, &htab_addr); | 281 | result = lv1_map_htab(0, &htab_addr); |
275 | 282 | ||
276 | htab = (hpte_t *)__ioremap(htab_addr, htab_size, | 283 | htab = (__force struct hash_pte *)ioremap_flags(htab_addr, htab_size, |
277 | pgprot_val(PAGE_READONLY_X)); | 284 | pgprot_val(PAGE_READONLY_X)); |
278 | 285 | ||
279 | DBG("%s:%d: lpar %016lxh, virt %016lxh\n", __func__, __LINE__, | 286 | DBG("%s:%d: lpar %016lxh, virt %016lxh\n", __func__, __LINE__, |
280 | htab_addr, (unsigned long)htab); | 287 | htab_addr, (unsigned long)htab); |