summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch')
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
new file mode 100644
index 00000000..3d784604
--- /dev/null
+++ b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
@@ -0,0 +1,90 @@
1From e67e20ec6ff0c9720d87844270421453c738066a Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Thu, 16 Feb 2017 12:15:58 -0800
4Subject: [PATCH 5/9] linux/mali_kernel_linux.c: Handle clock when probed and
5 removed
6
7This patch will handle the clock through clock
8specifier for GPU PP0 and PP1.
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com>
11Upstream Status: Inappropriate [Xilinx specific]
12---
13 .../src/devicedrv/mali/linux/mali_kernel_linux.c | 40 +++++++++++++++++++++-
14 1 file changed, 39 insertions(+), 1 deletion(-)
15
16diff --git a/driver/src/devicedrv/mali/linux/mali_kernel_linux.c b/driver/src/devicedrv/mali/linux/mali_kernel_linux.c
17index d7893a3..f15fb56 100644
18--- linux/mali_kernel_linux.c
19+++ b/linux/mali_kernel_linux.c
20@@ -45,6 +45,14 @@
21 #if defined(CONFIG_MALI400_INTERNAL_PROFILING)
22 #include "mali_profiling_internal.h"
23 #endif
24+
25+#if defined(CONFIG_ARCH_ZYNQMP)
26+/* Initialize variables for clocks */
27+struct clk *clk_gpu;
28+struct clk *clk_gpu_pp0;
29+struct clk *clk_gpu_pp1;
30+#endif
31+
32 #if defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_MALI_DVFS)
33 #include "mali_osk_profiling.h"
34 #include "mali_dvfs_policy.h"
35@@ -580,7 +588,23 @@ static int mali_probe(struct platform_device *pdev)
36 }
37 #endif
38
39-
40+#if defined(CONFIG_ARCH_ZYNQMP)
41+ /* Initialize clocks for GPU and PP */
42+ clk_gpu = devm_clk_get(&pdev->dev, "gpu");
43+ if (IS_ERR(clk_gpu))
44+ return PTR_ERR(clk_gpu);
45+ clk_prepare_enable(clk_gpu);
46+
47+ clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0");
48+ if (IS_ERR(clk_gpu_pp0))
49+ return PTR_ERR(clk_gpu_pp0);
50+ clk_prepare_enable(clk_gpu_pp0);
51+
52+ clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1");
53+ if (IS_ERR(clk_gpu_pp1))
54+ return PTR_ERR(clk_gpu_pp1);
55+ clk_prepare_enable(clk_gpu_pp1);
56+#endif
57 if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) {
58 /* Initialize the Mali GPU HW specified by pdev */
59 if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) {
60@@ -608,6 +632,12 @@ static int mali_probe(struct platform_device *pdev)
61 _mali_osk_wq_term();
62 }
63
64+#if defined(CONFIG_ARCH_ZYNQMP)
65+ clk_disable_unprepare(clk_gpu);
66+ clk_disable_unprepare(clk_gpu_pp0);
67+ clk_disable_unprepare(clk_gpu_pp1);
68+#endif
69+
70 #ifdef CONFIG_MALI_DEVFREQ
71 mali_devfreq_term(mdev);
72 devfreq_init_failed:
73@@ -673,6 +703,14 @@ static int mali_remove(struct platform_device *pdev)
74 mali_platform_device_deinit(mali_platform_device);
75 #endif
76 mali_platform_device = NULL;
77+
78+#if defined(CONFIG_ARCH_ZYNQMP)
79+ /* Remove clock */
80+ clk_disable_unprepare(clk_gpu);
81+ clk_disable_unprepare(clk_gpu_pp0);
82+ clk_disable_unprepare(clk_gpu_pp1);
83+#endif
84+
85 return 0;
86 }
87
88--
892.7.4
90