Implement MCCC measurements for SM8150 and SM8250

This commit is contained in:
Marijn Suijten
2023-01-19 00:35:23 +01:00
committed by Bjorn Andersson
parent a9e76e4f1b
commit 7365bca626
4 changed files with 23 additions and 8 deletions

View File

@@ -186,6 +186,12 @@ static unsigned long measure_default(const struct measure_clk *clk)
return raw_count_full;
}
unsigned long measure_mccc(const struct measure_clk *clk)
{
/* MCCC is always on, just read the rate and return. */
return 1000000000000ULL / readl(clk->leaf->base + clk->leaf_mux);
}
static void measure(const struct measure_clk *clk)
{
unsigned long clk_rate;

View File

@@ -87,6 +87,7 @@ struct debugcc_platform {
int mmap_mux(int devmem, struct debug_mux *mux);
void mux_enable(struct debug_mux *mux);
void mux_disable(struct debug_mux *mux);
unsigned long measure_mccc(const struct measure_clk *clk);
extern struct debugcc_platform msm8936_debugcc;
extern struct debugcc_platform msm8996_debugcc;

View File

@@ -138,6 +138,14 @@ static struct debug_mux npu_cc = {
.div_val = 2,
};
static struct debug_mux mc_cc = {
.phys = 0x90b0000,
.size = /* 0x54 */ 0x1000,
.block_name = "mc",
.measure = measure_mccc,
};
static struct debug_mux cpu_cc = {
.phys = 0x182a0000,
.size = 0x1000,
@@ -247,7 +255,7 @@ static struct measure_clk sm8150_clocks[] = {
{ "measure_only_cdsp_clk", &gcc, 0xdb, 0, 0, 2 },
{ "measure_only_snoc_clk", &gcc, 0x7 },
{ "measure_only_cnoc_clk", &gcc, 0x19 },
// { "measure_only_mccc_clk", &gcc, 0xd0, 1, MC_CC, 0xd0 }, // TODO: at 90b0000
{ "measure_only_mccc_clk", &gcc, 0xd0, &mc_cc, 0x50 },
{ "measure_only_ipa_2x_clk", &gcc, 0x147 },
{ "gcc_aggre_noc_pcie_tbu_clk", &gcc, 0x36 },
{ "gcc_aggre_ufs_card_axi_clk", &gcc, 0x141 },

View File

@@ -138,13 +138,13 @@ static struct debug_mux video_cc = {
.div_val = 3,
};
// static struct debug_mux mc_cc = {
// .phys = 0x90ba000,
// .size = /* 0x54 */ 0x1000,
// .block_name = "mc",
static struct debug_mux mc_cc = {
.phys = 0x90ba000,
.size = /* 0x54 */ 0x1000,
.block_name = "mc",
// /* TODO: Requires custom readback from https://github.com/andersson/debugcc/pull/15 */
// };
.measure = measure_mccc,
};
static struct debug_mux apss_cc = {
.phys = 0x182a0000,
@@ -477,7 +477,7 @@ static struct measure_clk sm8250_clocks[] = {
{ "video_cc_sleep_clk", &gcc, 0x57, &video_cc, 0xc },
{ "video_cc_xo_clk", &gcc, 0x57, &video_cc, 0xb },
// { "measure_only_mccc_clk", &gcc, 0xd1, &mc_cc },
{ "measure_only_mccc_clk", &gcc, 0xd1, &mc_cc, 0x50 },
{ "measure_only_apcs_gold_post_acd_clk", &gcc, 0xe7, &apss_cc, 0x25, /* TODO: Are these pre_div_vals? */ 8 },
{ "measure_only_apcs_goldplus_post_acd_clk", &gcc, 0xe7, &apss_cc, 0x61, /* TODO: Are these pre_div_vals? */ 8 },