Skip to content

Commit

Permalink
Add experimental Hawk Point support
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCJ60 authored and FlyGoat committed Dec 12, 2023
1 parent 3cf0734 commit dac383e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
26 changes: 26 additions & 0 deletions lib/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ static int request_table_addr(ryzen_access ry)
case FAM_CEZANNE:
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
get_table_addr_msg = 0x66;
break;
default:
Expand All @@ -219,6 +220,7 @@ static int request_table_addr(ryzen_access ry)
{
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
ry->table_addr = (uint64_t) args.arg1 << 32 | args.arg0;
break;
default:
Expand Down Expand Up @@ -253,6 +255,7 @@ static int request_transfer_table(ryzen_access ry)
case FAM_CEZANNE:
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
transfer_table_msg = 0x65;
break;
default:
Expand Down Expand Up @@ -440,6 +443,7 @@ EXP int CALL set_stapm_limit(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x14);
if (err) {
printf("%s: Retry with PSMU\n", __func__);
Expand Down Expand Up @@ -468,6 +472,7 @@ EXP int CALL set_fast_limit(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x15);
default:
break;
Expand All @@ -492,6 +497,7 @@ EXP int CALL set_slow_limit(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x16);
default:
break;
Expand All @@ -516,6 +522,7 @@ EXP int CALL set_slow_time(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x17);
default:
break;
Expand All @@ -540,6 +547,7 @@ EXP int CALL set_stapm_time(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x18);
default:
break;
Expand All @@ -564,6 +572,7 @@ EXP int CALL set_tctl_temp(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x19);
default:
break;
Expand All @@ -588,6 +597,7 @@ EXP int CALL set_vrm_current(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x1a);
default:
break;
Expand All @@ -612,6 +622,7 @@ EXP int CALL set_vrmsoc_current(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x1b);
default:
break;
Expand Down Expand Up @@ -661,6 +672,7 @@ EXP int CALL set_vrmmax_current(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x1c);
break;
case FAM_VANGOGH:
Expand Down Expand Up @@ -700,6 +712,7 @@ EXP int CALL set_vrmsocmax_current(ryzen_access ry, uint32_t value){
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x1d);
default:
break;
Expand Down Expand Up @@ -954,6 +967,7 @@ EXP int CALL set_prochot_deassertion_ramp(ryzen_access ry, uint32_t value) {
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x1f);
default:
break;
Expand All @@ -976,6 +990,7 @@ EXP int CALL set_apu_skin_temp_limit(ryzen_access ry, uint32_t value) {
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x33);
break;
default:
Expand All @@ -999,6 +1014,7 @@ EXP int CALL set_dgpu_skin_temp_limit(ryzen_access ry, uint32_t value) {
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x34);
break;
default:
Expand All @@ -1019,6 +1035,7 @@ EXP int CALL set_apu_slow_limit(ryzen_access ry, uint32_t value) {
break;
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x23);
break;
default:
Expand All @@ -1041,6 +1058,7 @@ EXP int CALL set_skin_temp_power_limit(ryzen_access ry, uint32_t value) {
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x4a);
break;
default:
Expand All @@ -1061,6 +1079,7 @@ EXP int CALL set_gfx_clk(ryzen_access ry, uint32_t value) {
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust_psmu(0x89);
break;
default:
Expand All @@ -1087,6 +1106,7 @@ EXP int CALL set_power_saving(ryzen_access ry) {
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x12);
break;
default:
Expand All @@ -1113,6 +1133,7 @@ EXP int CALL set_max_performance(ryzen_access ry) {
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x11);
break;
default:
Expand Down Expand Up @@ -1241,6 +1262,7 @@ EXP int CALL set_coall(ryzen_access ry, uint32_t value) {
case FAM_REMBRANDT:
case FAM_VANGOGH:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x4C);
break;
default:
Expand All @@ -1259,6 +1281,8 @@ EXP int CALL set_coper(ryzen_access ry, uint32_t value) {
case FAM_LUCIENNE:
_do_adjust(0x54);
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
_do_adjust(0x4B);
break;
default:
Expand All @@ -1278,6 +1302,8 @@ EXP int CALL set_cogfx(ryzen_access ry, uint32_t value) {
_do_adjust(0x64);
break;
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
case FAM_VANGOGH:
_do_adjust_psmu(0xB7);
break;
Expand Down
12 changes: 11 additions & 1 deletion lib/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static enum ryzen_family cpuid_load_family()
};
break;

case 0x19: /* Zen3 */
case 0x19: /* Zen3, Zen4 */
switch (model) {
case 80:
return FAM_CEZANNE;
Expand All @@ -82,11 +82,21 @@ static enum ryzen_family cpuid_load_family()
case 116:
case 120:
return FAM_PHOENIX;
case 117:
return FAM_HAWKPOINT;
default:
printf("Fam%xh: unsupported model %d\n", family, model);
break;
};
break;
case 0x1A: /* Zen5, Zen6 */
switch (model) {
case 32:
return FAM_STRIXPOINT;
default:
printf("Fam%xh: unsupported model %d\n", family, model);
break;
}

default:
printf("Unsupported family: %xh\n", family);
Expand Down
2 changes: 1 addition & 1 deletion lib/nb_smu_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ smu_t get_smu(nb_t nb, int smu_type) {
/* Fill SMU information */
switch(smu_type){
case TYPE_MP1:
if (family == FAM_REMBRANDT || family == FAM_VANGOGH || family == FAM_MENDOCINO || family == FAM_PHOENIX) {
if (family == FAM_REMBRANDT || family == FAM_VANGOGH || family == FAM_MENDOCINO || family == FAM_PHOENIX || family == FAM_HAWKPOINT) {
smu->msg = MP1_C2PMSG_MESSAGE_ADDR_2;
smu->rep = MP1_C2PMSG_RESPONSE_ADDR_2;
smu->arg_base = MP1_C2PMSG_ARG_BASE_2;
Expand Down
2 changes: 2 additions & 0 deletions lib/ryzenadj.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ enum ryzen_family {
FAM_REMBRANDT,
FAM_MENDOCINO,
FAM_PHOENIX,
FAM_HAWKPOINT,
FAM_STRIXPOINT,
FAM_END
};

Expand Down
4 changes: 3 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ static const char *family_name(enum ryzen_family fam)
case FAM_LUCIENNE: return "Lucienne";
case FAM_VANGOGH: return "Vangogh";
case FAM_REMBRANDT: return "Rembrandt";
case FAM_PHOENIX: return "Phoenix";
case FAM_PHOENIX: return "Phoenix Point";
case FAM_HAWKPOINT: return "Hawk Point";
case FAM_STRIXPOINT: return "Strix Point";
default:
break;
}
Expand Down

0 comments on commit dac383e

Please sign in to comment.