2011-03-11 06:17:45 +01:00
|
|
|
/*
|
|
|
|
* OMAP3 voltage domain data
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007, 2010 Texas Instruments, Inc.
|
|
|
|
* Rajendra Nayak <rnayak@ti.com>
|
|
|
|
* Lesly A M <x0080970@ti.com>
|
|
|
|
* Thara Gopinath <thara@ti.com>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008, 2011 Nokia Corporation
|
|
|
|
* Kalle Jokiniemi
|
|
|
|
* Paul Walmsley
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/err.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
|
2012-08-31 19:59:07 +02:00
|
|
|
#include "soc.h"
|
2011-11-10 22:45:17 +01:00
|
|
|
#include "common.h"
|
2011-03-11 06:17:45 +01:00
|
|
|
#include "prm-regbits-34xx.h"
|
|
|
|
#include "omap_opp_data.h"
|
|
|
|
#include "voltage.h"
|
|
|
|
#include "vc.h"
|
|
|
|
#include "vp.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* VDD data
|
|
|
|
*/
|
|
|
|
|
2011-12-17 01:09:11 +01:00
|
|
|
/* OMAP3-common voltagedomain data */
|
|
|
|
|
|
|
|
static struct voltagedomain omap3_voltdm_wkup = {
|
|
|
|
.name = "wakeup",
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 34xx/36xx voltagedomain data */
|
|
|
|
|
2011-03-29 23:36:04 +02:00
|
|
|
static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
|
2011-03-11 06:17:45 +01:00
|
|
|
.voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
|
|
|
|
.voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
|
|
|
|
};
|
|
|
|
|
2011-03-29 23:36:04 +02:00
|
|
|
static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
|
2011-03-11 06:17:45 +01:00
|
|
|
.voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
|
|
|
|
.voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
|
|
|
|
};
|
|
|
|
|
2011-03-16 22:25:45 +01:00
|
|
|
static struct voltagedomain omap3_voltdm_mpu = {
|
2011-03-23 19:18:08 +01:00
|
|
|
.name = "mpu_iva",
|
2011-03-24 01:00:21 +01:00
|
|
|
.scalable = true,
|
2011-03-28 19:40:15 +02:00
|
|
|
.read = omap3_prm_vcvp_read,
|
|
|
|
.write = omap3_prm_vcvp_write,
|
|
|
|
.rmw = omap3_prm_vcvp_rmw,
|
2011-03-23 00:14:57 +01:00
|
|
|
.vc = &omap3_vc_mpu,
|
2011-03-29 23:36:04 +02:00
|
|
|
.vfsm = &omap3_vdd1_vfsm,
|
2011-04-05 00:25:07 +02:00
|
|
|
.vp = &omap3_vp_mpu,
|
2011-03-11 06:17:45 +01:00
|
|
|
};
|
|
|
|
|
2011-03-16 22:25:45 +01:00
|
|
|
static struct voltagedomain omap3_voltdm_core = {
|
|
|
|
.name = "core",
|
2011-03-24 01:00:21 +01:00
|
|
|
.scalable = true,
|
2011-03-28 19:40:15 +02:00
|
|
|
.read = omap3_prm_vcvp_read,
|
|
|
|
.write = omap3_prm_vcvp_write,
|
|
|
|
.rmw = omap3_prm_vcvp_rmw,
|
2011-03-23 00:14:57 +01:00
|
|
|
.vc = &omap3_vc_core,
|
2011-03-29 23:36:04 +02:00
|
|
|
.vfsm = &omap3_vdd2_vfsm,
|
2011-04-05 00:25:07 +02:00
|
|
|
.vp = &omap3_vp_core,
|
2011-03-16 22:25:45 +01:00
|
|
|
};
|
2011-03-11 06:17:45 +01:00
|
|
|
|
2011-03-16 22:25:45 +01:00
|
|
|
static struct voltagedomain *voltagedomains_omap3[] __initdata = {
|
|
|
|
&omap3_voltdm_mpu,
|
|
|
|
&omap3_voltdm_core,
|
2011-03-23 21:30:33 +01:00
|
|
|
&omap3_voltdm_wkup,
|
2011-03-16 22:25:45 +01:00
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
2011-12-17 01:09:11 +01:00
|
|
|
/* AM35xx voltagedomain data */
|
|
|
|
|
|
|
|
static struct voltagedomain am35xx_voltdm_mpu = {
|
|
|
|
.name = "mpu_iva",
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct voltagedomain am35xx_voltdm_core = {
|
|
|
|
.name = "core",
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct voltagedomain *voltagedomains_am35xx[] __initdata = {
|
|
|
|
&am35xx_voltdm_mpu,
|
|
|
|
&am35xx_voltdm_core,
|
|
|
|
&omap3_voltdm_wkup,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-04-05 02:22:28 +02:00
|
|
|
static const char *sys_clk_name __initdata = "sys_ck";
|
|
|
|
|
2011-03-16 22:25:45 +01:00
|
|
|
void __init omap3xxx_voltagedomains_init(void)
|
|
|
|
{
|
2011-04-05 02:22:28 +02:00
|
|
|
struct voltagedomain *voltdm;
|
2011-12-17 01:09:11 +01:00
|
|
|
struct voltagedomain **voltdms;
|
2011-04-05 02:22:28 +02:00
|
|
|
int i;
|
|
|
|
|
2011-03-11 06:17:45 +01:00
|
|
|
/*
|
|
|
|
* XXX Will depend on the process, validation, and binning
|
|
|
|
* for the currently-running IC
|
|
|
|
*/
|
2012-02-15 12:28:06 +01:00
|
|
|
#ifdef CONFIG_PM_OPP
|
2011-03-11 06:17:45 +01:00
|
|
|
if (cpu_is_omap3630()) {
|
2011-07-14 20:29:06 +02:00
|
|
|
omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data;
|
|
|
|
omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data;
|
2011-03-11 06:17:45 +01:00
|
|
|
} else {
|
2011-07-14 20:29:06 +02:00
|
|
|
omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data;
|
|
|
|
omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;
|
2011-03-11 06:17:45 +01:00
|
|
|
}
|
2012-02-15 12:28:06 +01:00
|
|
|
#endif
|
2011-03-11 06:17:45 +01:00
|
|
|
|
2012-05-01 01:37:10 +02:00
|
|
|
if (soc_is_am35xx())
|
2011-12-17 01:09:11 +01:00
|
|
|
voltdms = voltagedomains_am35xx;
|
|
|
|
else
|
|
|
|
voltdms = voltagedomains_omap3;
|
|
|
|
|
|
|
|
for (i = 0; voltdm = voltdms[i], voltdm; i++)
|
2011-04-05 02:22:28 +02:00
|
|
|
voltdm->sys_clk.name = sys_clk_name;
|
|
|
|
|
2011-12-17 01:09:11 +01:00
|
|
|
voltdm_init(voltdms);
|
2011-03-11 06:17:45 +01:00
|
|
|
};
|