board-omap3logic.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * linux/arch/arm/mach-omap2/board-omap3logic.c
  3. *
  4. * Copyright (C) 2010 Li-Pro.Net
  5. * Stephan Linz <linz@li-pro.net>
  6. *
  7. * Copyright (C) 2010 Logic Product Development, Inc.
  8. * Peter Barada <peter.barada@logicpd.com>
  9. *
  10. * Modified from Beagle, EVM, and RX51
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/delay.h>
  20. #include <linux/err.h>
  21. #include <linux/clk.h>
  22. #include <linux/io.h>
  23. #include <linux/gpio.h>
  24. #include <linux/regulator/machine.h>
  25. #include <linux/i2c/twl.h>
  26. #include <mach/hardware.h>
  27. #include <asm/mach-types.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/map.h>
  30. #include "mux.h"
  31. #include <plat/mux.h>
  32. #include <plat/board.h>
  33. #include <plat/common.h>
  34. #include <plat/gpmc.h>
  35. #include <plat/timer-gp.h>
  36. #include <plat/sdrc.h>
  37. #include <plat/control.h>
  38. #define OMAP3LOGIC_SMSC911X_CS 1
  39. #define OMAP3530_LV_SOM_MMC_GPIO_CD 110
  40. #define OMAP3530_LV_SOM_MMC_GPIO_WP 126
  41. #define OMAP3530_LV_SOM_SMSC911X_GPIO_IRQ 152
  42. #define OMAP3_TORPEDO_MMC_GPIO_CD 127
  43. #define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ 129
  44. static struct regulator_consumer_supply omap3logic_vmmc1_supply = {
  45. .supply = "vmmc",
  46. };
  47. /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
  48. static struct regulator_init_data omap3logic_vmmc1 = {
  49. .constraints = {
  50. .name = "VMMC1",
  51. .min_uV = 1850000,
  52. .max_uV = 3150000,
  53. .valid_modes_mask = REGULATOR_MODE_NORMAL
  54. | REGULATOR_MODE_STANDBY,
  55. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  56. | REGULATOR_CHANGE_MODE
  57. | REGULATOR_CHANGE_STATUS,
  58. },
  59. .num_consumer_supplies = 1,
  60. .consumer_supplies = &omap3logic_vmmc1_supply,
  61. };
  62. static struct twl4030_gpio_platform_data omap3logic_gpio_data = {
  63. .gpio_base = OMAP_MAX_GPIO_LINES,
  64. .irq_base = TWL4030_GPIO_IRQ_BASE,
  65. .irq_end = TWL4030_GPIO_IRQ_END,
  66. .use_leds = true,
  67. .pullups = BIT(1),
  68. .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8)
  69. | BIT(13) | BIT(15) | BIT(16) | BIT(17),
  70. };
  71. static struct twl4030_platform_data omap3logic_twldata = {
  72. .irq_base = TWL4030_IRQ_BASE,
  73. .irq_end = TWL4030_IRQ_END,
  74. /* platform_data for children goes here */
  75. .gpio = &omap3logic_gpio_data,
  76. };
  77. static struct i2c_board_info __initdata omap3logic_i2c_boardinfo[] = {
  78. {
  79. I2C_BOARD_INFO("twl4030", 0x48),
  80. .flags = I2C_CLIENT_WAKE,
  81. .irq = INT_34XX_SYS_NIRQ,
  82. .platform_data = &omap3logic_twldata,
  83. },
  84. };
  85. static int __init omap3logic_i2c_init(void)
  86. {
  87. omap_register_i2c_bus(1, 2600, omap3logic_i2c_boardinfo,
  88. ARRAY_SIZE(omap3logic_i2c_boardinfo));
  89. return 0;
  90. }
  91. static void __init omap3logic_init_irq(void)
  92. {
  93. omap2_init_common_hw(NULL, NULL);
  94. omap_init_irq();
  95. omap_gpio_init();
  96. }
  97. static void __init omap3logic_init(void)
  98. {
  99. omap3logic_i2c_init();
  100. omap_serial_init();
  101. /* Ensure SDRC pins are mux'd for self-refresh */
  102. omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
  103. omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  104. }
  105. MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
  106. .phys_io = 0x48000000,
  107. .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
  108. .boot_params = 0x80000100,
  109. .map_io = omap3_map_io,
  110. .init_irq = omap3logic_init_irq,
  111. .init_machine = omap3logic_init,
  112. .timer = &omap_timer,
  113. MACHINE_END
  114. MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
  115. .phys_io = 0x48000000,
  116. .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
  117. .boot_params = 0x80000100,
  118. .map_io = omap3_map_io,
  119. .init_irq = omap3logic_init_irq,
  120. .init_machine = omap3logic_init,
  121. .timer = &omap_timer,
  122. MACHINE_END