aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-omap-2.6.37rc/dvfs/0004-OMAP3-Overo-Tide-enable-upto-720MHz-OPP.patch
blob: 5061daac3eb16dabcb3d484ee1c5afdf0ef87d59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
From 02b008bc50c79aeaa666917bcd2a58049d1ab68c Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Thu, 6 Jan 2011 13:32:19 +0100
Subject: [PATCH 4/4] OMAP3: Overo Tide: enable upto 720MHz OPP

Overo Tide uses a recent 3530 and the board design allows enabling 720MHz
OPP. tweak the default table to allow for higher OPP tables

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 arch/arm/mach-omap2/board-overo.c |   51 +++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 8686015..2fa0c96 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -29,6 +29,7 @@
 #include <linux/i2c/twl.h>
 #include <linux/regulator/machine.h>
 #include <linux/spi/spi.h>
+#include <linux/opp.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -52,10 +53,12 @@
 #include <plat/mcspi.h>
 #include <plat/mux.h>
 #include <plat/usb.h>
+#include <plat/omap_device.h>
 
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
+#include "pm.h"
 
 #define OVERO_GPIO_BT_XGATE	15
 #define OVERO_GPIO_W2W_NRESET	16
@@ -788,6 +791,53 @@ static void __init usrp1_e_init(void)
 
 }
 
+static void __init overo_opp_init(void)
+{
+	int r = 0;
+	
+	/* Initialize the omap3 opp table */
+	if (omap3_opp_init()) {
+		pr_err("%s: opp default init failed\n", __func__);
+		return;
+	}
+	
+	/* Custom OPP enabled for Tide */
+	if (omap3_has_720mhz()) {
+		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
+		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
+		struct device *dev;
+		
+		if (!mh || !dh) {
+			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
+				   __func__, mh, dh);
+			r = -EINVAL;
+		} else {
+			/* Enable MPU 720MHz */
+			dev = &mh->od->pdev.dev;
+			r = opp_enable(dev, 720000000);
+			
+			/* Enable IVA 520MHz and lower opps */
+			dev = &dh->od->pdev.dev;
+			r |= opp_enable(dev, 520000000);
+		}
+		if (r) {
+			pr_err("%s: failed to enable higher opp %d\n",
+				   __func__, r);
+			/*
+			 * Cleanup - disable the higher freqs - we dont care
+			 * about the results
+			 */
+			dev = &mh->od->pdev.dev;
+			opp_disable(dev, 720000000);
+			dev = &dh->od->pdev.dev;
+			opp_disable(dev, 520000000);
+		} else {
+			pr_err("%s: 720MHz MPU OPPs enabled!\n", __func__);
+		}
+	}
+	
+}
+
 static void __init overo_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -846,6 +896,7 @@ static void __init overo_init(void)
 	else
 		printk(KERN_ERR "could not obtain gpio for "
 					"OVERO_GPIO_USBH_CPEN\n");
+	overo_opp_init();
 }
 
 MACHINE_START(OVERO, "Gumstix Overo")
-- 
1.6.6.1