From f675ce78c5a035682910d1155752dd4c241c156e Mon Sep 17 00:00:00 2001 From: Jiyu Yang Date: Mon, 21 Dec 2015 22:07:14 +0800 Subject: [PATCH] PD#116328 hibernate support for mali83x Change-Id: I906e75eefe7a4dadf83b1071b7ad0116ad997870 --- .../gpu/arm/midgard/mali_kbase_core_linux.c | 19 +++++++++++++++++++ .../midgard/platform/devicetree/mali_clock.c | 5 ++--- .../devicetree/mali_kbase_config_platform.h | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c b/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c index 8a37e6e..d9fe3e0 100755 --- a/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c +++ b/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c @@ -3954,12 +3954,31 @@ static int kbase_device_runtime_idle(struct device *dev) return 1; } #endif /* KBASE_PM_RUNTIME */ +#ifndef CONFIG_MALI_DEVFREQ +static int mali_os_freeze(struct device *device) +{ + mali_dev_freeze(); + return kbase_device_suspend(device); +} + +static int mali_os_restore(struct device *device) +{ + mali_dev_restore(); + return kbase_device_resume(device); +} +#endif + /** The power management operations for the platform driver. */ static const struct dev_pm_ops kbase_pm_ops = { .suspend = kbase_device_suspend, .resume = kbase_device_resume, +#ifndef CONFIG_MALI_DEVFREQ + .freeze = mali_os_freeze, + .thaw = kbase_device_resume, + .restore = mali_os_restore, +#endif #ifdef KBASE_PM_RUNTIME .runtime_suspend = kbase_device_runtime_suspend, .runtime_resume = kbase_device_runtime_resume, diff --git a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c index 66dc881..008330d 100644 --- a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c +++ b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c @@ -199,7 +199,6 @@ int mali_dt_info(struct platform_device *pdev, struct mali_plat_info_t *mpdata) const __be32 *p; int length = 0, i = 0; u32 u; - int ret = 0; if (!gpu_dn) { dev_notice(&pdev->dev, "gpu device node not right\n"); @@ -234,11 +233,11 @@ int mali_dt_info(struct platform_device *pdev, struct mali_plat_info_t *mpdata) mpdata->scale_info.minclk = mpdata->cfg_min_clock; _dev_info(&pdev->dev, "min clk is %d\n", mpdata->scale_info.minclk); - mpdata->reg_base_hiubus = of_iomap(gpu_dn, 1); + mpdata->reg_base_hiubus = of_iomap(gpu_dn, 3); _dev_info(&pdev->dev, "hiu io source 0x%p\n", mpdata->reg_base_hiubus); mpdata->reg_base_aobus = of_iomap(gpu_dn, 2); - _dev_info(&pdev->dev, "hiu io source 0x%p\n", mpdata->reg_base_aobus); + _dev_info(&pdev->dev, "ao io source 0x%p\n", mpdata->reg_base_aobus); ret = of_property_read_u32(gpu_dn,"sc_mpp", &mpdata->sc_mpp); diff --git a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_kbase_config_platform.h b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_kbase_config_platform.h index 361089b..adc052c 100755 --- a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_kbase_config_platform.h +++ b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_kbase_config_platform.h @@ -83,6 +83,9 @@ extern struct devfreq_cooling_ops t83x_model_ops; #endif extern struct kbase_pm_callback_conf pm_callbacks; +void mali_dev_freeze(void); +void mali_dev_restore(void); + /** * Secure mode switch * -- 2.20.1