Subject: [@num@/@total@] i.MX27 family: Adding Phytec's evaluation board
From: Juergen Beisert <j.beisert@pengutronix.de>

This patch adds baseboard device support for the phyCORE-i.MX27 CPU module.
This evaluation board is called PCM970.

Currently its an empty implementation example without living in it.

Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>

---

 arch/arm/mach-mx2/Kconfig               |   14 ++++++++++++++
 arch/arm/mach-mx2/Makefile              |    2 ++
 arch/arm/mach-mx2/pcm038.c              |    3 +++
 arch/arm/mach-mx2/pcm970-baseboard.c    |   22 ++++++++++++++++++++++
 include/asm-arm/arch-mxc/board-pcm038.h |    9 +++++++++
 5 files changed, 50 insertions(+)

Index: arch/arm/mach-mx2/pcm970-baseboard.c
===================================================================
--- /dev/null
+++ arch/arm/mach-mx2/pcm970-baseboard.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2008 Juergen Beisert <j.beisert@pengutronix.de>, Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/platform_device.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+/*
+ * system init for baseboard usage. Will be called by pcm038 init.
+ *
+ * Add platform devices present on this baseboard and init
+ * them from CPU side as far as required to use them later on
+ */
+void __init pcm970_baseboard_init(void)
+{
+}
Index: arch/arm/mach-mx2/Kconfig
===================================================================
--- arch/arm/mach-mx2/Kconfig.orig
+++ arch/arm/mach-mx2/Kconfig
@@ -33,3 +33,17 @@ config MACH_PCM038
 	  includes specific configurations for the module and its peripherals.
 
 endchoice
+
+choice
+	prompt "Baseboard"
+	depends on MACH_PCM038
+	default MACH_PCM970_BASEBOARD
+
+config MACH_PCM970_BASEBOARD
+	prompt "PHYTEC PCM970 development board"
+	bool
+	help
+	  This adds board specific devices that can be found on Phytec's
+	  PCM970 evaluation board.
+
+endchoice
Index: arch/arm/mach-mx2/Makefile
===================================================================
--- arch/arm/mach-mx2/Makefile.orig
+++ arch/arm/mach-mx2/Makefile
@@ -8,3 +8,5 @@ obj-y		:= mm.o time.o dma.o gpio_mux.o c
 
 obj-$(CONFIG_MACH_MX27ADS)	+= mx27ads.o gpio_mx27ads.o
 obj-$(CONFIG_MACH_PCM038)	+= pcm038.o gpio_pcm038.o
+
+obj-$(CONFIG_MACH_PCM970_BASEBOARD)	+= pcm970-baseboard.o
Index: arch/arm/mach-mx2/pcm038.c
===================================================================
--- arch/arm/mach-mx2/pcm038.c.orig
+++ arch/arm/mach-mx2/pcm038.c
@@ -56,6 +56,9 @@ static void __init pcm038_init(void)
 	mxc_init_uart(1);
 	mxc_init_uart(2);
 	platform_device_register(&pcm038_nor_mtd_device);
+#ifdef CONFIG_MACH_PCM970_BASEBOARD
+	pcm970_baseboard_init();
+#endif
 }
 
 MACHINE_START(PCM038, "phyCORE-i.MX27")
Index: include/asm-arm/arch-mxc/board-pcm038.h
===================================================================
--- include/asm-arm/arch-mxc/board-pcm038.h.orig
+++ include/asm-arm/arch-mxc/board-pcm038.h
@@ -85,4 +85,16 @@
 #undef CLOCK_TICK_RATE
 #define CLOCK_TICK_RATE         14777777
 
+#ifndef __ASSEMBLY__
+/*
+ * This CPU module needs a baseboard to work. After basic initializing
+ * its own devices, it calls baseboard's init function.
+ * TODO: Add your own basebaord init function and call it from
+ * inside pcm038_init(). This example here is for the development board.
+ * Refer pcm970-baseboard.c
+ */
+extern void pcm970_baseboard_init(void);
+
+#endif
+
 #endif /* __ASM_ARCH_MXC_BOARD_PCM038_H__ */
