Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
7d2f5c10
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7d2f5c10
编写于
1月 04, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcSmbiosLib: Fixed SMBIOS Type4 External Clock values
上级
1623dddd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
22 deletion
+28
-22
Include/Library/OcCpuLib.h
Include/Library/OcCpuLib.h
+5
-6
Library/OcCpuLib/OcCpuLib.c
Library/OcCpuLib/OcCpuLib.c
+20
-0
Library/OcSmbiosLib/SmbiosPatch.c
Library/OcSmbiosLib/SmbiosPatch.c
+3
-16
未找到文件。
Include/Library/OcCpuLib.h
浏览文件 @
7d2f5c10
...
...
@@ -18,12 +18,6 @@
#include <IndustryStandard/CpuId.h>
#include <IndustryStandard/AppleIntelCpuInfo.h>
//
// External clock value on Sandy Bridge and above (in MHz).
// Rounded FSB * 4.
//
#define OC_CPU_SNB_QPB_CLOCK 0x19U
typedef
struct
{
//
// Note, Vendor and BrandString are reordered for proper alignment.
...
...
@@ -69,6 +63,11 @@ typedef struct {
UINT16
CoreCount
;
UINT16
ThreadCount
;
//
// External clock for SMBIOS Type4 table.
//
UINT16
ExternalClock
;
//
// Platform-dependent frequency for the Always Running Timer (ART), normally
// 24Mhz. Firmwares may choose to override this. Some CPUs like Xeon Scalable
...
...
Library/OcCpuLib/OcCpuLib.c
浏览文件 @
7d2f5c10
...
...
@@ -1478,6 +1478,26 @@ OcCpuScanProcessor (
return
;
}
//
// SMBIOS Type4 ExternalClock field is assumed to have X*4 FSB frequency in MT/s.
// This value is cosmetics, but we still want to set it properly.
// Magic 4 value comes from 4 links in pretty much every modern Intel CPU.
// On modern CPUs this is now named Base clock (BCLK).
// Note, that this value was incorrect for most Macs since iMac12,x till iMac18,x inclusive.
// REF: https://github.com/acidanthera/bugtracker/issues/622#issuecomment-570811185
//
Cpu
->
ExternalClock
=
(
UINT16
)
DivU64x32
(
Cpu
->
FSBFrequency
,
1000000
);
//
// This is again cosmetics by errors in FSBFrequency calculation.
//
if
(
Cpu
->
ExternalClock
>=
99
&&
Cpu
->
ExternalClock
<=
101
)
{
Cpu
->
ExternalClock
=
100
;
}
else
if
(
Cpu
->
ExternalClock
>=
132
&&
Cpu
->
ExternalClock
<=
134
)
{
Cpu
->
ExternalClock
=
133
;
}
else
if
(
Cpu
->
ExternalClock
>=
265
&&
Cpu
->
ExternalClock
<=
267
)
{
Cpu
->
ExternalClock
=
266
;
}
DEBUG
((
DEBUG_INFO
,
"OCCPU: CPUFrequencyFromTSC %11LuHz %5LuMHz
\n
"
,
...
...
Library/OcSmbiosLib/SmbiosPatch.c
浏览文件 @
7d2f5c10
...
...
@@ -327,15 +327,7 @@ PatchProcessorInformation (
SMBIOS_OVERRIDE_V
(
Table
,
Standard
.
Type4
->
ProcessorId
,
Original
,
NULL
,
NULL
);
SMBIOS_OVERRIDE_S
(
Table
,
Standard
.
Type4
->
ProcessorVersion
,
Original
,
NULL
,
&
StringIndex
,
NULL
);
SMBIOS_OVERRIDE_V
(
Table
,
Standard
.
Type4
->
Voltage
,
Original
,
NULL
,
NULL
);
//
// Models newer than Sandybridge require quad pumped bus value instead of a front side bus value.
//
if
(
CpuInfo
->
Model
>=
CPU_MODEL_SANDYBRIDGE
)
{
Table
->
CurrentPtr
.
Standard
.
Type4
->
ExternalClock
=
OC_CPU_SNB_QPB_CLOCK
;
}
else
{
Table
->
CurrentPtr
.
Standard
.
Type4
->
ExternalClock
=
(
UINT16
)
DivU64x32
(
CpuInfo
->
FSBFrequency
,
1000000
);
}
Table
->
CurrentPtr
.
Standard
.
Type4
->
ExternalClock
=
CpuInfo
->
ExternalClock
;
Table
->
CurrentPtr
.
Standard
.
Type4
->
MaxSpeed
=
(
UINT16
)
DivU64x32
(
CpuInfo
->
CPUFrequency
,
1000000
);
if
(
Table
->
CurrentPtr
.
Standard
.
Type4
->
MaxSpeed
%
100
!=
0
)
{
Table
->
CurrentPtr
.
Standard
.
Type4
->
MaxSpeed
=
(
UINT16
)
(((
Table
->
CurrentPtr
.
Standard
.
Type4
->
MaxSpeed
+
50
)
/
100
)
*
100
);
...
...
@@ -980,8 +972,7 @@ CreateAppleProcessorSpeed (
{
#ifndef OC_PROVIDE_APPLE_PROCESSOR_BUS_SPEED
//
// I believe this table is no longer used.
// The code below may be inaccurate as well, since it expects KHz.
// This table is not added in all modern Macs.
//
(
VOID
)
Table
;
(
VOID
)
Data
;
...
...
@@ -995,11 +986,7 @@ CreateAppleProcessorSpeed (
return
;
}
if
(
CpuInfo
->
Model
>=
CPU_MODEL_SANDYBRIDGE
)
{
Table
->
CurrentPtr
.
Type132
->
ProcessorBusSpeed
=
OC_CPU_SNB_QPB_CLOCK
*
1000
;
}
else
{
Table
->
CurrentPtr
.
Type132
->
ProcessorBusSpeed
=
(
UINT16
)
DivU64x32
(
CpuInfo
->
FSBFrequency
,
1000
);
}
Table
->
CurrentPtr
.
Type132
->
ProcessorBusSpeed
=
CpuInfo
->
ExternalClock
*
4
;
SmbiosFinaliseStruct
(
Table
);
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录