board-msm7x30.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. * 02110-1301, USA.
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/irq.h>
  19. #include <linux/gpio.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/delay.h>
  22. #include <linux/io.h>
  23. #include <linux/smsc911x.h>
  24. #include <asm/mach-types.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/setup.h>
  27. #include <mach/gpio.h>
  28. #include <mach/board.h>
  29. #include <mach/memory.h>
  30. #include <mach/msm_iomap.h>
  31. #include <mach/dma.h>
  32. #include <mach/vreg.h>
  33. #include "devices.h"
  34. #include "proc_comm.h"
  35. extern struct sys_timer msm_timer;
  36. #ifdef CONFIG_SERIAL_MSM_CONSOLE
  37. static struct msm_gpio uart2_config_data[] = {
  38. { GPIO_CFG(49, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_RFR"},
  39. { GPIO_CFG(50, 2, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_CTS"},
  40. { GPIO_CFG(51, 2, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Rx"},
  41. { GPIO_CFG(52, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Tx"},
  42. };
  43. static void msm7x30_init_uart2(void)
  44. {
  45. msm_gpios_request_enable(uart2_config_data,
  46. ARRAY_SIZE(uart2_config_data));
  47. }
  48. #endif
  49. static struct platform_device *devices[] __initdata = {
  50. #if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER)
  51. &msm_device_uart2,
  52. #endif
  53. };
  54. static void __init msm7x30_init_irq(void)
  55. {
  56. msm_init_irq();
  57. }
  58. static void __init msm7x30_init(void)
  59. {
  60. platform_add_devices(devices, ARRAY_SIZE(devices));
  61. #ifdef CONFIG_SERIAL_MSM_CONSOLE
  62. msm7x30_init_uart2();
  63. #endif
  64. }
  65. static void __init msm7x30_map_io(void)
  66. {
  67. msm_map_msm7x30_io();
  68. msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
  69. }
  70. MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
  71. #ifdef CONFIG_MSM_DEBUG_UART
  72. .phys_io = MSM_DEBUG_UART_PHYS,
  73. .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
  74. #endif
  75. .boot_params = PHYS_OFFSET + 0x100,
  76. .map_io = msm7x30_map_io,
  77. .init_irq = msm7x30_init_irq,
  78. .init_machine = msm7x30_init,
  79. .timer = &msm_timer,
  80. MACHINE_END
  81. MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
  82. #ifdef CONFIG_MSM_DEBUG_UART
  83. .phys_io = MSM_DEBUG_UART_PHYS,
  84. .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
  85. #endif
  86. .boot_params = PHYS_OFFSET + 0x100,
  87. .map_io = msm7x30_map_io,
  88. .init_irq = msm7x30_init_irq,
  89. .init_machine = msm7x30_init,
  90. .timer = &msm_timer,
  91. MACHINE_END
  92. MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
  93. #ifdef CONFIG_MSM_DEBUG_UART
  94. .phys_io = MSM_DEBUG_UART_PHYS,
  95. .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
  96. #endif
  97. .boot_params = PHYS_OFFSET + 0x100,
  98. .map_io = msm7x30_map_io,
  99. .init_irq = msm7x30_init_irq,
  100. .init_machine = msm7x30_init,
  101. .timer = &msm_timer,
  102. MACHINE_END