Skip to contentSkip to conversation

powerpc: Support for "weird" MPICs and fixup mpc7448_hpc2

PATCH In review Benjamin Herrenschmidt 2 participants 3 messages Aug 25, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Support for "weird" MPICs and fixup mpc7448_hpc2

This patch is a slightly cleaned up version of Zang Roy's support for the TSI108 MPIC variant. It also fixes up MPC7448_hpc2 to use the new version of the type macros and changes the way MPIC is selected in Kconfig to better match what is done for other system devices.

---

Zang Roy, please verify that it still works for you. I've tested it on an Apple G5 with and without CONFIG_MPIC_WEIRD .

Quoted 1 line

From [email protected] Thu Aug 24 05:04:51 2006

Return-Path: <[email protected]>
Received: from de01egw01.freescale.net (de01egw01.freescale.net

	[192.88.165.102]) by gate.crashing.org (8.12.8/8.12.8) with ESMTP id
	k7OA4mAu020592 for <[email protected]>; Thu, 24 Aug 2006 05:04:51
	-0500
Received: from de01smr01.freescale.net (de01smr01.freescale.net
	[10.208.0.31]) by de01egw01.freescale.net (8.12.11/de01egw01) with ESMTP id
	k7OBBP81018127 for <[email protected]>; Thu, 24 Aug 2006 05:11:25
	-0600 (MDT)
Received: from zch01exm23.fsl.freescale.net (zch01exm23.ap.freescale.net
	[10.192.129.207]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id
	k7O9qXun020289 for <[email protected]>; Thu, 24 Aug 2006 04:52:34
	-0500 (CDT)
Received: from [10.193.20.86] ([10.193.20.86]) by
	zch01exm23.fsl.freescale.net with Microsoft SMTPSVC(6.0.3790.2499); Thu, 24
	Aug 2006 17:52:32 +0800

Subject: Re: [PATCH ] powerpc: Add tsi108/9 and non standard mpic support
From: Zang Roy-r61911 <[email protected]>
To: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>, linuxppc-dev list <[email protected]>, Yang Xin-Xin-r48390 <[email protected]>
In-Reply-To: <[email protected]>
References:

	 <7EA18FDD2DC2154AA3BD6D2F22A62A0E19E353@zch01exm23.fsl.freescale.net>
	 <[email protected]>
	 <[email protected]>

Content-Type: text/plain
Organization:
Message-Id: <[email protected]>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4)
Date: 24 Aug 2006 17:52:15 +0800
X-OriginalArrivalTime: 24 Aug 2006 09:52:32.0621 (UTC)

	FILETIME=[04FFF1D0:01C6C763]
X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on gate.crashing.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0
	tests=AWL,BAYES_00,UPPERCASE_25_50  autolearn=no version=3.0.1

Status:
X-Evolution-Source: pop://benh@localhost:10110/
Content-Transfer-Encoding: 8bit

Quoted 26 lines · Benjamin Herrenschmidt
Quoted 11 lines · On Thu, 2006-08-24 at 13:42 +0800, Zang Roy-r61911 wrote:
Quoted 10 lines · On Tue, 2006-08-22 at 18:07, Zang Roy-r61911 wrote:

The patch adds new hardware information table for mpic. This enables mpic code to deal with mpic controller with hardware behavior difference.

CONFIG_MPIC_WEIRD is introduced in the code.
If a board with non standard mpic controller, it can select the CONFIG_MPIC_WEIRD with board and add its hardware information in the array mpic_infos.

TSI108/109 PIC takes the first index of weird hardware

information

Quoted 1 line
Quoted 1 line

table:) . The table can be extended. The Tsi108/109 PIC looks

like

Quoted 1 line
Quoted 1 line

standard OpenPIC but, in fact, is different in registers mapping

and

Quoted 1 line
Quoted 1 line

behavior.

The table should still contain the entries for a normal MPIC. One can build a kernel that will boot both machines with the "weird" one and with the normal one. Thus CONFIG_MPIC_WEIRD shall not exclude normal MPICs, though not having it does exclude weird ones. I thus would suggest to keep the table as it was in your earlier patches, that is with the normal MPIC mapping at 0.

Quoted 2 lines

I intend to re-use that to handle another weird MPIC from some other project :)

That is also my target. I hope the imported mpic_info table can support more non-standard mpic structure.
The following patch adds the standard MPIC entry to the table. I post it here.

arch/powerpc/Kconfig +14 -6
Index: linux-work/arch/powerpc/Kconfig
===================================================================
@@ -354,6 +354,7 @@ endchoice
 config PPC_PSERIES
 	depends on PPC_MULTIPLATFORM && PPC64
 	bool "IBM pSeries & new (POWER5-based) iSeries"
+	select MPIC
 	select PPC_I8259
 	select PPC_RTAS
 	select RTAS_ERROR_LOGGING
@@ -363,6 +364,7 @@ config PPC_PSERIES
 config PPC_CHRP
 	bool "Common Hardware Reference Platform (CHRP) based machines"
 	depends on PPC_MULTIPLATFORM && PPC32
+	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
 	select PPC_RTAS
@@ -373,6 +375,7 @@ config PPC_CHRP
 config PPC_PMAC
 	bool "Apple PowerMac based machines"
 	depends on PPC_MULTIPLATFORM
+	select MPIC
 	select PPC_INDIRECT_PCI if PPC32
 	select PPC_MPC106 if PPC32
 	default y
@@ -380,6 +383,7 @@ config PPC_PMAC
 config PPC_PMAC64
 	bool
 	depends on PPC_PMAC && POWER4
+	select MPIC
 	select U3_DART
 	select MPIC_BROKEN_U3
 	select GENERIC_TBSYNC
@@ -389,6 +393,7 @@ config PPC_PMAC64
 config PPC_PREP
 	bool "PowerPC Reference Platform (PReP) based machines"
 	depends on PPC_MULTIPLATFORM && PPC32 && BROKEN
+	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
 	select PPC_UDBG_16550
@@ -397,6 +402,7 @@ config PPC_PREP
 config PPC_MAPLE
 	depends on PPC_MULTIPLATFORM && PPC64
 	bool "Maple 970FX Evaluation Board"
+	select MPIC
 	select U3_DART
 	select MPIC_BROKEN_U3
 	select GENERIC_TBSYNC
@@ -439,12 +445,6 @@ config U3_DART
 	depends on PPC_MULTIPLATFORM && PPC64
 	default n
 
-config MPIC
-	depends on PPC_PSERIES || PPC_PMAC || PPC_MAPLE || PPC_CHRP \
-			       || MPC7448HPC2
-	bool
-	default y
-
 config PPC_RTAS
 	bool
 	default n
@@ -812,6 +812,14 @@ config GENERIC_ISA_DMA
 	depends on PPC64 || POWER4 || 6xx && !CPM2
 	default y
 
+config MPIC
+	bool
+	default n
+
+config MPIC_WEIRD
+	bool
+	default n
+
 config PPC_I8259
 	bool
 	default n
arch/powerpc/sysdev/mpic.c +164 -59

430 lines not on this page · raw message

include/asm-powerpc/mpic.h +125 -0

164 lines not on this page · raw message

arch/powerpc/platforms/embedded6xx/Kconfig +1 -0
Index: linux-work/arch/powerpc/platforms/embedded6xx/Kconfig
===================================================================
@@ -80,6 +80,7 @@ config MPC7448HPC2
 	select DEFAULT_UIMAGE
 	select PPC_UDBG_16550
 	select MPIC
+	select MPIC_WEIRD
 	help
 	  Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
 	  platform
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c +1 -1
Index: linux-work/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
===================================================================
@@ -248,7 +248,7 @@ static void __init mpc7448_hpc2_init_IRQ
 
 	mpic = mpic_alloc(mpic_paddr,
 			MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
-			MPIC_SPV_EOI | MPIC_MOD_ID(MPIC_ID_TSI108),
+			MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
 			0, /* num_sources used */
 			TSI108_IRQ_BASE,
 			0, /* num_sources used */
#1 lore raw
Quoted 5 lines · Benjamin Herrenschmidt

This patch is a slightly cleaned up version of Zang Roy's support for the TSI108 MPIC variant. It also fixes up MPC7448_hpc2 to use the new version of the type macros and changes the way MPIC is selected in Kconfig to better match what is done for other system devices.

Quoted 7 lines

---

Zang Roy, please verify that it still works for you. I've tested it on an Apple G5 with and without CONFIG_MPIC_WEIRD .

It works OK on my mpc7448hpc2 board.
There is a sequence for the patch applying.

(1) patch for IRQ update for mpc7448hpc2:
http://ozlabs.org/pipermail/linuxppc-dev/2006-August/025559.html

(2) the weird mpic patch repost by your mail.
(3) the following minor patch to build mpic.o for CONFIG_MPIC_WEIRD

---

arch/powerpc/sysdev/Makefile +1 -0
index cebfae2..8ae887b 100644
@@ -3,6 +3,7 @@ EXTRA_CFLAGS			+= -mno-minimal-toc
 endif
 
 obj-$(CONFIG_MPIC)		+= mpic.o
+obj-$(CONFIG_MPIC_WEIRD)	+= mpic.o
 obj-$(CONFIG_PPC_INDIRECT_PCI)	+= indirect_pci.o
 obj-$(CONFIG_PPC_MPC106)	+= grackle.o
 obj-$(CONFIG_BOOKE)		+= dcr.o
#2 lore raw
Quoted 14 lines · On Fri, 2006-08-25 at 15:47 +0800, Zang Roy-r61911 wrote:
Quoted 5 lines · Benjamin Herrenschmidt

This patch is a slightly cleaned up version of Zang Roy's support for the TSI108 MPIC variant. It also fixes up MPC7448_hpc2 to use the new version of the type macros and changes the way MPIC is selected in Kconfig to better match what is done for other system devices.

Quoted 7 lines

---

Zang Roy, please verify that it still works for you. I've tested it on an Apple G5 with and without CONFIG_MPIC_WEIRD .

Quoted 8 lines

It works OK on my mpc7448hpc2 board.
There is a sequence for the patch applying.

(1) patch for IRQ update for mpc7448hpc2:
http://ozlabs.org/pipermail/linuxppc-dev/2006-August/025559.html

(2) the weird mpic patch repost by your mail.
(3) the following minor patch to build mpic.o for CONFIG_MPIC_WEIRD

The later shouldn't be needed.

CONFIG_MPIC_WEIRD is an _addition_ to CONFIG_MPIC. That is, for example, your HPC2 platform should define both CONFIG_MPIC and CONFIG_MPIC_WEIRD

Ben.