Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-drm-fsl-dcu.git] / arch / powerpc / platforms / ps3 / htab.c
index 8fe1769655a326c558b206f7c63a591b23baf76f..a1409e450c70172faa23bdeb85c2a8021054b5aa 100644 (file)
@@ -2,7 +2,7 @@
  *  PS3 pagetable management routines.
  *
  *  Copyright (C) 2006 Sony Computer Entertainment Inc.
- *  Copyright 2006 Sony Corp.
+ *  Copyright 2006, 2007 Sony Corporation
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -23,8 +23,8 @@
 #include <asm/machdep.h>
 #include <asm/lmb.h>
 #include <asm/udbg.h>
-#include <asm/ps3.h>
 #include <asm/lv1call.h>
+#include <asm/ps3fb.h>
 
 #include "platform.h"
 
@@ -39,7 +39,7 @@ static unsigned long htab_addr;
 static unsigned char *bolttab;
 static unsigned char *inusetab;
 
-static spinlock_t ps3_bolttab_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ps3_bolttab_lock);
 
 #define debug_dump_hpte(_a, _b, _c, _d, _e, _f, _g) \
        _debug_dump_hpte(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__)
@@ -234,6 +234,9 @@ static void ps3_hpte_invalidate(unsigned long slot, unsigned long va,
 
 static void ps3_hpte_clear(void)
 {
+       /* Make sure to clean up the frame buffer device first */
+       ps3fb_cleanup();
+
        lv1_unmap_htab(htab_addr);
 }
 
@@ -270,7 +273,8 @@ void __init ps3_map_htab(void)
 
        result = lv1_map_htab(0, &htab_addr);
 
-       htab = (hpte_t *)__ioremap(htab_addr, htab_size, PAGE_READONLY_X);
+       htab = (hpte_t *)__ioremap(htab_addr, htab_size,
+                                  pgprot_val(PAGE_READONLY_X));
 
        DBG("%s:%d: lpar %016lxh, virt %016lxh\n", __func__, __LINE__,
                htab_addr, (unsigned long)htab);