public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Kukjin Kim <kgene.kim@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Russell King <linux@arm.linux.org.uk>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Sachin Kamat <sachin.kamat@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	linux-pm@vger.kernel.org,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	linux-kernel@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	linux-tegra@vger.kernel.org, linaro-kernel@lists.linaro.org,
	linux-arm-kernel@lists.infradead.org,
	Thierry Reding <treding@nvidia.com>
Subject: Re: [PATCH v7 2/5] ARM: add AFTR mode support to firmware do_idle method
Date: Thu, 25 Sep 2014 11:03:11 +0200	[thread overview]
Message-ID: <20140925090310.GA12046@ulmo> (raw)
In-Reply-To: <5423D104.4050809@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 3904 bytes --]

On Thu, Sep 25, 2014 at 05:23:32PM +0900, Kukjin Kim wrote:
> On 09/24/14 21:24, Bartlomiej Zolnierkiewicz wrote:
> >On some platforms (i.e. EXYNOS ones) more than one idle mode is
> >available and we need to distinguish them in firmware do_idle method.
> >
> >Add mode parameter to do_idle firmware method and AFTR mode support
> >to EXYNOS do_idle implementation.
> >
> >This change is a preparation for adding secure firmware support to
> >EXYNOS cpuidle driver.
> >
> >This patch shouldn't cause any functionality changes.
> >
> >Signed-off-by: Bartlomiej Zolnierkiewicz<b.zolnierkie@samsung.com>
> >Acked-by: Kyungmin Park<kyungmin.park@samsung.com>
> >---
> >v7:
> >- fixed build on Tegra
> >- updated summary line
> >
> >  arch/arm/include/asm/firmware.h        |  2 +-
> >  arch/arm/mach-exynos/common.h          |  5 +++++
> >  arch/arm/mach-exynos/firmware.c        | 10 ++++++++--
> >  arch/arm/mach-tegra/cpuidle-tegra114.c |  2 +-
> >  4 files changed, 15 insertions(+), 4 deletions(-)
> >
> >diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
> >index 5904f59..89aefe1 100644
> >--- a/arch/arm/include/asm/firmware.h
> >+++ b/arch/arm/include/asm/firmware.h
> >@@ -28,7 +28,7 @@ struct firmware_ops {
> >  	/*
> >  	 * Enters CPU idle mode
> >  	 */
> >-	int (*do_idle)(void);
> >+	int (*do_idle)(unsigned long mode);
> >  	/*
> >  	 * Sets boot address of specified physical CPU
> >  	 */
> >diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
> >index c218200..2d830df 100644
> >--- a/arch/arm/mach-exynos/common.h
> >+++ b/arch/arm/mach-exynos/common.h
> >@@ -119,6 +119,11 @@ extern void __iomem *sysram_base_addr;
> >  extern void __iomem *pmu_base_addr;
> >  void exynos_sysram_init(void);
> >
> >+enum {
> >+	FW_DO_IDLE_SLEEP,
> >+	FW_DO_IDLE_AFTR,
> >+};
> >+
> >  void exynos_firmware_init(void);
> >
> >  extern u32 exynos_get_eint_wake_mask(void);
> >diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
> >index f5e626d..e57b7c3 100644
> >--- a/arch/arm/mach-exynos/firmware.c
> >+++ b/arch/arm/mach-exynos/firmware.c
> >@@ -28,9 +28,15 @@
> >  #define EXYNOS_BOOT_ADDR	0x8
> >  #define EXYNOS_BOOT_FLAG	0xc
> >
> >-static int exynos_do_idle(void)
> >+static int exynos_do_idle(unsigned long mode)
> >  {
> >-	exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
> >+	switch (mode) {
> >+	case FW_DO_IDLE_AFTR:
> >+		exynos_smc(SMC_CMD_CPU0AFTR, 0, 0, 0);
> >+		break;
> >+	case FW_DO_IDLE_SLEEP:
> >+		exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
> >+	}
> >  	return 0;
> >  }
> >
> >diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c
> >index e3ebdce..425b6c8 100644
> >--- a/arch/arm/mach-tegra/cpuidle-tegra114.c
> >+++ b/arch/arm/mach-tegra/cpuidle-tegra114.c
> >@@ -49,7 +49,7 @@ static int tegra114_idle_power_down(struct cpuidle_device *dev,
> >  	call_firmware_op(prepare_idle);
> >
> >  	/* Do suspend by ourselves if the firmware does not implement it */
> >-	if (call_firmware_op(do_idle) == -ENOSYS)
> >+	if (call_firmware_op(do_idle, 0) == -ENOSYS)
> >  		cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
> >
> >  	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT,&dev->cpu);
> 
> + Thierry(using nvidia.com e-mail address)
> 
> Hi Thierry,
> 
> For supporting AFTR mode in call_firmware_op(do_idle), need to modify tegra
> stuff as you can see. The functionality will be same with before. Is it OK
> to you? If you have no objection, I'd like to take this series into samsung
> tree.

I'm only aware of any devices using TrustedFirmware on Tegra, which is
what the above code handles. The implementation for TrustedFirmware does
not implement do_idle() (yet?) so I don't think this patch would cause
any damage.

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-09-25  9:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 12:24 [PATCH v7 0/5] ARM: EXYNOS: cpuidle: fix AFTR mode on boards with secure firmware enabled Bartlomiej Zolnierkiewicz
2014-09-24 12:24 ` [PATCH v7 1/5] ARM: EXYNOS: PM: replace EXYNOS_BOOT_VECTOR_* macros by static inlines Bartlomiej Zolnierkiewicz
2014-09-24 12:24 ` [PATCH v7 2/5] ARM: add AFTR mode support to firmware do_idle method Bartlomiej Zolnierkiewicz
2014-09-25  8:23   ` Kukjin Kim
2014-09-25  9:03     ` Thierry Reding [this message]
2014-09-25  9:16       ` Kukjin Kim
     [not found] ` <1411561488-1739-1-git-send-email-b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-09-24 12:24   ` [PATCH v7 3/5] ARM: EXYNOS: cpuidle: add secure firmware support to AFTR mode code Bartlomiej Zolnierkiewicz
2014-09-24 12:24 ` [PATCH v7 4/5] ARM: EXYNOS: PM: fix register setup for " Bartlomiej Zolnierkiewicz
2014-09-24 12:24 ` [PATCH v7 5/5] ARM: EXYNOS: cpuidle: allow driver usage on Exynos4x12 SoCs Bartlomiej Zolnierkiewicz

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=20140925090310.GA12046@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rjw@rjwysocki.net \
    --cc=sachin.kamat@linaro.org \
    --cc=swarren@wwwdotorg.org \
    --cc=tomasz.figa@gmail.com \
    --cc=treding@nvidia.com \
    --cc=viresh.kumar@linaro.org \
    /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