linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: govindan@india.tejasnetworks.com
Cc: svacca@valcom.com,
	"LinuxEmbeddedMailList (E-mail)"
	<linuxppc-embedded@lists.linuxppc.org>,
	govindan@tejasnetworks.com
Subject: Re: Execute Reset via CheckStop approach
Date: Wed, 24 Jul 2002 17:46:20 +0200	[thread overview]
Message-ID: <20020724154625.05E4310875@denx.denx.de> (raw)
In-Reply-To: Your message of "Wed, 24 Jul 2002 10:49:39 +0530." <NEBBINFJMPEFJBMDGBGMAEOGFAAA.govindan@india.tejasnetworks.com>


In message <NEBBINFJMPEFJBMDGBGMAEOGFAAA.govindan@india.tejasnetworks.com> you wrote:
>
> Here is something we found working:
...
>       addr = 0x10000000;  // This should be a non-accessible memory
> location.

The big disadvantage of this approach is that it works on one  board,
and fails on another - or even on the same board after you added some
more RAM, etc.

We solved this problem in our version (see the  CVS)  by  explicitely
invalidating the mapping in the memory controller:

        /* Get base address mapped by BR0/OR0
         */
        bad_addr = ((immap_t *)IMAP_ADDR)->im_memctl.memc_br0 & 0xFFFF8000;
        cli();

        /* Enable CheckStop Reset
         */
        ((immap_t *)IMAP_ADDR)->im_clkrst.car_rmr |= 0x00000001;

        /* Invalidate BR0 mapping
         */
        ((immap_t *)IMAP_ADDR)->im_memctl.memc_br0 = 0;

        /* Set MSR and cause reset
         */
        __asm__("mfmsr %0" : "=r" (msr) );
        msr &= ~0x1000;
        __asm__("mtmsr %0" : "=r" (msr) );
        dummy = * (unsigned char *) bad_addr;
        printk("Restart failed\n");
        while(1);


Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
Microsoft Compatibility:
     your old Windows 3.11 application crash exactly as the new ones.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2002-07-24 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-23 13:45 Execute Reset via CheckStop approach Steven Vacca
2002-07-23 13:54 ` Wolfgang Denk
2002-07-24  5:19 ` Govindan
2002-07-24 15:46   ` Wolfgang Denk [this message]
     [not found] <3D6612BA.730D7A25@ardistech.com>
2002-08-23 11:33 ` Wolfgang Denk
2002-08-23 13:23   ` bart
2002-08-23 13:36     ` Wolfgang Denk

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=20020724154625.05E4310875@denx.denx.de \
    --to=wd@denx.de \
    --cc=govindan@india.tejasnetworks.com \
    --cc=govindan@tejasnetworks.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=svacca@valcom.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).