[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ltib] Re: Any assembly/8349 experts?
From: |
Kumar Gala |
Subject: |
[Ltib] Re: Any assembly/8349 experts? |
Date: |
Wed, 27 Dec 2006 08:42:09 -0600 |
On Dec 23, 2006, at 4:44 PM, Mark Lacas wrote:
Hello,
Any 8349 (powerpc)/assembly experts out there?
I am trying to understand how the following instructions work.
This is the code that is supposed to reboot the MPC8349 in my mITX
box, it doesn't seem to be working.
My system prints "Restart failed" and ends up in the infinite 'for'
loop at the end.
If anyone could add comments to the code or explain what is
happening it would be greatly appreciated.
Does anyone know of a workaround or fix?
Not exactly sure what this code is doing with OR0/BR0 or why its
doing it. What's this from?
If you're trying to have restart work, why not use the RESET module
in the 834x.
snipped from the linux kernel restart code:
void mpc83xx_restart(char *cmd)
{
#define RST_OFFSET 0x00000900
#define RST_PROT_REG 0x00000018
#define RST_CTRL_REG 0x0000001c
__be32 __iomem *reg;
/* map reset register space */
reg = ioremap(get_immrbase() + 0x900, 0xff);
local_irq_disable();
/* enable software reset "RSTE" */
out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
/* set software hard reset */
out_be32(reg + (RST_CTRL_REG >> 2), 0x2);
for (;;) ;
}
Thanks,
ml
#ifdef CONFIG_MPC8349_ITX
local_irq_disable();
/* abort(); */
printk("8349 Restart\n");
volatile unsigned char dummy;
volatile unsigned int msr;
unsigned int bad_addr, rmr_addr, br0_addr;
/* Get base address mapped by BR0/OR0 */
br0_addr = (unsigned int)(VIRT_IMMRBAR + 0x5000);
rmr_addr = (unsigned int)(VIRT_IMMRBAR + 0x0914);
bad_addr = br0_addr & 0xFFFF8000;
cli();
/* Enable CheckStop Reset */
rmr_addr |= 0x00000001;
/* Invalidate BR0 mapping */
br0_addr = 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");
for(;;);