mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Shishkin <virtuoso@slind.org>
To: "Shilimkar, Santosh" <santosh.shilimkar@ti.com>
Cc: Hari Kanigeri <hari.kanigeri@gmail.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Tony Lindgren <tony@atomide.com>,
	Russell King <linux@arm.linux.org.uk>,
	Paul Walmsley <paul@pwsan.com>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] omap3: make coresight register save across OFF modes a sysfs option
Date: Mon, 26 Jul 2010 12:04:21 +0300	[thread overview]
Message-ID: <20100726090421.GD14399@shisha.kicks-ass.net> (raw)
In-Reply-To: <EAF47CD23C76F840A9E7FCE10091EFAB02C625578A@dbde02.ent.ti.com>

On Mon, Jul 26, 2010 at 02:01:14 +0530, Shilimkar, Santosh wrote:
> 
> 
> > -----Original Message-----
> > From: Alexander Shishkin [mailto:virtuoso@slind.org]
> > Sent: Monday, July 26, 2010 1:02 PM
> > To: Shilimkar, Santosh
> > Cc: Hari Kanigeri; linux-arm-kernel@lists.infradead.org; Tony Lindgren;
> > Russell King; Paul Walmsley; Kevin Hilman; linux-omap@vger.kernel.org;
> > linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH] omap3: make coresight register save across OFF modes
> > a sysfs option
> > 
> > On Mon, Jul 26, 2010 at 12:28:38 +0530, Shilimkar, Santosh wrote:
> > > > -----Original Message-----
> > > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > > > owner@vger.kernel.org] On Behalf Of Alexander Shishkin
> > > > Sent: Monday, July 26, 2010 2:34 AM
> > > > To: Hari Kanigeri
> > > > Cc: Alexander Shishkin; linux-arm-kernel@lists.infradead.org; Tony
> > > > Lindgren; Russell King; Paul Walmsley; Kevin Hilman; linux-
> > > > omap@vger.kernel.org; linux-kernel@vger.kernel.org
> > > > Subject: [PATCH] omap3: make coresight register save across OFF modes
> > a
> > > > sysfs option
> > > >
> > > > This adds a sysfs file at /sys/power/coresight_save which is used to
> > > > control if the ETM and debug components' states should be saved and
> > > > restored across OFF modes.
> > > >
> > > > Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
> > > > Cc: Tony Lindgren <tony@atomide.com>
> > > > Cc: Russell King <linux@arm.linux.org.uk>
> > > > Cc: Paul Walmsley <paul@pwsan.com>
> > > > Cc: Kevin Hilman <khilman@deeprootsystems.com>
> > > > Cc: linux-omap@vger.kernel.org
> > > > Cc: linux-arm-kernel@lists.infradead.org
> > > > Cc: linux-kernel@vger.kernel.org
> > > > ---
> > > >  arch/arm/mach-omap2/Makefile    |    1 +
> > > >  arch/arm/mach-omap2/debug34xx.c |   66
> > > > +++++++++++++++++++++++++++++++++++++++
> > > >  arch/arm/mach-omap2/pm.h        |    6 +++
> > > >  arch/arm/mach-omap2/pm34xx.c    |    3 ++
> > > >  4 files changed, 76 insertions(+), 0 deletions(-)
> > > >  create mode 100644 arch/arm/mach-omap2/debug34xx.c
> > > >
> > > > diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-
> > omap2/Makefile
> > > > index f5b4ff4..3a64ce4 100644
> > > > --- a/arch/arm/mach-omap2/Makefile
> > > > +++ b/arch/arm/mach-omap2/Makefile
> > > > @@ -49,6 +49,7 @@ ifeq ($(CONFIG_PM),y)
> > > >  obj-$(CONFIG_ARCH_OMAP2)		+= pm24xx.o
> > > >  obj-$(CONFIG_ARCH_OMAP2)		+= sleep24xx.o
> > > >  obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o
> > > > +obj-$(CONFIG_ENABLE_OFF_MODE_JTAG_ETM_DEBUG) += debug34xx.o
> > > >  obj-$(CONFIG_PM_DEBUG)			+= pm-debug.o
> > > >
> > > >  AFLAGS_sleep24xx.o			:=-Wa,-march=armv6
> > > > diff --git a/arch/arm/mach-omap2/debug34xx.c b/arch/arm/mach-
> > > > omap2/debug34xx.c
> > > > new file mode 100644
> > > > index 0000000..698e83a
> > > > --- /dev/null
> > > > +++ b/arch/arm/mach-omap2/debug34xx.c
> > >
> > > > @@ -0,0 +1,66 @@
> > > > +/*
> > > > + * Control saving and restoring of coresight components' state during
> > > > + * OFF mode.
> > > > + *
> > > > + * Copyright (C) 2010 Nokia Corporation
> > > > + * Alexander Shishkin
> > > > + *
> > > > + * 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/sysfs.h>
> > > > +#include <linux/kobject.h>
> > > > +
> > > > +#include "pm.h"
> > > > +
> > > > +/*
> > > > + * Pointer to a place in sram where the ETM/debug state save
> > > > + * flag is. It can be calculated after the omap_sram_idle is
> > > > + * pushed to sram.
> > > > + */
> > > > +static unsigned int *_etm_save;
> > > > +
> > > > +/*
> > > > + * sysfs file /sys/power/coresight_save controls whether the
> > > > + * state of coresight components should be saved and restored
> > > > + * across OFF modes.
> > > > + */
> > > > +static ssize_t coresight_save_show(struct kobject *kobj,
> > > > +				  struct kobj_attribute *attr,
> > > > +				  char *buf)
> > > > +{
> > > > +	return sprintf(buf, "%u\n", *_etm_save);
> > > > +}
> > > > +
> > > > +static ssize_t coresight_save_store(struct kobject *kobj,
> > > > +				   struct kobj_attribute *attr,
> > > > +				   const char *buf, size_t n)
> > > > +{
> > > > +	unsigned int value;
> > > > +
> > > > +	if (sscanf(buf, "%u", &value) != 1)
> > > > +		return -EINVAL;
> > > > +
> > > > +	*_etm_save = !!value;
> > > > +
> > > > +	return n;
> > > > +}
> > > > +
> > > > +static struct kobj_attribute coresight_save_attr =
> > > > +	__ATTR(coresight_save, 0644, coresight_save_show,
> > > > coresight_save_store);
> > > > +
> > > > +int omap3_coresight_pm_init(void *sram_addr)
> > > > +{
> > > > +	int ret;
> > > > +
> > > > +	/* the last word from the top of omap_sram_idle */
> > > > +	_etm_save = (unsigned *)((u8 *)sram_addr + omap34xx_cpu_suspend_sz -
> > > > 4);
> > > > +
> > > > +	ret = sysfs_create_file(power_kobj, &coresight_save_attr.attr);
> > > > +
> > > > +	return ret;
> > > > +}
> > >
> > > Looking at content of this file, I think you can keep this under common
> > > pm-debug.c file.
> > > Any problems with that ?
> > 
> > I was trying to avoid #ifdeffing too much and I didn't want this code to
> > compile at all when CONFIG_ENABLE_OFF_MODE_JTAG_ETM_DEBUG is not set.
> > Otherwise, no problems.
> > 
> Ok. 

But feel free to ack, all the same. :)

Regards,
--
Alex

  reply	other threads:[~2010-07-26  9:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <13B9B4C6EF24D648824FF11BE896716203BADA0745@dlee02.ent.ti.com>
2010-07-25 17:05 ` [PATCH 1/7] coresight: move struct tracectx inside etm driver Alexander Shishkin
2010-07-25 17:05 ` [PATCH 2/7] coresight: add ETM management registers Alexander Shishkin
2010-07-25 17:05 ` [PATCH 3/7] coresight: cosmetic fixes Alexander Shishkin
2010-07-25 17:05 ` [PATCH 4/7] etm: do a dummy read from OSSRR during initialization Alexander Shishkin
2010-07-25 17:05 ` [PATCH 5/7] omap3: move EMU peripheral addresses to a platform header Alexander Shishkin
2010-07-26  7:03   ` Shilimkar, Santosh
2010-07-25 17:05 ` [PATCH 6/7] save and restore etm state across core OFF modes Alexander Shishkin
2010-07-25 18:34   ` Hari Kanigeri
2010-07-25 19:38     ` Alexander Shishkin
2010-07-25 21:04     ` [PATCH] omap3: make coresight register save across OFF modes a sysfs option Alexander Shishkin
2010-07-25 21:14       ` Alexander Shishkin
2010-07-26  6:58       ` Shilimkar, Santosh
2010-07-26  7:32         ` Alexander Shishkin
2010-07-26  8:31           ` Shilimkar, Santosh
2010-07-26  9:04             ` Alexander Shishkin [this message]
2010-07-25 21:15     ` [PATCH] save and restore etm state across core OFF modes Alexander Shishkin
2010-07-30 12:16   ` [PATCH 6/7] " Alexander Shishkin
2010-07-25 17:05 ` [PATCH 7/7] omap3: make coresight register save across OFF modes a sysfs option Alexander Shishkin
2010-08-06 12:37   ` Alexander Shishkin
2010-08-06 12:47     ` Tony Lindgren
2010-09-04  8:57       ` Cousson, Benoit
2010-09-23 17:52         ` Tony Lindgren
2010-08-26  9:14 ` [PATCH 1/3] omap3: move EMU peripheral addresses to a platform header Alexander Shishkin
2010-08-26  9:14 ` [PATCH 2/3] save and restore etm state across core OFF modes Alexander Shishkin
2010-08-26  9:14 ` [PATCH 3/3] omap3: make coresight register save across OFF modes a sysfs option Alexander Shishkin

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=20100726090421.GD14399@shisha.kicks-ass.net \
    --to=virtuoso@slind.org \
    --cc=hari.kanigeri@gmail.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=paul@pwsan.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=tony@atomide.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

all inboxes | Powered by JetHome®