
From: Sylvain Munaut <tnt@246tNt.com>

We remove all usage of the OCP system as preparation to switch to the platform
bus model / ppc_sys model.  This is only for 'generic' support, drivers are
adapted separatly, afterwards.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/ppc/Kconfig                |    2 +-
 25-akpm/arch/ppc/platforms/Makefile     |    2 +-
 25-akpm/arch/ppc/platforms/lite5200.c   |   32 ++------------------------------
 25-akpm/arch/ppc/syslib/mpc52xx_setup.c |   10 ----------
 25-akpm/include/asm-ppc/mpc52xx.h       |    2 --
 5 files changed, 4 insertions(+), 44 deletions(-)

diff -puN arch/ppc/Kconfig~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx arch/ppc/Kconfig
--- 25/arch/ppc/Kconfig~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx	Wed Mar 30 13:32:54 2005
+++ 25-akpm/arch/ppc/Kconfig	Wed Mar 30 13:32:54 2005
@@ -812,7 +812,7 @@ config MPC10X_BRIDGE
 
 config FSL_OCP
 	bool
-	depends on MPC10X_BRIDGE || PPC_MPC52xx
+	depends on MPC10X_BRIDGE
 	default y
 
 config MPC10X_OPENPIC
diff -puN arch/ppc/platforms/lite5200.c~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx arch/ppc/platforms/lite5200.c
--- 25/arch/ppc/platforms/lite5200.c~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx	Wed Mar 30 13:32:54 2005
+++ 25-akpm/arch/ppc/platforms/lite5200.c	Wed Mar 30 13:32:54 2005
@@ -13,7 +13,7 @@
  * Dale Farnsworth <dale.farnsworth@mvista.com> and
  * Wolfgang Denk <wd@denx.de>
  * 
- * Copyright 2004 Sylvain Munaut <tnt@246tNt.com>
+ * Copyright 2004-2005 Sylvain Munaut <tnt@246tNt.com>
  * Copyright 2003 Motorola Inc.
  * Copyright 2003 MontaVista Software Inc.
  * Copyright 2003 DENX Software Engineering (wd@denx.de)
@@ -29,10 +29,10 @@
 #include <linux/kdev_t.h>
 #include <linux/root_dev.h>
 #include <linux/console.h>
+#include <linux/module.h>
 
 #include <asm/bootinfo.h>
 #include <asm/io.h>
-#include <asm/ocp.h>
 #include <asm/mpc52xx.h>
 
 #include <syslib/mpc52xx_pci.h>
@@ -46,31 +46,6 @@ EXPORT_SYMBOL(__res);	/* For modules */
 
 
 /* ======================================================================== */
-/* OCP device definition                                                    */
-/* For board/shared resources like PSCs                                     */
-/* ======================================================================== */
-/* Be sure not to load conficting devices : e.g. loading the UART drivers for
- * PSC1 and then also loading a AC97 for this same PSC.
- * For details about how to create an entry, look in the doc of the concerned
- * driver ( eg drivers/serial/mpc52xx_uart.c for the PSC in uart mode )
- */
-
-static struct ocp_def board_ocp[] = {
-	{
-		.vendor		= OCP_VENDOR_FREESCALE,
-		.function	= OCP_FUNC_PSC_UART,
-		.index		= 0,
-		.paddr		= MPC52xx_PSC1,
-		.irq		= MPC52xx_PSC1_IRQ,
-		.pm		= OCP_CPM_NA,
-	},
-	{	/* Terminating entry */
-		.vendor		= OCP_VENDOR_INVALID
-	}
-};
-
-
-/* ======================================================================== */
 /* Platform specific code                                                   */
 /* ======================================================================== */
 
@@ -131,9 +106,6 @@ unmap_regs:
 static void __init
 lite5200_setup_arch(void)
 {
-	/* Add board OCP definitions */
-	mpc52xx_add_board_devices(board_ocp);
-
 	/* CPU & Port mux setup */
 	lite5200_setup_cpu();
 
diff -puN arch/ppc/platforms/Makefile~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx arch/ppc/platforms/Makefile
--- 25/arch/ppc/platforms/Makefile~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx	Wed Mar 30 13:32:54 2005
+++ 25-akpm/arch/ppc/platforms/Makefile	Wed Mar 30 13:32:54 2005
@@ -45,7 +45,7 @@ obj-$(CONFIG_RADSTONE_PPC7D)	+= radstone
 obj-$(CONFIG_SANDPOINT)		+= sandpoint.o
 obj-$(CONFIG_SBC82xx)		+= sbc82xx.o
 obj-$(CONFIG_SPRUCE)		+= spruce.o
-obj-$(CONFIG_LITE5200)		+= lite5200.o mpc5200.o
+obj-$(CONFIG_LITE5200)		+= lite5200.o
 
 ifeq ($(CONFIG_SMP),y)
 obj-$(CONFIG_PPC_PMAC)		+= pmac_smp.o
diff -puN arch/ppc/syslib/mpc52xx_setup.c~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx arch/ppc/syslib/mpc52xx_setup.c
--- 25/arch/ppc/syslib/mpc52xx_setup.c~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx	Wed Mar 30 13:32:54 2005
+++ 25-akpm/arch/ppc/syslib/mpc52xx_setup.c	Wed Mar 30 13:32:54 2005
@@ -23,7 +23,6 @@
 #include <asm/time.h>
 #include <asm/mpc52xx.h>
 #include <asm/mpc52xx_psc.h>
-#include <asm/ocp.h>
 #include <asm/pgtable.h>
 #include <asm/ppcboot.h>
 
@@ -218,12 +217,3 @@ mpc52xx_calibrate_decr(void)
 	tb_ticks_per_jiffy = xlbfreq / HZ / divisor;
 	tb_to_us = mulhwu_scale_factor(xlbfreq / divisor, 1000000);
 }
-
-
-void __init
-mpc52xx_add_board_devices(struct ocp_def board_ocp[]) {
-	while (board_ocp->vendor != OCP_VENDOR_INVALID)
-		if(ocp_add_one_device(board_ocp++))
-			printk("mpc5200-ocp: Failed to add board device !\n");
-}
-
diff -puN include/asm-ppc/mpc52xx.h~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx include/asm-ppc/mpc52xx.h
--- 25/include/asm-ppc/mpc52xx.h~ppc32-remove-the-ocp-system-from-the-freescale-mpc52xx	Wed Mar 30 13:32:54 2005
+++ 25-akpm/include/asm-ppc/mpc52xx.h	Wed Mar 30 13:32:54 2005
@@ -26,7 +26,6 @@
 #include <asm/types.h>
 
 struct pt_regs;
-struct ocp_def;
 #endif /* __ASSEMBLY__ */
 
 
@@ -391,7 +390,6 @@ extern void mpc52xx_halt(void);
 extern void mpc52xx_power_off(void);
 extern void mpc52xx_progress(char *s, unsigned short hex);
 extern void mpc52xx_calibrate_decr(void);
-extern void mpc52xx_add_board_devices(struct ocp_def board_ocp[]);
 
 extern void mpc52xx_find_bridges(void);
 
_
