linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Domen Puncer" <domen.puncer@telargo.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: [PATCH 4/5] mpc52xx suspend: deep-sleep
Date: Sun, 15 Apr 2007 23:40:53 -0600	[thread overview]
Message-ID: <528646bc0704152240u60bf24dbx6a1ca8dd15aaaf53@mail.gmail.com> (raw)
In-Reply-To: <20070404073755.GE18236@moe.telargo.com>

On 4/4/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> Hi!
>
> How about something like the following.
> Changes:
> - lots of code moved from asm to C
> - add compatible "mpc5200" to lite5200x soc (already is this
>   way on efika). And change Efika's soc device_type to "soc".
> - add wakeup supported with RTC (1 to 24*60-1 minutes)
> - each board now configures it's wakeup mode and possibly
>   board suspend and resume functions it needs to call (USB on lite)

Sorry it took so long for me to review and get back to you on this
patch.  I got wrapped up in other tasks.

I mostly like the approach that you're taking here to allow each board
to select it's own wakeup method, but I think it should be taken a
step farther.  Instead of providing a set of stock
mpc52xx_set_wakeup_*() functions, I think it would make for simpler
and more flexible code if each board takes care of its own wakeup
configuration in the board_suspend_prepare hook.  In fact, the
mpc52xx_set_wakeup_*() functions themselves make a lot of sense, and
are useful utility functions.  But rather than trying to codify which
pins/rtc to configure for wakeup via the .mask, .level, .pin and
.delay items, those functions should be called directly by
lite5200_suspend_prepare() and efika_suspend_prepare().  Doing this
will drop 19 lines of common code in exchange for adding 2 lines to
each board port.

As an added bonus, doing it this way allows multiple pins to be used
for wakeup.  :-)

> This code survived > 70k suspend/resume cycles :-)

That's pretty good evidence.  :-)

> Comments?

A few more comments below

> --- /dev/null
> +++ grant.git/arch/powerpc/platforms/52xx/mpc52xx_pm.c
<snip>
> +extern void mpc52xx_ds_sram(void);
> +extern const long mpc52xx_ds_sram_size;
> +extern void mpc52xx_ds_cached(void);
> +extern const long mpc52xx_ds_cached_size;

This *looks* like dangerous code (function prototypes not in a shared
header).  You should add a big comment here to the fact that these are
assembly functions that are only ever referenced in this file.

===================================================================
> --- grant.git.orig/arch/powerpc/boot/dts/lite5200.dts
> +++ grant.git/arch/powerpc/boot/dts/lite5200.dts
> @@ -49,6 +49,7 @@
>
>         soc5200@f0000000 {
>                 model = "fsl,mpc5200";
> +               compatible = "mpc5200";
>                 revision = ""                   // from bootloader
>                 #interrupt-cells = <3>;
>                 device_type = "soc";
> Index: grant.git/arch/powerpc/boot/dts/lite5200b.dts
> ===================================================================
> --- grant.git.orig/arch/powerpc/boot/dts/lite5200b.dts
> +++ grant.git/arch/powerpc/boot/dts/lite5200b.dts
> @@ -49,6 +49,7 @@
>
>         soc5200@f0000000 {
>                 model = "fsl,mpc5200b";
> +               compatible = "mpc5200";
>                 revision = "";                  // from bootloader
>                 #interrupt-cells = <3>;
>                 device_type = "soc";

Put these two changes in a seperate patch, and I'll ACK them right away

===================================================================
> --- grant.git.orig/arch/powerpc/kernel/prom_init.c
> +++ grant.git/arch/powerpc/kernel/prom_init.c
> @@ -2142,7 +2142,7 @@ static void __init fixup_device_tree_efi
>                                      3,12,0, 3,13,0, 3,14,0, 3,15,0 };
>         struct subst_entry efika_subst_table[] = {
>                 { "/",                  "device_type",  prop_cstr("efika") },
> -               { "/builtin",           "compatible",   prop_cstr("soc") },
> +               { "/builtin",           "device_type",  prop_cstr("soc") },
>                 { "/builtin/ata",       "compatible",   prop_cstr("mpc5200b-ata\0mpc5200-ata"), },
>                 { "/builtin/bestcomm",  "compatible",   prop_cstr("mpc5200b-bestcomm\0mpc5200-bestcomm") },
>                 { "/builtin/bestcomm",  "interrupts",   prop_bcomm_irq, sizeof(prop_bcomm_irq) },
>

This should also be a seperate patch.

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

  reply	other threads:[~2007-04-16  5:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15 10:39 [PATCH 0/5 v2] MPC5200 and Lite5200b low power modes Domen Puncer
2007-03-15 10:41 ` [PATCH 1/5] mpc52xx suspend: UART Domen Puncer
2007-03-15 10:41 ` [PATCH 2/5] mpc52xx suspend: FEC (ethernet) Domen Puncer
2007-03-15 13:35   ` Grant Likely
2007-03-15 10:42 ` [PATCH 3/5] mpc52xx suspend: USB Domen Puncer
2007-03-15 13:24   ` Grant Likely
2007-03-15 14:37     ` Wrong board info for ML403 Leonid
2007-03-16  8:15       ` Andrei Konovalov
2007-03-22  7:44     ` [PATCH 3/5 v2] mpc52xx suspend: USB Domen Puncer
2007-03-23 11:56       ` Sylvain Munaut
2007-03-23 16:00         ` Grant Likely
2007-03-15 10:43 ` [PATCH 4/5] mpc52xx suspend: deep-sleep Domen Puncer
2007-03-23 15:58   ` Grant Likely
2007-04-04  7:37     ` Domen Puncer
2007-04-16  5:40       ` Grant Likely [this message]
2007-04-17  7:05         ` Domen Puncer
2007-04-17  7:10           ` Grant Likely
2007-03-15 10:44 ` [PATCH] icecube/lite5200b: wakeup from low-power support Domen Puncer
2007-03-26 16:08   ` Grant Likely
2007-04-03  8:46     ` Domen Puncer
2007-04-16  4:45       ` Grant Likely
2007-04-16  6:25         ` Domen Puncer
2007-03-31 17:20   ` Rafal Jaworowski
2007-03-31 18:38     ` Domen Puncer
2007-03-15 10:44 ` [PATCH 5/5] lite5200b suspend: low-power mode Domen Puncer
2007-03-15 14:09   ` Grant Likely
2007-03-15 16:36     ` Domen Puncer
2007-03-22  7:41       ` Domen Puncer
2007-03-26 13:23         ` Domen Puncer
2007-03-26 15:54           ` Grant Likely
2007-04-17  7:11     ` Domen Puncer
2007-04-17  7:25       ` Grant Likely

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=528646bc0704152240u60bf24dbx6a1ca8dd15aaaf53@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=domen.puncer@telargo.com \
    --cc=linuxppc-embedded@ozlabs.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).