mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Victor <andrew@sanpeople.com>
To: Michel Benoit <murpme@gmail.com>
Cc: "Pierre Savary" <pierre.savary@kerlink.fr>,
	"Marc Pignat" <marc.pignat@hevs.ch>,
	"Hans-Jürgen Koch" <hjk@linutronix.de>,
	trivial@kernel.org, linux-kernel@vger.kernel.org,
	"Andy Herzig" <andrew.herzig@ngc.com>,
	"ARM Linux Mailing List"
	<linux-arm-kernel@lists.arm.linux.org.uk>
Subject: Re: [PATCH] at91 pm: Compilation fix for at91sam926x
Date: 24 Aug 2007 09:11:48 +0200	[thread overview]
Message-ID: <1187939507.28770.130.camel@fuzzie.sanpeople.com> (raw)
In-Reply-To: <c88e466f0708100300l401ef479sbce5eed22b869de2@mail.gmail.com>

hi,

> > About SDRAm self refresh mode on at91sam926x, in fact AT91_SDRAMC_SRR
> > doesn't exist but the new register is AT91_SDRAMC_LPR. So for instance, you
> > can replace at91_sys_write(AT91_SDRAMC_SRR, 1) by
> > at91_sys_write(AT91_SDRAMC_LPR, AT91_SDRAMC_LPCB_SELF_REFRESH).
> 
> I have also made that change in pm.c.

I think we will go with the following change for now.
We need to pull in different header files anyway.

(This file will need to be re-looked at if we ever allow compiling a
single kernel image that supports multiple AT91 processors)


--- pm.c	6 Jul 2007 09:18:01 -0000	1.5
+++ pm.c	24 Aug 2007 07:22:13 -0000
@@ -27,12 +27,24 @@
 #include <asm/mach-types.h>
 
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91rm9200_mc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/cpu.h>
 
 #include "generic.h"
 
+#ifdef CONFIG_ARCH_AT91RM9200
+#include <asm/arch/at91rm9200_mc.h>
+
+#define sdram_selfrefresh_enable()	at91_sys_write(AT91_SDRAMC_SRR, 1)
+#define sdram_selfrefresh_disable()
+
+#else
+#include <asm/arch/at91sam926x_mc.h>
+
+#define sdram_selfrefresh_enable()	at91_sys_write(AT91_SDRAMC_LPR, AT91_SDRAMC_LPCB_SELF_REFRESH)
+#define sdram_selfrefresh_disable()	at91_sys_write(AT91_SDRAMC_LPR, AT91_SDRAMC_LPCB_DISABLE)
+
+#endif
 
 static int at91_pm_valid_state(suspend_state_t state)
 {
@@ -172,7 +184,7 @@
 			 */
 			asm("b 1f; .align 5; 1:");
 			asm("mcr p15, 0, r0, c7, c10, 4");	/* drain write buffer */
-			at91_sys_write(AT91_SDRAMC_SRR, 1);	/* self-refresh mode */
+			sdram_selfrefresh_enable();		/* self-refresh mode */
 			/* fall though to next state */
 
 		case PM_SUSPEND_ON:
@@ -188,6 +200,7 @@
 			at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR));
 
 error:
+	sdram_selfrefresh_disable();
 	target_state = PM_SUSPEND_ON;
 	at91_irq_resume();
 	at91_gpio_resume();


Regards,
  Andrew Victor



  reply	other threads:[~2007-08-24  7:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09 12:10 Andy Herzig
2007-08-09 14:39 ` Andy Herzig
2007-08-09 14:53 ` Hans-Jürgen Koch
2007-08-09 16:01   ` Marc Pignat
2007-08-09 17:17     ` Andy Herzig
2007-08-09 18:19       ` Hans-Jürgen Koch
2007-08-09 22:15     ` Ulf Samuelsson
2007-08-10  7:12       ` Hans-Jürgen Koch
2007-08-10  7:33         ` Marc Pignat
     [not found]           ` <3858727143598039860@unknownmsgid>
2007-08-10 10:00             ` Michel Benoit
2007-08-24  7:11               ` Andrew Victor [this message]
2007-08-10 13:54           ` Ulf Samuelsson

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=1187939507.28770.130.camel@fuzzie.sanpeople.com \
    --to=andrew@sanpeople.com \
    --cc=andrew.herzig@ngc.com \
    --cc=hjk@linutronix.de \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.pignat@hevs.ch \
    --cc=murpme@gmail.com \
    --cc=pierre.savary@kerlink.fr \
    --cc=trivial@kernel.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

all inboxes | Powered by JetHome®