Skip to content

Commit 3dd316d

Browse files
committed
[AMD][Ryzen 5 6600H] Found voltage VID @ SMU 0x6f010 and 0x6f014
1 parent 083b05f commit 3dd316d

File tree

4 files changed

+62
-1
lines changed

4 files changed

+62
-1
lines changed

amd_reg.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,6 +1905,10 @@ typedef union
19051905
#define SMU_AMD_F17_60H_SVI(_plane) (0x0006f038 + (_plane << 2))
19061906
#endif
19071907

1908+
#ifndef SMU_AMD_RMB_SVI
1909+
#define SMU_AMD_RMB_SVI(_plane) (0x0006f010 + (_plane << 2))
1910+
#endif
1911+
19081912
typedef union
19091913
{/* --- SMU SVI [ 0x5a00c ; 0x5a010 ; 0x5a014 ; 0x6f038] ---
19101914
* [ CPU addr] [ SoC addr]
@@ -1926,6 +1930,21 @@ typedef union
19261930
};
19271931
} AMD_17_SVI;
19281932

1933+
typedef union
1934+
{/* --- SMU SVI [ Rembrandt ] ---
1935+
* [ CPU addr] [ SoC addr]
1936+
* ZEN3(+) [AF_44] [ 0x6f010 ] [ 0x6f014 ]
1937+
*/
1938+
unsigned int value;
1939+
struct {
1940+
unsigned int
1941+
SVI0 : 8-0,
1942+
SVI1 : 16-8,
1943+
SVI2 : 24-16,
1944+
SVI3 : 32-24;
1945+
};
1946+
} AMD_RMB_SVI;
1947+
19291948
#ifndef SMU_AMD_F17H_CORE_VID
19301949
#define SMU_AMD_F17H_CORE_VID(_mod) (0x0005a04c + (_mod << 2))
19311950
#endif

corefreqd.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7454,6 +7454,17 @@ static void Pkg_ComputeVoltage_AMD_17h(struct PKG_FLIP_FLOP *PFlip)
74547454
PFlip->Voltage.VID.SOC);
74557455
}
74567456

7457+
static void Pkg_ComputeVoltage_AMD_RMB(struct PKG_FLIP_FLOP *PFlip)
7458+
{
7459+
COMPUTE_VOLTAGE(AMD_RMB,
7460+
PFlip->Voltage.CPU,
7461+
PFlip->Voltage.VID.CPU);
7462+
7463+
COMPUTE_VOLTAGE(AMD_RMB,
7464+
PFlip->Voltage.SOC,
7465+
PFlip->Voltage.VID.SOC);
7466+
}
7467+
74577468
static void Pkg_ComputeVoltage_Winbond_IO(struct PKG_FLIP_FLOP *PFlip)
74587469
{ /* Winbond W83627EHF/EF, W83627EHG,EG */
74597470
COMPUTE_VOLTAGE(WINBOND_IO,
@@ -7603,6 +7614,9 @@ REASON_CODE Core_Manager(REF *Ref)
76037614
case VOLTAGE_KIND_AMD_17h:
76047615
Pkg_ComputeVoltageFormula = Pkg_ComputeVoltage_AMD_17h;
76057616
break;
7617+
case VOLTAGE_KIND_AMD_RMB:
7618+
Pkg_ComputeVoltageFormula = Pkg_ComputeVoltage_AMD_RMB;
7619+
break;
76067620
case VOLTAGE_KIND_WINBOND_IO:
76077621
Pkg_ComputeVoltageFormula = Pkg_ComputeVoltage_Winbond_IO;
76087622
break;

corefreqk.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17689,6 +17689,24 @@ static void Call_SVI_APU(const unsigned int plane0, const unsigned int plane1,
1768917689
SoC_RAPL(SVI, factor);
1769017690
}
1769117691

17692+
static void Call_SVI_RMB(const unsigned int plane0, const unsigned int plane1,
17693+
const unsigned long long factor)
17694+
{
17695+
AMD_RMB_SVI SVI = {.value = 0};
17696+
17697+
Core_AMD_SMN_Read( SVI,
17698+
SMU_AMD_RMB_SVI(plane0),
17699+
PRIVATE(OF(Zen)).Device.DF );
17700+
17701+
PUBLIC(RO(Proc))->PowerThermal.VID.CPU = SVI.SVI1;
17702+
17703+
Core_AMD_SMN_Read( SVI,
17704+
SMU_AMD_RMB_SVI(plane1),
17705+
PRIVATE(OF(Zen)).Device.DF );
17706+
17707+
PUBLIC(RO(Proc))->PowerThermal.VID.SOC = SVI.SVI1;
17708+
}
17709+
1769217710
static void Call_DFLT( const unsigned int plane0, const unsigned int plane1,
1769317711
const unsigned long long factor )
1769417712
{
@@ -17741,6 +17759,10 @@ static enum hrtimer_restart Cycle_AMD_F17h_Zen2_APU(struct hrtimer *pTimer)
1774117759
{
1774217760
return Entry_AMD_F17h(pTimer, Call_SVI_APU, 0, 1, 294300LLU);
1774317761
}
17762+
static enum hrtimer_restart Cycle_AMD_Zen3Plus_RMB(struct hrtimer *pTimer)
17763+
{
17764+
return Entry_AMD_F17h(pTimer, Call_SVI_RMB, 0, 1, 294300LLU);
17765+
}
1774417766
static enum hrtimer_restart Cycle_AMD_F17h(struct hrtimer *pTimer)
1774517767
{
1774617768
return Entry_AMD_F17h(pTimer, Call_DFLT, 0, 0, 0LLU);
@@ -17771,6 +17793,11 @@ static void InitTimer_AMD_F17h_Zen2_APU(unsigned int cpu)
1777117793
smp_call_function_single(cpu, InitTimer, Cycle_AMD_F17h_Zen2_APU, 1);
1777217794
}
1777317795

17796+
static void InitTimer_AMD_Zen3Plus_RMB(unsigned int cpu)
17797+
{
17798+
smp_call_function_single(cpu, InitTimer, Cycle_AMD_Zen3Plus_RMB, 1);
17799+
}
17800+
1777417801
static void Start_AMD_Family_17h(void *arg)
1777517802
{
1777617803
unsigned int cpu = smp_processor_id();

corefreqk.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,7 @@ static void InitTimer_AMD_F17h_Zen(unsigned int cpu) ;
16611661
static void InitTimer_AMD_F17h_Zen2_SP(unsigned int cpu) ;
16621662
static void InitTimer_AMD_F17h_Zen2_MP(unsigned int cpu) ;
16631663
static void InitTimer_AMD_F17h_Zen2_APU(unsigned int cpu) ;
1664+
static void InitTimer_AMD_Zen3Plus_RMB(unsigned int cpu) ;
16641665
static void Start_Uncore_AMD_Family_17h(void *arg) ;
16651666
static void Stop_Uncore_AMD_Family_17h(void *arg) ;
16661667

@@ -9584,7 +9585,7 @@ static ARCH Arch[ARCHITECTURES] = {
95849585
.Start = Start_AMD_Family_19h,
95859586
.Stop = Stop_AMD_Family_19h,
95869587
.Exit = Exit_AMD_F19h,
9587-
.Timer = InitTimer_AMD_F19h_Zen3_APU,
9588+
.Timer = InitTimer_AMD_Zen3Plus_RMB,
95889589
.BaseClock = BaseClock_AMD_Family_19h,
95899590
.ClockMod = ClockMod_AMD_Zen,
95909591
.TurboClock = TurboClock_AMD_Zen,

0 commit comments

Comments
 (0)