Skip to contentSkip to conversation

: sparc32: Use OF device probing for sun4m irq

PATCH In review David Miller 2 participants 7 messages Sep 9, 2008 – Sep 10, 2008 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 2/2 : sparc32: Use OF device probing for sun4m irq

sparc32: Use OF device probing for sun4m irq registers.

---
 arch/sparc/kernel/entry.S     |   38 ++++----
 arch/sparc/kernel/sun4m_irq.c |  192 +++++++++++++++++------------------------
 2 files changed, 99 insertions(+), 131 deletions(-)
arch/sparc/kernel/entry.S +19 -19
index 68689fa..19b20a0 100644
@@ -272,17 +272,18 @@ smp4m_ticker:
 	 */
 maybe_smp4m_msg:
 	GET_PROCESSOR4M_ID(o3)
-	set	sun4m_interrupts, %l5
-	ld	[%l5], %o5
+	sethi	%hi(sun4m_irq_percpu), %l5
+	ld	[%l5 + %lo(sun4m_irq_percpu)], %o5
 	sethi	%hi(0x40000000), %o2
-	sll	%o3, 12, %o3
+	sll	%o3, 2, %o3
 	ld	[%o5 + %o3], %o1
+	ld	[%o1 + 0x00], %o1	! sun4m_irq_percpu[cpu]->pending
 	andcc	%o1, %o2, %g0
 	be,a	smp4m_ticker
 	 cmp	%l7, 14
-	st	%o2, [%o5 + 0x4]
+	st	%o2, [%o1 + 0x04]	! sun4m_irq_percpu[cpu]->clear=0x40000000
 	WRITE_PAUSE
-	ld	[%o5], %g0
+	ld	[%o1 + 0x00], %g0	! sun4m_irq_percpu[cpu]->pending
 	WRITE_PAUSE
 	or	%l0, PSR_PIL, %l4
 	wr	%l4, 0x0, %psr
@@ -300,16 +301,16 @@ linux_trap_ipi15_sun4m:
 	SAVE_ALL
 	sethi	%hi(0x80000000), %o2
 	GET_PROCESSOR4M_ID(o0)
-	set	sun4m_interrupts, %l5
-	ld	[%l5], %o5
-	sll	%o0, 12, %o0
-	add	%o5, %o0, %o5
-	ld	[%o5], %o3
+	sethi	%hi(sun4m_irq_percpu), %l5
+	ld	[%l5 + %lo(sun4m_irq_percpu)], %o5
+	sll	%o0, 2, %o0
+	ld	[%o5 + %o0], %o5
+	ld	[%o5 + 0x00], %o3	! sun4m_irq_percpu[cpu]->pending
 	andcc	%o3, %o2, %g0
 	be	1f			! Must be an NMI async memory error
-	 st	%o2, [%o5 + 4]
+	 st	%o2, [%o5 + 0x04]	! sun4m_irq_percpu[cpu]->clear=0x80000000
 	WRITE_PAUSE
-	ld	[%o5], %g0
+	ld	[%o5 + 0x00], %g0	! sun4m_irq_percpu[cpu]->pending
 	WRITE_PAUSE
 	or	%l0, PSR_PIL, %l4
 	wr	%l4, 0x0, %psr
@@ -323,12 +324,11 @@ linux_trap_ipi15_sun4m:
 1:
 	/* NMI async memory error handling. */
 	sethi	%hi(0x80000000), %l4
-	sethi	%hi(0x4000), %o3
-	sub	%o5, %o0, %o5
-	add	%o5, %o3, %l5
-	st	%l4, [%l5 + 0xc]
+	sethi	%hi(sun4m_irq_global), %o5
+	ld	[%o5 + %lo(sun4m_irq_global)], %l5
+	st	%l4, [%l5 + 0x0c]	! sun4m_irq_global->mask_set=0x80000000
 	WRITE_PAUSE
-	ld	[%l5], %g0
+	ld	[%l5 + 0x00], %g0	! sun4m_irq_global->pending
 	WRITE_PAUSE
 	or	%l0, PSR_PIL, %l4
 	wr	%l4, 0x0, %psr
@@ -337,9 +337,9 @@ linux_trap_ipi15_sun4m:
 	WRITE_PAUSE
 	call	sun4m_nmi
 	 nop
-	st	%l4, [%l5 + 0x8]
+	st	%l4, [%l5 + 0x08]	! sun4m_irq_global->mask_clear=0x80000000
 	WRITE_PAUSE
-	ld	[%l5], %g0
+	ld	[%l5 + 0x00], %g0	! sun4m_irq_global->pending
 	WRITE_PAUSE
 	RESTORE_ALL
 
arch/sparc/kernel/sun4m_irq.c +80 -112

265 lines not on this page · raw message

Signature · 1 line
1.5.6.5.GIT
#1 lore raw

Re: [PATCH 2/2]: sparc32: Use OF device probing for sun4m irq registers.

With both patches applied, I get:

<#0> ok boot
Boot device: /iommu/sbus/SUNW,fas/sd@0,0 File and args:
SILO Version 1.4.13
boot:
Uncompressing image...
Loading kernel version 2.6.27
Loading initial ramdisk (2738820 bytes at 0x3000000 phys, 0x60000000 virt)...
PROMLIB: obio_ranges 5
OF stdout device is: /iommu@f,e0000000/sbus@f,e0001000/cgsix@3,0 Booting Linux...
Level 15 Interrupt
<#2 ok>

#3 lore raw

Re: [PATCH 2/2]: sparc32: Use OF device probing for sun4m irq registers.

In reply to David Miller
Quoted 6 lines · David Miller

Thanks for testing, can you revert the second one, ie. have only the first one applied?

Thanks.

No joy. Rather than a level 15 interrupt, I now just get a hang after:
Booting Linux...

author maintainer
#4 lore raw
In reply to David Miller

From: Robert Reif <[email protected]>
Date: Wed, 10 Sep 2008 19:41:09 -0400

Quoted 9 lines
Quoted 6 lines · David Miller

Thanks for testing, can you revert the second one, ie. have only the first one applied?

Thanks.

No joy. Rather than a level 15 interrupt, I now just get a hang after:
Booting Linux...

Thanks a lot for testing, I'll try to figure out what is wrong and post new patches.

#5 lore raw

Re: [PATCH 2/2]: sparc32: Use OF device probing for sun4m irq registers.

In reply to David Miller
Quoted 13 lines · David Miller

From: Robert Reif <[email protected]>
Date: Wed, 10 Sep 2008 19:41:09 -0400

Quoted 9 lines
Quoted 7 lines · David Miller

Thanks for testing, can you revert the second one, ie. have only the first one applied?

Thanks.

Quoted 8 lines
Quoted 3 lines

No joy. Rather than a level 15 interrupt, I now just get a hang after:
Booting Linux...

Thanks a lot for testing, I'll try to figure out what is wrong and post new patches.

Hang on. I looked at my command line history and applied the second patch rather than the first.

Give me a few minutes to try the right patch.

author maintainer
#6 lore raw
In reply to David Miller

From: Robert Reif <[email protected]>
Date: Wed, 10 Sep 2008 19:45:04 -0400

Quoted 4 lines

Hang on. I looked at my command line history and applied the second patch rather than the first.

Give me a few minutes to try the right patch.

OK :)