Skip to content

Commit

Permalink
read table from hx370
Browse files Browse the repository at this point in the history
  • Loading branch information
mzdluo123 committed Sep 4, 2024
1 parent ad7f620 commit a04f1d4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
7 changes: 7 additions & 0 deletions lib/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ static int request_table_ver_and_size(ryzen_access ry)
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
case FAM_STRIXPOINT:
get_table_ver_msg = 0x6;
break;
default:
Expand Down Expand Up @@ -208,8 +209,12 @@ static int request_table_addr(ryzen_access ry)
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
case FAM_STRIXPOINT:
get_table_addr_msg = 0x66;
break;

// get_table_addr_msg = 0x65;
//break;
default:
printf("request_table_addr is not supported on this family\n");
return ADJ_ERR_FAM_UNSUPPORTED;
Expand All @@ -222,6 +227,7 @@ static int request_table_addr(ryzen_access ry)
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
case FAM_STRIXPOINT:
ry->table_addr = (uint64_t) args.arg1 << 32 | args.arg0;
break;
default:
Expand Down Expand Up @@ -257,6 +263,7 @@ static int request_transfer_table(ryzen_access ry)
case FAM_REMBRANDT:
case FAM_PHOENIX:
case FAM_HAWKPOINT:
case FAM_STRIXPOINT:
transfer_table_msg = 0x65;
break;
default:
Expand Down
2 changes: 2 additions & 0 deletions lib/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static enum ryzen_family cpuid_load_family()
model = ((regs[0] >> 4) & 0xf) | ((regs[0] >> 12) & 0xf0);

switch (family) {

case 0x17: /* Zen, Zen+, Zen2 */
switch (model) {
case 17:
Expand Down Expand Up @@ -92,6 +93,7 @@ static enum ryzen_family cpuid_load_family()
case 0x1A: /* Zen5, Zen6 */
switch (model) {
case 32:
case 36:
return FAM_STRIXPOINT;
default:
printf("Fam%xh: unsupported model %d\n", family, model);
Expand Down
15 changes: 11 additions & 4 deletions lib/nb_smu_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,18 @@ smu_t get_smu(nb_t nb, int smu_type) {
smu->msg = MP1_C2PMSG_MESSAGE_ADDR_2;
smu->rep = MP1_C2PMSG_RESPONSE_ADDR_2;
smu->arg_base = MP1_C2PMSG_ARG_BASE_2;
} else {
smu->msg = MP1_C2PMSG_MESSAGE_ADDR_1;
smu->rep = MP1_C2PMSG_RESPONSE_ADDR_1;
smu->arg_base = MP1_C2PMSG_ARG_BASE_1;
break;
}
if (family == FAM_STRIXPOINT) {
smu->msg = MP1_C2PMSG_MESSAGE_ADDR_3;
smu->rep = MP1_C2PMSG_RESPONSE_ADDR_3;
smu->arg_base = MP1_C2PMSG_ARG_BASE_3;
break;
}
smu->msg = MP1_C2PMSG_MESSAGE_ADDR_1;
smu->rep = MP1_C2PMSG_RESPONSE_ADDR_1;
smu->arg_base = MP1_C2PMSG_ARG_BASE_1;

break;
case TYPE_PSMU:
smu->msg = PSMU_C2PMSG_MESSAGE_ADDR;
Expand Down
5 changes: 5 additions & 0 deletions lib/nb_smu_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ enum SMU_TYPE{
#define MP1_C2PMSG_RESPONSE_ADDR_2 0x3B10578
#define MP1_C2PMSG_ARG_BASE_2 0x3B10998

#define MP1_C2PMSG_MESSAGE_ADDR_3 0x3b10a20
#define MP1_C2PMSG_RESPONSE_ADDR_3 0x3b10a80
#define MP1_C2PMSG_ARG_BASE_3 0x3b10a88


#define PSMU_C2PMSG_MESSAGE_ADDR 0x3B10a20
#define PSMU_C2PMSG_RESPONSE_ADDR 0x3B10a80
#define PSMU_C2PMSG_ARG_BASE 0x3B10a88
Expand Down

0 comments on commit a04f1d4

Please sign in to comment.