linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Domen Puncer <domen.puncer@telargo.com>
To: linuxppc-embedded@ozlabs.org
Subject: lite5200b low power mode and self refresh
Date: Tue, 14 Nov 2006 11:02:35 +0100	[thread overview]
Message-ID: <20061114100235.GA7694@domen-desktop> (raw)

Hi!

I'm trying to implement low power mode on lite5200b board
(everything but sdram is powered off), and I seem to have
problems with putting ram to self-refresh.

As far as I can tell I'm following datasheets, but if it
sleeps for a day or so, contents of RAM get cleared to
zeroes (I get 0x02800100 and similar patterns).

Any ideas, tips, comments... anything really, is appreaciated.

I'm also interested in mpc5200 "deep sleep", anyone had any
success?


Thanks!

	Domen


Code for low power mode via "QT" chip. It is ran from flash,
since sdram isn't accessible after this.

        // put sdram into self-refresh
        lis     r5, 0xf000
        ori     r5, r5, 0x100
        lwz     r4, 0x4(r5)
        oris    r4, r4, 0x8000
        stw     r4, 0x4(r5)     // mode_en
        sync

        ori     r4, r4, 0x0002  // setup soft_pre

        lis     r6, 0xbfff
        ori     r6, r6, 0xffff
        and     r6, r4, r6      // setup !cke
        oris    r6, r6, 0x1000  // setup ref_en

        stw     r4, 0x4(r5)     // soft_pre
        sync

        stw     r6, 0x4(r5)     // ref_en !cke
        sync

        clrlwi  r6, r6, 1       // !mode_en
        stw     r6, 0x4(r5)
        sync

        // turn off with QT chip
        lis     r3, 0xf000
        ori     r3, r3, 0x0c00
        li      r4, 0x02
        stb     r4, 0(r3)       // enable gpio_wkup1
        sync
        stb     r4, 8(r3)       // output
        sync
        stb     r4, 0xc(r3)     // output high
        sync

        lis     r5, 0x0001
delay_10us:
        addi    r5, r5, -1
        cmpi    cr7, r5, 0
        bne     cr7, delay_10us
        sync

        // turn off
        li      r4, 0
        stb     r4, 0xc(r3)     // output low
        sync

                 reply	other threads:[~2006-11-14 10:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20061114100235.GA7694@domen-desktop \
    --to=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).