]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/powerpc/kernel/cpu_setup_ppc970.S
Merge tag 'befs-v4.10-rc1' of git://github.com/luisbg/linux-befs
[mirror_ubuntu-zesty-kernel.git] / arch / powerpc / kernel / cpu_setup_ppc970.S
index 27f2507279d830571fcecd0aa4e13c8a41d81062..12fac8df01c53172c6a8251845c83ed9c16f163a 100644 (file)
@@ -76,7 +76,7 @@ _GLOBAL(__setup_cpu_ppc970)
        /* Do nothing if not running in HV mode */
        mfmsr   r0
        rldicl. r0,r0,4,63
-       beqlr
+       beq     no_hv_mode
 
        mfspr   r0,SPRN_HID0
        li      r11,5                   /* clear DOZE and SLEEP */
@@ -90,7 +90,7 @@ _GLOBAL(__setup_cpu_ppc970MP)
        /* Do nothing if not running in HV mode */
        mfmsr   r0
        rldicl. r0,r0,4,63
-       beqlr
+       beq     no_hv_mode
 
        mfspr   r0,SPRN_HID0
        li      r11,0x15                /* clear DOZE and SLEEP */
@@ -109,6 +109,14 @@ load_hids:
        sync
        isync
 
+       /* Try to set LPES = 01 in HID4 */
+       mfspr   r0,SPRN_HID4
+       clrldi  r0,r0,1                 /* clear LPES0 */
+       ori     r0,r0,HID4_LPES1        /* set LPES1 */
+       sync
+       mtspr   SPRN_HID4,r0
+       isync
+
        /* Save away cpu state */
        LOAD_REG_ADDR(r5,cpu_state_storage)
 
@@ -117,11 +125,21 @@ load_hids:
        std     r3,CS_HID0(r5)
        mfspr   r3,SPRN_HID1
        std     r3,CS_HID1(r5)
-       mfspr   r3,SPRN_HID4
-       std     r3,CS_HID4(r5)
+       mfspr   r4,SPRN_HID4
+       std     r4,CS_HID4(r5)
        mfspr   r3,SPRN_HID5
        std     r3,CS_HID5(r5)
 
+       /* See if we successfully set LPES1 to 1; if not we are in Apple mode */
+       andi.   r4,r4,HID4_LPES1
+       bnelr
+
+no_hv_mode:
+       /* Disable CPU_FTR_HVMODE and exit, since we don't have HV mode */
+       ld      r5,CPU_SPEC_FEATURES(r4)
+       LOAD_REG_IMMEDIATE(r6,CPU_FTR_HVMODE)
+       andc    r5,r5,r6
+       std     r5,CPU_SPEC_FEATURES(r4)
        blr
 
 /* Called with no MMU context (typically MSR:IR/DR off) to