board-msm7x30.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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/bootmem.h>
  23. #include <linux/io.h>
  24. #include <linux/smsc911x.h>
  25. #include <asm/mach-types.h>
  26. #include <asm/mach/arch.h>
  27. #include <asm/setup.h>
  28. #include <mach/gpio.h>
  29. #include <mach/board.h>
  30. #include <mach/memory.h>
  31. #include <mach/msm_iomap.h>
  32. #include <mach/dma.h>
  33. #include <mach/vreg.h>
  34. #include "devices.h"
  35. #include "proc_comm.h"
  36. extern struct sys_timer msm_timer;
  37. #ifdef CONFIG_SERIAL_MSM_CONSOLE
  38. static struct msm_gpio uart2_config_data[] = {
  39. { GPIO_CFG(49, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_RFR"},
  40. { GPIO_CFG(50, 2, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_CTS"},
  41. { GPIO_CFG(51, 2, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Rx"},
  42. { GPIO_CFG(52, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Tx"},
  43. };
  44. static void msm7x30_init_uart2(void)
  45. {
  46. msm_gpios_request_enable(uart2_config_data,
  47. ARRAY_SIZE(uart2_config_data));
  48. }
  49. #endif
  50. static struct platform_device *devices[] __initdata = {
  51. #if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER)
  52. &msm_device_uart2,
  53. #endif
  54. };
  55. static void __init msm7x30_init_irq(void)
  56. {
  57. msm_init_irq();
  58. }
  59. static void __init msm7x30_init(void)
  60. {
  61. platform_add_devices(devices, ARRAY_SIZE(devices));
  62. #ifdef CONFIG_SERIAL_MSM_CONSOLE
  63. msm7x30_init_uart2();
  64. #endif
  65. }
  66. static void __init msm7x30_map_io(void)
  67. {
  68. msm_map_msm7x30_io();
  69. msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
  70. }
  71. MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
  72. #ifdef CONFIG_MSM_DEBUG_UART
  73. .phys_io = MSM_DEBUG_UART_PHYS,
  74. .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
  75. #endif
  76. .boot_params = PHYS_OFFSET + 0x100,
  77. .map_io = msm7x30_map_io,
  78. .init_irq = msm7x30_init_irq,
  79. .init_machine = msm7x30_init,
  80. .timer = &msm_timer,
  81. MACHINE_END
  82. MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
  83. #ifdef CONFIG_MSM_DEBUG_UART
  84. .phys_io = MSM_DEBUG_UART_PHYS,
  85. .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
  86. #endif
  87. .boot_params = PHYS_OFFSET + 0x100,
  88. .map_io = msm7x30_map_io,
  89. .init_irq = msm7x30_init_irq,
  90. .init_machine = msm7x30_init,
  91. .timer = &msm_timer,
  92. MACHINE_END
  93. MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
  94. #ifdef CONFIG_MSM_DEBUG_UART
  95. .phys_io = MSM_DEBUG_UART_PHYS,
  96. .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
  97. #endif
  98. .boot_params = PHYS_OFFSET + 0x100,
  99. .map_io = msm7x30_map_io,
  100. .init_irq = msm7x30_init_irq,
  101. .init_machine = msm7x30_init,
  102. .timer = &msm_timer,
  103. MACHINE_END