[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap / dvfs / 0003-OMAP3-beagle-C4-enable-upto-720MHz-OPP.patch
1 From 1a97a3600227fd0b52ee3bfd67bac6dde034af0d Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Thu, 6 Jan 2011 13:23:45 +0100
4 Subject: [PATCH 3/4] OMAP3: beagle C4: enable upto 720MHz OPP
6 Beagle C4 uses a recent 3530 and the board design allows enabling 720MHz
7 OPP. tweak the default table to allow for higher OPP tables
9 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
10 ---
11 arch/arm/mach-omap2/board-omap3beagle.c | 35 +++++++++++++++++++++++++++++++
12 1 files changed, 35 insertions(+), 0 deletions(-)
14 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
15 index 9393e75..a0462b9 100644
16 --- a/arch/arm/mach-omap2/board-omap3beagle.c
17 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
18 @@ -829,6 +829,41 @@ static void __init beagle_opp_init(void)
19 pr_err("%s: turbo OPPs enabled!\n", __func__);
20 }
21 }
22 + /* Custom OPP enabled for C4 */
23 + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4) {
24 + struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
25 + struct omap_hwmod *dh = omap_hwmod_lookup("iva");
26 + struct device *dev;
27 +
28 + if (!mh || !dh) {
29 + pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
30 + __func__, mh, dh);
31 + r = -EINVAL;
32 + } else {
33 + /* Enable MPU 720MHz */
34 + dev = &mh->od->pdev.dev;
35 + r = opp_enable(dev, 720000000);
36 +
37 + /* Enable IVA 520MHz and lower opps */
38 + dev = &dh->od->pdev.dev;
39 + r |= opp_enable(dev, 520000000);
40 + }
41 + if (r) {
42 + pr_err("%s: failed to enable higher opp %d\n",
43 + __func__, r);
44 + /*
45 + * Cleanup - disable the higher freqs - we dont care
46 + * about the results
47 + */
48 + dev = &mh->od->pdev.dev;
49 + opp_disable(dev, 720000000);
50 + dev = &dh->od->pdev.dev;
51 + opp_disable(dev, 520000000);
52 + } else {
53 + pr_err("%s: 720MHz MPU OPPs enabled!\n", __func__);
54 + }
55 + }
56 +
57 }
59 static void __init omap3_beagle_init(void)
60 --
61 1.6.6.1