MALI_DEBUG_PRINT(4, ("mali_os_freeze() called\n"));
+ mali_dev_freeze();
+
if (NULL != device->driver &&
NULL != device->driver->pm &&
NULL != device->driver->pm->freeze)
/* for frequency reporter in DS-5 streamline. */
u32 get_current_frequency(void);
+void mali_dev_freeze(void);
void mali_dev_restore(void);
extern int mali_pm_statue;
#define AML_CLK_LOCK_ERROR 1
#endif
-#define HHI_MALI_CLK_CNTL 0x6C
-#define mplt_read(r) readl((pmali_plat->reg_base_hiubus) + ((r)<<2))
-#define mplt_write(r, v) writel((v), ((pmali_plat->reg_base_hiubus) + ((r)<<2)))
-#define mplt_setbits(r, m) mplt_write((r), (mplt_read(r) | (m)));
-#define mplt_clrbits(r, m) mplt_write((r), (mplt_read(r) & (~(m))));
-
static unsigned gpu_dbg_level = 0;
module_param(gpu_dbg_level, uint, 0644);
MODULE_PARM_DESC(gpu_dbg_level, "gpu debug level");
#include <linux/amlogic/iomap.h>
#endif
+#ifndef HHI_MALI_CLK_CNTL
+#define HHI_MALI_CLK_CNTL 0x6C
+#define mplt_read(r) readl((pmali_plat->reg_base_hiubus) + ((r)<<2))
+#define mplt_write(r, v) writel((v), ((pmali_plat->reg_base_hiubus) + ((r)<<2)))
+#define mplt_setbits(r, m) mplt_write((r), (mplt_read(r) | (m)));
+#define mplt_clrbits(r, m) mplt_write((r), (mplt_read(r) & (~(m))));
+#endif
+
//extern int mali_clock_init(struct platform_device *dev);
int mali_clock_init_clk_tree(struct platform_device *pdev);
}
#endif
}
+static u32 clk_cntl_save = 0;
+void mali_dev_freeze(void)
+{
+ clk_cntl_save = mplt_read(HHI_MALI_CLK_CNTL);
+}
void mali_dev_restore(void)
{
- mali_perf_set_num_pp_cores(num_cores_enabled);
+
+ mplt_write(HHI_MALI_CLK_CNTL, clk_cntl_save);
if (pmali_plat && pmali_plat->pdev) {
mali_clock_init_clk_tree(pmali_plat->pdev);
} else {