123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- /*
- * board-devkit8000.c - TimLL Devkit8000
- *
- * Copyright (C) 2009 Kim Botherway
- * Copyright (C) 2010 Thomas Weber
- *
- * Modified from mach-omap2/board-omap3beagle.c
- *
- * Initial code: Syed Mohammed Khasim
- *
- * 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/kernel.h>
- #include <linux/init.h>
- #include <linux/platform_device.h>
- #include <linux/delay.h>
- #include <linux/err.h>
- #include <linux/clk.h>
- #include <linux/io.h>
- #include <linux/leds.h>
- #include <linux/gpio.h>
- #include <linux/input.h>
- #include <linux/gpio_keys.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/partitions.h>
- #include <linux/mtd/nand.h>
- #include <linux/mmc/host.h>
- #include <linux/regulator/machine.h>
- #include <linux/i2c/twl.h>
- #include "id.h"
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
- #include <asm/mach/map.h>
- #include <asm/mach/flash.h>
- #include "common.h"
- #include "gpmc.h"
- #include <linux/platform_data/mtd-nand-omap2.h>
- #include <video/omapdss.h>
- #include <video/omap-panel-generic-dpi.h>
- #include <video/omap-panel-tfp410.h>
- #include <linux/platform_data/spi-omap2-mcspi.h>
- #include <linux/input/matrix_keypad.h>
- #include <linux/spi/spi.h>
- #include <linux/dm9000.h>
- #include <linux/interrupt.h>
- #include "sdram-micron-mt46h32m32lf-6.h"
- #include "mux.h"
- #include "hsmmc.h"
- #include "board-flash.h"
- #include "common-board-devices.h"
- #define NAND_CS 0
- #define OMAP_DM9000_GPIO_IRQ 25
- #define OMAP3_DEVKIT_TS_GPIO 27
- static struct mtd_partition devkit8000_nand_partitions[] = {
- /* All the partition sizes are listed in terms of NAND block size */
- {
- .name = "X-Loader",
- .offset = 0,
- .size = 4 * NAND_BLOCK_SIZE,
- .mask_flags = MTD_WRITEABLE, /* force read-only */
- },
- {
- .name = "U-Boot",
- .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
- .size = 15 * NAND_BLOCK_SIZE,
- .mask_flags = MTD_WRITEABLE, /* force read-only */
- },
- {
- .name = "U-Boot Env",
- .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
- .size = 1 * NAND_BLOCK_SIZE,
- },
- {
- .name = "Kernel",
- .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
- .size = 32 * NAND_BLOCK_SIZE,
- },
- {
- .name = "File System",
- .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
- .size = MTDPART_SIZ_FULL,
- },
- };
- static struct omap2_hsmmc_info mmc[] = {
- {
- .mmc = 1,
- .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
- .gpio_wp = 29,
- .deferred = true,
- },
- {} /* Terminator */
- };
- static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
- {
- if (gpio_is_valid(dssdev->reset_gpio))
- gpio_set_value_cansleep(dssdev->reset_gpio, 1);
- return 0;
- }
- static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
- {
- if (gpio_is_valid(dssdev->reset_gpio))
- gpio_set_value_cansleep(dssdev->reset_gpio, 0);
- }
- static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = {
- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
- };
- /* ads7846 on SPI */
- static struct regulator_consumer_supply devkit8000_vio_supply[] = {
- REGULATOR_SUPPLY("vcc", "spi2.0"),
- };
- static struct panel_generic_dpi_data lcd_panel = {
- .name = "innolux_at070tn83",
- .platform_enable = devkit8000_panel_enable_lcd,
- .platform_disable = devkit8000_panel_disable_lcd,
- };
- static struct omap_dss_device devkit8000_lcd_device = {
- .name = "lcd",
- .type = OMAP_DISPLAY_TYPE_DPI,
- .driver_name = "generic_dpi_panel",
- .data = &lcd_panel,
- .phy.dpi.data_lines = 24,
- };
- static struct tfp410_platform_data dvi_panel = {
- .power_down_gpio = -1,
- .i2c_bus_num = 1,
- };
- static struct omap_dss_device devkit8000_dvi_device = {
- .name = "dvi",
- .type = OMAP_DISPLAY_TYPE_DPI,
- .driver_name = "tfp410",
- .data = &dvi_panel,
- .phy.dpi.data_lines = 24,
- };
- static struct omap_dss_device devkit8000_tv_device = {
- .name = "tv",
- .driver_name = "venc",
- .type = OMAP_DISPLAY_TYPE_VENC,
- .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
- };
- static struct omap_dss_device *devkit8000_dss_devices[] = {
- &devkit8000_lcd_device,
- &devkit8000_dvi_device,
- &devkit8000_tv_device,
- };
- static struct omap_dss_board_info devkit8000_dss_data = {
- .num_devices = ARRAY_SIZE(devkit8000_dss_devices),
- .devices = devkit8000_dss_devices,
- .default_device = &devkit8000_lcd_device,
- };
- static uint32_t board_keymap[] = {
- KEY(0, 0, KEY_1),
|