aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-da850-evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/board-da850-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c96
1 files changed, 90 insertions, 6 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index b01fb2ab944a..a7b41bf505f1 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -29,6 +29,8 @@
29#include <linux/regulator/machine.h> 29#include <linux/regulator/machine.h>
30#include <linux/regulator/tps6507x.h> 30#include <linux/regulator/tps6507x.h>
31#include <linux/input/tps6507x-ts.h> 31#include <linux/input/tps6507x-ts.h>
32#include <linux/spi/spi.h>
33#include <linux/spi/flash.h>
32 34
33#include <asm/mach-types.h> 35#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
@@ -38,6 +40,7 @@
38#include <mach/nand.h> 40#include <mach/nand.h>
39#include <mach/mux.h> 41#include <mach/mux.h>
40#include <mach/aemif.h> 42#include <mach/aemif.h>
43#include <mach/spi.h>
41 44
42#define DA850_EVM_PHY_ID "0:00" 45#define DA850_EVM_PHY_ID "0:00"
43#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) 46#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
@@ -48,6 +51,70 @@
48 51
49#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) 52#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
50 53
54static struct mtd_partition da850evm_spiflash_part[] = {
55 [0] = {
56 .name = "UBL",
57 .offset = 0,
58 .size = SZ_64K,
59 .mask_flags = MTD_WRITEABLE,
60 },
61 [1] = {
62 .name = "U-Boot",
63 .offset = MTDPART_OFS_APPEND,
64 .size = SZ_512K,
65 .mask_flags = MTD_WRITEABLE,
66 },
67 [2] = {
68 .name = "U-Boot-Env",
69 .offset = MTDPART_OFS_APPEND,
70 .size = SZ_64K,
71 .mask_flags = MTD_WRITEABLE,
72 },
73 [3] = {
74 .name = "Kernel",
75 .offset = MTDPART_OFS_APPEND,
76 .size = SZ_2M + SZ_512K,
77 .mask_flags = 0,
78 },
79 [4] = {
80 .name = "Filesystem",
81 .offset = MTDPART_OFS_APPEND,
82 .size = SZ_4M,
83 .mask_flags = 0,
84 },
85 [5] = {
86 .name = "MAC-Address",
87 .offset = SZ_8M - SZ_64K,
88 .size = SZ_64K,
89 .mask_flags = MTD_WRITEABLE,
90 },
91};
92
93static struct flash_platform_data da850evm_spiflash_data = {
94 .name = "m25p80",
95 .parts = da850evm_spiflash_part,
96 .nr_parts = ARRAY_SIZE(da850evm_spiflash_part),
97 .type = "m25p64",
98};
99
100static struct davinci_spi_config da850evm_spiflash_cfg = {
101 .io_type = SPI_IO_TYPE_DMA,
102 .c2tdelay = 8,
103 .t2cdelay = 8,
104};
105
106static struct spi_board_info da850evm_spi_info[] = {
107 {
108 .modalias = "m25p80",
109 .platform_data = &da850evm_spiflash_data,
110 .controller_data = &da850evm_spiflash_cfg,
111 .mode = SPI_MODE_0,
112 .max_speed_hz = 30000000,
113 .bus_num = 1,
114 .chip_select = 0,
115 },
116};
117
51static struct mtd_partition da850_evm_norflash_partition[] = { 118static struct mtd_partition da850_evm_norflash_partition[] = {
52 { 119 {
53 .name = "bootloaders + env", 120 .name = "bootloaders + env",
@@ -231,8 +298,6 @@ static const short da850_evm_nor_pins[] = {
231 -1 298 -1
232}; 299};
233 300
234static u32 ui_card_detected;
235
236#if defined(CONFIG_MMC_DAVINCI) || \ 301#if defined(CONFIG_MMC_DAVINCI) || \
237 defined(CONFIG_MMC_DAVINCI_MODULE) 302 defined(CONFIG_MMC_DAVINCI_MODULE)
238#define HAS_MMC 1 303#define HAS_MMC 1
@@ -244,7 +309,7 @@ static inline void da850_evm_setup_nor_nand(void)
244{ 309{
245 int ret = 0; 310 int ret = 0;
246 311
247 if (ui_card_detected & !HAS_MMC) { 312 if (!HAS_MMC) {
248 ret = davinci_cfg_reg_list(da850_evm_nand_pins); 313 ret = davinci_cfg_reg_list(da850_evm_nand_pins);
249 if (ret) 314 if (ret)
250 pr_warning("da850_evm_init: nand mux setup failed: " 315 pr_warning("da850_evm_init: nand mux setup failed: "
@@ -394,7 +459,6 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
394 goto exp_setup_keys_fail; 459 goto exp_setup_keys_fail;
395 } 460 }
396 461
397 ui_card_detected = 1;
398 pr_info("DA850/OMAP-L138 EVM UI card detected\n"); 462 pr_info("DA850/OMAP-L138 EVM UI card detected\n");
399 463
400 da850_evm_setup_nor_nand(); 464 da850_evm_setup_nor_nand();
@@ -664,6 +728,13 @@ static struct snd_platform_data da850_evm_snd_data = {
664 .rxnumevt = 1, 728 .rxnumevt = 1,
665}; 729};
666 730
731static const short da850_evm_mcasp_pins[] __initconst = {
732 DA850_AHCLKX, DA850_ACLKX, DA850_AFSX,
733 DA850_AHCLKR, DA850_ACLKR, DA850_AFSR, DA850_AMUTE,
734 DA850_AXR_11, DA850_AXR_12,
735 -1
736};
737
667static int da850_evm_mmc_get_ro(int index) 738static int da850_evm_mmc_get_ro(int index)
668{ 739{
669 return gpio_get_value(DA850_MMCSD_WP_PIN); 740 return gpio_get_value(DA850_MMCSD_WP_PIN);
@@ -683,6 +754,13 @@ static struct davinci_mmc_config da850_mmc_config = {
683 .version = MMC_CTLR_VERSION_2, 754 .version = MMC_CTLR_VERSION_2,
684}; 755};
685 756
757static const short da850_evm_mmcsd0_pins[] __initconst = {
758 DA850_MMCSD0_DAT_0, DA850_MMCSD0_DAT_1, DA850_MMCSD0_DAT_2,
759 DA850_MMCSD0_DAT_3, DA850_MMCSD0_CLK, DA850_MMCSD0_CMD,
760 DA850_GPIO4_0, DA850_GPIO4_1,
761 -1
762};
763
686static void da850_panel_power_ctrl(int val) 764static void da850_panel_power_ctrl(int val)
687{ 765{
688 /* lcd backlight */ 766 /* lcd backlight */
@@ -1070,7 +1148,7 @@ static __init void da850_evm_init(void)
1070 ret); 1148 ret);
1071 1149
1072 if (HAS_MMC) { 1150 if (HAS_MMC) {
1073 ret = davinci_cfg_reg_list(da850_mmcsd0_pins); 1151 ret = davinci_cfg_reg_list(da850_evm_mmcsd0_pins);
1074 if (ret) 1152 if (ret)
1075 pr_warning("da850_evm_init: mmcsd0 mux setup failed:" 1153 pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
1076 " %d\n", ret); 1154 " %d\n", ret);
@@ -1106,7 +1184,7 @@ static __init void da850_evm_init(void)
1106 __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); 1184 __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
1107 __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); 1185 __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
1108 1186
1109 ret = davinci_cfg_reg_list(da850_mcasp_pins); 1187 ret = davinci_cfg_reg_list(da850_evm_mcasp_pins);
1110 if (ret) 1188 if (ret)
1111 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n", 1189 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
1112 ret); 1190 ret);
@@ -1153,6 +1231,12 @@ static __init void da850_evm_init(void)
1153 if (ret) 1231 if (ret)
1154 pr_warning("da850_evm_init: suspend registration failed: %d\n", 1232 pr_warning("da850_evm_init: suspend registration failed: %d\n",
1155 ret); 1233 ret);
1234
1235 ret = da8xx_register_spi(1, da850evm_spi_info,
1236 ARRAY_SIZE(da850evm_spi_info));
1237 if (ret)
1238 pr_warning("da850_evm_init: spi 1 registration failed: %d\n",
1239 ret);
1156} 1240}
1157 1241
1158#ifdef CONFIG_SERIAL_8250_CONSOLE 1242#ifdef CONFIG_SERIAL_8250_CONSOLE