diff options
author | Marcelo Tosatti <marcelo.tosatti@cyclades.com> | 2005-10-28 20:46:10 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-28 23:55:27 -0400 |
commit | e37b0c9670fed2264661ade1beb5c228dec29c96 (patch) | |
tree | 4f23bc5ea578db11de39222aa046804ed9286782 /arch/ppc/syslib/m8xx_wdt.c | |
parent | 9e3699ea7b8d63eabde7fefa9892e3a258c9c27d (diff) |
[PATCH] ppc32 8xx: use io accessor macros instead of direct memory reference
Convert core 8xx drivers to use in_xxxbe/in_xxx macros instead of direct
memory references.
Other than making IO accesses explicit (which is a plus for readability), a
common set of macros provides a unified place for the volatile flag to
constraint compiler code reordering.
There are several unlucky places at the moment which lack the volatile
flag.
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc/syslib/m8xx_wdt.c')
-rw-r--r-- | arch/ppc/syslib/m8xx_wdt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c index 2ddc857e7fc7..c5ac5ce5d7d2 100644 --- a/arch/ppc/syslib/m8xx_wdt.c +++ b/arch/ppc/syslib/m8xx_wdt.c | |||
@@ -29,8 +29,8 @@ void m8xx_wdt_reset(void) | |||
29 | { | 29 | { |
30 | volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; | 30 | volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; |
31 | 31 | ||
32 | imap->im_siu_conf.sc_swsr = 0x556c; /* write magic1 */ | 32 | out_be16(imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */ |
33 | imap->im_siu_conf.sc_swsr = 0xaa39; /* write magic2 */ | 33 | out_be16(imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */ |
34 | } | 34 | } |
35 | 35 | ||
36 | static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs) | 36 | static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs) |
@@ -39,7 +39,7 @@ static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs) | |||
39 | 39 | ||
40 | m8xx_wdt_reset(); | 40 | m8xx_wdt_reset(); |
41 | 41 | ||
42 | imap->im_sit.sit_piscr |= PISCR_PS; /* clear irq */ | 42 | out_be16(imap->im_sit.sit_piscr, in_be16(imap->im_sit.sit_piscr | PISCR_PS)); /* clear irq */ |
43 | 43 | ||
44 | return IRQ_HANDLED; | 44 | return IRQ_HANDLED; |
45 | } | 45 | } |
@@ -51,7 +51,7 @@ void __init m8xx_wdt_handler_install(bd_t * binfo) | |||
51 | u32 sypcr; | 51 | u32 sypcr; |
52 | u32 pitrtclk; | 52 | u32 pitrtclk; |
53 | 53 | ||
54 | sypcr = imap->im_siu_conf.sc_sypcr; | 54 | sypcr = in_be32(imap->im_siu_conf.sc_sypcr); |
55 | 55 | ||
56 | if (!(sypcr & 0x04)) { | 56 | if (!(sypcr & 0x04)) { |
57 | printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n", | 57 | printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n", |
@@ -87,9 +87,9 @@ void __init m8xx_wdt_handler_install(bd_t * binfo) | |||
87 | else | 87 | else |
88 | pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2; | 88 | pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2; |
89 | 89 | ||
90 | imap->im_sit.sit_pitc = pitc << 16; | 90 | out_be32(imap->im_sit.sit_pitc, pitc << 16); |
91 | imap->im_sit.sit_piscr = | 91 | |
92 | (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE; | 92 | out_be16(imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE); |
93 | 93 | ||
94 | if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction)) | 94 | if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction)) |
95 | panic("m8xx_wdt: error setting up the watchdog irq!"); | 95 | panic("m8xx_wdt: error setting up the watchdog irq!"); |