From: Zhao Chenhui <chenhui.zhao@freescale.com>
To: Tabi Timur-B04825 <B04825@freescale.com>
Cc: Zhao Chenhui-B35336 <B35336@freescale.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
Wood Scott-B07421 <B07421@freescale.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"galak@kernel.crashing.org" <galak@kernel.crashing.org>,
Li Yang-R58472 <r58472@freescale.com>, <leoli@freescale.com>
Subject: Re: [PATCH v6 1/5] powerpc/85xx: implement hardware timebase sync
Date: Mon, 2 Jul 2012 18:10:48 +0800 [thread overview]
Message-ID: <20120702101048.GA22108@localhost.localdomain> (raw)
In-Reply-To: <CAOZdJXWiGOCtP1iJYR2S48XwR2Wpry8+VswctctdVfY9Z+QTiQ@mail.gmail.com>
On Fri, Jun 29, 2012 at 10:39:24AM -0500, Tabi Timur-B04825 wrote:
> On Tue, Jun 26, 2012 at 5:25 AM, Zhao Chenhui
> <chenhui.zhao@freescale.com> wrote:
> > Do hardware timebase sync. Firstly, stop all timebases, and transfer
> > the timebase value of the boot core to the other core. Finally,
> > start all timebases.
> >
> > Only apply to dual-core chips, such as MPC8572, P2020, etc.
> >
> > Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> > Signed-off-by: Li Yang <leoli@freescale.com>
> > ---
> > Changes for v6:
> > * added 85xx_TB_SYNC
> > * added isync() after set_tb()
> > * removed extra entries from mpc85xx_smp_guts_ids
> >
> > arch/powerpc/include/asm/fsl_guts.h | 2 +
> > arch/powerpc/platforms/85xx/Kconfig | 5 ++
> > arch/powerpc/platforms/85xx/smp.c | 84 +++++++++++++++++++++++++++++++++++
> > 3 files changed, 91 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
> > index ff42490..edb0cad 100644
> > --- a/arch/powerpc/platforms/85xx/smp.c
> > +++ b/arch/powerpc/platforms/85xx/smp.c
> > @@ -24,6 +24,7 @@
> > #include <asm/mpic.h>
> > #include <asm/cacheflush.h>
> > #include <asm/dbell.h>
> > +#include <asm/fsl_guts.h>
> >
> > #include <sysdev/fsl_soc.h>
> > #include <sysdev/mpic.h>
> > @@ -42,6 +43,69 @@ extern void __early_start(void);
> > #define NUM_BOOT_ENTRY 8
> > #define SIZE_BOOT_ENTRY (NUM_BOOT_ENTRY * sizeof(u32))
> >
> > +#ifdef CONFIG_85xx_TB_SYNC
> > +static struct ccsr_guts __iomem *guts;
> > +static u64 timebase;
> > +static int tb_req;
> > +static int tb_valid;
> > +
> > +static void mpc85xx_timebase_freeze(int freeze)
> > +{
> > + unsigned int mask;
>
> 'mask' should be uint32_t
OK.
>
> > +
> > + if (!guts)
> > + return;
>
> This function should never be called if guts is NULL, so this check
> should be unnecessary.
OK.
>
> > +
> > + mask = CCSR_GUTS_DEVDISR_TB0 | CCSR_GUTS_DEVDISR_TB1;
> > + if (freeze)
> > + setbits32(&guts->devdisr, mask);
> > + else
> > + clrbits32(&guts->devdisr, mask);
> > +
> > + in_be32(&guts->devdisr);
> > +}
> > +
> > @@ -249,6 +323,16 @@ void __init mpc85xx_smp_init(void)
> > smp_85xx_ops.cause_ipi = doorbell_cause_ipi;
> > }
> >
> > + np = of_find_matching_node(NULL, mpc85xx_smp_guts_ids);
> > + if (np) {
> > +#ifdef CONFIG_85xx_TB_SYNC
> > + guts = of_iomap(np, 0);
>
> You need to test the return value of of_iomap(). smp_85xx_ops should
> be set only if guts is not NULL.
Yes. Thanks.
>
> > + smp_85xx_ops.give_timebase = mpc85xx_give_timebase;
> > + smp_85xx_ops.take_timebase = mpc85xx_take_timebase;
> > +#endif
> > + of_node_put(np);
> > + }
> > +
> > smp_ops = &smp_85xx_ops;
> >
> > #ifdef CONFIG_KEXEC
> > --
> > 1.6.4.1
prev parent reply other threads:[~2012-07-02 10:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 10:25 [PATCH v6 1/5] powerpc/85xx: implement hardware timebase sync Zhao Chenhui
2012-06-26 10:25 ` [PATCH v6 2/5] powerpc/85xx: add HOTPLUG_CPU support Zhao Chenhui
2012-06-26 10:25 ` [PATCH v6 3/5] powerpc/85xx: add sleep and deep sleep support Zhao Chenhui
2012-07-13 12:27 ` Kumar Gala
2012-06-26 10:25 ` [PATCH v6 4/5] fsl_pmc: Add API to enable device as wakeup event source Zhao Chenhui
2012-06-26 10:25 ` [PATCH v6 5/5] powerpc/85xx: add support to JOG feature using cpufreq interface Zhao Chenhui
2012-06-26 14:03 ` [PATCH v6 1/5] powerpc/85xx: implement hardware timebase sync Kumar Gala
2012-06-26 21:45 ` Scott Wood
2012-06-26 22:10 ` Benjamin Herrenschmidt
2012-06-27 10:10 ` Zhao Chenhui
2012-06-26 22:10 ` Benjamin Herrenschmidt
2012-06-27 10:21 ` Zhao Chenhui
2012-06-27 11:48 ` Benjamin Herrenschmidt
2012-06-28 3:38 ` Zhao Chenhui
2012-06-28 10:50 ` Benjamin Herrenschmidt
2012-06-28 18:30 ` Kumar Gala
2012-06-29 10:33 ` Zhao Chenhui-B35336
2012-07-02 10:44 ` Zhao Chenhui
2012-06-29 15:39 ` Tabi Timur-B04825
2012-06-29 15:57 ` Scott Wood
2012-06-29 16:04 ` Timur Tabi
2012-06-29 16:10 ` Scott Wood
2012-06-29 16:12 ` Timur Tabi
2012-06-29 17:10 ` Scott Wood
2012-07-02 10:10 ` Zhao Chenhui [this message]
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=20120702101048.GA22108@localhost.localdomain \
--to=chenhui.zhao@freescale.com \
--cc=B04825@freescale.com \
--cc=B07421@freescale.com \
--cc=B35336@freescale.com \
--cc=galak@kernel.crashing.org \
--cc=leoli@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=r58472@freescale.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