Skip to content

Commit dbc0e1e

Browse files
committed
[Intel] Query the Overclocking bit (OC) from Capabilities
1 parent cf26a20 commit dbc0e1e

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

x86_64/corefreq-cli-json.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,8 @@ void JsonSysInfo(RO(SHM_STRUCT) *RO(Shm))
15411541
json_literal(&s, "%llu", RO(Shm)->Proc.Technology.IPU);
15421542
json_key(&s, "VPU");
15431543
json_literal(&s, "%llu", RO(Shm)->Proc.Technology.VPU);
1544+
json_key(&s, "OC");
1545+
json_literal(&s, "%llu", RO(Shm)->Proc.Technology.OC);
15441546

15451547
json_end_object(&s);
15461548
}

x86_64/corefreq.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ typedef struct
375375
HDCP : 46-45,
376376
IPU : 47-46,
377377
VPU : 48-47,
378-
_pad64 : 64-48;
378+
OC : 49-48,
379+
_pad64 : 64-49;
379380
} Technology;
380381

381382
struct {

x86_64/corefreqd.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4416,7 +4416,8 @@ void IVB_CAP(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc), RO(CORE) *RO(Core))
44164416
RO(Shm)->Uncore.Unit.DDR_Ver = 3;
44174417
RO(Shm)->Uncore.Unit.DDR_Std = RAM_STD_UNSPEC;
44184418

4419-
RO(Shm)->Proc.Technology.IOMMU = !RO(Proc)->Uncore.Bus.SNB_Cap.VT_d;
4419+
RO(Shm)->Proc.Technology.IOMMU = !RO(Proc)->Uncore.Bus.SNB_Cap.IVB.VT_d;
4420+
RO(Shm)->Proc.Technology.OC = RO(Proc)->Uncore.Bus.IVB_Cap.OC_ENABLED;
44204421
}
44214422

44224423
unsigned int DimmWidthToRows(unsigned int width)
@@ -4973,6 +4974,7 @@ void SKL_CAP(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc), RO(CORE) *RO(Core))
49734974

49744975
RO(Shm)->Proc.Technology.GNA = !RO(Proc)->Uncore.Bus.SKL_Cap_B.GMM_DIS;
49754976
RO(Shm)->Proc.Technology.IPU = !RO(Proc)->Uncore.Bus.SKL_Cap_B.IMGU_DIS;
4977+
RO(Shm)->Proc.Technology.OC = RO(Proc)->Uncore.Bus.SKL_Cap_B.OC_ENABLED;
49764978
}
49774979

49784980
void RKL_IMC(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc))
@@ -5294,6 +5296,7 @@ void RKL_CAP(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc), RO(CORE) *RO(Core))
52945296
RO(Shm)->Proc.Technology.GNA = !RO(Proc)->Uncore.Bus.RKL_Cap_B.GNA_DIS;
52955297
RO(Shm)->Proc.Technology.HDCP= !RO(Proc)->Uncore.Bus.RKL_Cap_B.HDCPD;
52965298
RO(Shm)->Proc.Technology.IPU = !RO(Proc)->Uncore.Bus.RKL_Cap_B.IPU_DIS;
5299+
RO(Shm)->Proc.Technology.OC = RO(Proc)->Uncore.Bus.RKL_Cap_B.OC_ENABLED;
52975300
}
52985301

52995302
void TGL_IMC(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc))
@@ -5851,6 +5854,7 @@ void ADL_CAP(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc), RO(CORE) *RO(Core))
58515854
RO(Shm)->Proc.Technology.GNA = !RO(Proc)->Uncore.Bus.ADL_Cap_B.GNA_DIS;
58525855
RO(Shm)->Proc.Technology.HDCP= !RO(Proc)->Uncore.Bus.ADL_Cap_B.HDCPD;
58535856
RO(Shm)->Proc.Technology.IPU = !RO(Proc)->Uncore.Bus.ADL_Cap_B.IPU_DIS;
5857+
RO(Shm)->Proc.Technology.OC = RO(Proc)->Uncore.Bus.ADL_Cap_B.OC_ENABLED;
58545858
}
58555859

58565860
void GLK_CAP(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc), RO(CORE) *RO(Core))
@@ -5874,6 +5878,7 @@ void GLK_CAP(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc), RO(CORE) *RO(Core))
58745878

58755879
RO(Shm)->Proc.Technology.GNA = !RO(Proc)->Uncore.Bus.GLK_Cap_B.GMM_DIS;
58765880
RO(Shm)->Proc.Technology.IPU = !RO(Proc)->Uncore.Bus.GLK_Cap_B.IMGU_DIS;
5881+
RO(Shm)->Proc.Technology.OC = RO(Proc)->Uncore.Bus.GLK_Cap_B.OC_ENABLED;
58775882
}
58785883

58795884
void GLK_IMC(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc))
@@ -6004,6 +6009,7 @@ void MTL_CAP(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc), RO(CORE) *RO(Core))
60046009
RO(Shm)->Proc.Technology.HDCP= !RO(Proc)->Uncore.Bus.MTL_Cap_B.HDCPD;
60056010
RO(Shm)->Proc.Technology.IPU = !RO(Proc)->Uncore.Bus.MTL_Cap_B.IPU_DIS;
60066011
RO(Shm)->Proc.Technology.VPU = !RO(Proc)->Uncore.Bus.MTL_Cap_C.VPU_DIS;
6012+
RO(Shm)->Proc.Technology.OC = RO(Proc)->Uncore.Bus.MTL_Cap_B.OC_ENABLED;
60076013
}
60086014

60096015
void MTL_IMC(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc))

x86_64/intel_reg.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3828,7 +3828,8 @@ typedef union
38283828
ReservedBits4 : 25-24,
38293829
CACHESZ : 28-25, /* Cache Size Capability */
38303830
SMTCAP : 29-28, /* SMT Capability */
3831-
ReservedBits5 : 32-29;
3831+
OC_ENABLED : 30-29, /* 0: Overclocking is disabled */
3832+
ReservedBits5 : 32-30;
38323833
};
38333834
} IVB_CAPID_B; /* Chap. 2.5.39 CAPID0_B Capabilities B Register */
38343835

@@ -5046,7 +5047,8 @@ typedef union
50465047
ReservedBits7 : 25-24,
50475048
CACHESZ : 28-25,
50485049
SMTCAP : 29-28,
5049-
ReservedBits8 : 31-29,
5050+
OC_ENABLED : 30-29, /* 0: Overclocking is disabled */
5051+
ReservedBits8 : 31-30,
50505052
IMGU_DIS : 32-31; /* Device 5 associated memory spaces */
50515053
}; /* Chap. 3.40 CAPID0_B Capabilities B Register */
50525054
} SKL_CAPID_B;

0 commit comments

Comments
 (0)