* [PATCHv5 1/4] regulator: omap smps regulator driver
2011-08-31 15:11 [PATCHv5 0/4] omap smps regulator driver Tero Kristo
@ 2011-08-31 15:11 ` Tero Kristo
2011-09-27 20:06 ` Kevin Hilman
2011-08-31 15:11 ` [PATCHv5 2/4] omap: voltage: added mapping from voltagedomains to processor devices Tero Kristo
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Tero Kristo @ 2011-08-31 15:11 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Tony Lindgren, Todd Poynor, Mark Brown,
Liam Girdwood, Graeme Gregory
OMAP SMPS regulator driver provides access to OMAP voltage processor
controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
layer for the actual voltage regulation operations.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Todd Poynor <toddpoynor@google.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Graeme Gregory <gg@slimlogic.co.uk>
---
drivers/regulator/Kconfig | 8 ++
drivers/regulator/Makefile | 1 +
drivers/regulator/omap-smps-regulator.c | 178 +++++++++++++++++++++++++++++++
include/linux/regulator/omap-smps.h | 20 ++++
4 files changed, 207 insertions(+), 0 deletions(-)
create mode 100644 drivers/regulator/omap-smps-regulator.c
create mode 100644 include/linux/regulator/omap-smps.h
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index c7fd2c0..17c60bc 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -317,5 +317,13 @@ config REGULATOR_AAT2870
If you have a AnalogicTech AAT2870 say Y to enable the
regulator driver.
+config REGULATOR_OMAP_SMPS
+ tristate "TI OMAP SMPS Power Regulators"
+ depends on (ARCH_OMAP3 || ARCH_OMAP4) && PM
+ help
+ This driver supports the OMAP3 / OMAP4 SMPS regulators for VDD1,
+ VDD2 and VDD3. These regulators are accessed using the voltage
+ processor interface of OMAP.
+
endif
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 040d5aa..42d3405 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -45,5 +45,6 @@ obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
obj-$(CONFIG_REGULATOR_TPS65910) += tps65910-regulator.o
obj-$(CONFIG_REGULATOR_AAT2870) += aat2870-regulator.o
+obj-$(CONFIG_REGULATOR_OMAP_SMPS) += omap-smps-regulator.o
ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/omap-smps-regulator.c b/drivers/regulator/omap-smps-regulator.c
new file mode 100644
index 0000000..f07c42d
--- /dev/null
+++ b/drivers/regulator/omap-smps-regulator.c
@@ -0,0 +1,178 @@
+/*
+ * OMAP SMPS regulator driver
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *
+ * Author: Tero Kristo <t-kristo@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/ctype.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/omap-smps.h>
+#include <plat/voltage.h>
+
+#define DRIVER_NAME "omap-smps"
+
+struct omap_smps_reg_info {
+ const char *vdd_name;
+ struct regulator_dev *rdev;
+ struct voltagedomain *voltdm;
+ struct regulator_desc desc;
+};
+
+static int omap_smps_set_voltage(struct regulator_dev *rdev, int min_uV,
+ int max_uV, unsigned *selector)
+{
+ struct omap_smps_reg_info *info = rdev_get_drvdata(rdev);
+ return voltdm_scale(info->voltdm, min_uV);
+}
+
+static int omap_smps_get_voltage(struct regulator_dev *rdev)
+{
+ struct omap_smps_reg_info *info = rdev_get_drvdata(rdev);
+ return voltdm_get_voltage(info->voltdm);
+}
+
+static struct regulator_ops omap_smps_ops = {
+ .set_voltage = omap_smps_set_voltage,
+ .get_voltage = omap_smps_get_voltage,
+};
+
+#define SMPS_REG(name) { \
+ .vdd_name = #name, \
+ .desc = { \
+ .ops = &omap_smps_ops, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ }, \
+ }
+
+static struct omap_smps_reg_info omap_smps_regs[] = {
+ SMPS_REG(mpu),
+ SMPS_REG(mpu_iva),
+ SMPS_REG(iva),
+ SMPS_REG(core),
+};
+
+static void omap_smps_reg_cleanup(void)
+{
+ int i;
+ struct omap_smps_reg_info *info;
+
+ for (i = 0; i < ARRAY_SIZE(omap_smps_regs); i++) {
+ info = &omap_smps_regs[i];
+ if (info->rdev) {
+ regulator_unregister(info->rdev);
+ info->rdev = NULL;
+ }
+
+ kfree(info->desc.name);
+ info->desc.name = NULL;
+ }
+}
+
+static struct regulator_init_data dummy_initdata __devinitdata;
+
+static int __devinit omap_smps_reg_probe(struct platform_device *pdev)
+{
+ int i, j, ret;
+ struct omap_smps_reg_info *info;
+ struct omap_smps_platform_data *pdata;
+ struct regulator_dev *rdev;
+ struct regulator_init_data *initdata;
+ struct voltagedomain *voltdm;
+ char *name;
+
+ pdata = pdev->dev.platform_data;
+
+ for (i = 0; i < ARRAY_SIZE(omap_smps_regs); i++) {
+ info = &omap_smps_regs[i];
+ voltdm = voltdm_lookup(info->vdd_name);
+ initdata = &dummy_initdata;
+
+ if (!voltdm)
+ continue;
+
+ for (j = 0; j < pdata->num_regulators; j++)
+ if (voltdm == pdata->regulators[j]->driver_data) {
+ initdata = pdata->regulators[j];
+ break;
+ }
+
+ info->voltdm = voltdm;
+
+ name = kmalloc(strlen(info->vdd_name) + 5, GFP_KERNEL);
+
+ if (!name) {
+ ret = -ENOMEM;
+ goto err;
+ }
+
+ sprintf(name, "VDD_%s", info->vdd_name);
+
+ for (j = 0; j < strlen(name); j++)
+ name[j] = toupper(name[j]);
+
+ info->desc.name = name;
+
+ rdev = regulator_register(&info->desc, &pdev->dev, initdata,
+ info);
+
+ if (IS_ERR(rdev)) {
+ dev_err(&pdev->dev, "can't register %s, %ld\n",
+ info->desc.name, PTR_ERR(rdev));
+ ret = PTR_ERR(rdev);
+ goto err;
+ }
+
+ info->rdev = rdev;
+ }
+
+ return 0;
+err:
+ omap_smps_reg_cleanup();
+ return ret;
+}
+
+static int omap_smps_reg_remove(struct platform_device *pdev)
+{
+ omap_smps_reg_cleanup();
+ return 0;
+}
+
+static struct platform_driver omap_smps_reg_driver = {
+ .probe = omap_smps_reg_probe,
+ .remove = __devexit_p(omap_smps_reg_remove),
+ .driver.name = DRIVER_NAME,
+ .driver.owner = THIS_MODULE,
+};
+
+static int __init omap_smps_reg_init(void)
+{
+ return platform_driver_register(&omap_smps_reg_driver);
+}
+subsys_initcall(omap_smps_reg_init);
+
+static void __exit omap_smps_reg_exit(void)
+{
+ platform_driver_unregister(&omap_smps_reg_driver);
+}
+module_exit(omap_smps_reg_exit);
+
+MODULE_ALIAS("platform:"DRIVER_NAME);
+MODULE_AUTHOR("Tero Kristo <t-kristo@ti.com>");
+MODULE_DESCRIPTION("OMAP SMPS regulator driver");
+MODULE_LICENSE("GPL");
diff --git a/include/linux/regulator/omap-smps.h b/include/linux/regulator/omap-smps.h
new file mode 100644
index 0000000..1d5f940
--- /dev/null
+++ b/include/linux/regulator/omap-smps.h
@@ -0,0 +1,20 @@
+/*
+ * omap-smps.h - header for OMAP SMPS regulator support
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *
+ *
+ * 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.
+ */
+
+#ifndef __OMAP_SMPS_H__
+#define __OMAP_SMPS_H__
+
+struct omap_smps_platform_data {
+ struct regulator_init_data **regulators;
+ int num_regulators;
+};
+
+#endif /* End of __OMAP_SMPS_H__ */
--
1.7.4.1
Texas Instruments Oy, Tekniikantie 12, 02150 Espoo. Y-tunnus: 0115040-6. Kotipaikka: Helsinki
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCHv5 1/4] regulator: omap smps regulator driver
2011-08-31 15:11 ` [PATCHv5 1/4] regulator: " Tero Kristo
@ 2011-09-27 20:06 ` Kevin Hilman
2011-09-28 6:49 ` Tero Kristo
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Hilman @ 2011-09-27 20:06 UTC (permalink / raw)
To: Tero Kristo
Cc: linux-omap, Tony Lindgren, Todd Poynor, Mark Brown, Liam Girdwood,
Graeme Gregory
Tero Kristo <t-kristo@ti.com> writes:
> OMAP SMPS regulator driver provides access to OMAP voltage processor
> controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
> additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
> layer for the actual voltage regulation operations.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Todd Poynor <toddpoynor@google.com>
> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Cc: Liam Girdwood <lrg@ti.com>
> Cc: Graeme Gregory <gg@slimlogic.co.uk>
I believe this was already ack'd by Mark. Have there been any
significan changes since then?
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCHv5 1/4] regulator: omap smps regulator driver
2011-09-27 20:06 ` Kevin Hilman
@ 2011-09-28 6:49 ` Tero Kristo
0 siblings, 0 replies; 7+ messages in thread
From: Tero Kristo @ 2011-09-28 6:49 UTC (permalink / raw)
To: Hilman, Kevin
Cc: linux-omap, Tony Lindgren, Todd Poynor, Mark Brown,
Girdwood, Liam, Graeme Gregory
On Tue, 2011-09-27 at 22:06 +0200, Hilman, Kevin wrote:
> Tero Kristo <t-kristo@ti.com> writes:
>
> > OMAP SMPS regulator driver provides access to OMAP voltage processor
> > controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
> > additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
> > layer for the actual voltage regulation operations.
> >
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > Cc: Kevin Hilman <khilman@ti.com>
> > Cc: Tony Lindgren <tony@atomide.com>
> > Cc: Todd Poynor <toddpoynor@google.com>
> > Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> > Cc: Liam Girdwood <lrg@ti.com>
> > Cc: Graeme Gregory <gg@slimlogic.co.uk>
>
> I believe this was already ack'd by Mark. Have there been any
> significan changes since then?
Just the consumer supply naming was changed for this.
-Tero
Texas Instruments Oy, Tekniikantie 12, 02150 Espoo. Y-tunnus: 0115040-6. Kotipaikka: Helsinki
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHv5 2/4] omap: voltage: added mapping from voltagedomains to processor devices
2011-08-31 15:11 [PATCHv5 0/4] omap smps regulator driver Tero Kristo
2011-08-31 15:11 ` [PATCHv5 1/4] regulator: " Tero Kristo
@ 2011-08-31 15:11 ` Tero Kristo
2011-08-31 15:11 ` [PATCHv5 3/4] omap: smps: add smps regulator init to voltage.c Tero Kristo
2011-08-31 15:11 ` [PATCHv5 4/4] TEMP: OMAP3: beagle rev-c4: enable OPP6 Tero Kristo
3 siblings, 0 replies; 7+ messages in thread
From: Tero Kristo @ 2011-08-31 15:11 UTC (permalink / raw)
To: linux-omap
This is needed so that SMPS regulators can be properly mapped to corresponding
processor devices.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/voltage.h | 2 ++
arch/arm/mach-omap2/voltagedomains3xxx_data.c | 2 ++
arch/arm/mach-omap2/voltagedomains44xx_data.c | 3 +++
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index b4c6259..bcbf0c0 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -53,6 +53,7 @@ struct omap_vfsm_instance {
/**
* struct voltagedomain - omap voltage domain global structure.
* @name: Name of the voltage domain which can be used as a unique identifier.
+ * @proc_dev: Name of the associated processor device / hwmod.
* @scalable: Whether or not this voltage domain is scalable
* @node: list_head linking all voltage domains
* @pwrdm_node: list_head linking all powerdomains in this voltagedomain
@@ -63,6 +64,7 @@ struct omap_vfsm_instance {
*/
struct voltagedomain {
char *name;
+ char *proc_dev;
bool scalable;
struct list_head node;
struct list_head pwrdm_list;
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index b0d0ae1..28f1908 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -45,6 +45,7 @@ static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
static struct voltagedomain omap3_voltdm_mpu = {
.name = "mpu_iva",
+ .proc_dev = "mpu.0",
.scalable = true,
.read = omap3_prm_vcvp_read,
.write = omap3_prm_vcvp_write,
@@ -56,6 +57,7 @@ static struct voltagedomain omap3_voltdm_mpu = {
static struct voltagedomain omap3_voltdm_core = {
.name = "core",
+ .proc_dev = "l3_main.0",
.scalable = true,
.read = omap3_prm_vcvp_read,
.write = omap3_prm_vcvp_write,
diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c
index c4584e9..10c1d66 100644
--- a/arch/arm/mach-omap2/voltagedomains44xx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c
@@ -46,6 +46,7 @@ static const struct omap_vfsm_instance omap4_vdd_core_vfsm = {
static struct voltagedomain omap4_voltdm_mpu = {
.name = "mpu",
+ .proc_dev = "mpu.0",
.scalable = true,
.read = omap4_prm_vcvp_read,
.write = omap4_prm_vcvp_write,
@@ -57,6 +58,7 @@ static struct voltagedomain omap4_voltdm_mpu = {
static struct voltagedomain omap4_voltdm_iva = {
.name = "iva",
+ .proc_dev = "iva.0",
.scalable = true,
.read = omap4_prm_vcvp_read,
.write = omap4_prm_vcvp_write,
@@ -68,6 +70,7 @@ static struct voltagedomain omap4_voltdm_iva = {
static struct voltagedomain omap4_voltdm_core = {
.name = "core",
+ .proc_dev = "l3_main_1.0",
.scalable = true,
.read = omap4_prm_vcvp_read,
.write = omap4_prm_vcvp_write,
--
1.7.4.1
Texas Instruments Oy, Tekniikantie 12, 02150 Espoo. Y-tunnus: 0115040-6. Kotipaikka: Helsinki
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCHv5 3/4] omap: smps: add smps regulator init to voltage.c
2011-08-31 15:11 [PATCHv5 0/4] omap smps regulator driver Tero Kristo
2011-08-31 15:11 ` [PATCHv5 1/4] regulator: " Tero Kristo
2011-08-31 15:11 ` [PATCHv5 2/4] omap: voltage: added mapping from voltagedomains to processor devices Tero Kristo
@ 2011-08-31 15:11 ` Tero Kristo
2011-08-31 15:11 ` [PATCHv5 4/4] TEMP: OMAP3: beagle rev-c4: enable OPP6 Tero Kristo
3 siblings, 0 replies; 7+ messages in thread
From: Tero Kristo @ 2011-08-31 15:11 UTC (permalink / raw)
To: linux-omap
All voltagedomains that have support for vc and vp are now automatically
registered with SMPS regulator driver. Voltage.c builds a platform device
structure for this purpose during late init.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/voltage.c | 81 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 81 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index cebc8b1..30102a4 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -25,6 +25,9 @@
#include <linux/debugfs.h>
#include <linux/slab.h>
#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/omap-smps.h>
#include <plat/common.h>
@@ -238,6 +241,42 @@ void omap_change_voltscale_method(struct voltagedomain *voltdm,
}
}
+static void smps_add_regulator_info(struct platform_device *smps_dev,
+ struct voltagedomain *voltdm)
+{
+ struct omap_smps_platform_data *info;
+ struct regulator_init_data *init_data;
+ struct regulator_consumer_supply *supply;
+
+ if (!smps_dev || !voltdm)
+ return;
+
+ info = smps_dev->dev.platform_data;
+
+ init_data = kzalloc(sizeof(struct regulator_init_data), GFP_KERNEL);
+ supply = kzalloc(sizeof(struct regulator_consumer_supply), GFP_KERNEL);
+
+ if (!init_data || !supply) {
+ kfree(init_data);
+ kfree(supply);
+ return;
+ }
+ supply->supply = "vcc";
+ supply->dev_name = voltdm->proc_dev;
+ init_data->constraints.min_uV =
+ voltdm->pmic->vsel_to_uv(voltdm->pmic->vp_vddmin);
+ init_data->constraints.max_uV =
+ voltdm->pmic->vsel_to_uv(voltdm->pmic->vp_vddmax);
+ init_data->constraints.valid_modes_mask = REGULATOR_MODE_NORMAL;
+ init_data->constraints.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE;
+ init_data->num_consumer_supplies = 1;
+ init_data->consumer_supplies = supply;
+ init_data->driver_data = voltdm;
+
+ info->regulators[info->num_regulators++] = init_data;
+}
+
+
/**
* omap_voltage_late_init() - Init the various voltage parameters
*
@@ -248,6 +287,11 @@ void omap_change_voltscale_method(struct voltagedomain *voltdm,
int __init omap_voltage_late_init(void)
{
struct voltagedomain *voltdm;
+ struct platform_device *smps_dev;
+ struct omap_smps_platform_data *smps_pdata;
+ struct regulator_init_data **reg_list;
+ int num_smps = 0;
+ int ret;
if (list_empty(&voltdm_list)) {
pr_err("%s: Voltage driver support not added\n",
@@ -279,8 +323,45 @@ int __init omap_voltage_late_init(void)
voltdm->scale = omap_vp_forceupdate_scale;
omap_vp_init(voltdm);
}
+
+ if (voltdm->vc && voltdm->vp)
+ num_smps++;
}
+ if (num_smps) {
+ smps_dev = platform_device_alloc("omap-smps", -1);
+
+ if (!smps_dev)
+ return -ENOMEM;
+
+ smps_pdata = kzalloc(sizeof(struct omap_smps_platform_data),
+ GFP_KERNEL);
+ reg_list = kzalloc(sizeof(void *) * num_smps, GFP_KERNEL);
+
+ if (!smps_pdata || !reg_list) {
+ kfree(smps_pdata);
+ kfree(reg_list);
+ return -ENOMEM;
+ }
+
+ smps_pdata->regulators = reg_list;
+
+ ret = platform_device_add_data(smps_dev, smps_pdata,
+ sizeof(struct omap_smps_platform_data));
+
+ if (ret) {
+ kfree(smps_pdata);
+ kfree(reg_list);
+ platform_device_put(smps_dev);
+ return ret;
+ }
+
+ list_for_each_entry(voltdm, &voltdm_list, node)
+ if (voltdm->vp && voltdm->vc)
+ smps_add_regulator_info(smps_dev, voltdm);
+
+ platform_device_add(smps_dev);
+ }
return 0;
}
--
1.7.4.1
Texas Instruments Oy, Tekniikantie 12, 02150 Espoo. Y-tunnus: 0115040-6. Kotipaikka: Helsinki
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCHv5 4/4] TEMP: OMAP3: beagle rev-c4: enable OPP6
2011-08-31 15:11 [PATCHv5 0/4] omap smps regulator driver Tero Kristo
` (2 preceding siblings ...)
2011-08-31 15:11 ` [PATCHv5 3/4] omap: smps: add smps regulator init to voltage.c Tero Kristo
@ 2011-08-31 15:11 ` Tero Kristo
3 siblings, 0 replies; 7+ messages in thread
From: Tero Kristo @ 2011-08-31 15:11 UTC (permalink / raw)
To: linux-omap
Beagleboard rev-c4 has a speed sorted OMAP3530 chip which can run at 720MHz.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/board-omap3beagle.c | 29 +++++++++++++++++++++++++++++
arch/arm/mach-omap2/opp3xxx_data.c | 4 ++++
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 32f5f89..b07af4f 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -489,6 +489,35 @@ static void __init beagle_opp_init(void)
return;
}
+ if (omap3_beagle_version == OMAP3BEAGLE_BOARD_C4) {
+ struct device *mpu_dev, *iva_dev;
+
+ mpu_dev = omap2_get_mpuss_device();
+ iva_dev = omap2_get_iva_device();
+
+ if (!mpu_dev || !iva_dev) {
+ pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
+ __func__, mpu_dev, iva_dev);
+ return;
+ }
+ /* Enable MPU 720MHz opp */
+ r = opp_enable(mpu_dev, 720000000);
+
+ /* Enable IVA 520MHz opp */
+ r |= opp_enable(iva_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
+ */
+ opp_disable(mpu_dev, 720000000);
+ opp_disable(iva_dev, 520000000);
+ }
+ }
+
/* Custom OPP enabled for all xM versions */
if (cpu_is_omap3630()) {
struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index d95f3f9..a0f5fe1 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -98,6 +98,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
OPP_INITIALIZER("mpu", true, 550000000, OMAP3430_VDD_MPU_OPP4_UV),
/* MPU OPP5 */
OPP_INITIALIZER("mpu", true, 600000000, OMAP3430_VDD_MPU_OPP5_UV),
+ /* MPU OPP6 : omap3530 high speed grade only */
+ OPP_INITIALIZER("mpu", false, 720000000, OMAP3430_VDD_MPU_OPP5_UV),
/*
* L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is
@@ -123,6 +125,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
OPP_INITIALIZER("iva", true, 400000000, OMAP3430_VDD_MPU_OPP4_UV),
/* DSP OPP5 */
OPP_INITIALIZER("iva", true, 430000000, OMAP3430_VDD_MPU_OPP5_UV),
+ /* DSP OPP6 : omap3530 high speed grade only */
+ OPP_INITIALIZER("iva", false, 520000000, OMAP3430_VDD_MPU_OPP5_UV),
};
static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
--
1.7.4.1
Texas Instruments Oy, Tekniikantie 12, 02150 Espoo. Y-tunnus: 0115040-6. Kotipaikka: Helsinki
^ permalink raw reply related [flat|nested] 7+ messages in thread