public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH v4 2/9] OMAP3: PM: Adding smartreflex driver support.
@ 2010-10-28  5:39 Varadarajan, Charulatha
  2010-10-28 15:27 ` Gopinath, Thara
  0 siblings, 1 reply; 7+ messages in thread
From: Varadarajan, Charulatha @ 2010-10-28  5:39 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org
  Cc: paul@pwsan.com, khilman@deeprootsystems.com, Cousson, Benoit,
	Sripathy, Vishwanath, Sawant, Anand, Gopinath, Thara

 
Thara,

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Thara Gopinath
> Sent: Wednesday, October 27, 2010 9:41 PM
> To: linux-omap@vger.kernel.org
> Cc: paul@pwsan.com; khilman@deeprootsystems.com; Cousson, 
> Benoit; Sripathy, Vishwanath; Sawant, Anand; Gopinath, Thara
> Subject: [PATCH v4 2/9] OMAP3: PM: Adding smartreflex driver support.
> 
> SmartReflex modules do adaptive voltage control for real-time
> voltage adjustments. With Smartreflex the power supply voltage
> can be adapted to the silicon performance(manufacturing process,
> temperature induced performance, age induced performance etc).
> 
> There are differnet classes of smartreflex implementation.
> 	Class-0: Manufacturing Test Calibration
> 	Class-1: Boot-Time Software Calibration
> 	Class-2: Continuous Software Calibration
> 	Class-3: Continuous Hardware Calibration
> 	Class-4: Fully Integrated Power Management
> 
> OMAP3 has two smartreflex modules one associated with VDD MPU and the
> other associated with VDD CORE.
> This patch adds support for  smartreflex driver. The driver 
> is designed
> for Class-1 , Class-2 and Class-3 support and is  a platform driver.
> Smartreflex driver can be enabled through a Kconfig option
> "SmartReflex support" under "System type"->"TI OMAP 
> implementations" menu.
> 
> Smartreflex autocompensation feature can be enabled runtime through
> a debug fs option.
> To enable smartreflex autocompensation feature
> 	echo 1 > /debug/voltage/vdd_<X>/smartreflex/autocomp
> To disable smartreflex autocompensation feature
> 	echo 0 > /debug/voltage/vdd_<X>/smartreflex/autocomp
> 
> where X can be mpu, core , iva etc.
> 
> This patch contains code originally in linux omap pm branch.
> Major contributors to this driver are
> Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley,
> Nishant Menon, Kevin Hilman.
> 
> Signed-off-by: Thara Gopinath <thara@ti.com>
> ---
>  arch/arm/mach-omap2/Makefile                  |    1 +
>  arch/arm/mach-omap2/smartreflex.c             |  975 
> +++++++++++++++++++++++++
>  arch/arm/plat-omap/Kconfig                    |   36 +
>  arch/arm/plat-omap/include/plat/smartreflex.h |  271 +++++++
>  4 files changed, 1283 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/smartreflex.c
>  create mode 100644 arch/arm/plat-omap/include/plat/smartreflex.h
> 

<<snip>>

> +static int __init omap_sr_probe(struct platform_device *pdev)
> +{
> +	struct omap_sr *sr_info = kzalloc(sizeof(struct 
> omap_sr), GFP_KERNEL);
> +	struct omap_device *odev = to_omap_device(pdev);

Patch3 should be ordered before patch2 in your series. Otherwise,
this would fail during a git-bisect.

> +	struct omap_sr_data *pdata = pdev->dev.platform_data;
> +	struct resource *mem, *irq;
> +	struct dentry *vdd_dbg_dir, *dbg_dir;
> +	int ret = 0;
> +
> +	if (!sr_info) {
> +		dev_err(&pdev->dev, "%s: unable to allocate sr_info\n",
> +			__func__);
> +		return -ENOMEM;
> +	}
> +
> +	if (!pdata) {
> +		dev_err(&pdev->dev, "%s: platform data 
> missing\n", __func__);
> +		return -EINVAL;
> +	}
> +
> +	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!mem) {
> +		dev_err(&pdev->dev, "%s: no mem resource\n", __func__);
> +		ret = -ENODEV;
> +		goto err_free_devinfo;
> +	}
> +
> +	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> +
> +	pm_runtime_enable(&pdev->dev);
> +
> +	sr_info->pdev = pdev;
> +	sr_info->srid = pdev->id;
> +	sr_info->voltdm = pdata->voltdm;
> +	sr_info->autocomp_active = false;
> +	sr_info->ip_type = odev->hwmods[0]->class->rev;

I am not sure if it is okay to get hwmods-info in the driver.
To avoid too many indirections, it can be obtained before
omap_device_build() of the device and passed to the driver.

> +	sr_info->base = ioremap(mem->start, resource_size(mem));
> +	if (!sr_info->base) {
> +		dev_err(&pdev->dev, "%s: ioremap fail\n", __func__);
> +		ret = -ENOMEM;
> +		goto err_release_region;
> +	}

<<snip>>

-V Charulatha

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH v4 0/9] OMAP3: Adding Smartreflex and Voltage driver support
@ 2010-10-27 16:10 Thara Gopinath
  2010-10-27 16:10 ` [PATCH v4 2/9] OMAP3: PM: Adding smartreflex " Thara Gopinath
  0 siblings, 1 reply; 7+ messages in thread
From: Thara Gopinath @ 2010-10-27 16:10 UTC (permalink / raw)
  To: linux-omap
  Cc: paul, khilman, b-cousson, vishwanath.bs, sawant, Thara Gopinath

This patch series introduces smartreflex and voltage driver support
for OMAP3430 and OMAP3630. SmartReflex modules do adaptive voltage
control for real-time voltage adjustments.

Originally all the functionalities introduced in this patch
were present in arch/arm/mach-omap2/smartreflex.c file in Kevin's
pm tree. This patch series does a major rewrite of this file
and introduces a separate voltage driver. Major contributors
to the original driver are

Eduardo Valentin (1):
      OMAP3: PM: SmartReflex: Fix scheduled while atomic problem

Kalle Jokiniemi (1):
      OMAP3: PM: SmartReflex driver integration

Kevin Hilman (2):
      temp: SR: IO_ADDRESS conversion
      OMAP: SR: OPP interfaces removed from OMAP PM layer

Nishanth Menon (1):
      omap3: pm: sr: replace get_opp with freq_to_opp

Paul Walmsley (2):
      OMAP SR: use opp_find_opp_by_opp_id()
      OMAP SR: use OPP API for OPP ID, remove direct access

Phil Carmody (2):
      OMAP3: PM: Don't do unnecessary searches in omap_sr_vdd*_autocomp_store
      OMAP3: PM: Early exit on invalid parameters

Rajendra Nayak (9):
      OMAP3: SR: Fix init voltage on OPP change
      OMAP3: SR: Update VDD1/2 voltages at boot
      OMAP3: SR: Use sysclk for SR CLKLENGTH calc
      OMAP3: SR: Reset voltage level on SR disable
      OMAP3: SR: Replace printk's with pr_* calls
      OMAP3: SR: Remove redundant defines
      OMAP3: SR: Fix SR driver to check for omap-pm return values
      OMAP3: PM: Put optimal SMPS stabilization delay
      OMAP3: SR: Wait for VP idle before a VP disable

Roger Quadros (4):
      OMAP3: PM: Fix Smartreflex when used with PM_NOOP layer
      OMAP3: PM: Make Smartreflex driver independent of SRF
      OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined
      OMAP3: PM: Smartreflex: Fix VDD2 OPP determining logic

Romit Dasgupta (1):
      omap: pm: SR: use enum for OPP types

Teerth Reddy (1):
      OMAP3: SR: Replace SR_PASS/FAIL,SR_TRUE/FALSE

Tero Kristo (1):
      Smartreflex: Avoid unnecessary spam

This patch series is based against lo-master with the following additional
patches applied.
	https://patchwork.kernel.org/patch/266911/
	https://patchwork.kernel.org/patch/266921/
	https://patchwork.kernel.org/patch/266931/
	https://patchwork.kernel.org/patch/183712/
	https://patchwork.kernel.org/patch/285872/

The entire series with the dependencies are available at
        http://dev.omapzoom.org/?p=thara/omap-dvfs.git;a=summary
        head: thara-pm-sr

This patch series has been tested on OMAP3430 SDP with omap2plus_defconfig
with the following menuconfig options enabled.
System type -> TI OMAP Implementations -> Smartreflex Support
System type -> TI OMAP Implementations ->
		Class 3 mode of Smartreflex Implementation

Thara Gopinath (9):
  OMAP3: PM: Adding voltage driver support for OMAP3
  OMAP3: PM: Adding smartreflex driver support.
  OMAP3: PM: Adding smartreflex device file.
  OMAP3: PM: Adding smartreflex hwmod data
  OMAP3: PM: Adding smartreflex class3 driver
  OMAP3: PM: Adding T2 enabling of smartreflex support
  OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers
  OMAP3: PM: Program correct init voltages for VDD1 and VDD2
  OMAP3: PM: Register TWL4030 pmic info with the voltage driver.

 arch/arm/mach-omap2/Makefile                  |    5 +-
 arch/arm/mach-omap2/control.h                 |   27 +
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c    |  249 +++++
 arch/arm/mach-omap2/pm.c                      |   68 ++
 arch/arm/mach-omap2/smartreflex-class3.c      |   59 ++
 arch/arm/mach-omap2/smartreflex.c             | 1005 ++++++++++++++++++
 arch/arm/mach-omap2/sr_device.c               |  177 ++++
 arch/arm/mach-omap2/voltage.c                 | 1369 +++++++++++++++++++++++++
 arch/arm/plat-omap/Kconfig                    |   45 +
 arch/arm/plat-omap/include/plat/smartreflex.h |  271 +++++
 arch/arm/plat-omap/include/plat/voltage.h     |  142 +++
 arch/arm/plat-omap/opp_twl_tps.c              |   17 +
 drivers/mfd/twl-core.c                        |    7 +-
 drivers/mfd/twl4030-power.c                   |   29 +
 include/linux/i2c/twl.h                       |    1 +
 15 files changed, 3468 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-omap2/smartreflex-class3.c
 create mode 100644 arch/arm/mach-omap2/smartreflex.c
 create mode 100644 arch/arm/mach-omap2/sr_device.c
 create mode 100644 arch/arm/mach-omap2/voltage.c
 create mode 100644 arch/arm/plat-omap/include/plat/smartreflex.h
 create mode 100644 arch/arm/plat-omap/include/plat/voltage.h


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-02 11:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28  5:39 [PATCH v4 2/9] OMAP3: PM: Adding smartreflex driver support Varadarajan, Charulatha
2010-10-28 15:27 ` Gopinath, Thara
2010-10-29  4:53   ` Varadarajan, Charulatha
2010-10-29  4:55     ` Gopinath, Thara
2010-10-29  5:00       ` Varadarajan, Charulatha
2010-11-02 11:50   ` Cousson, Benoit
  -- strict thread matches above, loose matches on Subject: below --
2010-10-27 16:10 [PATCH v4 0/9] OMAP3: Adding Smartreflex and Voltage " Thara Gopinath
2010-10-27 16:10 ` [PATCH v4 2/9] OMAP3: PM: Adding smartreflex " Thara Gopinath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox