Skip to content

Commit

Permalink
[PATCH] ppc32 8xx: fix m8xx_wdt accessor macro update
Browse files Browse the repository at this point in the history
The following patch against m8xx_wdt.c adds <asm/io.h> (required for
out,in_be32/16) and fixes syntatic problems introduced with the IO
accessor macro update.

Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Marcelo Tosatti authored and Paul Mackerras committed Nov 7, 2005
1 parent 9d2ba6f commit c6d9504
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions arch/ppc/syslib/m8xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <asm/io.h>
#include <asm/8xx_immap.h>
#include <syslib/m8xx_wdt.h>

Expand All @@ -29,8 +30,8 @@ void m8xx_wdt_reset(void)
{
volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;

out_be16(imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
out_be16(imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
out_be16(&imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
out_be16(&imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
}

static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
Expand All @@ -39,7 +40,7 @@ static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)

m8xx_wdt_reset();

out_be16(imap->im_sit.sit_piscr, in_be16(imap->im_sit.sit_piscr | PISCR_PS)); /* clear irq */
out_be16(&imap->im_sit.sit_piscr, in_be16(&imap->im_sit.sit_piscr) | PISCR_PS); /* clear irq */

return IRQ_HANDLED;
}
Expand All @@ -51,7 +52,7 @@ void __init m8xx_wdt_handler_install(bd_t * binfo)
u32 sypcr;
u32 pitrtclk;

sypcr = in_be32(imap->im_siu_conf.sc_sypcr);
sypcr = in_be32(&imap->im_siu_conf.sc_sypcr);

if (!(sypcr & 0x04)) {
printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n",
Expand Down Expand Up @@ -87,9 +88,9 @@ void __init m8xx_wdt_handler_install(bd_t * binfo)
else
pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2;

out_be32(imap->im_sit.sit_pitc, pitc << 16);
out_be32(&imap->im_sit.sit_pitc, pitc << 16);

out_be16(imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE);
out_be16(&imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE);

if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction))
panic("m8xx_wdt: error setting up the watchdog irq!");
Expand Down

0 comments on commit c6d9504

Please sign in to comment.