aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/syslib/m8xx_setup.c
diff options
context:
space:
mode:
authorVitaly Bordug <vbordug@ru.mvista.com>2006-01-15 09:30:29 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-20 00:13:29 -0500
commit0ce928e1b2ad4309fae6c4324b9e9e433fbf62a2 (patch)
tree774811b3bba02ac53292c56cc0be0d144e616044 /arch/ppc/syslib/m8xx_setup.c
parent63dafe5728e7354bc3f15bd49f13f1f9a433e8fb (diff)
[PATCH] ppc32 8xx: Added setbitsXX/clrbitsXX macro for read-modify-write operations
This adds setbitsXX/clrbitsXX macro for read-modify-write operations and converts the 8xx core and drivers to use them. Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com> Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc/syslib/m8xx_setup.c')
-rw-r--r--arch/ppc/syslib/m8xx_setup.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
index 688616de3cde..ff0282479a78 100644
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -140,9 +140,11 @@ void __init __attribute__ ((weak))
140init_internal_rtc(void) 140init_internal_rtc(void)
141{ 141{
142 /* Disable the RTC one second and alarm interrupts. */ 142 /* Disable the RTC one second and alarm interrupts. */
143 out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, in_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) & ~(RTCSC_SIE | RTCSC_ALE)); 143 clrbits16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, (RTCSC_SIE | RTCSC_ALE));
144
144 /* Enable the RTC */ 145 /* Enable the RTC */
145 out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, in_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) | (RTCSC_RTF | RTCSC_RTE)); 146 setbits16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, (RTCSC_RTF | RTCSC_RTE));
147
146} 148}
147 149
148/* The decrementer counts at the system (internal) clock frequency divided by 150/* The decrementer counts at the system (internal) clock frequency divided by
@@ -159,8 +161,7 @@ void __init m8xx_calibrate_decr(void)
159 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY); 161 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY);
160 162
161 /* Force all 8xx processors to use divide by 16 processor clock. */ 163 /* Force all 8xx processors to use divide by 16 processor clock. */
162 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr, 164 setbits32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr, 0x02000000);
163 in_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr)|0x02000000);
164 /* Processor frequency is MHz. 165 /* Processor frequency is MHz.
165 * The value 'fp' is the number of decrementer ticks per second. 166 * The value 'fp' is the number of decrementer ticks per second.
166 */ 167 */
@@ -239,8 +240,8 @@ m8xx_restart(char *cmd)
239 __volatile__ unsigned char dummy; 240 __volatile__ unsigned char dummy;
240 241
241 local_irq_disable(); 242 local_irq_disable();
242 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, in_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr) | 0x00000080);
243 243
244 setbits32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, 0x00000080);
244 /* Clear the ME bit in MSR to cause checkstop on machine check 245 /* Clear the ME bit in MSR to cause checkstop on machine check
245 */ 246 */
246 mtmsr(mfmsr() & ~0x1000); 247 mtmsr(mfmsr() & ~0x1000);
@@ -310,8 +311,8 @@ m8xx_init_IRQ(void)
310 i8259_init(0); 311 i8259_init(0);
311 312
312 /* The i8259 cascade interrupt must be level sensitive. */ 313 /* The i8259 cascade interrupt must be level sensitive. */
313 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, in_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel & ~(0x80000000 >> ISA_BRIDGE_INT)));
314 314
315 clrbits32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, (0x80000000 >> ISA_BRIDGE_INT));
315 if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction)) 316 if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction))
316 enable_irq(ISA_BRIDGE_INT); 317 enable_irq(ISA_BRIDGE_INT);
317#endif /* CONFIG_PCI */ 318#endif /* CONFIG_PCI */