Merge commit 'v2.6.39' into 20110526
[linux-2.6.git] / arch / arm / mach-mx3 / eukrea_mbimxsd-baseboard.c
index 6785978..2e288b3 100644 (file)
@@ -36,7 +36,6 @@
 #include <asm/mach/time.h>
 #include <asm/mach/map.h>
 
-#include <mach/board-eukrea_cpuimx35.h>
 #include <mach/hardware.h>
 #include <mach/common.h>
 #include <mach/imx-uart.h>
 #include <mach/ipu.h>
 #include <mach/mx3fb.h>
 #include <mach/audmux.h>
-#include <mach/ssi.h>
+#include <mach/esdhc.h>
 
+#include "devices-imx35.h"
 #include "devices.h"
 
 static const struct fb_videomode fb_modedb[] = {
        {
-               .name           = "CMO_QVGA",
+               .name           = "CMO-QVGA",
                .refresh        = 60,
                .xres           = 320,
                .yres           = 240,
@@ -65,6 +65,40 @@ static const struct fb_videomode fb_modedb[] = {
                .vmode          = FB_VMODE_NONINTERLACED,
                .flag           = 0,
        },
+       {
+               .name           = "DVI-VGA",
+               .refresh        = 60,
+               .xres           = 640,
+               .yres           = 480,
+               .pixclock       = 32000,
+               .left_margin    = 100,
+               .right_margin   = 100,
+               .upper_margin   = 7,
+               .lower_margin   = 100,
+               .hsync_len      = 7,
+               .vsync_len      = 7,
+               .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT |
+                                 FB_SYNC_OE_ACT_HIGH | FB_SYNC_CLK_INVERT,
+               .vmode          = FB_VMODE_NONINTERLACED,
+               .flag           = 0,
+       },
+       {
+               .name           = "DVI-SVGA",
+               .refresh        = 60,
+               .xres           = 800,
+               .yres           = 600,
+               .pixclock       = 25000,
+               .left_margin    = 75,
+               .right_margin   = 75,
+               .upper_margin   = 7,
+               .lower_margin   = 75,
+               .hsync_len      = 7,
+               .vsync_len      = 7,
+               .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT |
+                                 FB_SYNC_OE_ACT_HIGH | FB_SYNC_CLK_INVERT,
+               .vmode          = FB_VMODE_NONINTERLACED,
+               .flag           = 0,
+       },
 };
 
 static struct ipu_platform_data mx3_ipu_data = {
@@ -73,12 +107,12 @@ static struct ipu_platform_data mx3_ipu_data = {
 
 static struct mx3fb_platform_data mx3fb_pdata = {
        .dma_dev        = &mx3_ipu.dev,
-       .name           = "CMO_QVGA",
+       .name           = "CMO-QVGA",
        .mode           = fb_modedb,
        .num_modes      = ARRAY_SIZE(fb_modedb),
 };
 
-static struct pad_desc eukrea_mbimxsd_pads[] = {
+static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
        /* LCD */
        MX35_PAD_LD0__IPU_DISPB_DAT_0,
        MX35_PAD_LD1__IPU_DISPB_DAT_1,
@@ -120,11 +154,24 @@ static struct pad_desc eukrea_mbimxsd_pads[] = {
        MX35_PAD_STXD4__AUDMUX_AUD4_TXD,
        MX35_PAD_SRXD4__AUDMUX_AUD4_RXD,
        MX35_PAD_SCK4__AUDMUX_AUD4_TXC,
+       /* CAN2 */
+       MX35_PAD_TX5_RX0__CAN2_TXCAN,
+       MX35_PAD_TX4_RX1__CAN2_RXCAN,
+       /* SDCARD */
+       MX35_PAD_SD1_CMD__ESDHC1_CMD,
+       MX35_PAD_SD1_CLK__ESDHC1_CLK,
+       MX35_PAD_SD1_DATA0__ESDHC1_DAT0,
+       MX35_PAD_SD1_DATA1__ESDHC1_DAT1,
+       MX35_PAD_SD1_DATA2__ESDHC1_DAT2,
+       MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
+       /* SD1 CD */
+       MX35_PAD_LD18__GPIO3_24,
 };
 
-#define GPIO_LED1      (2 * 32 + 29)
-#define GPIO_SWITCH1   (2 * 32 + 25)
-#define GPIO_LCDPWR    (4)
+#define GPIO_LED1      IMX_GPIO_NR(3, 29)
+#define GPIO_SWITCH1   IMX_GPIO_NR(3, 25)
+#define GPIO_LCDPWR    IMX_GPIO_NR(1, 4)
+#define GPIO_SD1CD     IMX_GPIO_NR(3, 24)
 
 static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd,
                                   unsigned int power)
@@ -196,7 +243,7 @@ static struct platform_device *platform_devices[] __initdata = {
        &eukrea_mbimxsd_lcd_powerdev,
 };
 
-static struct imxuart_platform_data uart_pdata = {
+static const struct imxuart_platform_data uart_pdata __initconst = {
        .flags = IMXUART_HAVE_RTSCTS,
 };
 
@@ -206,17 +253,23 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = {
        },
 };
 
-struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata = {
+static const
+struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = {
        .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE,
 };
 
+static struct esdhc_platform_data sd1_pdata = {
+       .cd_gpio = GPIO_SD1CD,
+       .wp_gpio = -EINVAL,
+};
+
 /*
  * system init for baseboard usage. Will be called by cpuimx35 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 eukrea_mbimxsd_baseboard_init(void)
+void __init eukrea_mbimxsd35_baseboard_init(void)
 {
        if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd_pads,
                        ARRAY_SIZE(eukrea_mbimxsd_pads)))
@@ -238,11 +291,14 @@ void __init eukrea_mbimxsd_baseboard_init(void)
        );
 #endif
 
-       mxc_register_device(&mxc_uart_device1, &uart_pdata);
+       imx35_add_imx_uart1(&uart_pdata);
        mxc_register_device(&mx3_ipu, &mx3_ipu_data);
        mxc_register_device(&mx3_fb, &mx3fb_pdata);
 
-       mxc_register_device(&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata);
+       imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
+
+       imx35_add_flexcan1(NULL);
+       imx35_add_sdhci_esdhc_imx(0, &sd1_pdata);
 
        gpio_request(GPIO_LED1, "LED1");
        gpio_direction_output(GPIO_LED1, 1);
@@ -254,7 +310,6 @@ void __init eukrea_mbimxsd_baseboard_init(void)
 
        gpio_request(GPIO_LCDPWR, "LCDPWR");
        gpio_direction_output(GPIO_LCDPWR, 1);
-       gpio_free(GPIO_SWITCH1);
 
        i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
                                ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));