summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHemant Hariyani2013-07-25 17:44:29 -0500
committerHemant Hariyani2013-07-25 17:44:29 -0500
commit12a51f01def3f941316e2feda32d56921f2f015f (patch)
tree79b8512b0f3d753b56f73bc0bad8a7ee62bf8dd5
parentba006b660ca16c864fcfe041805ddb5e65e8f3d8 (diff)
downloaddevice-ti-proprietary-open-12a51f01def3f941316e2feda32d56921f2f015f.tar.gz
device-ti-proprietary-open-12a51f01def3f941316e2feda32d56921f2f015f.tar.xz
device-ti-proprietary-open-12a51f01def3f941316e2feda32d56921f2f015f.zip
SGX-BIN: Binaries/KM source with GPU thermal integration
DDK 1.9@2291151 Branch: origin/1.9/2291151_k3.8 Change-Id: Ic498f3a10f93763f74fd96b25335704dce7aab17 Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
-rw-r--r--jacinto6/README.SGX4
-rw-r--r--jacinto6/sgx.tgzbin2649848 -> 2651780 bytes
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c8
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_cool.c87
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils.c2
5 files changed, 94 insertions, 7 deletions
diff --git a/jacinto6/README.SGX b/jacinto6/README.SGX
index 839ab3a..4c83268 100644
--- a/jacinto6/README.SGX
+++ b/jacinto6/README.SGX
@@ -17,9 +17,9 @@ now a wrapper which detects the current processor and loads the corresponding
17core specific pvrsrvinit. 17core specific pvrsrvinit.
18 18
19[DDK Version] 19[DDK Version]
20 1.9@2166536 20 1.9/2291151
21[DDK commit ID] 21[DDK commit ID]
22 6708c05 build: Add jacinto6 gralloc binary 22 2f85c98 SGX-KM: GPU thermal integration for k3.8
23[Branch] 23[Branch]
24 origin/1.9/2291151_k3.8 24 origin/1.9/2291151_k3.8
25[Kernel modules built against] 25[Kernel modules built against]
diff --git a/jacinto6/sgx.tgz b/jacinto6/sgx.tgz
index 42da719..c62bc19 100644
--- a/jacinto6/sgx.tgz
+++ b/jacinto6/sgx.tgz
Binary files differ
diff --git a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c
index 11e1238..0285d00 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c
@@ -78,7 +78,7 @@ static unsigned long _idle_prev_time;
78static unsigned long _active_curr_time; 78static unsigned long _active_curr_time;
79static unsigned long _active_prev_time; 79static unsigned long _active_prev_time;
80 80
81#if defined(CONFIG_THERMAL_FRAMEWORK) 81#if (defined(CONFIG_THERMAL) || defined(CONFIG_THERMAL_FRAMEWORK))
82int cool_init(void); 82int cool_init(void);
83void cool_deinit(void); 83void cool_deinit(void);
84#endif 84#endif
@@ -491,8 +491,8 @@ int sgxfreq_init(struct device *dev)
491 return ret; 491 return ret;
492 } 492 }
493 493
494#if defined(CONFIG_THERMAL_FRAMEWORK) 494#if (defined(CONFIG_THERMAL) || defined(CONFIG_THERMAL_FRAMEWORK))
495 //cool_init(); 495 cool_init();
496#endif 496#endif
497 497
498 for (i = 0; sgxfreq_gov_init[i] != NULL; i++) 498 for (i = 0; sgxfreq_gov_init[i] != NULL; i++)
@@ -517,7 +517,7 @@ int sgxfreq_deinit(void)
517 517
518 sgxfreq_set_freq_request(sfd.freq_list[0]); 518 sgxfreq_set_freq_request(sfd.freq_list[0]);
519 519
520#if defined(CONFIG_THERMAL_FRAMEWORK) 520#if (defined(CONFIG_THERMAL) || defined(CONFIG_THERMAL_FRAMEWORK))
521 cool_deinit(); 521 cool_deinit();
522#endif 522#endif
523 523
diff --git a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_cool.c b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_cool.c
index 9233def..a58eb39 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_cool.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_cool.c
@@ -14,6 +14,92 @@
14 * this program. If not, see <http://www.gnu.org/licenses/>. 14 * this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
18
19#include <linux/thermal.h>
20
21static struct cool_data {
22 int freq_cnt;
23 unsigned long *freq_list;
24 unsigned long state;
25 struct thermal_cooling_device *cdev;
26} cd;
27
28static int sgxfreq_get_max_state(struct thermal_cooling_device *cdev,
29 unsigned long *state)
30{
31 *state = cd.freq_cnt - 1;
32 return 0;
33}
34
35static int sgxfreq_get_cur_state(struct thermal_cooling_device *cdev,
36 unsigned long *state)
37{
38 *state = cd.state;
39 return 0;
40}
41
42static int sgxfreq_set_cur_state(struct thermal_cooling_device *cdev,
43 unsigned long state)
44{
45 int freq_max_index, freq_limit_index;
46
47 freq_max_index = cd.freq_cnt - 1;
48
49 freq_limit_index = freq_max_index - (unsigned int)state;
50
51 if (freq_limit_index < 0)
52 freq_limit_index = 0;
53
54 sgxfreq_set_freq_limit(cd.freq_list[freq_limit_index]);
55
56 cd.state = state;
57 return 0;
58}
59
60
61static const struct thermal_cooling_device_ops sgxfreq_cooling_ops = {
62 .get_max_state = sgxfreq_get_max_state,
63 .get_cur_state = sgxfreq_get_cur_state,
64 .set_cur_state = sgxfreq_set_cur_state,
65};
66
67int cool_init(void)
68{
69 int ret;
70 struct thermal_zone_device *tz;
71
72 cd.freq_cnt = sgxfreq_get_freq_list(&cd.freq_list);
73 if (!cd.freq_cnt || !cd.freq_list)
74 return -EINVAL;
75
76 cd.cdev = thermal_cooling_device_register("gpu", (void *)NULL, &sgxfreq_cooling_ops);
77
78 if(IS_ERR(cd.cdev)) {
79 pr_err("sgxfreq: Error while regeistering cooling device: %ld\n", PTR_ERR(cd.cdev));
80 return -1;
81 }
82
83 tz = thermal_zone_get_zone_by_name("gpu");
84 if(IS_ERR(tz)) {
85 pr_err("sgxfreq: Error while trying to obtain zone device: %ld\n", PTR_ERR(tz));
86 return -1;
87 }
88
89 ret = thermal_zone_bind_cooling_device(tz, 0, cd.cdev, THERMAL_NO_LIMIT, THERMAL_NO_LIMIT);
90 if (ret)
91 {
92 pr_err("sgxfreq: Error binding cooling device: %d\n", ret);
93 }
94
95 return 0;
96}
97
98void cool_deinit(void)
99{
100 thermal_cooling_device_unregister(cd.cdev);
101}
102#else //if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
17#include <linux/thermal_framework.h> 103#include <linux/thermal_framework.h>
18 104
19static int cool_device(struct thermal_dev *dev, int cooling_level); 105static int cool_device(struct thermal_dev *dev, int cooling_level);
@@ -102,3 +188,4 @@ static int cool_device(struct thermal_dev *dev, int cooling_level)
102 188
103 return 0; 189 return 0;
104} 190}
191#endif //if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
diff --git a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils.c b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils.c
index 20baad2..fef97c2 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils.c
@@ -50,7 +50,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50#include "sgxfreq_activeidle.c" 50#include "sgxfreq_activeidle.c"
51#include "sgxfreq_on3demand.c" 51#include "sgxfreq_on3demand.c"
52#include "sgxfreq_userspace.c" 52#include "sgxfreq_userspace.c"
53#if defined(CONFIG_THERMAL_FRAMEWORK) 53#if (defined(CONFIG_THERMAL) || defined(CONFIG_THERMAL_FRAMEWORK))
54#include "sgxfreq_cool.c" 54#include "sgxfreq_cool.c"
55#endif 55#endif
56#endif 56#endif