Skip to content

Commit aa140f5

Browse files
committed
[AMD][Zen5][STX/KRK/STXH] Avoid undefined COF and Power registers
1 parent 638faa3 commit aa140f5

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

x86_64/corefreqk.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8304,10 +8304,7 @@ static bool Compute_AMD_Zen_Boost(unsigned int cpu)
83048304
AMD_17_ZEN2_COF XtraCOF = {.value = 0};
83058305

83068306
switch (PUBLIC(RO(Proc))->ArchID) {
8307-
case AMD_Zen5_STXH:
8308-
case AMD_Zen5_KRK:
83098307
case AMD_Zen5_Eldora:
8310-
case AMD_Zen5_STX:
83118308
case AMD_Zen4_HWK:
83128309
case AMD_Zen4_PHX2:
83138310
case AMD_Zen4_PHXR:
@@ -8328,6 +8325,9 @@ static bool Compute_AMD_Zen_Boost(unsigned int cpu)
83288325
SMU_AMD_F17H_ZEN2_MCM_COF,
83298326
PRIVATE(OF(Zen)).Device.DF);
83308327
break;
8328+
case AMD_Zen5_STXH:
8329+
case AMD_Zen5_KRK:
8330+
case AMD_Zen5_STX:
83318331
case AMD_Zen4_Genoa:
83328332
break;
83338333
}
@@ -9328,6 +9328,25 @@ static void Query_AMD_F19h_61h_PerCluster(unsigned int cpu)
93289328
}
93299329
}
93309330

9331+
static void Query_AMD_F1Ah_24h_60h_70h_PerSocket(unsigned int cpu)
9332+
{
9333+
Core_AMD_Family_17h_Temp = CTL_AMD_Family_17h_Temp;
9334+
9335+
Probe_AMD_DataFabric();
9336+
9337+
Query_AMD_Family_17h(cpu);
9338+
9339+
if (cpu == PUBLIC(RO(Proc))->Service.Core) {
9340+
if (AMD_F17h_CPPC() == -ENODEV) {
9341+
For_All_ACPI_CPPC(Read_ACPI_CPPC_Registers, NULL);
9342+
}
9343+
Read_ACPI_PCT_Registers(cpu);
9344+
Read_ACPI_PSS_Registers(cpu);
9345+
Read_ACPI_PPC_Registers(cpu);
9346+
Read_ACPI_CST_Registers(cpu);
9347+
}
9348+
}
9349+
93319350
static void Query_Hygon_F18h(unsigned int cpu)
93329351
{
93339352
switch (PUBLIC(RO(Proc))->Features.Std.EAX.Model) {
@@ -20753,6 +20772,11 @@ static void InitTimer_AMD_Zen4_Genoa(unsigned int cpu)
2075320772
smp_call_function_single(cpu, InitTimer, Cycle_AMD_Zen4_Genoa, 1);
2075420773
}
2075520774

20775+
static void InitTimer_AMD_Zen5_STX(unsigned int cpu)
20776+
{
20777+
smp_call_function_single(cpu, InitTimer, Cycle_AMD_F17h, 1);
20778+
}
20779+
2075620780
static void Start_AMD_Family_17h(void *arg)
2075720781
{
2075820782
unsigned int cpu = smp_processor_id();

x86_64/corefreqk.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,6 @@ static void InitTimer_AMD_Zen4_RPL(unsigned int cpu) ;
17901790
static void InitTimer_AMD_Zen4_Genoa(unsigned int cpu) ;
17911791

17921792
#define Exit_AMD_F1Ah Exit_AMD_F19h
1793-
#define Query_AMD_F1Ah_PerSocket Query_AMD_F19h_PerSocket
17941793
#define Query_AMD_F1Ah_PerCluster Query_AMD_F19h_PerCluster
17951794
#define PerCore_AMD_Family_1Ah_Query PerCore_AMD_Family_19h_Query
17961795
#define Start_AMD_Family_1Ah Start_AMD_Family_19h
@@ -1799,7 +1798,8 @@ static void InitTimer_AMD_Zen4_Genoa(unsigned int cpu) ;
17991798
#define Start_Uncore_AMD_Family_1Ah Start_Uncore_AMD_Family_19h
18001799
#define Stop_Uncore_AMD_Family_1Ah Stop_Uncore_AMD_Family_19h
18011800

1802-
#define InitTimer_AMD_Zen5_STX InitTimer_AMD_Zen4_RPL
1801+
static void Query_AMD_F1Ah_24h_60h_70h_PerSocket(unsigned int cpu) ;
1802+
static void InitTimer_AMD_Zen5_STX(unsigned int cpu) ;
18031803

18041804
/* [Void] */
18051805
#define _Void_Signature {.ExtFamily=0x0, .Family=0x0, .ExtModel=0x0, .Model=0x0}
@@ -13362,7 +13362,7 @@ static ARCH Arch[ARCHITECTURES] = {
1336213362
},
1336313363
[AMD_Zen5_STX] = { /*124*/
1336413364
.Signature = _AMD_Zen5_STX,
13365-
.Query = Query_AMD_F1Ah_PerSocket,
13365+
.Query = Query_AMD_F1Ah_24h_60h_70h_PerSocket,
1336613366
.Update = PerCore_AMD_Family_1Ah_Query,
1336713367
.Start = Start_AMD_Family_1Ah,
1336813368
.Stop = Stop_AMD_Family_1Ah,
@@ -13466,7 +13466,7 @@ static ARCH Arch[ARCHITECTURES] = {
1346613466
},
1346713467
[AMD_Zen5_KRK] = { /*128*/
1346813468
.Signature = _AMD_Zen5_KRK,
13469-
.Query = Query_AMD_F1Ah_PerSocket,
13469+
.Query = Query_AMD_F1Ah_24h_60h_70h_PerSocket,
1347013470
.Update = PerCore_AMD_Family_1Ah_Query,
1347113471
.Start = Start_AMD_Family_1Ah,
1347213472
.Stop = Stop_AMD_Family_1Ah,
@@ -13490,7 +13490,7 @@ static ARCH Arch[ARCHITECTURES] = {
1349013490
},
1349113491
[AMD_Zen5_STXH] = { /*129*/
1349213492
.Signature = _AMD_Zen5_STXH,
13493-
.Query = Query_AMD_F1Ah_PerSocket,
13493+
.Query = Query_AMD_F1Ah_24h_60h_70h_PerSocket,
1349413494
.Update = PerCore_AMD_Family_1Ah_Query,
1349513495
.Start = Start_AMD_Family_1Ah,
1349613496
.Stop = Stop_AMD_Family_1Ah,

0 commit comments

Comments
 (0)