summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
diff options
context:
space:
mode:
authorManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2017-12-06 16:06:35 -0800
committerManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2017-12-13 16:11:14 -0800
commita18947c20dba2c0c38db8bde1ad4684995df4bbd (patch)
tree917bf2abbe439a6f99ede8cfafb25812dca54a9a /meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
parent6ddc5873b0ede30e6542f0ab151a6236acc37944 (diff)
downloadmeta-xilinx-a18947c20dba2c0c38db8bde1ad4684995df4bbd.tar.gz
meta-xilinx: Restructuring meta-xilinx to support multiple layers
As discussed previously on mailing list, we are proceeding with layer restructuring. For rocko release we will have the following layers meta-xilinx ->meta-xilinx-bsp (current meta-xilinx) ->meta-xilinx-contrib In the subsequent releases we will add other layers from Xilinx meta-xilinx ->meta-xilinx-bsp (current meta-xilinx) ->meta-petalinux ->meta-xilinx-tools ->meta-xilinx-contrib This will provide one clone to get all the required meta layers from Xilinx for a complete solution, and the users can blacklist any layer which they don't want to use using bblayer.conf. This will enables us to help our vendors/partners to add their reference designs, board definitions etc. Recipe changes : * Move reference design zybo-linux-bd.bb to meta-xilinx-contrib * Move kernel patches realted to zybo-linux-bd-zynq7 board to meta-xilinx-contrib * Update README Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Diffstat (limited to 'meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch')
-rw-r--r--meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
new file mode 100644
index 00000000..34cbccf4
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
@@ -0,0 +1,90 @@
1From ba8c94302a1c606315109a9d1cee342213fdbf98 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Thu, 16 Feb 2017 12:15:58 -0800
4Subject: [PATCH] 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 [Specific to Xilinx ZynqMP]
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 9bfa2bd..cfde20f 100755
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