File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 29
29
30
30
#define PLL_REF_CLK_FREQ (50 * 1000000)
31
31
#define PLL_SIMULATION_FREQ (10 * 1000000)
32
- #define PLL_RATIO_TO_FREQ (x ) ((x) * PLL_REF_CLK_FREQ)
33
32
#define PLL_DEFAULT_EPP_VALUE 0x80
34
33
35
34
#define TIM_SAFE_ENABLE 0xf1d0dead
@@ -789,6 +788,19 @@ static void ivpu_hw_mtl_wdt_disable(struct ivpu_device *vdev)
789
788
REGV_WR32 (MTL_VPU_CPU_SS_TIM_GEN_CONFIG , val );
790
789
}
791
790
791
+ static u32 ivpu_hw_mtl_pll_to_freq (u32 ratio , u32 config )
792
+ {
793
+ u32 pll_clock = PLL_REF_CLK_FREQ * ratio ;
794
+ u32 cpu_clock ;
795
+
796
+ if ((config & 0xff ) == PLL_RATIO_4_3 )
797
+ cpu_clock = pll_clock * 2 / 4 ;
798
+ else
799
+ cpu_clock = pll_clock * 2 / 5 ;
800
+
801
+ return cpu_clock ;
802
+ }
803
+
792
804
/* Register indirect accesses */
793
805
static u32 ivpu_hw_mtl_reg_pll_freq_get (struct ivpu_device * vdev )
794
806
{
@@ -800,7 +812,7 @@ static u32 ivpu_hw_mtl_reg_pll_freq_get(struct ivpu_device *vdev)
800
812
if (!ivpu_is_silicon (vdev ))
801
813
return PLL_SIMULATION_FREQ ;
802
814
803
- return PLL_RATIO_TO_FREQ (pll_curr_ratio );
815
+ return ivpu_hw_mtl_pll_to_freq (pll_curr_ratio , vdev -> hw -> config );
804
816
}
805
817
806
818
static u32 ivpu_hw_mtl_reg_telemetry_offset_get (struct ivpu_device * vdev )
You can’t perform that action at this time.
0 commit comments