board-cm-t3517.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * linux/arch/arm/mach-omap2/board-cm-t3517.c
  3. *
  4. * Support for the CompuLab CM-T3517 modules
  5. *
  6. * Copyright (C) 2010 CompuLab, Ltd.
  7. * Author: Igor Grinberg <grinberg@compulab.co.il>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * version 2 as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA
  22. *
  23. */
  24. #include <linux/kernel.h>
  25. #include <linux/init.h>
  26. #include <linux/platform_device.h>
  27. #include <linux/gpio.h>
  28. #include <linux/leds.h>
  29. #include <asm/mach-types.h>
  30. #include <asm/mach/arch.h>
  31. #include <asm/mach/map.h>
  32. #include <plat/board.h>
  33. #include <plat/common.h>
  34. #include <plat/control.h>
  35. #include "mux.h"
  36. #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
  37. static struct gpio_led cm_t3517_leds[] = {
  38. [0] = {
  39. .gpio = 186,
  40. .name = "cm-t3517:green",
  41. .default_trigger = "heartbeat",
  42. .active_low = 0,
  43. },
  44. };
  45. static struct gpio_led_platform_data cm_t3517_led_pdata = {
  46. .num_leds = ARRAY_SIZE(cm_t3517_leds),
  47. .leds = cm_t3517_leds,
  48. };
  49. static struct platform_device cm_t3517_led_device = {
  50. .name = "leds-gpio",
  51. .id = -1,
  52. .dev = {
  53. .platform_data = &cm_t3517_led_pdata,
  54. },
  55. };
  56. static void __init cm_t3517_init_leds(void)
  57. {
  58. platform_device_register(&cm_t3517_led_device);
  59. }
  60. #else
  61. static inline void cm_t3517_init_leds(void) {}
  62. #endif
  63. static struct omap_board_config_kernel cm_t3517_config[] __initdata = {
  64. };
  65. static void __init cm_t3517_init_irq(void)
  66. {
  67. omap_board_config = cm_t3517_config;
  68. omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
  69. omap2_init_common_hw(NULL, NULL);
  70. omap_init_irq();
  71. omap_gpio_init();
  72. }
  73. static struct omap_board_mux board_mux[] __initdata = {
  74. /* GPIO186 - Green LED */
  75. OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
  76. { .reg_offset = OMAP_MUX_TERMINATOR },
  77. };
  78. static void __init cm_t3517_init(void)
  79. {
  80. omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  81. omap_serial_init();
  82. cm_t3517_init_leds();
  83. }
  84. MACHINE_START(CM_T3517, "Compulab CM-T3517")
  85. .phys_io = 0x48000000,
  86. .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
  87. .boot_params = 0x80000100,
  88. .map_io = omap3_map_io,
  89. .reserve = omap_reserve,
  90. .init_irq = cm_t3517_init_irq,
  91. .init_machine = cm_t3517_init,
  92. .timer = &omap_timer,
  93. MACHINE_END