]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
omap4: opp: add OPP table data
authorNishanth Menon <nm@ti.com>
Thu, 9 Dec 2010 15:13:47 +0000 (09:13 -0600)
committerKevin Hilman <khilman@deeprootsystems.com>
Tue, 21 Dec 2010 22:30:40 +0000 (14:30 -0800)
This patch adds OPP tables for OMAP4. New file has been added to keep
the OMAP4 opp tables and the registration of these tables with the
generic opp framework by OMAP SoC OPP interface.

Based on:
http://dev.omapzoom.org/?p=santosh/kernel-omap4-base.git;a=blob;f=arch/arm/mach-omap2/opp44xx_data.c;h=252e3d0cb6050a64f390b9311c1c4977d74f762a;hb=refs/heads/omap4_next

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/opp4xxx_data.c [new file with mode: 0644]
arch/arm/mach-omap2/pm.h

index e752cb397ba71a4abea17644c997538c456e1349..3e8c9e859f98fa9c6c4b904cf9fcfae4619cb86d 100644 (file)
@@ -46,6 +46,8 @@ config ARCH_OMAP4
        select ARM_GIC
        select PL310_ERRATA_588369
        select ARM_ERRATA_720789
+       select ARCH_HAS_OPP
+       select PM_OPP if PM
 
 comment "OMAP Core Type"
        depends on ARCH_OMAP2
index fa16806092e5dfaec1a72c1f02ea1d2625b78e47..e11943d77fe0e1814eacb99742e5c1f9153d33a3 100644 (file)
@@ -53,6 +53,7 @@ obj-$(CONFIG_ARCH_OMAP2)              += sdrc2xxx.o
 ifeq ($(CONFIG_PM_OPP),y)
 obj-y                                  += opp.o
 obj-$(CONFIG_ARCH_OMAP3)               += opp3xxx_data.o
+obj-$(CONFIG_ARCH_OMAP4)               += opp4xxx_data.o
 endif
 
 # Power Management
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c
new file mode 100644 (file)
index 0000000..a11fa56
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * OMAP4 OPP table definitions.
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *     Nishanth Menon
+ *     Kevin Hilman
+ *     Thara Gopinath
+ * Copyright (C) 2010 Nokia Corporation.
+ *      Eduardo Valentin
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include <linux/module.h>
+
+#include <plat/cpu.h>
+
+#include "omap_opp_data.h"
+
+static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
+       /* MPU OPP1 - OPP50 */
+       OPP_INITIALIZER("mpu", true, 300000000, 1100000),
+       /* MPU OPP2 - OPP100 */
+       OPP_INITIALIZER("mpu", true, 600000000, 1200000),
+       /* MPU OPP3 - OPP-Turbo */
+       OPP_INITIALIZER("mpu", false, 800000000, 1260000),
+       /* MPU OPP4 - OPP-SB */
+       OPP_INITIALIZER("mpu", false, 1008000000, 1350000),
+       /* L3 OPP1 - OPP50 */
+       OPP_INITIALIZER("l3_main_1", true, 100000000, 930000),
+       /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
+       OPP_INITIALIZER("l3_main_1", true, 200000000, 1100000),
+       /* TODO: add IVA, DSP, aess, fdif, gpu */
+};
+
+/**
+ * omap4_opp_init() - initialize omap4 opp table
+ */
+static int __init omap4_opp_init(void)
+{
+       int r = -ENODEV;
+
+       if (!cpu_is_omap44xx())
+               return r;
+
+       r = omap_init_opp_table(omap44xx_opp_def_list,
+                       ARRAY_SIZE(omap44xx_opp_def_list));
+
+       return r;
+}
+device_initcall(omap4_opp_init);
index 2031f157a6ee86924d617abd7128ed707ecc3574..a43e0697b6bc1aa520f9979a264e2111b17eec0b 100644 (file)
@@ -22,11 +22,16 @@ extern int omap3_idle_init(void);
 
 #if defined(CONFIG_PM_OPP)
 extern int omap3_opp_init(void);
+extern int omap4_opp_init(void);
 #else
 static inline int omap3_opp_init(void)
 {
        return -EINVAL;
 }
+static inline int omap4_opp_init(void)
+{
+       return -EINVAL;
+}
 #endif
 
 struct cpuidle_params {