[AMD][Zen5][STX/KRK/STXH] Avoid undefined COF and Power registers

This commit is contained in:
CyrIng
2025-07-13 09:19:17 +02:00
parent 638faa37cc
commit aa140f5c1c
2 changed files with 32 additions and 8 deletions

View File

@@ -8304,10 +8304,7 @@ static bool Compute_AMD_Zen_Boost(unsigned int cpu)
AMD_17_ZEN2_COF XtraCOF = {.value = 0};
switch (PUBLIC(RO(Proc))->ArchID) {
case AMD_Zen5_STXH:
case AMD_Zen5_KRK:
case AMD_Zen5_Eldora:
case AMD_Zen5_STX:
case AMD_Zen4_HWK:
case AMD_Zen4_PHX2:
case AMD_Zen4_PHXR:
@@ -8328,6 +8325,9 @@ static bool Compute_AMD_Zen_Boost(unsigned int cpu)
SMU_AMD_F17H_ZEN2_MCM_COF,
PRIVATE(OF(Zen)).Device.DF);
break;
case AMD_Zen5_STXH:
case AMD_Zen5_KRK:
case AMD_Zen5_STX:
case AMD_Zen4_Genoa:
break;
}
@@ -9328,6 +9328,25 @@ static void Query_AMD_F19h_61h_PerCluster(unsigned int cpu)
}
}
static void Query_AMD_F1Ah_24h_60h_70h_PerSocket(unsigned int cpu)
{
Core_AMD_Family_17h_Temp = CTL_AMD_Family_17h_Temp;
Probe_AMD_DataFabric();
Query_AMD_Family_17h(cpu);
if (cpu == PUBLIC(RO(Proc))->Service.Core) {
if (AMD_F17h_CPPC() == -ENODEV) {
For_All_ACPI_CPPC(Read_ACPI_CPPC_Registers, NULL);
}
Read_ACPI_PCT_Registers(cpu);
Read_ACPI_PSS_Registers(cpu);
Read_ACPI_PPC_Registers(cpu);
Read_ACPI_CST_Registers(cpu);
}
}
static void Query_Hygon_F18h(unsigned int cpu)
{
switch (PUBLIC(RO(Proc))->Features.Std.EAX.Model) {
@@ -20753,6 +20772,11 @@ static void InitTimer_AMD_Zen4_Genoa(unsigned int cpu)
smp_call_function_single(cpu, InitTimer, Cycle_AMD_Zen4_Genoa, 1);
}
static void InitTimer_AMD_Zen5_STX(unsigned int cpu)
{
smp_call_function_single(cpu, InitTimer, Cycle_AMD_F17h, 1);
}
static void Start_AMD_Family_17h(void *arg)
{
unsigned int cpu = smp_processor_id();

View File

@@ -1790,7 +1790,6 @@ static void InitTimer_AMD_Zen4_RPL(unsigned int cpu) ;
static void InitTimer_AMD_Zen4_Genoa(unsigned int cpu) ;
#define Exit_AMD_F1Ah Exit_AMD_F19h
#define Query_AMD_F1Ah_PerSocket Query_AMD_F19h_PerSocket
#define Query_AMD_F1Ah_PerCluster Query_AMD_F19h_PerCluster
#define PerCore_AMD_Family_1Ah_Query PerCore_AMD_Family_19h_Query
#define Start_AMD_Family_1Ah Start_AMD_Family_19h
@@ -1799,7 +1798,8 @@ static void InitTimer_AMD_Zen4_Genoa(unsigned int cpu) ;
#define Start_Uncore_AMD_Family_1Ah Start_Uncore_AMD_Family_19h
#define Stop_Uncore_AMD_Family_1Ah Stop_Uncore_AMD_Family_19h
#define InitTimer_AMD_Zen5_STX InitTimer_AMD_Zen4_RPL
static void Query_AMD_F1Ah_24h_60h_70h_PerSocket(unsigned int cpu) ;
static void InitTimer_AMD_Zen5_STX(unsigned int cpu) ;
/* [Void] */
#define _Void_Signature {.ExtFamily=0x0, .Family=0x0, .ExtModel=0x0, .Model=0x0}
@@ -13362,7 +13362,7 @@ static ARCH Arch[ARCHITECTURES] = {
},
[AMD_Zen5_STX] = { /*124*/
.Signature = _AMD_Zen5_STX,
.Query = Query_AMD_F1Ah_PerSocket,
.Query = Query_AMD_F1Ah_24h_60h_70h_PerSocket,
.Update = PerCore_AMD_Family_1Ah_Query,
.Start = Start_AMD_Family_1Ah,
.Stop = Stop_AMD_Family_1Ah,
@@ -13466,7 +13466,7 @@ static ARCH Arch[ARCHITECTURES] = {
},
[AMD_Zen5_KRK] = { /*128*/
.Signature = _AMD_Zen5_KRK,
.Query = Query_AMD_F1Ah_PerSocket,
.Query = Query_AMD_F1Ah_24h_60h_70h_PerSocket,
.Update = PerCore_AMD_Family_1Ah_Query,
.Start = Start_AMD_Family_1Ah,
.Stop = Stop_AMD_Family_1Ah,
@@ -13490,7 +13490,7 @@ static ARCH Arch[ARCHITECTURES] = {
},
[AMD_Zen5_STXH] = { /*129*/
.Signature = _AMD_Zen5_STXH,
.Query = Query_AMD_F1Ah_PerSocket,
.Query = Query_AMD_F1Ah_24h_60h_70h_PerSocket,
.Update = PerCore_AMD_Family_1Ah_Query,
.Start = Start_AMD_Family_1Ah,
.Stop = Stop_AMD_Family_1Ah,