Thread (6 messages) 6 messages, 4 authors, 2006-07-20

Re: reboot on PQ2FADS board.

From: Lei Sun <hidden>
Date: 2006-07-20 03:46:42

Possibly related (same subject, not in this thread)

Hi :
  The following is the version I am using, it's pretty much same as
do_reset() code in u-boot -1.1.4 for m8260 target. However the machine
just hangs.
  I wonder if there are any difference between Power on Reset and Hard
reset?  in my case maybe the machine did get reset, but the u-boot
didn't get executed correctly in the case of hard reset ?  It doesn't
explain the fact that i can run "reset" in u-boot console though.

Any comments are highly appreciated! I am stucked in here now.

m8260_restart(char * cmd)
        uint    startaddr;
        unsigned long msr;
        char badval;
        volatile cpm2_map_t *immap = cpm2_immr;

        /* Enable CheckStop reset. */
        immap->im_clkrst.car_rmr |= 0x00000001;
        /* Interrupts and MMU off */
        __asm__ __volatile__("mfmsr %0":"=r" (msr):);
        msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR);
        __asm__ __volatile__("mtmsr %0":: "r" (msr));
        startaddr = 0x04400000; /* this is taken from u-boot-1.1.4 */
        /* Access bad address.*/
        ((void (*)(void)) startaddr) ();
        return 1;
}

On 7/19/06, Wolfgang Denk [off-list ref] wrote:
In message [ref] you wrote:
quoted
quoted
command cause machine check and kernel ooops.  The problem seems in
the "m8260_gorom" in head.S.  The restart() function in m8260_setup.c
passed 2 parameters to that assembly code, r3 is the bd_info , r4 is
the warm start address,  I changed it to 0xFF800100, that's where the
u-boot's _start_warm lives, I have verified that address by typing "g
ff800100" in u-boot console, which cause the board reset.
Are you sure ff800100 is _start_warm lives?  In latest u-boot
Trying to jump to some boot rom address is IMHO always a bad approach
to reboot a system. You should always try to cause a reset  condition
for  the CPU, and thus for all the associated hardware. On 8xx / 8260
systems this is usually done by going through  a  machine  check.  We
have  the  following code in our linuxppc_2_4_devel tree, which works
on ALL 8260 systems, no matter whioch boot loder they use:

static void
m8260_restart(char *cmd)
{
        __volatile__ unsigned char dummy;
        ulong msr;

        cli();
        volatile immap_t *immap = (immap_t *) IMAP_ADDR;

        immap->im_clkrst.car_rmr = 1;    /* Checkstop Reset enable */

        /* Interrupts and MMU off */
        __asm__ __volatile__ ("mfmsr    %0":"=r" (msr):);

        msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR);
        __asm__ __volatile__ ("mtmsr    %0"::"r" (msr));

        dummy = ((immap_t *)IMAP_ADDR)->im_clkrst.res[0];

        printk("Restart failed\n");
        for (;;);
}


Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
If a group of N persons implements a COBOL compiler,  there  will  be
N-1 passes. Someone in the group has to be the manager. - T. Cheatham
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help