board-zoom2.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright (C) 2009 Texas Instruments Inc.
  3. * Mikkel Christensen <mlc@ti.com>
  4. *
  5. * Modified from mach-omap2/board-ldp.c
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/gpio.h>
  15. #include <linux/i2c/twl4030.h>
  16. #include <asm/mach-types.h>
  17. #include <asm/mach/arch.h>
  18. #include <mach/common.h>
  19. #include <mach/usb.h>
  20. #include "mmc-twl4030.h"
  21. static void __init omap_zoom2_init_irq(void)
  22. {
  23. omap2_init_common_hw(NULL);
  24. omap_init_irq();
  25. omap_gpio_init();
  26. }
  27. static struct omap_uart_config zoom2_uart_config __initdata = {
  28. .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
  29. };
  30. static struct omap_board_config_kernel zoom2_config[] __initdata = {
  31. { OMAP_TAG_UART, &zoom2_uart_config },
  32. };
  33. static struct twl4030_gpio_platform_data zoom2_gpio_data = {
  34. .gpio_base = OMAP_MAX_GPIO_LINES,
  35. .irq_base = TWL4030_GPIO_IRQ_BASE,
  36. .irq_end = TWL4030_GPIO_IRQ_END,
  37. };
  38. static struct twl4030_platform_data zoom2_twldata = {
  39. .irq_base = TWL4030_IRQ_BASE,
  40. .irq_end = TWL4030_IRQ_END,
  41. /* platform_data for children goes here */
  42. .gpio = &zoom2_gpio_data,
  43. };
  44. static struct i2c_board_info __initdata zoom2_i2c_boardinfo[] = {
  45. {
  46. I2C_BOARD_INFO("twl4030", 0x48),
  47. .flags = I2C_CLIENT_WAKE,
  48. .irq = INT_34XX_SYS_NIRQ,
  49. .platform_data = &zoom2_twldata,
  50. },
  51. };
  52. static int __init omap_i2c_init(void)
  53. {
  54. omap_register_i2c_bus(1, 2600, zoom2_i2c_boardinfo,
  55. ARRAY_SIZE(zoom2_i2c_boardinfo));
  56. omap_register_i2c_bus(2, 400, NULL, 0);
  57. omap_register_i2c_bus(3, 400, NULL, 0);
  58. return 0;
  59. }
  60. static struct twl4030_hsmmc_info mmc[] __initdata = {
  61. {
  62. .mmc = 1,
  63. .wires = 4,
  64. .gpio_cd = -EINVAL,
  65. .gpio_wp = -EINVAL,
  66. },
  67. {} /* Terminator */
  68. };
  69. extern int __init omap_zoom2_debugboard_init(void);
  70. static void __init omap_zoom2_init(void)
  71. {
  72. omap_i2c_init();
  73. omap_board_config = zoom2_config;
  74. omap_board_config_size = ARRAY_SIZE(zoom2_config);
  75. omap_serial_init();
  76. omap_zoom2_debugboard_init();
  77. twl4030_mmc_init(mmc);
  78. usb_musb_init();
  79. }
  80. static void __init omap_zoom2_map_io(void)
  81. {
  82. omap2_set_globals_343x();
  83. omap2_map_common_io();
  84. }
  85. MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
  86. .phys_io = 0x48000000,
  87. .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
  88. .boot_params = 0x80000100,
  89. .map_io = omap_zoom2_map_io,
  90. .init_irq = omap_zoom2_init_irq,
  91. .init_machine = omap_zoom2_init,
  92. .timer = &omap_timer,
  93. MACHINE_END