]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/head_32.S
Merge branch 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/hskinnem...
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / head_32.S
index c86c626cf156431210fe70cacb50771cc7f2eaf8..a5b13ae7fd20d6a225cee77942c7b26f19ab8f58 100644 (file)
@@ -149,6 +149,9 @@ __after_mmu_off:
 #if defined(CONFIG_BOOTX_TEXT)
        bl      setup_disp_bat
 #endif
+#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
+       bl      setup_cpm_bat
+#endif
 
 /*
  * Call setup_cpu for CPU 0 and initialize 6xx Idle
@@ -466,12 +469,12 @@ InstructionTLBMiss:
        mfctr   r0
        /* Get PTE (linux-style) and check access */
        mfspr   r3,SPRN_IMISS
-       lis     r1,KERNELBASE@h         /* check if kernel address */
-       cmplw   0,r3,r1
+       lis     r1,PAGE_OFFSET@h                /* check if kernel address */
+       cmplw   0,r1,r3
        mfspr   r2,SPRN_SPRG3
        li      r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
        lwz     r2,PGDIR(r2)
-       blt+    112f
+       bge-    112f
        mfspr   r2,SPRN_SRR1            /* and MSR_PR bit from SRR1 */
        rlwimi  r1,r2,32-12,29,29       /* shift MSR_PR to _PAGE_USER posn */
        lis     r2,swapper_pg_dir@ha    /* if kernel address, use */
@@ -540,12 +543,12 @@ DataLoadTLBMiss:
        mfctr   r0
        /* Get PTE (linux-style) and check access */
        mfspr   r3,SPRN_DMISS
-       lis     r1,KERNELBASE@h         /* check if kernel address */
-       cmplw   0,r3,r1
+       lis     r1,PAGE_OFFSET@h                /* check if kernel address */
+       cmplw   0,r1,r3
        mfspr   r2,SPRN_SPRG3
        li      r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
        lwz     r2,PGDIR(r2)
-       blt+    112f
+       bge-    112f
        mfspr   r2,SPRN_SRR1            /* and MSR_PR bit from SRR1 */
        rlwimi  r1,r2,32-12,29,29       /* shift MSR_PR to _PAGE_USER posn */
        lis     r2,swapper_pg_dir@ha    /* if kernel address, use */
@@ -612,12 +615,12 @@ DataStoreTLBMiss:
        mfctr   r0
        /* Get PTE (linux-style) and check access */
        mfspr   r3,SPRN_DMISS
-       lis     r1,KERNELBASE@h         /* check if kernel address */
-       cmplw   0,r3,r1
+       lis     r1,PAGE_OFFSET@h                /* check if kernel address */
+       cmplw   0,r1,r3
        mfspr   r2,SPRN_SPRG3
        li      r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */
        lwz     r2,PGDIR(r2)
-       blt+    112f
+       bge-    112f
        mfspr   r2,SPRN_SRR1            /* and MSR_PR bit from SRR1 */
        rlwimi  r1,r2,32-12,29,29       /* shift MSR_PR to _PAGE_USER posn */
        lis     r2,swapper_pg_dir@ha    /* if kernel address, use */
@@ -1245,6 +1248,19 @@ setup_disp_bat:
        blr
 #endif /* CONFIG_BOOTX_TEXT */
 
+#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
+setup_cpm_bat:
+       lis     r8, 0xf000
+       ori     r8, r8, 0x002a
+       mtspr   SPRN_DBAT1L, r8
+
+       lis     r11, 0xf000
+       ori     r11, r11, (BL_1M << 2) | 2
+       mtspr   SPRN_DBAT1U, r11
+
+       blr
+#endif
+
 #ifdef CONFIG_8260
 /* Jump into the system reset for the rom.
  * We first disable the MMU, and then jump to the ROM reset address.