Skip to content

Commit fd3f1b3

Browse files
committed
[Intel/SNB] Query the IMC Power-Down Mode
1 parent 347dd79 commit fd3f1b3

File tree

5 files changed

+43
-5
lines changed

5 files changed

+43
-5
lines changed

corefreq-api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ typedef struct
497497
/* 4004h */ SNB_IMC_TC_RAP RAP; /* 32 bits */
498498
/* 4008h */ SNB_IMC_TC_RWP RWP; /* 32 bits */
499499
/* 400Ch */ SNB_IMC_TC_OTP OTP; /* 32 bits */
500+
/* 40B0h */ SNB_IMC_PDWN PDWN; /* 32 bits */
500501
/* 4298h */ SNB_IMC_TC_RFTP RFTP; /* 32 bits */
501502
/* 42A4h */ SNB_IMC_TC_SRFTP SRFTP; /* 32 bits */
502503
} SNB;

corefreqd.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3410,6 +3410,15 @@ void SNB_IMC(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc))
34103410
TIMING(mc, cha).tXS = \
34113411
RO(Proc)->Uncore.MC[mc].Channel[cha].SNB.SRFTP.tXS;
34123412

3413+
TIMING(mc, cha).PDM_EN = \
3414+
0 != RO(Proc)->Uncore.MC[mc].Channel[cha].SNB.PDWN.PDWN_Mode;
3415+
3416+
TIMING(mc, cha).PDM_MODE = \
3417+
RO(Proc)->Uncore.MC[mc].Channel[cha].SNB.PDWN.GLPDN;
3418+
3419+
TIMING(mc, cha).PDM_AGGR = \
3420+
RO(Proc)->Uncore.MC[mc].Channel[cha].SNB.PDWN.PDWN_Mode;
3421+
34133422
for (slot = 0; slot < RO(Shm)->Uncore.MC[mc].SlotCount; slot++)
34143423
{
34153424
unsigned int width = 1;

corefreqk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4280,6 +4280,9 @@ void Query_SNB_IMC(void __iomem *mchmap, unsigned short mc)
42804280
PUBLIC(RO(Proc))->Uncore.MC[mc].Channel[cha].SNB.OTP.value = \
42814281
readl(mchmap + 0x400c + 0x400 * cha);
42824282

4283+
PUBLIC(RO(Proc))->Uncore.MC[mc].Channel[cha].SNB.PDWN.value = \
4284+
readl(mchmap + 0x40b0 + 0x400 * cha);
4285+
42834286
PUBLIC(RO(Proc))->Uncore.MC[mc].Channel[cha].SNB.RFTP.value = \
42844287
readl(mchmap + 0x4298 + 0x400 * cha);
42854288

coretypes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,15 +1881,15 @@ typedef struct
18811881
union {
18821882
unsigned int B2B;
18831883
unsigned int GEAR;
1884-
struct {
1884+
};
1885+
struct {
18851886
unsigned int GDM : 1-0,
18861887
BGS : 2-1,
18871888
BGS_ALT : 3-2,
18881889
PDM_EN : 4-3,
18891890
PDM_MODE: 5-4,
1890-
PDM_AGGR: 6-5,
1891-
Unused : 32-6;
1892-
};
1891+
PDM_AGGR: 9-5,
1892+
Unused : 32-9;
18931893
};
18941894
unsigned int ECC;
18951895
} RAM_TIMING;

intelmsr.h

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2741,7 +2741,7 @@ typedef union
27412741
} SNB_IMC_TC_DBP;
27422742

27432743
typedef union
2744-
{ /* Device: 0 - Function: 0 - Offset Channel0: 4004h & Channel1: 4400h */
2744+
{ /* Device: 0 - Function: 0 - Offset Channel0: 4004h & Channel1: 4404h */
27452745
unsigned int value;
27462746
struct {
27472747
unsigned int
@@ -2831,6 +2831,31 @@ typedef union
28312831
} EP;
28322832
} SNB_IMC_TC_OTP;
28332833

2834+
typedef union
2835+
{ /* Device: 0 - Function: 0 - Offset Channel0: 40B0h & Channel1: 44B0h */
2836+
unsigned int value;
2837+
struct {
2838+
unsigned int
2839+
PDWN_Idle_Ctr : 8-0, /* Rank Power-down idle timer (DCLK) */
2840+
PDWN_Mode : 12-8, /* (1) */
2841+
GLPDN : 13-12, /* (2) */
2842+
ReservedBits : 32-13;
2843+
};
2844+
} SNB_IMC_PDWN;
2845+
2846+
/*
2847+
* (1) The value 0h (no power-down) is a don't care.
2848+
* 0h = No Power Down
2849+
* 1h = APD
2850+
* 2h = PPD
2851+
* 3h = APD - PPD
2852+
* 6h = DLL Off
2853+
* 7h = APD-DLL Off
2854+
*
2855+
* (2) 1 = Power-down decision is global for channel.
2856+
* 0 = A separate decision is taken for each rank.
2857+
*/
2858+
28342859
typedef union
28352860
{ /* Device: 0 - Function: 0 - Offset Channel0: 4298h & Channel1: 4698h */
28362861
unsigned int value;

0 commit comments

Comments
 (0)