powerpc: rename SPRN_HID2 define to SPRN_HID2_750FX
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Wed, 24 Jan 2024 10:50:31 +0000 (11:50 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 May 2024 14:25:00 +0000 (00:25 +1000)
This register number is hardware-specific, rename it for clarity.

FIXME comments are added in a few places where it seems like the wrong
register is used. As I can't test this, only the rename is done with no
functional change.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240124105031.45734-1-matthias.schiffer@ew.tq-group.com
arch/powerpc/include/asm/reg.h
arch/powerpc/kernel/cpu_setup_6xx.S
arch/powerpc/kvm/book3s_emulate.c
arch/powerpc/platforms/52xx/lite5200_sleep.S
arch/powerpc/platforms/83xx/suspend-asm.S
drivers/cpufreq/pmac32-cpufreq.c

index d3d1aea009b46b59135fc71c77b3b51576d1e997..eed33cb916d0ffc59ea80e4b4efb4640f9ba1ebb 100644 (file)
 #define HID1_ABE       (1<<10)         /* 7450 Address Broadcast Enable */
 #define HID1_PS                (1<<16)         /* 750FX PLL selection */
 #endif
-#define SPRN_HID2      0x3F8           /* Hardware Implementation Register 2 */
+#define SPRN_HID2_750FX        0x3F8           /* IBM 750FX HID2 Register */
 #define SPRN_HID2_GEKKO        0x398           /* Gekko HID2 Register */
 #define SPRN_HID2_G2_LE        0x3F3           /* G2_LE HID2 Register */
 #define  HID2_G2_LE_HBE        (1<<18)         /* High BAT Enable (G2_LE) */
index bfd3f442e5eb9dfcb851f1b1c5b68e690f1702ae..ab3ca74e673022066c61f902e7cdc387a9c164b3 100644 (file)
@@ -401,7 +401,7 @@ _GLOBAL(__save_cpu_setup)
        andi.   r3,r3,0xff00
        cmpwi   cr0,r3,0x0200
        bne     1f
-       mfspr   r4,SPRN_HID2
+       mfspr   r4,SPRN_HID2_750FX
        stw     r4,CS_HID2(r5)
 1:
        mtcr    r7
@@ -496,7 +496,7 @@ _GLOBAL(__restore_cpu_setup)
        bne     4f
        lwz     r4,CS_HID2(r5)
        rlwinm  r4,r4,0,19,17
-       mtspr   SPRN_HID2,r4
+       mtspr   SPRN_HID2_750FX,r4
        sync
 4:
        lwz     r4,CS_HID1(r5)
index 5bbfb2eed1277f2ec6257dc8aee469ceac503e5c..de126d153328276620573f2571fd802e12d8388d 100644 (file)
@@ -714,7 +714,7 @@ int kvmppc_core_emulate_mtspr_pr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)
        case SPRN_HID1:
                to_book3s(vcpu)->hid[1] = spr_val;
                break;
-       case SPRN_HID2:
+       case SPRN_HID2_750FX:
                to_book3s(vcpu)->hid[2] = spr_val;
                break;
        case SPRN_HID2_GEKKO:
@@ -900,7 +900,7 @@ int kvmppc_core_emulate_mfspr_pr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val
        case SPRN_HID1:
                *spr_val = to_book3s(vcpu)->hid[1];
                break;
-       case SPRN_HID2:
+       case SPRN_HID2_750FX:
        case SPRN_HID2_GEKKO:
                *spr_val = to_book3s(vcpu)->hid[2];
                break;
index 0b12647e7b420ceedd70676ce250a9367c82c342..0ec2522ee4adb68b8b0e29cf4e183ede11e145de 100644 (file)
@@ -203,7 +203,8 @@ lite5200_wakeup:
 
        /* HIDs, MSR */
        LOAD_SPRN(HID1, 0x19)
-       LOAD_SPRN(HID2, 0x1a)
+       /* FIXME: Should this use HID2_G2_LE? */
+       LOAD_SPRN(HID2_750FX, 0x1a)
 
 
        /* address translation is tricky (see turn_on_mmu) */
@@ -283,7 +284,8 @@ SYM_FUNC_START_LOCAL(save_regs)
 
        SAVE_SPRN(HID0, 0x18)
        SAVE_SPRN(HID1, 0x19)
-       SAVE_SPRN(HID2, 0x1a)
+       /* FIXME: Should this use HID2_G2_LE? */
+       SAVE_SPRN(HID2_750FX, 0x1a)
        mfmsr   r10
        stw     r10, (4*0x1b)(r4)
        /*SAVE_SPRN(LR, 0x1c) have to save it before the call */
index bc6bd4d0ae965b5877281e088d80bef579984b85..6a62ed6082c93140abdbb7c28cdbc185c662a10e 100644 (file)
@@ -68,7 +68,8 @@ _GLOBAL(mpc83xx_enter_deep_sleep)
 
        mfspr   r5, SPRN_HID0
        mfspr   r6, SPRN_HID1
-       mfspr   r7, SPRN_HID2
+       /* FIXME: Should this use SPRN_HID2_G2_LE? */
+       mfspr   r7, SPRN_HID2_750FX
 
        stw     r5, SS_HID+0(r3)
        stw     r6, SS_HID+4(r3)
@@ -396,7 +397,8 @@ mpc83xx_deep_resume:
 
        mtspr   SPRN_HID0, r5
        mtspr   SPRN_HID1, r6
-       mtspr   SPRN_HID2, r7
+       /* FIXME: Should this use SPRN_HID2_G2_LE? */
+       mtspr   SPRN_HID2_750FX, r7
 
        lwz     r4, SS_IABR+0(r3)
        lwz     r5, SS_IABR+4(r3)
index df3567c1e93b7a375027f26188b7130b48c2a3e0..6c9f0888a2a753dfd1bf2581d4bae86dc39d6fe4 100644 (file)
@@ -120,9 +120,9 @@ static int cpu_750fx_cpu_speed(int low_speed)
 
                /* tweak L2 for high voltage */
                if (has_cpu_l2lve) {
-                       hid2 = mfspr(SPRN_HID2);
+                       hid2 = mfspr(SPRN_HID2_750FX);
                        hid2 &= ~0x2000;
-                       mtspr(SPRN_HID2, hid2);
+                       mtspr(SPRN_HID2_750FX, hid2);
                }
        }
 #ifdef CONFIG_PPC_BOOK3S_32
@@ -131,9 +131,9 @@ static int cpu_750fx_cpu_speed(int low_speed)
        if (low_speed == 1) {
                /* tweak L2 for low voltage */
                if (has_cpu_l2lve) {
-                       hid2 = mfspr(SPRN_HID2);
+                       hid2 = mfspr(SPRN_HID2_750FX);
                        hid2 |= 0x2000;
-                       mtspr(SPRN_HID2, hid2);
+                       mtspr(SPRN_HID2_750FX, hid2);
                }
 
                /* ramping down, set voltage last */