Skip to content

Commit

Permalink
[AArch64][DynamIQ] Query the product revision
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Mar 11, 2024
1 parent 903eb49 commit 75b1813
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
14 changes: 14 additions & 0 deletions aarch64/arm_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define MRS_SVCR sys_reg(0b11, 0b011, 0b0100, 0b0010, 0b010)
#define AMCGCR_EL0 sys_reg(0b11, 0b011, 0b1101, 0b0010, 0b010)
#define CLUSTERCFR_EL1 sys_reg(0b11, 0b000, 0b1111, 0b0011, 0b000)
#define CLUSTERIDR_EL1 sys_reg(0b11, 0b000, 0b1111, 0b0011, 0b001)

typedef union
{
Expand Down Expand Up @@ -780,6 +781,19 @@ typedef union
} DSU;
} CLUSTERCFR;

typedef union
{
unsigned long long value; /* Pkg:0x0000000000000041 */
struct
{
unsigned long long
Revision : 4-0,
Variant : 8-4,
RAZ : 32-8,
RSVD : 64-32;
};
} CLUSTERIDR;

typedef union
{
unsigned long long value;
Expand Down
3 changes: 3 additions & 0 deletions aarch64/corefreq-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ typedef struct
signed int ArchID;

struct {
CLUSTERCFR ClusterCfg;
CLUSTERIDR ClusterRev;

unsigned int Boost[UNCORE_BOOST(SIZE)];
BUS_REGISTERS Bus;
MC_REGISTERS MC[MC_MAX_CTRL];
Expand Down
3 changes: 2 additions & 1 deletion aarch64/corefreqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,8 @@ void Uncore_Update( RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc),
RO(Shm)->Uncore.CtrlCount = RO(Proc)->Uncore.CtrlCount;
/* Decode the Memory Controller for each found vendor:device */
Chipset[IC_CHIPSET] = RO(Proc)->Features.Info.Vendor.ID;
RO(Shm)->Uncore.ChipID = 0x0;
RO(Shm)->Uncore.ChipID = RO(Proc)->Uncore.ClusterRev.Revision
| (RO(Proc)->Uncore.ClusterRev.Variant << 4);
RO(Shm)->Uncore.Chipset.ArchID = IC_CHIPSET;
/* Copy the chipset codename. */
StrCopy(RO(Shm)->Uncore.Chipset.CodeName,
Expand Down
4 changes: 2 additions & 2 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2349,8 +2349,8 @@ static void Query_DynamIQ(unsigned int cpu)

if (PUBLIC(RO(Proc))->HypervisorID == BARE_METAL) {
/* Query the Cluster Configuration on Bare Metal only */
volatile CLUSTERCFR clusterCfg = {.value = SysRegRead(CLUSTERCFR_EL1)};
UNUSED(clusterCfg);
PUBLIC(RO(Proc))->Uncore.ClusterCfg.value = SysRegRead(CLUSTERCFR_EL1);
PUBLIC(RO(Proc))->Uncore.ClusterRev.value = SysRegRead(CLUSTERIDR_EL1);
}
}

Expand Down

0 comments on commit 75b1813

Please sign in to comment.