Skip to contentSkip to conversation

e500: improve MPIC initialization

PATCH New Timur Tabi 2 participants 3 messages Aug 20, 2009 – Aug 21, 2009

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 e500: improve MPIC initialization

The MPIC initialization code for Freescale e500 CPUs was not using I/O accessors, and it was not issuing a read-back to the MPIC after setting mixed mode. This may be the cause of a spurious interrupt on some systems.

---
 cpu/mpc85xx/interrupts.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
cpu/mpc85xx/interrupts.c +7 -5
index 4ef8395..409367d 100644
@@ -31,15 +31,17 @@
 #include <watchdog.h>
 #include <command.h>
 #include <asm/processor.h>
+#include <asm/io.h>
 
-int interrupt_init_cpu(unsigned long *decrementer_count)
+int interrupt_init_cpu(unsigned int *decrementer_count)
 {
-	volatile ccsr_pic_t *pic = (void *)(CONFIG_SYS_MPC85xx_PIC_ADDR);
+	ccsr_pic_t __iomem *pic = (void *)CONFIG_SYS_MPC85xx_PIC_ADDR;
 
-	pic->gcr = MPC85xx_PICGCR_RST;
-	while (pic->gcr & MPC85xx_PICGCR_RST)
+	out_be32(&pic->gcr, MPC85xx_PICGCR_RST);
+	while (in_be32(&pic->gcr) & MPC85xx_PICGCR_RST)
 		;
-	pic->gcr = MPC85xx_PICGCR_M;
+	out_be32(&pic->gcr, MPC85xx_PICGCR_M);
+	in_be32(&pic->gcr);
 
 	*decrementer_count = get_tbclk() / CONFIG_SYS_HZ;
 
Signature · 1 line
1.6.0.6
author
#1 lore raw

PATCH 1/1 e500: improve MPIC initialization

Quoted 5 lines · Timur Tabi

The MPIC initialization code for Freescale e500 CPUs was not using I/O accessors, and it was not issuing a read-back to the MPIC after setting mixed mode. ?This may be the cause of a spurious interrupt on some systems.

The git summary should be "85xx: ..." not "e500: ...". Kumar, please amend the title if you apply this patch. Thanks.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
Applied
#2 lore raw

PATCH 1/1 e500: improve MPIC initialization

In reply to Timur Tabi
Quoted 9 lines · Timur Tabi

The MPIC initialization code for Freescale e500 CPUs was not using I/O accessors, and it was not issuing a read-back to the MPIC after setting mixed
mode. This may be the cause of a spurious interrupt on some systems.

---
cpu/mpc85xx/interrupts.c | 12 +++++++-----

1 files changed, 7 insertions(+), 5 deletions(-)

applied to 85xx next

- k