reboot on PQ2FADS board.

Liu Dave-r63238 DaveLiu at freescale.com
Thu Jul 20 17:22:34 EST 2006


This way maybe can not work. when the MMU turn off, 
the next instructions maybe can not be fetched if these instructions
didn't exist cache. 
so it is possible these instruction can not executed.  

> 
> 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)); 
>     
Now the MMU trun off, is real address mode. But the PC still is
0xC00xxxx.. It is old effective address.

>         dummy = ((immap_t *)IMAP_ADDR)->im_clkrst.res[0];
These instructions will locate on the real address space...... It is
0xC00xxxx- KERNELBASE
>     
>         printk("Restart failed\n");
>         for (;;);
> }   
> 



More information about the Linuxppc-embedded mailing list