LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Yang, Wenyou" <Wenyou.Yang@atmel.com>
To: Sylvain Rochet <sylvain.rochet@finsecur.com>
Cc: "Ferre, Nicolas" <Nicolas.FERRE@atmel.com>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"alexandre.belloni@free-electrons.com" 
	<alexandre.belloni@free-electrons.com>,
	"peda@axentia.se" <peda@axentia.se>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH 08/12] pm: at91: rename file name: pm_slowclock.S -->pm_suspend.S
Date: Mon, 26 Jan 2015 01:25:13 +0000	[thread overview]
Message-ID: <B256D81BAE5131468A838E5D7A243641BFD32766@penmbx01> (raw)
In-Reply-To: <20150123191719.GA29601@gradator.net>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3219 bytes --]

Hi Sylvain,

Thank you for your review.

> -----Original Message-----
> From: Sylvain Rochet [mailto:sylvain.rochet@finsecur.com]
> Sent: Saturday, January 24, 2015 3:17 AM
> To: Yang, Wenyou
> Cc: Ferre, Nicolas; linux@arm.linux.org.uk; linux-kernel@vger.kernel.org;
> alexandre.belloni@free-electrons.com; peda@axentia.se; linux-arm-
> kernel@lists.infradead.org
> Subject: Re: [PATCH 08/12] pm: at91: rename file name: pm_slowclock.S --
> >pm_suspend.S
> 
> Hello Wenyou,
> 
> On Tue, Jan 20, 2015 at 04:17:01PM +0800, Wenyou Yang wrote:
> >
> > diff --git a/arch/arm/mach-at91/pm_suspend.S
> > b/arch/arm/mach-at91/pm_suspend.S new file mode 100644 index
> > 0000000..420e730
> > --- /dev/null
> 
> 
> > +	/* Turn off the main oscillator */
> > +	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
> > +	bic	tmp1, tmp1, #AT91_PMC_MOSCEN
> 
> at91sam9x5 and probably others need a key here:
> 	orr     tmp1, tmp1, #AT91_PMC_KEY
> 
Yes, I am preparing the patches to support other SoCs.

> > +	str	tmp1, [pmc, #AT91_CKGR_MOR]
> 
> 
> 
> > +	/* Wait for interrupt */
> > +	mcr	p15, 0, tmp1, c7, c0, 4
> 
> The linux-3.10-at91 branch uses a different approach which seem necessary for
> newer board, you probably forget to merge the following:
> 
> /*
>  * Put the processor to enter into Standby mode, wait for interrupt to wakeup  */
> 	.macro _do_wfi
> 
> #if defined(CONFIG_CPU_V7)
> 	dsb
> 
> 	/* Disable the processor clock */
> 	mov	tmp1, #AT91_PMC_PCK
> 	str	tmp1, [pmc, #AT91_PMC_SCDR]
> 
> 	wfi		@ Wait For Interrupt
> #else
> 	mcr	p15, 0, tmp1, c7, c0, 4
> #endif
> 
> 	.endm
> 
> 	.text
> 
I will send the new patch serials to support it in this week. Thanks.

> ENTRY(at91_slow_clock)
> (...)
> 	/* Wait for interrupt */
> 	_do_wfi
> (...)
> 
> 
> 
> 
> > +	/* Turn on the main oscillator */
> > +	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
> > +	orr	tmp1, tmp1, #AT91_PMC_MOSCEN
> 
> at91sam9x5 and probably others need a key here:
>         orr     tmp1, tmp1, #AT91_PMC_KEY
> 
> > +	str	tmp1, [pmc, #AT91_CKGR_MOR]
> 
> 
> 
> What about the following parts which are also in linux-3.10-at91 branch but not in
> this rework, are they necessary ?
Yes, they are necessary, I will send the next patch serial in this week.

> 
> sdr_sr_done:
> 	/* Disable MPDDRC Clock*/
> 	cmp	ddrcid, #0
> 	beq	2f
> 	bic	tmp2, ddrcid, #0xe0 /* fetch lowest 5 bits */
> 	mov	tmp1, #0x01
> 	mov	tmp1, tmp1, lsl tmp2
> 
> 	tst	ddrcid, #0x20	/* > 32 ? */
> 	beq	1f
> 	str	tmp1, [pmc, #AT91_PMC_PCDR1]
> 	b	2f
> 1:
> 	str	tmp1, [pmc, #AT91_PMC_PCDR]
> 2:
> 
> 	/* Disable DDR Clock */
> 	mov 	tmp1, #AT91_PMC_SYS_DDR
> 	str	tmp1, [pmc, #AT91_PMC_SCDR]
> 
> 
> 
> 
> 	/* Enable MPDDRC Clock*/
> 	cmp	ddrcid, #0
> 	beq	4f
> 	bic	tmp2, ddrcid, #0xe0 /* fetch lowest 5 bits */
> 	mov	tmp1, #0x01
> 	mov	tmp1, tmp1, lsl tmp2
> 
> 	tst	ddrcid, #0x20	/* > 32 ? */
> 	beq	3f
> 	str	tmp1, [pmc, #AT91_PMC_PCER1]
> 	b	4f
> 3:
> 	str	tmp1, [pmc, #AT91_PMC_PCER]
> 4:
> 
> 	/* Enable DDR clock */
> 	mov 	tmp1, #AT91_PMC_SYS_DDR
> 	str	tmp1, [pmc, #AT91_PMC_SCER]
> 
> 
> 
> Sylvain

Best Regards,
Wenyou Yang
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  parent reply	other threads:[~2015-01-26  1:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20  8:16 [PATCH 00/12] AT91 pm cleanup for 3.20 Wenyou Yang
2015-01-20  8:16 ` [PATCH 01/12] pm: at91: pm_slowclock: improve reliability of suspend/resume Wenyou Yang
2015-01-20  8:16 ` [PATCH 02/12] pm: at91: Workaround DDRSDRC self-refresh bug with LPDDR1 memories Wenyou Yang
2015-01-20  8:16 ` [PATCH 03/12] pm: at91: pm_slowclock: remove the unused code related with SLOWDOWN_MASTER_CLOCK Wenyou Yang
2015-01-20  8:16 ` [PATCH 04/12] pm: at91: move the copying the sram function to the sram initializationi phase Wenyou Yang
2015-01-20  8:16 ` [PATCH 05/12] ARM: at91: move select SRAM to ARCH_AT91 Wenyou Yang
2015-01-23 10:24   ` Alexandre Belloni
2015-01-26  1:10     ` Yang, Wenyou
2015-01-20  8:16 ` [PATCH 06/12] pm: at91: remove the config item CONFIG_AT91_SLOW_CLOCK Wenyou Yang
2015-01-20  8:17 ` [PATCH 07/12] pm: at91: the standby mode uses the same sram function as the suspend to memory mode Wenyou Yang
2015-01-23 10:30   ` Alexandre Belloni
2015-01-23 16:50   ` Sylvain Rochet
2015-01-23 23:13     ` Alexandre Belloni
2015-01-27  3:08       ` Yang, Wenyou
2015-01-23 17:32   ` Sylvain Rochet
2015-01-23 23:02     ` Alexandre Belloni
2015-01-26  3:08       ` Yang, Wenyou
2015-01-26  3:06     ` Yang, Wenyou
2015-01-20  8:17 ` [PATCH 08/12] pm: at91: rename file name: pm_slowclock.S -->pm_suspend.S Wenyou Yang
2015-01-23 19:17   ` Sylvain Rochet
2015-01-23 23:17     ` Alexandre Belloni
2015-01-25 13:30       ` Sylvain Rochet
2015-01-26  1:25     ` Yang, Wenyou [this message]
2015-01-20  8:17 ` [PATCH 09/12] pm: at91: rename function name: at91_slow_clock()-->at91_pm_suspend_sram_fn Wenyou Yang
2015-01-20  8:24 ` Wenyou Yang
2015-01-20  8:24 ` [PATCH 10/12] pm: at91: remove the at91_xxx_standby() function definitions in the pm.h Wenyou Yang
2015-01-20  8:25 ` [PATCH 11/12] pm: at91: remove the struct ramc_ids .data at91_xxx_standby members Wenyou Yang
2015-01-20  8:26 ` [PATCH 12/12] pm: at91: amend the pm_suspend entry for at91_cpuidle_device Wenyou Yang

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=B256D81BAE5131468A838E5D7A243641BFD32766@penmbx01 \
    --to=wenyou.yang@atmel.com \
    --cc=Nicolas.FERRE@atmel.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=peda@axentia.se \
    --cc=sylvain.rochet@finsecur.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;
as well as URLs for NNTP newsgroup(s).