summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/dvfs/0020-omap3-Add-basic-support-for-720MHz-part.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/dvfs/0020-omap3-Add-basic-support-for-720MHz-part.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap/dvfs/0020-omap3-Add-basic-support-for-720MHz-part.patch202
1 files changed, 202 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/dvfs/0020-omap3-Add-basic-support-for-720MHz-part.patch b/extras/recipes-kernel/linux/linux-omap/dvfs/0020-omap3-Add-basic-support-for-720MHz-part.patch
new file mode 100644
index 00000000..107e1162
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap/dvfs/0020-omap3-Add-basic-support-for-720MHz-part.patch
@@ -0,0 +1,202 @@
1From bb655c594a2f77b17d0747116795f46e00d5ffcb Mon Sep 17 00:00:00 2001
2From: Sanjeev Premi <premi@ti.com>
3Date: Tue, 18 Jan 2011 13:19:55 +0530
4Subject: [PATCH 20/20] omap3: Add basic support for 720MHz part
5
6This patch adds support for new speed enhanced parts with ARM
7and IVA running at 720MHz and 520MHz respectively. These parts
8can be probed at run-time by reading PRODID.SKUID[3:0] at
90x4830A20C [1].
10
11This patch specifically does following:
12 * Detect devices capable of 720MHz.
13 * Add new OPP
14 * Ensure that OPP is conditionally enabled.
15 * Check for presence of IVA before attempting to enable
16 the corresponding OPP.
17
18 [1] http://focus.ti.com/lit/ug/spruff1d/spruff1d.pdf
19
20Signed-off-by: Sanjeev Premi <premi@ti.com>
21---
22 arch/arm/mach-omap2/control.h | 7 ++++
23 arch/arm/mach-omap2/id.c | 10 +++++
24 arch/arm/mach-omap2/opp3xxx_data.c | 63 ++++++++++++++++++++++++++++++++-
25 arch/arm/plat-omap/include/plat/cpu.h | 2 +
26 4 files changed, 81 insertions(+), 1 deletions(-)
27
28diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
29index f0629ae..eebc045 100644
30--- a/arch/arm/mach-omap2/control.h
31+++ b/arch/arm/mach-omap2/control.h
32@@ -365,6 +365,13 @@
33 #define FEAT_NEON 0
34 #define FEAT_NEON_NONE 1
35
36+/*
37+ * Product ID register
38+ */
39+#define OMAP3_PRODID 0x020C
40+
41+#define OMAP3_SKUID_MASK 0x0f
42+#define OMAP3_SKUID_720MHZ 0x08
43
44 #ifndef __ASSEMBLY__
45 #ifdef CONFIG_ARCH_OMAP2PLUS
46diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
47index 5f9086c..53fbe01 100644
48--- a/arch/arm/mach-omap2/id.c
49+++ b/arch/arm/mach-omap2/id.c
50@@ -195,6 +195,15 @@ static void __init omap3_check_features(void)
51 * TODO: Get additional info (where applicable)
52 * e.g. Size of L2 cache.
53 */
54+
55+ /*
56+ * Does it support 720MHz?
57+ */
58+ status = (OMAP3_SKUID_MASK & read_tap_reg(OMAP3_PRODID));
59+
60+ if (status & OMAP3_SKUID_720MHZ) {
61+ omap3_features |= OMAP3_HAS_720MHZ;
62+ }
63 }
64
65 static void __init omap3_check_revision(void)
66@@ -445,6 +454,7 @@ static void __init omap3_cpuinfo(void)
67 OMAP3_SHOW_FEATURE(neon);
68 OMAP3_SHOW_FEATURE(isp);
69 OMAP3_SHOW_FEATURE(192mhz_clk);
70+ OMAP3_SHOW_FEATURE(720mhz);
71
72 printk(")\n");
73 }
74diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
75index fd3a1af..76d26c7 100644
76--- a/arch/arm/mach-omap2/opp3xxx_data.c
77+++ b/arch/arm/mach-omap2/opp3xxx_data.c
78@@ -17,8 +17,10 @@
79 * GNU General Public License for more details.
80 */
81 #include <linux/module.h>
82+#include <linux/opp.h>
83
84 #include <plat/cpu.h>
85+#include <plat/omap_device.h>
86
87 #include "omap_opp_data.h"
88 #include "pm.h"
89@@ -34,6 +36,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
90 OPP_INITIALIZER("mpu", true, 550000000, 1270000),
91 /* MPU OPP5 */
92 OPP_INITIALIZER("mpu", true, 600000000, 1350000),
93+ /* MPU OPP6 */
94+ OPP_INITIALIZER("mpu", false, 720000000, 1350000),
95
96 /*
97 * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is
98@@ -59,6 +63,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
99 OPP_INITIALIZER("iva", true, 400000000, 1270000),
100 /* DSP OPP5 */
101 OPP_INITIALIZER("iva", true, 430000000, 1350000),
102+ /* DSP OPP6 */
103+ OPP_INITIALIZER("iva", false, 520000000, 1350000),
104 };
105
106 static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
107@@ -86,6 +92,57 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
108 OPP_INITIALIZER("iva", false, 800000000, 1375000),
109 };
110
111+
112+/**
113+ * omap3_opp_enable_720Mhz() - Enable the OPP corresponding to 720MHz
114+ *
115+ * This function would be executed only if the silicon is capable of
116+ * running at the 720MHz.
117+ */
118+static int __init omap3_opp_enable_720Mhz(void)
119+{
120+ int r = -ENODEV;
121+ struct omap_hwmod *oh_mpu = omap_hwmod_lookup("mpu");
122+ struct omap_hwmod *oh_iva;
123+ struct platform_device *pdev;
124+
125+ if (!oh_mpu || !oh_mpu->od) {
126+ goto err;
127+ } else {
128+ pdev = &oh_mpu->od->pdev;
129+
130+ r = opp_enable(&pdev->dev, 720000000);
131+ if (r < 0) {
132+ dev_err(&pdev->dev,
133+ "opp_enable() failed for mpu@720MHz");
134+ goto err;
135+ }
136+ }
137+
138+ if (omap3_has_iva()) {
139+ oh_iva = omap_hwmod_lookup("iva");
140+
141+ if (!oh_iva || !oh_iva->od) {
142+ r = -ENODEV;
143+ goto err;
144+ } else {
145+ pdev = &oh_iva->od->pdev;
146+
147+ r = opp_enable(&pdev->dev, 520000000);
148+ if (r < 0) {
149+ dev_err(&pdev->dev,
150+ "opp_enable() failed for iva@520MHz");
151+ goto err;
152+ }
153+ }
154+ }
155+
156+ dev_info(&pdev->dev, "Enabled OPP corresponding to 720MHz\n");
157+
158+err:
159+ return r;
160+}
161+
162 /**
163 * omap3_opp_init() - initialize omap3 opp table
164 */
165@@ -99,10 +156,14 @@ int __init omap3_opp_init(void)
166 if (cpu_is_omap3630())
167 r = omap_init_opp_table(omap36xx_opp_def_list,
168 ARRAY_SIZE(omap36xx_opp_def_list));
169- else
170+ else {
171 r = omap_init_opp_table(omap34xx_opp_def_list,
172 ARRAY_SIZE(omap34xx_opp_def_list));
173
174+ if (omap3_has_720mhz())
175+ r = omap3_opp_enable_720Mhz();
176+ }
177+
178 return r;
179 }
180 device_initcall(omap3_opp_init);
181diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
182index 1a8c347..7d24faa 100644
183--- a/arch/arm/plat-omap/include/plat/cpu.h
184+++ b/arch/arm/plat-omap/include/plat/cpu.h
185@@ -510,6 +510,7 @@ extern u32 omap3_features;
186 #define OMAP3_HAS_ISP BIT(4)
187 #define OMAP3_HAS_192MHZ_CLK BIT(5)
188 #define OMAP3_HAS_IO_WAKEUP BIT(6)
189+#define OMAP3_HAS_720MHZ BIT(7)
190
191 #define OMAP3_HAS_FEATURE(feat,flag) \
192 static inline unsigned int omap3_has_ ##feat(void) \
193@@ -524,5 +525,6 @@ OMAP3_HAS_FEATURE(neon, NEON)
194 OMAP3_HAS_FEATURE(isp, ISP)
195 OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
196 OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
197+OMAP3_HAS_FEATURE(720mhz, 720MHZ)
198
199 #endif
200--
2011.6.6.1
202