Skip to content

Commit

Permalink
more processors
Browse files Browse the repository at this point in the history
Signed-off-by: Slice <[email protected]>
  • Loading branch information
SergeySlice committed Dec 6, 2024
1 parent 788654c commit 286a4f3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Include/IndustryStandard/ProcessorInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ enum {
#define CPU_MODEL_RAPTORLAKE 0xB7 /* 13h Raptor Lake */
#define CPU_MODEL_RAPTORLAKE_B 0xBF /* 13h Raptor Lake, i5-13400h */
#define CPU_MODEL_METEORLAKE 0xAA /* 14h Meteor Lake */
#define CPU_MODEL_ARROWLAKE 0xC6
#define CPU_MODEL_ARROWLAKE 0xC6 /* 15h Arrow Lake */
#define CPU_MODEL_ARROWLAKE_X 0xC5 /* 15h Arrow Lake */
#define CPU_MODEL_ARROWLAKE_U 0xB5 /* 15h Arrow Lake */

#define CPU_SOCKET_UNKNOWN 0x02
#define CPU_SOCKET_PGA478 0x0F
Expand Down
6 changes: 5 additions & 1 deletion rEFIt_UEFI/Platform/StateGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number)
case CPU_MODEL_RAPTORLAKE:
case CPU_MODEL_METEORLAKE:
case CPU_MODEL_ARROWLAKE:
case CPU_MODEL_ARROWLAKE_X:
case CPU_MODEL_ARROWLAKE_U:
{
maximum.Control.Control = RShiftU64(AsmReadMsr64(MSR_PLATFORM_INFO), 8) & 0xff;
if (gSettings.ACPI.SSDT.MaxMultiplier) {
Expand Down Expand Up @@ -358,6 +360,8 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number)
(gCPUStructure.Model == CPU_MODEL_RAPTORLAKE_B) ||
(gCPUStructure.Model == CPU_MODEL_METEORLAKE) ||
(gCPUStructure.Model == CPU_MODEL_ARROWLAKE ) ||
(gCPUStructure.Model == CPU_MODEL_ARROWLAKE_X ) ||
(gCPUStructure.Model == CPU_MODEL_ARROWLAKE_U ) ||
(gCPUStructure.Model == CPU_MODEL_COMETLAKE_S) ||
(gCPUStructure.Model == CPU_MODEL_COMETLAKE_Y) ||
(gCPUStructure.Model == CPU_MODEL_COMETLAKE_U)) {
Expand All @@ -379,7 +383,7 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number)
p_states_count++;
}
}
break;//case CPU_MODEL_ARROWLAKE:
break;
}
default:
MsgLog ("Unsupported CPU (0x%X): P-States not generated !!!\n", gCPUStructure.Family);
Expand Down
21 changes: 18 additions & 3 deletions rEFIt_UEFI/Platform/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,19 @@ void GetCPUProperties (void)
case CPU_MODEL_ALDERLAKE_ULT:
case CPU_MODEL_RAPTORLAKE_B:
case CPU_MODEL_METEORLAKE:
case CPU_MODEL_ARROWLAKE:
msr = AsmReadMsr64(MSR_CORE_THREAD_COUNT); //0x35
DBG("MSR 0x35 %16llX\n", msr);
gCPUStructure.Cores = (UINT8)bitfield((UINT32)msr, 31, 16);
gCPUStructure.Threads = (UINT8)bitfield((UINT32)msr, 15, 0);
break;
case CPU_MODEL_ARROWLAKE:
case CPU_MODEL_ARROWLAKE_X:
case CPU_MODEL_ARROWLAKE_U:
msr = AsmReadMsr64(MSR_CORE_THREAD_COUNT); //0x35
DBG("MSR 0x35 %16llX\n", msr);
gCPUStructure.Cores = (UINT8)bitfield((UINT32)msr, 31, 16);
gCPUStructure.Threads = gCPUStructure.Cores; // no hyperthreading
break;

case CPU_MODEL_DALES:
case CPU_MODEL_WESTMERE: // Intel Core i7 LGA1366 (32nm) 6 Core
Expand Down Expand Up @@ -421,7 +428,7 @@ void GetCPUProperties (void)
gCPUStructure.Threads = 4;
}

//New for SkyLake 0x4E, 0x5E
//New for SkyLake 0x4E, 0x5E and up
if(gCPUStructure.CPUID[CPUID_0][EAX] >= 0x15) {
UINT32 Num, Denom;
DoCpuid(0x15, gCPUStructure.CPUID[CPUID_15]);
Expand Down Expand Up @@ -540,6 +547,8 @@ void GetCPUProperties (void)
case CPU_MODEL_RAPTORLAKE:
case CPU_MODEL_METEORLAKE:
case CPU_MODEL_ARROWLAKE:
case CPU_MODEL_ARROWLAKE_X:
case CPU_MODEL_ARROWLAKE_U:

gCPUStructure.TSCFrequency = MultU64x32(gCPUStructure.CurrentSpeed, Mega); //MHz -> Hz
gCPUStructure.CPUFrequency = gCPUStructure.TSCFrequency;
Expand Down Expand Up @@ -1428,6 +1437,8 @@ UINT16 GetAdvancedCpuType()
case CPU_MODEL_RAPTORLAKE:
case CPU_MODEL_METEORLAKE:
case CPU_MODEL_ARROWLAKE:
case CPU_MODEL_ARROWLAKE_X:
case CPU_MODEL_ARROWLAKE_U:
if ( gCPUStructure.BrandString.contains("Core(TM) i3") )
return 0x905; // Core i3 - Apple doesn't use it
if ( gCPUStructure.BrandString.contains("Core(TM) i5-1") )
Expand Down Expand Up @@ -1566,6 +1577,8 @@ MacModel GetDefaultModel()
case CPU_MODEL_ICELAKE_A:
case CPU_MODEL_ICELAKE_C:
case CPU_MODEL_ICELAKE_D:
case CPU_MODEL_ALDERLAKE_ULT: //???
case CPU_MODEL_ARROWLAKE_U:
DefaultType = MacBookPro161;
break;
default:
Expand Down Expand Up @@ -1678,13 +1691,15 @@ MacModel GetDefaultModel()
DefaultType = MacPro61;
break;
case CPU_MODEL_ALDERLAKE:
case CPU_MODEL_ALDERLAKE_ULT: //???

case CPU_MODEL_RAPTORLAKE_B:
case CPU_MODEL_COMETLAKE_S:
case CPU_MODEL_ROCKETLAKE:
case CPU_MODEL_RAPTORLAKE:
case CPU_MODEL_METEORLAKE:
case CPU_MODEL_ARROWLAKE:
case CPU_MODEL_ARROWLAKE_X:

DefaultType = MacPro71;
break;
default:
Expand Down
2 changes: 2 additions & 0 deletions rEFIt_UEFI/Platform/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
#define CPU_MODEL_RAPTORLAKE 0xB7 /* 13h Raptor Lake */
#define CPU_MODEL_RAPTORLAKE_B 0xBF /* 13h Raptor Lake, i5-13400h */
#define CPU_MODEL_ARROWLAKE 0xC6
#define CPU_MODEL_ARROWLAKE_X 0xC5 /* 15h Arrow Lake */
#define CPU_MODEL_ARROWLAKE_U 0xB5 /* 15h Arrow Lake */

#define CPU_VENDOR_INTEL 0x756E6547
#define CPU_VENDOR_AMD 0x68747541
Expand Down

0 comments on commit 286a4f3

Please sign in to comment.