mmc: access mxcmmc from mx31 boards

This patch modifies mxcmmc.c to be used
not only by i.MX27 but also by i.MX31 boards.
Both use the same SD controller, but have different
clock set-ups.
The i.MX27 imx_get_XXXclock functions are made static to
generic.c and a public mxc_get_clock() function
is provided.  Pins, base address and prototypes for
an i.MX31 specific board_init_mmc() are provided.
Some of the i.MX27 clock getters are unused and marked
as such to avoid warnings (./MAKEALL -s mx27), but
the code was left in for future use.

Signed-off-by: Helmut Raiger <helmut.raiger@hale.at>
Acked-by: Stefano Babic <sbabic@denx.de>
diff --git a/drivers/mmc/mxcmmc.c b/drivers/mmc/mxcmmc.c
index 8afb221..d58c18b 100644
--- a/drivers/mmc/mxcmmc.c
+++ b/drivers/mmc/mxcmmc.c
@@ -25,9 +25,7 @@
 #include <mmc.h>
 #include <asm/errno.h>
 #include <asm/io.h>
-#ifdef CONFIG_MX27
 #include <asm/arch/clock.h>
-#endif
 
 #define DRIVER_NAME "mxc-mmc"
 
@@ -422,7 +420,7 @@
 {
 	unsigned int divider;
 	int prescaler = 0;
-	unsigned long clk_in = imx_get_perclk2();
+	unsigned long clk_in = mxc_get_clock(MXC_ESDHC_CLK);
 
 	while (prescaler <= 0x800) {
 		for (divider = 1; divider <= 0xF; divider++) {
@@ -509,8 +507,8 @@
 
 	mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
 
-	mmc->f_min = imx_get_perclk2() >> 7;
-	mmc->f_max = imx_get_perclk2() >> 1;
+	mmc->f_min = mxc_get_clock(MXC_ESDHC_CLK) >> 7;
+	mmc->f_max = mxc_get_clock(MXC_ESDHC_CLK) >> 1;
 
 	mmc->b_max = 0;