Index: testing/arch/ppc/platforms/fads.h
===================================================================
--- testing.orig/arch/ppc/platforms/fads.h	2005-11-16 14:06:42.000000000 -0200
+++ testing/arch/ppc/platforms/fads.h	2005-11-16 14:06:48.000000000 -0200
@@ -25,6 +25,8 @@
 
 #if defined(CONFIG_MPC86XADS)
 
+#define BOARD_CHIP_NAME "MPC86X"
+
 /* U-Boot maps BCSR to 0xff080000 */
 #define BCSR_ADDR		((uint)0xff080000)
 
Index: testing/arch/ppc/platforms/mpc885ads.h
===================================================================
--- testing.orig/arch/ppc/platforms/mpc885ads.h	2005-11-16 14:06:42.000000000 -0200
+++ testing/arch/ppc/platforms/mpc885ads.h	2005-11-16 14:06:48.000000000 -0200
@@ -88,5 +88,7 @@
 #define SICR_ENET_MASK	((uint)0x00ff0000)
 #define SICR_ENET_CLKRT	((uint)0x002c0000)
 
+#define BOARD_CHIP_NAME "MPC885"
+
 #endif /* __ASM_MPC885ADS_H__ */
 #endif /* __KERNEL__ */
Index: testing/arch/ppc/syslib/m8260_setup.c
===================================================================
--- testing.orig/arch/ppc/syslib/m8260_setup.c	2005-11-16 14:06:42.000000000 -0200
+++ testing/arch/ppc/syslib/m8260_setup.c	2005-11-16 14:06:48.000000000 -0200
@@ -62,6 +62,10 @@
 	if (initrd_start)
 		ROOT_DEV = Root_RAM0;
 #endif
+
+	identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME,
+				in_be32(CPM_MAP_ADDR + CPM_IMMR_OFFSET));
+
 	m82xx_board_setup();
 }
 
Index: testing/arch/ppc/syslib/m8xx_setup.c
===================================================================
--- testing.orig/arch/ppc/syslib/m8xx_setup.c	2005-11-16 14:06:42.000000000 -0200
+++ testing/arch/ppc/syslib/m8xx_setup.c	2005-11-16 14:06:48.000000000 -0200
@@ -404,6 +404,8 @@
 		strcpy(cmd_line, (char *)(r6+KERNELBASE));
 	}
 
+	identify_ppc_sys_by_name(BOARD_CHIP_NAME);
+
 	ppc_md.setup_arch		= m8xx_setup_arch;
 	ppc_md.show_percpuinfo		= m8xx_show_percpuinfo;
 	ppc_md.irq_canonicalize	= NULL;
Index: testing/arch/ppc/syslib/mpc8xx_sys.c
===================================================================
--- testing.orig/arch/ppc/syslib/mpc8xx_sys.c	2005-11-16 14:06:42.000000000 -0200
+++ testing/arch/ppc/syslib/mpc8xx_sys.c	2005-11-16 14:06:48.000000000 -0200
@@ -24,7 +24,7 @@
 		.ppc_sys_name	= "MPC86X",
 		.mask 		= 0xFFFFFFFF,
 		.value 		= 0x00000000,
-		.num_devices	= 2,
+		.num_devices	= 7,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC8xx_CPM_FEC1,
@@ -40,7 +40,7 @@
 		.ppc_sys_name	= "MPC885",
 		.mask 		= 0xFFFFFFFF,
 		.value 		= 0x00000000,
-		.num_devices	= 3,
+		.num_devices	= 8,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC8xx_CPM_FEC1,
Index: testing/arch/ppc/syslib/ppc_sys.c
===================================================================
--- testing.orig/arch/ppc/syslib/ppc_sys.c	2005-11-16 14:06:42.000000000 -0200
+++ testing/arch/ppc/syslib/ppc_sys.c	2005-11-16 14:06:48.000000000 -0200
@@ -69,6 +69,9 @@
 			matched[j++] = i;
 		i++;
 	}
+
+	ret = i;
+
 	if (j != 0) {
 		for (i = 0; i < j; i++) {
 			if ((ppc_sys_specs[matched[i]].mask & id) ==
Index: testing/include/asm-ppc/cpm2.h
===================================================================
--- testing.orig/include/asm-ppc/cpm2.h	2005-11-16 14:06:42.000000000 -0200
+++ testing/include/asm-ppc/cpm2.h	2005-11-16 14:06:48.000000000 -0200
@@ -1087,6 +1087,9 @@
 #define SCCR_PCIDF_MSK	0x00000078	/* PCI division factor	*/
 #define SCCR_PCIDF_SHIFT 3
 
+#ifndef CPM_IMMR_OFFSET
+#define CPM_IMMR_OFFSET	0x101a8
+#endif
 
 
 #define FCC_PSMR_RMII   ((uint)0x00020000)      /* Use RMII interface */
Index: testing/include/asm-ppc/mpc8260.h
===================================================================
--- testing.orig/include/asm-ppc/mpc8260.h	2005-11-16 14:06:42.000000000 -0200
+++ testing/include/asm-ppc/mpc8260.h	2005-11-16 14:06:48.000000000 -0200
@@ -92,6 +92,10 @@
 extern unsigned char __res[];
 #endif
 
+#ifndef BOARD_CHIP_NAME
+#define BOARD_CHIP_NAME ""
+#endif
+
 #endif /* CONFIG_8260 */
 #endif /* !__ASM_PPC_MPC8260_H__ */
 #endif /* __KERNEL__ */
Index: testing/include/asm-ppc/mpc8xx.h
===================================================================
--- testing.orig/include/asm-ppc/mpc8xx.h	2005-11-16 14:06:42.000000000 -0200
+++ testing/include/asm-ppc/mpc8xx.h	2005-11-16 14:06:48.000000000 -0200
@@ -121,6 +121,10 @@
 	MPC8xx_CPM_USB,
 };
 
+#ifndef BOARD_CHIP_NAME
+#define BOARD_CHIP_NAME ""
+#endif
+
 #endif /* !__ASSEMBLY__ */
 #endif /* CONFIG_8xx */
 #endif /* __CONFIG_8xx_DEFS */
