Skip to content

Commit ad67971

Browse files
tq-schiffermmpe
authored andcommitted
powerpc: rename SPRN_HID2 define to SPRN_HID2_750FX
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 0ddbbb8 commit ad67971

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

arch/powerpc/include/asm/reg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@
615615
#define HID1_ABE (1<<10) /* 7450 Address Broadcast Enable */
616616
#define HID1_PS (1<<16) /* 750FX PLL selection */
617617
#endif
618-
#define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */
618+
#define SPRN_HID2_750FX 0x3F8 /* IBM 750FX HID2 Register */
619619
#define SPRN_HID2_GEKKO 0x398 /* Gekko HID2 Register */
620620
#define SPRN_HID2_G2_LE 0x3F3 /* G2_LE HID2 Register */
621621
#define HID2_G2_LE_HBE (1<<18) /* High BAT Enable (G2_LE) */

arch/powerpc/kernel/cpu_setup_6xx.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ _GLOBAL(__save_cpu_setup)
401401
andi. r3,r3,0xff00
402402
cmpwi cr0,r3,0x0200
403403
bne 1f
404-
mfspr r4,SPRN_HID2
404+
mfspr r4,SPRN_HID2_750FX
405405
stw r4,CS_HID2(r5)
406406
1:
407407
mtcr r7
@@ -496,7 +496,7 @@ _GLOBAL(__restore_cpu_setup)
496496
bne 4f
497497
lwz r4,CS_HID2(r5)
498498
rlwinm r4,r4,0,19,17
499-
mtspr SPRN_HID2,r4
499+
mtspr SPRN_HID2_750FX,r4
500500
sync
501501
4:
502502
lwz r4,CS_HID1(r5)

arch/powerpc/kvm/book3s_emulate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ int kvmppc_core_emulate_mtspr_pr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)
714714
case SPRN_HID1:
715715
to_book3s(vcpu)->hid[1] = spr_val;
716716
break;
717-
case SPRN_HID2:
717+
case SPRN_HID2_750FX:
718718
to_book3s(vcpu)->hid[2] = spr_val;
719719
break;
720720
case SPRN_HID2_GEKKO:
@@ -900,7 +900,7 @@ int kvmppc_core_emulate_mfspr_pr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val
900900
case SPRN_HID1:
901901
*spr_val = to_book3s(vcpu)->hid[1];
902902
break;
903-
case SPRN_HID2:
903+
case SPRN_HID2_750FX:
904904
case SPRN_HID2_GEKKO:
905905
*spr_val = to_book3s(vcpu)->hid[2];
906906
break;

arch/powerpc/platforms/52xx/lite5200_sleep.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ lite5200_wakeup:
203203

204204
/* HIDs, MSR */
205205
LOAD_SPRN(HID1, 0x19)
206-
LOAD_SPRN(HID2, 0x1a)
206+
/* FIXME: Should this use HID2_G2_LE? */
207+
LOAD_SPRN(HID2_750FX, 0x1a)
207208

208209

209210
/* address translation is tricky (see turn_on_mmu) */
@@ -283,7 +284,8 @@ SYM_FUNC_START_LOCAL(save_regs)
283284

284285
SAVE_SPRN(HID0, 0x18)
285286
SAVE_SPRN(HID1, 0x19)
286-
SAVE_SPRN(HID2, 0x1a)
287+
/* FIXME: Should this use HID2_G2_LE? */
288+
SAVE_SPRN(HID2_750FX, 0x1a)
287289
mfmsr r10
288290
stw r10, (4*0x1b)(r4)
289291
/*SAVE_SPRN(LR, 0x1c) have to save it before the call */

arch/powerpc/platforms/83xx/suspend-asm.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ _GLOBAL(mpc83xx_enter_deep_sleep)
6868

6969
mfspr r5, SPRN_HID0
7070
mfspr r6, SPRN_HID1
71-
mfspr r7, SPRN_HID2
71+
/* FIXME: Should this use SPRN_HID2_G2_LE? */
72+
mfspr r7, SPRN_HID2_750FX
7273

7374
stw r5, SS_HID+0(r3)
7475
stw r6, SS_HID+4(r3)
@@ -396,7 +397,8 @@ mpc83xx_deep_resume:
396397

397398
mtspr SPRN_HID0, r5
398399
mtspr SPRN_HID1, r6
399-
mtspr SPRN_HID2, r7
400+
/* FIXME: Should this use SPRN_HID2_G2_LE? */
401+
mtspr SPRN_HID2_750FX, r7
400402

401403
lwz r4, SS_IABR+0(r3)
402404
lwz r5, SS_IABR+4(r3)

drivers/cpufreq/pmac32-cpufreq.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ static int cpu_750fx_cpu_speed(int low_speed)
120120

121121
/* tweak L2 for high voltage */
122122
if (has_cpu_l2lve) {
123-
hid2 = mfspr(SPRN_HID2);
123+
hid2 = mfspr(SPRN_HID2_750FX);
124124
hid2 &= ~0x2000;
125-
mtspr(SPRN_HID2, hid2);
125+
mtspr(SPRN_HID2_750FX, hid2);
126126
}
127127
}
128128
#ifdef CONFIG_PPC_BOOK3S_32
@@ -131,9 +131,9 @@ static int cpu_750fx_cpu_speed(int low_speed)
131131
if (low_speed == 1) {
132132
/* tweak L2 for low voltage */
133133
if (has_cpu_l2lve) {
134-
hid2 = mfspr(SPRN_HID2);
134+
hid2 = mfspr(SPRN_HID2_750FX);
135135
hid2 |= 0x2000;
136-
mtspr(SPRN_HID2, hid2);
136+
mtspr(SPRN_HID2_750FX, hid2);
137137
}
138138

139139
/* ramping down, set voltage last */

0 commit comments

Comments
 (0)