public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Thara Gopinath <thara@ti.com>
To: linux-omap@vger.kernel.org
Cc: khilman@deeprootsystems.com, paul@pwsan.com,
	vishwanath.bs@ti.com, sawant@ti.com, b-cousson@ti.com,
	Thara Gopinath <thara@ti.com>
Subject: [PATCH 10/10] OMAP4: Add opp tables.
Date: Wed, 18 Aug 2010 16:46:31 +0530	[thread overview]
Message-ID: <1282130191-9062-11-git-send-email-thara@ti.com> (raw)
In-Reply-To: <1282130191-9062-1-git-send-email-thara@ti.com>

This patch adds OPP tables for OMAP4. A new file
opp44xx.c has been added to keep the OMAP4 opp tables
and the registeration of these tables with the generic
opp framework.

Signed-off-by: Thara Gopinath <thara@ti.com>
---
 arch/arm/mach-omap2/Makefile       |    2 +-
 arch/arm/mach-omap2/opp44xx.h      |   26 ++++++++++++
 arch/arm/mach-omap2/opp44xx_data.c |   80 ++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/pm.c           |    6 ++-
 4 files changed, 112 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/opp44xx.h
 create mode 100644 arch/arm/mach-omap2/opp44xx_data.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index d46fbec..ebe3f36 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -51,7 +51,7 @@ obj-$(CONFIG_ARCH_OMAP2)		+= pm24xx.o
 obj-$(CONFIG_ARCH_OMAP2)		+= sleep24xx.o
 obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o voltage.o \
 					   cpuidle34xx.o
-obj-$(CONFIG_ARCH_OMAP4)		+= pm44xx.o voltage.o
+obj-$(CONFIG_ARCH_OMAP4)		+= pm44xx.o voltage.o opp44xx_data.o
 obj-$(CONFIG_PM_DEBUG)			+= pm-debug.o
 obj-$(CONFIG_OMAP_SMARTREFLEX)          += sr_device.o smartreflex.o
 obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3)	+= smartreflex-class3.o
diff --git a/arch/arm/mach-omap2/opp44xx.h b/arch/arm/mach-omap2/opp44xx.h
new file mode 100644
index 0000000..2cae9f3
--- /dev/null
+++ b/arch/arm/mach-omap2/opp44xx.h
@@ -0,0 +1,26 @@
+/*
+ * OMAP4 OPP API's.
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated.
+ *	Thara Gopinath
+ *
+ * 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 PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * History:
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_OPP44XX_H
+#define __ARCH_ARM_MACH_OMAP2_OPP44XX_H
+
+#ifdef CONFIG_PM
+extern int omap4_pm_init_opp_table(void);
+#else
+static inline int omap4_pm_init_opp_table(void) { return -EINVAL; }
+#endif
+
+#endif
diff --git a/arch/arm/mach-omap2/opp44xx_data.c b/arch/arm/mach-omap2/opp44xx_data.c
new file mode 100644
index 0000000..b5c9680
--- /dev/null
+++ b/arch/arm/mach-omap2/opp44xx_data.c
@@ -0,0 +1,80 @@
+/*
+ * OMAP4 OPP table definitions.
+ *
+ * Copyright (C) 2009 - 2010 Texas Instruments Incorporated.
+ *	Nishanth Menon
+ * Copyright (C) 2009 - 2010 Deep Root Systems, LLC.
+ *	Kevin Hilman
+ * Copyright (C) 2010 Nokia Corporation.
+ *      Eduardo Valentin
+ * Copyright (C) 2010 Texas Instruments Incorporated.
+ *	Thara Gopinath
+ *
+ * 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 PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * History:
+ */
+
+#include <linux/module.h>
+#include <linux/err.h>
+
+#include <plat/opp.h>
+#include <plat/cpu.h>
+
+#include "opp44xx.h"
+
+static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
+	/* MPU OPP1 - OPP50 */
+	OMAP_OPP_DEF("mpu", true, 300000000, 930000),
+	/* MPU OPP2 - OPP100 */
+	OMAP_OPP_DEF("mpu", true, 600000000, 1100000),
+	/* MPU OPP3 - OPP-Turbo */
+	OMAP_OPP_DEF("mpu", true, 800000000, 1260000),
+	/* MPU OPP4 - OPP-SB */
+	OMAP_OPP_DEF("mpu", true, 1008000000, 1350000),
+	/* IVA OPP1 - OPP50 */
+	OMAP_OPP_DEF("iva", true,  133000000, 930000),
+	/* IVA OPP2 - OPP100 */
+	OMAP_OPP_DEF("iva", true,  266000000, 1100000),
+	/* IVA OPP3 - OPP-Turbo */
+	OMAP_OPP_DEF("iva", false, 332000000, 1260000),
+	/* L3 OPP1 - OPP50 */
+	OMAP_OPP_DEF("l3_main_1", true, 100000000, 930000),
+	/* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
+	OMAP_OPP_DEF("l3_main_1", true, 200000000, 1100000),
+};
+
+static u32 omap44xx_opp_def_size = ARRAY_SIZE(omap44xx_opp_def_list);
+
+/* Temp variable to allow multiple calls */
+static u8 __initdata omap4_table_init;
+
+
+int __init omap4_pm_init_opp_table(void)
+{
+	struct omap_opp_def *opp_def;
+	int i, r;
+
+	/*
+	 * Allow multiple calls, but initialize only if not already initalized
+	 * even if the previous call failed, coz, no reason we'd succeed again
+	 */
+	if (omap4_table_init)
+		return 0;
+	omap4_table_init = 1;
+
+	opp_def = omap44xx_opp_def_list;
+
+	for (i = 0; i < omap44xx_opp_def_size; i++) {
+		r = opp_add(opp_def++);
+		if (r)
+			pr_err("unable to add OPP %ld Hz for %s\n",
+				opp_def->freq, opp_def->hwmod_name);
+	}
+	return 0;
+}
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 740e506..6707a2e 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -19,6 +19,7 @@
 #include <plat/common.h>
 
 #include "omap3-opp.h"
+#include "opp44xx.h"
 
 static struct omap_device_pm_latency *pm_lats;
 
@@ -90,7 +91,10 @@ static void omap2_init_processor_devices(void)
 static int __init omap2_common_pm_init(void)
 {
 	omap2_init_processor_devices();
-	omap3_pm_init_opp_table();
+	if (cpu_is_omap34xx())
+		omap3_pm_init_opp_table();
+	else if (cpu_is_omap44xx())
+		omap4_pm_init_opp_table();
 
 	omap_pm_if_init();
 
-- 
1.7.1.GIT


  parent reply	other threads:[~2010-08-18 11:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 11:16 [PATCH 00/10] OMAP4: Smartreflex and Voltage layer support Thara Gopinath
2010-08-18 11:16 ` [PATCH 01/10] OMAP4: PM debugfs support Thara Gopinath
2010-08-18 11:16 ` [PATCH 02/10] OMAP4: OPP framework support Thara Gopinath
2010-08-18 11:16 ` [PATCH 03/10] OMAP4: Add the new voltage to vsel calculation formula Thara Gopinath
2010-08-18 11:16 ` [PATCH 04/10] OMAP4: Extend clock data Thara Gopinath
2010-08-18 11:16 ` [PATCH 05/10] OMAP4: Adding voltage driver support Thara Gopinath
2010-08-25 23:08   ` Kevin Hilman
2010-08-18 11:16 ` [PATCH 06/10] OMAP4: hwmod: Add inital data for smartreflex modules Thara Gopinath
2010-08-18 11:16 ` [PATCH 07/10] OMAP4: Adding dev atrributes to OMAP4 smartreflex hwmod data Thara Gopinath
2010-08-18 11:16 ` [PATCH 08/10] OMAP4: Smartreflex framework extensions Thara Gopinath
2010-08-25 23:12   ` Kevin Hilman
2010-08-26  5:12     ` Shilimkar, Santosh
2010-08-18 11:16 ` [PATCH 09/10] OMAP4: Enabling smartrefles class 3 driver Thara Gopinath
2010-08-18 11:16 ` Thara Gopinath [this message]
2010-08-25 23:15   ` [PATCH 10/10] OMAP4: Add opp tables Kevin Hilman
2010-08-25 23:24     ` Kevin Hilman
2010-08-25 22:58 ` [PATCH 00/10] OMAP4: Smartreflex and Voltage layer support Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282130191-9062-11-git-send-email-thara@ti.com \
    --to=thara@ti.com \
    --cc=b-cousson@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=sawant@ti.com \
    --cc=vishwanath.bs@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox