board-cm-t35.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /*
  2. * board-cm-t35.c (CompuLab CM-T35 module)
  3. *
  4. * Copyright (C) 2009 CompuLab, Ltd.
  5. * Author: Mike Rapoport <mike@compulab.co.il>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. *
  21. */
  22. #include <linux/kernel.h>
  23. #include <linux/init.h>
  24. #include <linux/platform_device.h>
  25. #include <linux/input.h>
  26. #include <linux/input/matrix_keypad.h>
  27. #include <linux/delay.h>
  28. #include <linux/gpio.h>
  29. #include <linux/i2c/at24.h>
  30. #include <linux/i2c/twl.h>
  31. #include <linux/regulator/machine.h>
  32. #include <linux/mmc/host.h>
  33. #include <linux/spi/spi.h>
  34. #include <linux/spi/tdo24m.h>
  35. #include <asm/mach-types.h>
  36. #include <asm/mach/arch.h>
  37. #include <asm/mach/map.h>
  38. #include <plat/board.h>
  39. #include <plat/common.h>
  40. #include <plat/nand.h>
  41. #include <plat/gpmc.h>
  42. #include <plat/usb.h>
  43. #include <video/omapdss.h>
  44. #include <video/omap-panel-generic-dpi.h>
  45. #include <plat/mcspi.h>
  46. #include <mach/hardware.h>
  47. #include "mux.h"
  48. #include "sdram-micron-mt46h32m32lf-6.h"
  49. #include "hsmmc.h"
  50. #include "common-board-devices.h"
  51. #define CM_T35_GPIO_PENDOWN 57
  52. #define CM_T35_SMSC911X_CS 5
  53. #define CM_T35_SMSC911X_GPIO 163
  54. #define SB_T35_SMSC911X_CS 4
  55. #define SB_T35_SMSC911X_GPIO 65
  56. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  57. #include <linux/smsc911x.h>
  58. #include <plat/gpmc-smsc911x.h>
  59. static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = {
  60. .id = 0,
  61. .cs = CM_T35_SMSC911X_CS,
  62. .gpio_irq = CM_T35_SMSC911X_GPIO,
  63. .gpio_reset = -EINVAL,
  64. .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  65. };
  66. static struct omap_smsc911x_platform_data sb_t35_smsc911x_cfg = {
  67. .id = 1,
  68. .cs = SB_T35_SMSC911X_CS,
  69. .gpio_irq = SB_T35_SMSC911X_GPIO,
  70. .gpio_reset = -EINVAL,
  71. .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  72. };
  73. static void __init cm_t35_init_ethernet(void)
  74. {
  75. gpmc_smsc911x_init(&cm_t35_smsc911x_cfg);
  76. gpmc_smsc911x_init(&sb_t35_smsc911x_cfg);
  77. }
  78. #else
  79. static inline void __init cm_t35_init_ethernet(void) { return; }
  80. #endif
  81. #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
  82. #include <linux/leds.h>
  83. static struct gpio_led cm_t35_leds[] = {
  84. [0] = {
  85. .gpio = 186,
  86. .name = "cm-t35:green",
  87. .default_trigger = "heartbeat",
  88. .active_low = 0,
  89. },
  90. };
  91. static struct gpio_led_platform_data cm_t35_led_pdata = {
  92. .num_leds = ARRAY_SIZE(cm_t35_leds),
  93. .leds = cm_t35_leds,
  94. };
  95. static struct platform_device cm_t35_led_device = {
  96. .name = "leds-gpio",
  97. .id = -1,
  98. .dev = {
  99. .platform_data = &cm_t35_led_pdata,
  100. },
  101. };
  102. static void __init cm_t35_init_led(void)
  103. {
  104. platform_device_register(&cm_t35_led_device);
  105. }
  106. #else
  107. static inline void cm_t35_init_led(void) {}
  108. #endif
  109. #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
  110. #include <linux/mtd/mtd.h>
  111. #include <linux/mtd/nand.h>
  112. #include <linux/mtd/partitions.h>
  113. static struct mtd_partition cm_t35_nand_partitions[] = {
  114. {
  115. .name = "xloader",
  116. .offset = 0, /* Offset = 0x00000 */
  117. .size = 4 * NAND_BLOCK_SIZE,
  118. .mask_flags = MTD_WRITEABLE
  119. },
  120. {
  121. .name = "uboot",
  122. .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
  123. .size = 15 * NAND_BLOCK_SIZE,
  124. },
  125. {
  126. .name = "uboot environment",
  127. .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
  128. .size = 2 * NAND_BLOCK_SIZE,
  129. },
  130. {
  131. .name = "linux",
  132. .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
  133. .size = 32 * NAND_BLOCK_SIZE,
  134. },
  135. {
  136. .name = "rootfs",
  137. .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
  138. .size = MTDPART_SIZ_FULL,
  139. },
  140. };
  141. static struct omap_nand_platform_data cm_t35_nand_data = {
  142. .parts = cm_t35_nand_partitions,
  143. .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions),
  144. .cs = 0,
  145. };
  146. static void __init cm_t35_init_nand(void)
  147. {
  148. if (gpmc_nand_init(&cm_t35_nand_data) < 0)
  149. pr_err("CM-T35: Unable to register NAND device\n");
  150. }
  151. #else
  152. static inline void cm_t35_init_nand(void) {}
  153. #endif
  154. #define CM_T35_LCD_EN_GPIO 157
  155. #define CM_T35_LCD_BL_GPIO 58
  156. #define CM_T35_DVI_EN_GPIO 54
  157. static int lcd_enabled;
  158. static int dvi_enabled;
  159. static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev)
  160. {
  161. if (dvi_enabled) {
  162. printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
  163. return -EINVAL;
  164. }
  165. gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
  166. gpio_set_value(CM_T35_LCD_BL_GPIO, 1);
  167. lcd_enabled = 1;
  168. return 0;
  169. }
  170. static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
  171. {
  172. lcd_enabled = 0;
  173. gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
  174. gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
  175. }
  176. static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev)
  177. {
  178. if (lcd_enabled) {
  179. printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
  180. return -EINVAL;
  181. }
  182. gpio_set_value(CM_T35_DVI_EN_GPIO, 0);
  183. dvi_enabled = 1;
  184. return 0;
  185. }
  186. static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev)
  187. {
  188. gpio_set_value(CM_T35_DVI_EN_GPIO, 1);
  189. dvi_enabled = 0;
  190. }
  191. static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
  192. {
  193. return 0;
  194. }
  195. static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)
  196. {
  197. }
  198. static struct panel_generic_dpi_data lcd_panel = {
  199. .name = "toppoly_tdo35s",
  200. .platform_enable = cm_t35_panel_enable_lcd,
  201. .platform_disable = cm_t35_panel_disable_lcd,
  202. };
  203. static struct omap_dss_device cm_t35_lcd_device = {
  204. .name = "lcd",
  205. .type = OMAP_DISPLAY_TYPE_DPI,
  206. .driver_name = "generic_dpi_panel",
  207. .data = &lcd_panel,
  208. .phy.dpi.data_lines = 18,
  209. };
  210. static struct panel_generic_dpi_data dvi_panel = {
  211. .name = "generic",
  212. .platform_enable = cm_t35_panel_enable_dvi,
  213. .platform_disable = cm_t35_panel_disable_dvi,
  214. };
  215. static struct omap_dss_device cm_t35_dvi_device = {
  216. .name = "dvi",
  217. .type = OMAP_DISPLAY_TYPE_DPI,
  218. .driver_name = "generic_dpi_panel",
  219. .data = &dvi_panel,
  220. .phy.dpi.data_lines = 24,
  221. };
  222. static struct omap_dss_device cm_t35_tv_device = {
  223. .name = "tv",
  224. .driver_name = "venc",
  225. .type = OMAP_DISPLAY_TYPE_VENC,
  226. .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
  227. .platform_enable = cm_t35_panel_enable_tv,
  228. .platform_disable = cm_t35_panel_disable_tv,
  229. };
  230. static struct omap_dss_device *cm_t35_dss_devices[] = {
  231. &cm_t35_lcd_device,
  232. &cm_t35_dvi_device,
  233. &cm_t35_tv_device,
  234. };
  235. static struct omap_dss_board_info cm_t35_dss_data = {
  236. .num_devices = ARRAY_SIZE(cm_t35_dss_devices),
  237. .devices = cm_t35_dss_devices,
  238. .default_device = &cm_t35_dvi_device,
  239. };
  240. static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
  241. .turbo_mode = 0,
  242. .single_channel = 1, /* 0: slave, 1: master */
  243. };
  244. static struct tdo24m_platform_data tdo24m_config = {
  245. .model = TDO35S,
  246. };
  247. static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
  248. {
  249. .modalias = "tdo24m",
  250. .bus_num = 4,
  251. .chip_select = 0,
  252. .max_speed_hz = 1000000,
  253. .controller_data = &tdo24m_mcspi_config,
  254. .platform_data = &tdo24m_config,
  255. },
  256. };
  257. static struct gpio cm_t35_dss_gpios[] __initdata = {
  258. { CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" },
  259. { CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" },
  260. { CM_T35_DVI_EN_GPIO, GPIOF_OUT_INIT_HIGH, "dvi enable" },
  261. };
  262. static void __init cm_t35_init_display(void)
  263. {
  264. int err;
  265. spi_register_board_info(cm_t35_lcd_spi_board_info,
  266. ARRAY_SIZE(cm_t35_lcd_spi_board_info));
  267. err = gpio_request_array(cm_t35_dss_gpios,
  268. ARRAY_SIZE(cm_t35_dss_gpios));
  269. if (err) {
  270. pr_err("CM-T35: failed to request DSS control GPIOs\n");
  271. return;
  272. }
  273. gpio_export(CM_T35_LCD_EN_GPIO, 0);
  274. gpio_export(CM_T35_LCD_BL_GPIO, 0);
  275. gpio_export(CM_T35_DVI_EN_GPIO, 0);
  276. msleep(50);
  277. gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
  278. err = omap_display_init(&cm_t35_dss_data);
  279. if (err) {
  280. pr_err("CM-T35: failed to register DSS device\n");
  281. gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios));
  282. }
  283. }
  284. static struct regulator_consumer_supply cm_t35_vmmc1_supply[] = {
  285. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
  286. };
  287. static struct regulator_consumer_supply cm_t35_vsim_supply[] = {
  288. REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
  289. };
  290. static struct regulator_consumer_supply cm_t35_vdvi_supply[] = {
  291. REGULATOR_SUPPLY("vdvi", "omapdss"),
  292. };
  293. /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
  294. static struct regulator_init_data cm_t35_vmmc1 = {
  295. .constraints = {
  296. .min_uV = 1850000,
  297. .max_uV = 3150000,
  298. .valid_modes_mask = REGULATOR_MODE_NORMAL
  299. | REGULATOR_MODE_STANDBY,
  300. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  301. | REGULATOR_CHANGE_MODE
  302. | REGULATOR_CHANGE_STATUS,
  303. },
  304. .num_consumer_supplies = ARRAY_SIZE(cm_t35_vmmc1_supply),
  305. .consumer_supplies = cm_t35_vmmc1_supply,
  306. };
  307. /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
  308. static struct regulator_init_data cm_t35_vsim = {
  309. .constraints = {
  310. .min_uV = 1800000,
  311. .max_uV = 3000000,
  312. .valid_modes_mask = REGULATOR_MODE_NORMAL
  313. | REGULATOR_MODE_STANDBY,
  314. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  315. | REGULATOR_CHANGE_MODE
  316. | REGULATOR_CHANGE_STATUS,
  317. },
  318. .num_consumer_supplies = ARRAY_SIZE(cm_t35_vsim_supply),
  319. .consumer_supplies = cm_t35_vsim_supply,
  320. };
  321. static uint32_t cm_t35_keymap[] = {
  322. KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT),
  323. KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN),
  324. KEY(2, 0, KEY_RIGHT), KEY(2, 1, KEY_C), KEY(2, 2, KEY_D),
  325. };
  326. static struct matrix_keymap_data cm_t35_keymap_data = {
  327. .keymap = cm_t35_keymap,
  328. .keymap_size = ARRAY_SIZE(cm_t35_keymap),
  329. };
  330. static struct twl4030_keypad_data cm_t35_kp_data = {
  331. .keymap_data = &cm_t35_keymap_data,
  332. .rows = 3,
  333. .cols = 3,
  334. .rep = 1,
  335. };
  336. static struct omap2_hsmmc_info mmc[] = {
  337. {
  338. .mmc = 1,
  339. .caps = MMC_CAP_4_BIT_DATA,
  340. .gpio_cd = -EINVAL,
  341. .gpio_wp = -EINVAL,
  342. },
  343. {
  344. .mmc = 2,
  345. .caps = MMC_CAP_4_BIT_DATA,
  346. .transceiver = 1,
  347. .gpio_cd = -EINVAL,
  348. .gpio_wp = -EINVAL,
  349. .ocr_mask = 0x00100000, /* 3.3V */
  350. },
  351. {} /* Terminator */
  352. };
  353. static struct usbhs_omap_board_data usbhs_bdata __initdata = {
  354. .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
  355. .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
  356. .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
  357. .phy_reset = true,
  358. .reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6,
  359. .reset_gpio_port[1] = OMAP_MAX_GPIO_LINES + 7,
  360. .reset_gpio_port[2] = -EINVAL
  361. };
  362. static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
  363. unsigned ngpio)
  364. {
  365. int wlan_rst = gpio + 2;
  366. if (gpio_request_one(wlan_rst, GPIOF_OUT_INIT_HIGH, "WLAN RST") == 0) {
  367. gpio_export(wlan_rst, 0);
  368. udelay(10);
  369. gpio_set_value(wlan_rst, 0);
  370. udelay(10);
  371. gpio_set_value(wlan_rst, 1);
  372. } else {
  373. pr_err("CM-T35: could not obtain gpio for WiFi reset\n");
  374. }
  375. /* gpio + 0 is "mmc0_cd" (input/IRQ) */
  376. mmc[0].gpio_cd = gpio + 0;
  377. omap2_hsmmc_init(mmc);
  378. return 0;
  379. }
  380. static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
  381. .gpio_base = OMAP_MAX_GPIO_LINES,
  382. .irq_base = TWL4030_GPIO_IRQ_BASE,
  383. .irq_end = TWL4030_GPIO_IRQ_END,
  384. .setup = cm_t35_twl_gpio_setup,
  385. };
  386. static struct twl4030_platform_data cm_t35_twldata = {
  387. /* platform_data for children goes here */
  388. .keypad = &cm_t35_kp_data,
  389. .gpio = &cm_t35_gpio_data,
  390. .vmmc1 = &cm_t35_vmmc1,
  391. .vsim = &cm_t35_vsim,
  392. };
  393. static void __init cm_t35_init_i2c(void)
  394. {
  395. omap3_pmic_get_config(&cm_t35_twldata, TWL_COMMON_PDATA_USB,
  396. TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
  397. cm_t35_twldata.vpll2->constraints.name = "VDVI";
  398. cm_t35_twldata.vpll2->num_consumer_supplies =
  399. ARRAY_SIZE(cm_t35_vdvi_supply);
  400. cm_t35_twldata.vpll2->consumer_supplies = cm_t35_vdvi_supply;
  401. omap3_pmic_init("tps65930", &cm_t35_twldata);
  402. }
  403. static void __init cm_t35_init_early(void)
  404. {
  405. omap2_init_common_infrastructure();
  406. omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
  407. mt46h32m32lf6_sdrc_params);
  408. }
  409. #ifdef CONFIG_OMAP_MUX
  410. static struct omap_board_mux board_mux[] __initdata = {
  411. /* nCS and IRQ for CM-T35 ethernet */
  412. OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0),
  413. OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
  414. /* nCS and IRQ for SB-T35 ethernet */
  415. OMAP3_MUX(GPMC_NCS4, OMAP_MUX_MODE0),
  416. OMAP3_MUX(GPMC_WAIT3, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
  417. /* PENDOWN GPIO */
  418. OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
  419. /* mUSB */
  420. OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  421. OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  422. OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  423. OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  424. OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  425. OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  426. OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  427. OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  428. OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  429. OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  430. OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  431. OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  432. /* MMC 2 */
  433. OMAP3_MUX(SDMMC2_DAT4, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
  434. OMAP3_MUX(SDMMC2_DAT5, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
  435. OMAP3_MUX(SDMMC2_DAT6, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
  436. OMAP3_MUX(SDMMC2_DAT7, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  437. /* McSPI 1 */
  438. OMAP3_MUX(MCSPI1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  439. OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  440. OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  441. OMAP3_MUX(MCSPI1_CS0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
  442. /* McSPI 4 */
  443. OMAP3_MUX(MCBSP1_CLKR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  444. OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  445. OMAP3_MUX(MCBSP1_DR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  446. OMAP3_MUX(MCBSP1_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP),
  447. /* McBSP 2 */
  448. OMAP3_MUX(MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  449. OMAP3_MUX(MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  450. OMAP3_MUX(MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  451. OMAP3_MUX(MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  452. /* serial ports */
  453. OMAP3_MUX(MCBSP3_CLKX, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
  454. OMAP3_MUX(MCBSP3_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  455. OMAP3_MUX(UART1_TX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  456. OMAP3_MUX(UART1_RX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
  457. /* DSS */
  458. OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  459. OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  460. OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  461. OMAP3_MUX(DSS_ACBIAS, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  462. OMAP3_MUX(DSS_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  463. OMAP3_MUX(DSS_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  464. OMAP3_MUX(DSS_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  465. OMAP3_MUX(DSS_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  466. OMAP3_MUX(DSS_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  467. OMAP3_MUX(DSS_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  468. OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  469. OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  470. OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  471. OMAP3_MUX(DSS_DATA9, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  472. OMAP3_MUX(DSS_DATA10, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  473. OMAP3_MUX(DSS_DATA11, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  474. OMAP3_MUX(DSS_DATA12, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  475. OMAP3_MUX(DSS_DATA13, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  476. OMAP3_MUX(DSS_DATA14, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  477. OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  478. OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  479. OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  480. OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  481. OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  482. OMAP3_MUX(DSS_DATA20, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  483. OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  484. OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  485. OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
  486. /* display controls */
  487. OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
  488. OMAP3_MUX(GPMC_NCS7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
  489. OMAP3_MUX(GPMC_NCS3, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
  490. /* TPS IRQ */
  491. OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \
  492. OMAP_PIN_INPUT_PULLUP),
  493. { .reg_offset = OMAP_MUX_TERMINATOR },
  494. };
  495. #endif
  496. static struct omap_board_config_kernel cm_t35_config[] __initdata = {
  497. };
  498. static void __init cm_t35_init(void)
  499. {
  500. omap_board_config = cm_t35_config;
  501. omap_board_config_size = ARRAY_SIZE(cm_t35_config);
  502. omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
  503. omap_serial_init();
  504. cm_t35_init_i2c();
  505. cm_t35_init_nand();
  506. omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL);
  507. cm_t35_init_ethernet();
  508. cm_t35_init_led();
  509. cm_t35_init_display();
  510. usb_musb_init(NULL);
  511. usbhs_init(&usbhs_bdata);
  512. }
  513. MACHINE_START(CM_T35, "Compulab CM-T35")
  514. .boot_params = 0x80000100,
  515. .reserve = omap_reserve,
  516. .map_io = omap3_map_io,
  517. .init_early = cm_t35_init_early,
  518. .init_irq = omap3_init_irq,
  519. .init_machine = cm_t35_init,
  520. .timer = &omap3_timer,
  521. MACHINE_END