Skip to content

Commit f055e6a

Browse files
committed
[Intel][MTL][ARL] Improving MC Bus and DDR speed to follow OC SOC
1 parent 812f297 commit f055e6a

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

x86_64/corefreq-api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,8 @@ typedef struct
822822
MTL_CAPID_B MTL_Cap_B;
823823
MTL_CAPID_C MTL_Cap_C;
824824
MTL_CAPID_E MTL_Cap_E;
825+
MTL_SA_PERF_STATUS MTL_SA_Pll; /* 64 bits */
826+
MTL_PWR_MGMT_BCLK MTL_BCLK; /* 64 bits */
825827
MTL_MEMSS_PMA_CR_MEM MTL_CR_MEM; /* 32 bits */
826828
MTL_MEMSS_PMA_CR_BIOS MTL_CR_BIOS; /* 32 bits */
827829
};

x86_64/corefreqd.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6056,15 +6056,20 @@ void MTL_CAP(RO(SHM_STRUCT) *RO(Shm), RO(PROC) *RO(Proc), RO(CORE) *RO(Core))
60566056
}
60576057
}
60586058
}
6059+
/* Clock Topology: BCLK drives the Memory Controller clock domain.
6060+
* Qclk ratio with reference of 33.33MHz. */
60596061
RO(Shm)->Uncore.Bus.Rate = \
6060-
RO(Proc)->Uncore.Bus.MTL_CR_BIOS.REQ.QCLK_RATIO * PRECISION;
6062+
( RO(Proc)->Uncore.Bus.MTL_CR_BIOS.REQ.QCLK_RATIO
6063+
* RO(Proc)->Uncore.Bus.MTL_BCLK.PCIE_FREQ_KHZ ) / 3000U;
60616064

6062-
RO(Shm)->Uncore.Bus.Rate = RO(Shm)->Uncore.Bus.Rate / 3U;
6063-
6064-
RO(Shm)->Uncore.Bus.Speed = (RO(Core)->Clock.Hz
6065-
* RO(Shm)->Uncore.Bus.Rate)
6066-
/ RO(Shm)->Proc.Features.Factory.Clock.Hz;
6065+
/* BCLK_FREQ_0_0_0_MCHBAR is used by software to calculate
6066+
* various clock frequencies that are derived from BCLK
6067+
* such as Core, Ring, Memory Controller and GT. */
6068+
RO(Shm)->Uncore.Bus.Speed = \
6069+
( RO(Proc)->Uncore.Bus.MTL_CR_BIOS.REQ.QCLK_RATIO
6070+
* RO(Proc)->Uncore.Bus.MTL_BCLK.SOC_FREQ_KHZ ) / 3000LLU;
60676071

6072+
/* DDR Transfer Rate (MT/s) */
60686073
RO(Shm)->Uncore.CtrlSpeed = 2LLU * RO(Shm)->Uncore.Bus.Speed;
60696074

60706075
RO(Shm)->Uncore.Unit.Bus_Rate = MC_MHZ;

x86_64/corefreqk.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5632,6 +5632,8 @@ static void Query_ADL_IMC(void __iomem *mchmap, unsigned short mc)
56325632
EMPTY_STMT();
56335633
}
56345634

5635+
#define MTL_SA ADL_SA
5636+
56355637
static void Query_MTL_IMC(void __iomem *mchmap, unsigned short mc)
56365638
{ /* Source: 13th and 14th Gen. Ultra series 1 and 2. Datasheet Vol 2 */
56375639
unsigned short cha, virtualCount;
@@ -5738,7 +5740,9 @@ static void Query_MTL_IMC(void __iomem *mchmap, unsigned short mc)
57385740
static void Query_MTL_Package_IMC(void __iomem *mchmap, unsigned short mc)
57395741
{
57405742
Query_Turbo_TDP_Config(mchmap);
5743+
MTL_SA(mchmap);
57415744
/* Source: Intel Core Ultra 200S and 200HX Series Proc. CFG & MEM Registers */
5745+
PUBLIC(RO(Proc))->Uncore.Bus.MTL_BCLK.value = readq(mchmap + 0x5f60);
57425746
PUBLIC(RO(Proc))->Uncore.Bus.MTL_CR_MEM.value = readl(mchmap + 0x13d00);
57435747
PUBLIC(RO(Proc))->Uncore.Bus.MTL_CR_BIOS.value= readl(mchmap + 0x13d08);
57445748
}

x86_64/intel_reg.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4158,7 +4158,7 @@ typedef union
41584158
struct {
41594159
unsigned long long
41604160
tFAW : 9-0, /* Range: 16-88 */
4161-
tRRD_SG : 15-9, /* Range: 4-32 | tRRD/tRRD_​L */
4161+
tRRD_SG : 15-9, /* Range: 4-32 | tRRD/tRRD_L */
41624162
tRRD_DG : 22-15, /* Range: 4-32 tRRD */
41634163
tRCD : 30-22,
41644164
ReservedBits1 : 32-30,
@@ -5323,6 +5323,18 @@ typedef union
53235323
};
53245324
} MTL_CAPID_E;
53255325

5326+
#define MTL_SA_PERF_STATUS ADL_SA_PERF_STATUS
5327+
5328+
typedef union
5329+
{ /* Offset 5F60h BCLK_FREQ_0_0_0_MCHBAR */
5330+
unsigned long long value;
5331+
struct {
5332+
unsigned long long
5333+
SOC_FREQ_KHZ : 32-0,
5334+
PCIE_FREQ_KHZ : 64-32;
5335+
};
5336+
} MTL_PWR_MGMT_BCLK;
5337+
53265338
typedef union
53275339
{ /* Offset 13D00h, 13D04h */
53285340
unsigned int value;

0 commit comments

Comments
 (0)