Skip to contentSkip to conversation

OCP for MP10x

PATCH In review Adrian Cox 3 participants 3 messages Jun 29, 2004

lore
Share & tools
lore

Adrian Cox

author
#0 lore raw

PATCH 1/1 OCP for MP10x

Attached is the latest version of my OCP patch for MPC107/8240/8245. This unifies some openpic setup code, and ensures that the OCP devices are only added to the bus on chip variants which have them.

All interested parties seem happy, and this patch is necessary to provide a unified I2C driver for 85xx and 107/824x.

- Adrian Cox
Humboldt Solutions Ltd.

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/06/29 10:09:24+01:00 [email protected]
# ocp2.patch
#

# include/asm-ppc/mpc10x.h
#   2004/06/20 17:40:17+01:00 [email protected] +3 -0
#   Import patch ocp2.patch
#
# arch/ppc/syslib/mpc10x_common.c
#   2004/06/20 17:40:17+01:00 [email protected] +79 -2
#   Import patch ocp2.patch
#
# arch/ppc/syslib/Makefile
#   2004/06/20 17:40:17+01:00 [email protected] +4 -3
#   Import patch ocp2.patch
#
# arch/ppc/platforms/sandpoint.c
#   2004/06/20 17:40:17+01:00 [email protected] +1 -11
#   Import patch ocp2.patch
#
# arch/ppc/platforms/powerpmc250.c
#   2004/06/20 17:40:17+01:00 [email protected] +1 -1
#   Import patch ocp2.patch
#
# arch/ppc/platforms/lopec_setup.c
#   2004/06/20 17:40:17+01:00 [email protected] +1 -14
#   Import patch ocp2.patch
#
# arch/ppc/Kconfig
#   2004/06/20 17:40:17+01:00 [email protected] +10 -0
#   Import patch ocp2.patch
#
diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig
--- a/arch/ppc/Kconfig	Tue Jun 29 14:36:09 2004
+++ b/arch/ppc/Kconfig	Tue Jun 29 14:36:09 2004
@@ -679,6 +679,16 @@
 	depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT
 	default y

+config FSL_OCP
+ bool
+ depends on MPC10X_BRIDGE
+ default y
+
+config MPC10X_OPENPIC
+ bool
+ depends on POWERPMC250 || LOPEC || SANDPOINT
+ default y
+
config MPC10X_STORE_GATHERING
bool "Enable MPC10x store gathering"
depends on MPC10X_BRIDGE

arch/ppc/platforms/lopec_setup.c +1 -14
diff -Nru a/arch/ppc/platforms/lopec_setup.c b/arch/ppc/platforms/lopec_setup.c
@@ -193,21 +193,8 @@
 	OpenPIC_InitSenses = lopec_openpic_initsenses;
 	OpenPIC_NumInitSenses = sizeof(lopec_openpic_initsenses);
 
-	/*
-	 * We need to tell openpic_set_sources where things actually are.
-	 * mpc10x_common will setup OpenPIC_Addr at ioremap(EUMB phys base +
-	 * EPIC offset (0x40000));  The EPIC IRQ Register Address Map -
-	 * Interrupt Source Configuration Registers gives these numbers
-	 * as offsets starting at 0x50200, we need to adjust occordinly.
-	 */
-	/* Map serial interrupts 0-15 */
-	openpic_set_sources(0, 16, OpenPIC_Addr + 0x10200);
-	/* Skip reserved space and map i2c and DMA Ch[01] */
-	openpic_set_sources(16, 3, OpenPIC_Addr + 0x11020);
-	/* Skip reserved space and map Message Unit Interrupt (I2O) */
-	openpic_set_sources(19, 1, OpenPIC_Addr + 0x110C0);
+	mpc10x_set_openpic();
 
-	openpic_init(NUM_8259_INTERRUPTS);
 	/* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
 	openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
 			&i8259_irq);
arch/ppc/platforms/powerpmc250.c +1 -1
diff -Nru a/arch/ppc/platforms/powerpmc250.c b/arch/ppc/platforms/powerpmc250.c
@@ -197,7 +197,7 @@
 
 	OpenPIC_InitSenses = powerpmc250_openpic_initsenses;
 	OpenPIC_NumInitSenses = sizeof(powerpmc250_openpic_initsenses);
-	openpic_init(1, 0, 0, -1);
+	mpc10x_set_openpic();
 }
 
 /*
arch/ppc/platforms/sandpoint.c +1 -11
diff -Nru a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
@@ -433,17 +433,7 @@
 	OpenPIC_InitSenses = sandpoint_openpic_initsenses;
 	OpenPIC_NumInitSenses = sizeof(sandpoint_openpic_initsenses);
 
-	/*
-	 * We need to tell openpic_set_sources where things actually are.
-	 * mpc10x_common will setup OpenPIC_Addr at ioremap(EUMB phys base +
-	 * EPIC offset (0x40000));  The EPIC IRQ Register Address Map -
-	 * Interrupt Source Configuration Registers gives these numbers
-	 * as offsets starting at 0x50200, we need to adjust occordinly.
-	 */
-	/* Map serial interrupts 0-15 */
-	openpic_set_sources(0, 16, OpenPIC_Addr + 0x10200);
-
-	openpic_init(NUM_8259_INTERRUPTS);
+	mpc10x_set_openpic();
 	openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
 			i8259_irq);
 
arch/ppc/syslib/Makefile +4 -3
diff -Nru a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
@@ -51,7 +51,7 @@
 obj-$(CONFIG_GEMINI)		+= open_pic.o indirect_pci.o
 obj-$(CONFIG_K2)		+= i8259.o indirect_pci.o todc_time.o \
 					pci_auto.o
-obj-$(CONFIG_LOPEC)		+= pci_auto.o open_pic.o i8259.o todc_time.o
+obj-$(CONFIG_LOPEC)		+= i8259.o pci_auto.o todc_time.o
 obj-$(CONFIG_MCPN765)		+= todc_time.o indirect_pci.o pci_auto.o \
 					open_pic.o i8259.o hawk_common.o
 obj-$(CONFIG_MENF1)		+= todc_time.o i8259.o mpc10x_common.o \
@@ -61,14 +61,14 @@
 obj-$(CONFIG_OCOTEA)		+= indirect_pci.o pci_auto.o todc_time.o
 obj-$(CONFIG_PAL4)		+= cpc700_pic.o
 obj-$(CONFIG_PCORE)		+= todc_time.o i8259.o pci_auto.o
-obj-$(CONFIG_POWERPMC250)	+= open_pic.o pci_auto.o
+obj-$(CONFIG_POWERPMC250)	+= pci_auto.o
 obj-$(CONFIG_PPLUS)		+= hawk_common.o open_pic.o i8259.o \
 				   indirect_pci.o todc_time.o pci_auto.o
 obj-$(CONFIG_PRPMC750)		+= open_pic.o indirect_pci.o pci_auto.o \
 					hawk_common.o
 obj-$(CONFIG_HARRIER)		+= harrier.o
 obj-$(CONFIG_PRPMC800)		+= open_pic.o indirect_pci.o pci_auto.o
-obj-$(CONFIG_SANDPOINT)		+= i8259.o open_pic.o pci_auto.o todc_time.o
+obj-$(CONFIG_SANDPOINT)		+= i8259.o pci_auto.o todc_time.o
 obj-$(CONFIG_SBC82xx)		+= todc_time.o
 obj-$(CONFIG_SPRUCE)		+= cpc700_pic.o indirect_pci.o pci_auto.o \
 				   todc_time.o
@@ -79,6 +79,7 @@
 endif
 obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
 obj-$(CONFIG_MPC10X_BRIDGE)     += mpc10x_common.o indirect_pci.o
+obj-$(CONFIG_MPC10X_OPENPIC)	+= open_pic.o
 obj-$(CONFIG_40x)		+= dcr.o
 obj-$(CONFIG_BOOKE)		+= dcr.o
 obj-$(CONFIG_85xx)		+= open_pic.o ppc85xx_common.o ppc85xx_setup.o
arch/ppc/syslib/mpc10x_common.c +79 -2

100 lines not on this page · raw message

include/asm-ppc/mpc10x.h +3 -0
diff -Nru a/include/asm-ppc/mpc10x.h b/include/asm-ppc/mpc10x.h
@@ -164,4 +164,7 @@
 int mpc10x_enable_store_gathering(struct pci_controller *hose);
 int mpc10x_disable_store_gathering(struct pci_controller *hose);
 
+/* For MPC107 boards that use the built-in openpic */
+void mpc10x_set_openpic(void);
+
 #endif	/* __PPC_KERNEL_MPC10X_H */
#1 lore raw

Tom,

This patch looks good to me.

- kumar

Quoted 10 lines · Adrian Cox

Attached is the latest version of my OCP patch for MPC107/8240/8245. This unifies some openpic setup code, and ensures that the OCP devices are only added to the bus on chip variants which have them. All interested parties seem happy, and this patch is necessary to provide a unified I2C driver for 85xx and 107/824x.

- Adrian Cox
Humboldt Solutions Ltd.

<ocp3.patch>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
In reply to Adrian Cox
Quoted 8 lines · Adrian Cox

Attached is the latest version of my OCP patch for MPC107/8240/8245. This unifies some openpic setup code, and ensures that the OCP devices are only added to the bus on chip variants which have them.

All interested parties seem happy, and this patch is necessary to provide a unified I2C driver for 85xx and 107/824x.

OK. I'm going to fire this up on my LoPEC and then Sandpoint, and if it's happy, I'll pass it along to akpm.

--
Tom Rini
http://gate.crashing.org/~trini/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/