mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2026-01-27 12:35:36 +01:00
LF-15186-1 gpu: remove gpumix block ctrl
same as LF-11706 in lf-6.12.y, add directive for the gpumix reset control, which has been moved into SM. Change-Id: Ide9d01e34cd6b9061d177f70c6caacb785732f22 Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com> Signed-off-by: Jessie Hao <juan.hao@nxp.com> Reviewed-by: Xianzhong Li <xianzhong.li@nxp.com> Reviewed-by: Jason Liu <jason.hui.liu@nxp.com> Acked-by: Jason Liu <jason.hui.liu@nxp.com>
This commit is contained in:
parent
1ab4f3d81e
commit
55018aa9dd
|
|
@ -54,6 +54,7 @@ static int platform_init_func(struct kbase_device *kbdev)
|
|||
|
||||
ictx = devm_kzalloc(kbdev->dev, sizeof(struct imx_platform_ctx), GFP_KERNEL);
|
||||
if (pdev->num_resources > 1) {
|
||||
#ifdef IMX_GPU_BLK_CTRL
|
||||
ictx->reg_blk_ctrl = devm_platform_ioremap_resource_byname(pdev, "gpumix_blk_ctrl");
|
||||
if (IS_ERR_OR_NULL(ictx->reg_blk_ctrl))
|
||||
ictx->reg_blk_ctrl = devm_platform_ioremap_resource(pdev, 1);
|
||||
|
|
@ -62,6 +63,7 @@ static int platform_init_func(struct kbase_device *kbdev)
|
|||
}
|
||||
|
||||
if (pdev->num_resources > 2) {
|
||||
#endif
|
||||
ictx->reg_tcm = devm_platform_ioremap_resource_byname(pdev, "tcm");
|
||||
if (!IS_ERR_OR_NULL(ictx->reg_tcm))
|
||||
dev_dbg(kbdev->dev, "wave dump reg = %pK\n", ictx->reg_tcm);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
//TODO remove IMX_GPU_BLK_CTRL
|
||||
#include <linux/version.h>
|
||||
|
||||
/**
|
||||
* POWER_MANAGEMENT_CALLBACKS - Power management configuration
|
||||
*
|
||||
|
|
@ -47,11 +50,18 @@ extern struct kbase_platform_funcs_conf platform_funcs;
|
|||
* The delay time (in milliseconds) to be used for autosuspend
|
||||
*/
|
||||
#define AUTO_SUSPEND_DELAY (100)
|
||||
#ifndef IMX_GPU_BLK_CTRL
|
||||
#if KERNEL_VERSION(6, 12, 0) >= LINUX_VERSION_CODE
|
||||
#define IMX_GPU_BLK_CTRL 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct imx_platform_ctx {
|
||||
struct kbase_device *kbdev;
|
||||
#ifdef IMX_GPU_BLK_CTRL
|
||||
void __iomem *reg_blk_ctrl;
|
||||
int init_blk_ctrl;
|
||||
#endif
|
||||
void __iomem *reg_tcm;
|
||||
int dumpStarted;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -83,18 +83,22 @@ static int pm_callback_power_on(struct kbase_device *kbdev)
|
|||
#ifdef CONFIG_MALI_DEBUG
|
||||
unsigned long flags;
|
||||
#endif
|
||||
#ifdef IMX_GPU_BLK_CTRL
|
||||
struct imx_platform_ctx *ictx = kbdev->platform_context;
|
||||
#endif
|
||||
|
||||
dev_dbg(kbdev->dev, "%s %pK\n", __func__, (void *)kbdev->dev->pm_domain);
|
||||
|
||||
if (pm_runtime_enabled(kbdev->dev)) {
|
||||
error = pm_runtime_get_sync(kbdev->dev);
|
||||
dev_dbg(kbdev->dev, "power on pm_runtime_get_sync returned %d\n", error);
|
||||
#ifdef IMX_GPU_BLK_CTRL
|
||||
if (ictx && (ictx->init_blk_ctrl == 0)
|
||||
&& !IS_ERR_OR_NULL(ictx->reg_blk_ctrl)) {
|
||||
ictx->init_blk_ctrl = 1;
|
||||
writel(0x1, ictx->reg_blk_ctrl + 0x8);
|
||||
}
|
||||
#endif
|
||||
if (error == 1)
|
||||
ret = 0; //gpu still powered on.
|
||||
}
|
||||
|
|
@ -117,7 +121,9 @@ static int pm_callback_power_on(struct kbase_device *kbdev)
|
|||
|
||||
static void pm_callback_power_off(struct kbase_device *kbdev)
|
||||
{
|
||||
#ifdef IMX_GPU_BLK_CTRL
|
||||
struct imx_platform_ctx *ictx = kbdev->platform_context;
|
||||
#endif
|
||||
#ifdef CONFIG_MALI_DEBUG
|
||||
unsigned long flags;
|
||||
|
||||
|
|
@ -136,7 +142,9 @@ static void pm_callback_power_off(struct kbase_device *kbdev)
|
|||
pm_runtime_mark_last_busy(kbdev->dev);
|
||||
pm_runtime_put_autosuspend(kbdev->dev);
|
||||
|
||||
#ifdef IMX_GPU_BLK_CTRL
|
||||
ictx->init_blk_ctrl = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef KBASE_PM_RUNTIME
|
||||
|
|
@ -213,9 +221,13 @@ static void pm_callback_resume(struct kbase_device *kbdev)
|
|||
|
||||
static void pm_callback_suspend(struct kbase_device *kbdev)
|
||||
{
|
||||
#ifdef IMX_GPU_BLK_CTRL
|
||||
struct imx_platform_ctx *ictx = kbdev->platform_context;
|
||||
#endif
|
||||
pm_callback_runtime_off(kbdev);
|
||||
#ifdef IMX_GPU_BLK_CTRL
|
||||
ictx->init_blk_ctrl = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kbase_pm_callback_conf pm_callbacks = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user