board-qsd8x50.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* Copyright (c) 2008-2009, 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 <asm/mach-types.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/io.h>
  25. #include <asm/setup.h>
  26. #include <mach/board.h>
  27. #include <mach/irqs.h>
  28. #include <mach/sirc.h>
  29. #include <mach/gpio.h>
  30. #include "devices.h"
  31. extern struct sys_timer msm_timer;
  32. static struct msm_gpio uart3_config_data[] = {
  33. { GPIO_CFG(86, 1, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Rx"},
  34. { GPIO_CFG(87, 1, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Tx"},
  35. };
  36. static struct platform_device *devices[] __initdata = {
  37. &msm_device_uart3,
  38. };
  39. static void msm8x50_init_uart3(void)
  40. {
  41. msm_gpios_request_enable(uart3_config_data,
  42. ARRAY_SIZE(uart3_config_data));
  43. }
  44. static void __init qsd8x50_map_io(void)
  45. {
  46. msm_map_qsd8x50_io();
  47. msm_clock_init(msm_clocks_8x50, msm_num_clocks_8x50);
  48. }
  49. static void __init qsd8x50_init_irq(void)
  50. {
  51. msm_init_irq();
  52. msm_init_sirc();
  53. }
  54. static void __init qsd8x50_init(void)
  55. {
  56. msm8x50_init_uart3();
  57. platform_add_devices(devices, ARRAY_SIZE(devices));
  58. }
  59. MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
  60. #ifdef CONFIG_MSM_DEBUG_UART
  61. .phys_io = MSM_DEBUG_UART_PHYS,
  62. .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
  63. #endif
  64. .boot_params = PHYS_OFFSET + 0x100,
  65. .map_io = qsd8x50_map_io,
  66. .init_irq = qsd8x50_init_irq,
  67. .init_machine = qsd8x50_init,
  68. .timer = &msm_timer,
  69. MACHINE_END
  70. MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
  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 = qsd8x50_map_io,
  77. .init_irq = qsd8x50_init_irq,
  78. .init_machine = qsd8x50_init,
  79. .timer = &msm_timer,
  80. MACHINE_END