]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/board-h6300.c
h63xx: nfs mount works, gpe image boots to ts config screen.
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / board-h6300.c
index 749db4b3b612a307655714e6a5901f05b8458a81..6bf80ccc50dff49622194706f76641549557ce44 100644 (file)
@@ -29,6 +29,7 @@
 #include <mach/gpio.h>
 #include <mach/common.h>
 #include <mach/board.h>
+#include <mach/mmc.h>
 
 static struct platform_device h6300_lcd_device = {
        .name   = "lcd_h6300",
@@ -43,8 +44,123 @@ static struct omap_lcd_config h6300_lcd_config __initdata = {
        .ctrl_name      = "internal",
 };
 
+static struct omap_uart_config h6300_uart_config __initdata = {
+       .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
+};
+
+/* assume no Mini-AB port */
+static struct omap_usb_config h6300_usb_config __initdata = {
+       .register_dev   = 1,
+       .hmc_mode       = 0,
+       .pins[0]        = 0,
+};
+
+#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
+
+//#define H6300_GPIO_MMC_POWER 13
+#define H6300_GPIO_MMC_WRITE_PROTECT   13
+#define H6300_GPIO_MMC_CARD_DETECT     15
+
+
+static int h6300_mmc_set_power(struct device *dev, int slot, int power_on,
+                               int vdd)
+{
+       //printk("h6300_mmc_set_power started\n");
+
+/*
+       int err;
+       u8 dat = 0;
+
+       err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat);
+       if (err < 0)
+               return err;
+
+       if (power_on)
+               dat |= SOFIA_MMC_POWER;
+       else
+               dat &= ~SOFIA_MMC_POWER;
+
+       return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat);
+*/
+/*
+       if (power_on)
+               gpio_set_value(H6300_GPIO_MMC_POWER, 1);
+       else
+               gpio_set_value(H6300_GPIO_MMC_POWER, 0);
+*/
+       return 0;
+}
+
+/*
+static int h6300_mmc_get_cover_state(struct device *dev, int slot)
+{
+       return gpio_get_value(H6300_GPIO_MMC_CARD_DETECT);
+}
+*/
+
+static struct omap_mmc_platform_data h6300_mmc1_data = {
+       .nr_slots                       = 1,
+/*     .dma_mask                       = 0xffffffff, */
+       .slots[0]       = {
+               .set_power              = h6300_mmc_set_power,
+/*             .get_cover_state        = h6300_mmc_get_cover_state, */
+               .gpio_wp                = H6300_GPIO_MMC_WRITE_PROTECT,         // input, write protect
+/*             .switch_pin             = H6300_GPIO_MMC_CARD_DETECT,   */      // input, card detect
+/*
+               .wires                  = 4,
+               .name                   = "mmcblk",
+*/
+       },
+};
+
+static struct omap_mmc_platform_data *h6300_mmc_data[OMAP15XX_NR_MMC];
+
+static void __init h6300_mmc_init(void)
+{
+       int     ret;
+
+       printk("h6300_mmc_init() started\n");
+       ret = gpio_request(H6300_GPIO_MMC_WRITE_PROTECT, "MMC WP");
+       if (ret < 0) {
+               printk("Failed to get MMC WP gpio\n");
+               gpio_free(H6300_GPIO_MMC_WRITE_PROTECT);
+               return;
+       }
+       gpio_direction_input(H6300_GPIO_MMC_WRITE_PROTECT);
+       printk("MMC WP gpio set input\n");
+
+       h6300_mmc_data[0] = &h6300_mmc1_data;
+       omap1_init_mmc(h6300_mmc_data, OMAP15XX_NR_MMC);
+       printk("h6300 mmc init done\n");
+/*
+       int ret;
+
+       ret = gpio_request(H6300_GPIO_MMC_POWER, "MMC power");
+       if (ret < 0)
+               return;
+       gpio_direction_output(H6300_GPIO_MMC_POWER, 0);
+       mmc_data[0] = &h6300_mmc1_data;
+       omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC);
+
+       ret = gpio_request(NOKIA770_GPIO_MMC_SWITCH, "MMC cover");
+       if (ret < 0) {
+               gpio_free(NOKIA770_GPIO_MMC_POWER);
+               return;
+       }
+       gpio_direction_input(NOKIA770_GPIO_MMC_SWITCH);
+*/
+}
+
+#else
+static inline void h6300_mmc_init(void)
+{
+}
+#endif
+
 static struct omap_board_config_kernel h6300_config[] = {
        { OMAP_TAG_LCD,         &h6300_lcd_config },
+       { OMAP_TAG_UART,        &h6300_uart_config },
+       { OMAP_TAG_USB,         &h6300_usb_config },
 };
 
 static void __init h6300_init_irq(void)
@@ -66,6 +182,7 @@ static void __init h6300_init(void)
        omap_board_config_size  = ARRAY_SIZE(h6300_config);
        omap_serial_init();
        omap_register_i2c_bus(1, 100, NULL, 0);
+       h6300_mmc_init();
 }
 
 static void __init h6300_map_io(void)