linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: b.zolnierkie@samsung.com (Bartlomiej Zolnierkiewicz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/4] ARM: EXYNOS: add code for setting/clearing boot flag
Date: Wed, 18 Mar 2015 15:23:59 +0100	[thread overview]
Message-ID: <3757903.ojJ3AYU7Ml@amdc1032> (raw)
In-Reply-To: <CAJKOXPe_V8uj9opDQ_oYMZMb8aFsNc2CCC4MgV8nna9u2-rkaQ@mail.gmail.com>

On Wednesday, March 18, 2015 02:33:54 PM Krzysztof Kozlowski wrote:
> 2015-03-18 13:51 GMT+01:00 Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>:
> > This code is needed for cpuidle (W-)AFTR mode support on Exynos3250.
> >
> > Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> >  arch/arm/mach-exynos/common.h |  6 ++++++
> >  arch/arm/mach-exynos/exynos.c | 25 +++++++++++++++++++++++++
> >  2 files changed, 31 insertions(+)
> >
> > diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
> > index f70eca7..87bf1f3 100644
> > --- a/arch/arm/mach-exynos/common.h
> > +++ b/arch/arm/mach-exynos/common.h
> > @@ -119,6 +119,12 @@ extern void __iomem *sysram_base_addr;
> >  extern void __iomem *pmu_base_addr;
> >  void exynos_sysram_init(void);
> >
> > +/* CPU BOOT mode flag */
> > +#define C2_STATE       (1 << 3)
> 
> Is this "C2_STATE" like ACPI C2 state? It looks specific to Exynos3250
> boot loader so maybe describe its real purpose?

According to my knowledge it is not like ACPI C2 but my knowledge is
limited since this state is not documented anywhere.  I can add a comment
about it being currently limited to Exynos3250 though.

> > +
> > +void exynos_set_boot_flag(unsigned int cpu, unsigned int mode);
> > +void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode);
> > +
> >  enum {
> >         FW_DO_IDLE_SLEEP,
> >         FW_DO_IDLE_AFTR,
> > diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
> > index 4031a96..90ed2e5 100644
> > --- a/arch/arm/mach-exynos/exynos.c
> > +++ b/arch/arm/mach-exynos/exynos.c
> > @@ -117,6 +117,31 @@ static void __init exynos_init_late(void)
> >         exynos_pm_init();
> >  }
> >
> > +#define REG_CPU_STATE_ADDR     (sysram_ns_base_addr + 0x28)
> > +#define BOOT_MODE_MASK         0x1f
> > +
> > +void exynos_set_boot_flag(unsigned int cpu, unsigned int mode)
> > +{
> > +       unsigned int tmp;
> > +
> > +       tmp = __raw_readl(REG_CPU_STATE_ADDR + cpu * 4);
> > +
> > +       if (mode & BOOT_MODE_MASK)
> > +               tmp &= ~BOOT_MODE_MASK;
> > +
> > +       tmp |= mode;
> > +       __raw_writel(tmp, REG_CPU_STATE_ADDR + cpu * 4);
> > +}
> > +
> > +void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode)
> > +{
> > +       unsigned int tmp;
> > +
> > +       tmp = __raw_readl(REG_CPU_STATE_ADDR + cpu * 4);
> > +       tmp &= ~mode;
> > +       __raw_writel(tmp, REG_CPU_STATE_ADDR + cpu * 4);
> > +}
> > +
> 
> Shouldn't these to functions be put in firmware.c? The
> exynos_set_cpu_boot_addr() is there already. It would be consistent to
> have them in one place.

I can move it to firmware.c if this is desired.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

  reply	other threads:[~2015-03-18 14:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18 12:51 [PATCH v3 0/4] ARM: EXYNOS: cpuidle: add AFTR mode support for Exynos3250 Bartlomiej Zolnierkiewicz
2015-03-18 12:51 ` [PATCH v3 1/4] ARM: EXYNOS: fix CPU1 hotplug for AFTR mode on Exynos3250 Bartlomiej Zolnierkiewicz
2015-03-18 13:10   ` Krzysztof Kozlowski
2015-03-18 13:23     ` Bartlomiej Zolnierkiewicz
2015-03-18 13:32       ` Krzysztof Kozlowski
2015-03-18 14:16         ` Bartlomiej Zolnierkiewicz
2015-03-18 12:51 ` [PATCH v3 2/4] ARM: EXYNOS: add code for setting/clearing boot flag Bartlomiej Zolnierkiewicz
2015-03-18 13:33   ` Krzysztof Kozlowski
2015-03-18 14:23     ` Bartlomiej Zolnierkiewicz [this message]
2015-03-18 12:51 ` [PATCH v3 3/4] ARM: EXYNOS: cpuidle: add AFTR mode support for Exynos3250 Bartlomiej Zolnierkiewicz
2015-03-18 13:38   ` Krzysztof Kozlowski
2015-03-18 15:03     ` Bartlomiej Zolnierkiewicz
2015-03-18 12:51 ` [PATCH v3 4/4] ARM: EXYNOS: cpuidle: allow driver usage on Exynos3250 SoC Bartlomiej Zolnierkiewicz
2015-03-18 13:39   ` Krzysztof Kozlowski

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=3757903.ojJ3AYU7Ml@amdc1032 \
    --to=b.zolnierkie@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).