#define GPU_CLK_DBG(fmt, arg...)
//disable print
-#define _dev_info(...)
+//#define _dev_info(...)
//static DEFINE_SPINLOCK(lock);
static mali_plat_info_t* pmali_plat = NULL;
if (ret) {
dev_notice(&pdev->dev, "read clk_freq failed\n");
}
-#if 0
-#ifdef MESON_CPU_VERSION_OPS
- if (is_meson_gxbbm_cpu()) {
- if (dvfs_tbl->clk_freq >= GXBBM_MAX_GPU_FREQ)
- continue;
- }
-#endif
-#endif
-#if 0
+
ret = of_property_read_string(gpu_clk_dn,"clk_parent",
- &dvfs_tbl->clk_parent);
+ &dvfs_tbl->clk_parent);
if (ret) {
dev_notice(&pdev->dev, "read clk_parent failed\n");
+ } else if (0 == strcmp(dvfs_tbl->clk_parent, "gp0_pll")) {
+ dvfs_tbl->clkp_handle = devm_clk_get(&pdev->dev, dvfs_tbl->clk_parent);
+ if (IS_ERR(dvfs_tbl->clkp_handle)) {
+ dev_notice(&pdev->dev, "failed to get %s's clock pointer\n", dvfs_tbl->clk_parent);
+ }
+ ret = of_property_read_u32(gpu_clk_dn,"clkp_freq", &dvfs_tbl->clkp_freq);
+ if (ret) {
+ dev_notice(&pdev->dev, "read clk_parent freq failed\n");
+ }
}
- dvfs_tbl->clkp_handle = devm_clk_get(&pdev->dev, dvfs_tbl->clk_parent);
- if (IS_ERR(dvfs_tbl->clkp_handle)) {
- dev_notice(&pdev->dev, "failed to get %s's clock pointer\n", dvfs_tbl->clk_parent);
- }
- ret = of_property_read_u32(gpu_clk_dn,"clkp_freq", &dvfs_tbl->clkp_freq);
- if (ret) {
- dev_notice(&pdev->dev, "read clk_parent freq failed\n");
- }
-#endif
+
ret = of_property_read_u32(gpu_clk_dn,"voltage", &dvfs_tbl->voltage);
if (ret) {
dev_notice(&pdev->dev, "read voltage failed\n");
{
mali_dvfs_threshold_table * pdvfs = pmali_plat->dvfs_table;
uint32_t execStep = currentStep;
-#if AMLOGIC_GPU_USE_GPPLL
mali_dvfs_threshold_table *dvfs_tbl = &pmali_plat->dvfs_table[currentStep];
-#endif
//if (pdvfs[currentStep].freq_index == pdvfs[lastStep].freq_index) return;
if ((pdvfs[execStep].freq_index == pdvfs[lastStep].freq_index) ||
is_gp_pll_put = 0;
gp_pll_release(gp_pll_user_gpu);
}
+#else
+ if ((0 == strcmp(dvfs_tbl->clk_parent, "gp0_pll")) &&
+ !IS_ERR(dvfs_tbl->clkp_handle) &&
+ (0 != dvfs_tbl->clkp_freq)) {
+ clk_prepare_enable(dvfs_tbl->clkp_handle);
+ clk_set_rate(dvfs_tbl->clkp_handle, dvfs_tbl->clkp_freq);
+ }
+
#endif
//mali_dev_pause();
mali_clock_set(pdvfs[execStep].freq_index);
//mali_dev_resume();
+#if AMLOGIC_GPU_USE_GPPLL==0
+ if ((0 == strcmp(pdvfs[lastStep].clk_parent,"gp0_pll")) &&
+ (0 != strcmp(pdvfs[execStep].clk_parent, "gp0_pll"))) {
+ clk_disable_unprepare(pdvfs[lastStep].clkp_handle);
+ }
+#endif
lastStep = execStep;
#if AMLOGIC_GPU_USE_GPPLL
if (is_gp_pll_put) {