board-mx51_3ds.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright (C) 2010 Jason Wang <jason77.wang@gmail.com>
  4. *
  5. * The code contained herein is licensed under the GNU General Public
  6. * License. You may obtain a copy of the GNU General Public License
  7. * Version 2 or later at the following locations:
  8. *
  9. * http://www.opensource.org/licenses/gpl-license.html
  10. * http://www.gnu.org/copyleft/gpl.html
  11. */
  12. #include <linux/irq.h>
  13. #include <linux/platform_device.h>
  14. #include <asm/mach-types.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/time.h>
  17. #include <mach/hardware.h>
  18. #include <mach/common.h>
  19. #include <mach/iomux-mx51.h>
  20. #include <mach/imx-uart.h>
  21. #include <mach/3ds_debugboard.h>
  22. #include "devices.h"
  23. #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6)
  24. static struct pad_desc mx51_3ds_pads[] = {
  25. /* UART1 */
  26. MX51_PAD_UART1_RXD__UART1_RXD,
  27. MX51_PAD_UART1_TXD__UART1_TXD,
  28. MX51_PAD_UART1_RTS__UART1_RTS,
  29. MX51_PAD_UART1_CTS__UART1_CTS,
  30. /* UART2 */
  31. MX51_PAD_UART2_RXD__UART2_RXD,
  32. MX51_PAD_UART2_TXD__UART2_TXD,
  33. MX51_PAD_EIM_D25__UART2_CTS,
  34. MX51_PAD_EIM_D26__UART2_RTS,
  35. /* UART3 */
  36. MX51_PAD_UART3_RXD__UART3_RXD,
  37. MX51_PAD_UART3_TXD__UART3_TXD,
  38. MX51_PAD_EIM_D24__UART3_CTS,
  39. MX51_PAD_EIM_D27__UART3_RTS,
  40. /* CPLD PARENT IRQ PIN */
  41. MX51_PAD_GPIO_1_6__GPIO_1_6,
  42. };
  43. /* Serial ports */
  44. #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
  45. static struct imxuart_platform_data uart_pdata = {
  46. .flags = IMXUART_HAVE_RTSCTS,
  47. };
  48. static inline void mxc_init_imx_uart(void)
  49. {
  50. mxc_register_device(&mxc_uart_device0, &uart_pdata);
  51. mxc_register_device(&mxc_uart_device1, &uart_pdata);
  52. mxc_register_device(&mxc_uart_device2, &uart_pdata);
  53. }
  54. #else /* !SERIAL_IMX */
  55. static inline void mxc_init_imx_uart(void)
  56. {
  57. }
  58. #endif /* SERIAL_IMX */
  59. /*
  60. * Board specific initialization.
  61. */
  62. static void __init mxc_board_init(void)
  63. {
  64. mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads,
  65. ARRAY_SIZE(mx51_3ds_pads));
  66. mxc_init_imx_uart();
  67. if (mxc_expio_init(MX51_CS5_BASE_ADDR, EXPIO_PARENT_INT))
  68. printk(KERN_WARNING "Init of the debugboard failed, all "
  69. "devices on the board are unusable.\n");
  70. }
  71. static void __init mx51_3ds_timer_init(void)
  72. {
  73. mx51_clocks_init(32768, 24000000, 22579200, 0);
  74. }
  75. static struct sys_timer mxc_timer = {
  76. .init = mx51_3ds_timer_init,
  77. };
  78. MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
  79. /* Maintainer: Freescale Semiconductor, Inc. */
  80. .phys_io = MX51_AIPS1_BASE_ADDR,
  81. .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
  82. .boot_params = PHYS_OFFSET + 0x100,
  83. .map_io = mx51_map_io,
  84. .init_irq = mx51_init_irq,
  85. .init_machine = mxc_board_init,
  86. .timer = &mxc_timer,
  87. MACHINE_END