board-mx51_babbage.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.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/init.h>
  13. #include <linux/platform_device.h>
  14. #include <mach/common.h>
  15. #include <mach/hardware.h>
  16. #include <mach/imx-uart.h>
  17. #include <mach/iomux-mx51.h>
  18. #include <asm/irq.h>
  19. #include <asm/setup.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach/time.h>
  23. #include "devices.h"
  24. static struct platform_device *devices[] __initdata = {
  25. &mxc_fec_device,
  26. };
  27. static struct pad_desc mx51babbage_pads[] = {
  28. /* UART1 */
  29. MX51_PAD_UART1_RXD__UART1_RXD,
  30. MX51_PAD_UART1_TXD__UART1_TXD,
  31. MX51_PAD_UART1_RTS__UART1_RTS,
  32. MX51_PAD_UART1_CTS__UART1_CTS,
  33. /* UART2 */
  34. MX51_PAD_UART2_RXD__UART2_RXD,
  35. MX51_PAD_UART2_TXD__UART2_TXD,
  36. /* UART3 */
  37. MX51_PAD_EIM_D25__UART3_RXD,
  38. MX51_PAD_EIM_D26__UART3_TXD,
  39. MX51_PAD_EIM_D27__UART3_RTS,
  40. MX51_PAD_EIM_D24__UART3_CTS,
  41. };
  42. /* Serial ports */
  43. #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
  44. static struct imxuart_platform_data uart_pdata = {
  45. .flags = IMXUART_HAVE_RTSCTS,
  46. };
  47. static inline void mxc_init_imx_uart(void)
  48. {
  49. mxc_register_device(&mxc_uart_device0, &uart_pdata);
  50. mxc_register_device(&mxc_uart_device1, &uart_pdata);
  51. mxc_register_device(&mxc_uart_device2, &uart_pdata);
  52. }
  53. #else /* !SERIAL_IMX */
  54. static inline void mxc_init_imx_uart(void)
  55. {
  56. }
  57. #endif /* SERIAL_IMX */
  58. /*
  59. * Board specific initialization.
  60. */
  61. static void __init mxc_board_init(void)
  62. {
  63. mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
  64. ARRAY_SIZE(mx51babbage_pads));
  65. mxc_init_imx_uart();
  66. platform_add_devices(devices, ARRAY_SIZE(devices));
  67. }
  68. static void __init mx51_babbage_timer_init(void)
  69. {
  70. mx51_clocks_init(32768, 24000000, 22579200, 0);
  71. }
  72. static struct sys_timer mxc_timer = {
  73. .init = mx51_babbage_timer_init,
  74. };
  75. MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
  76. /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */
  77. .phys_io = MX51_AIPS1_BASE_ADDR,
  78. .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
  79. .boot_params = PHYS_OFFSET + 0x100,
  80. .map_io = mx51_map_io,
  81. .init_irq = mx51_init_irq,
  82. .init_machine = mxc_board_init,
  83. .timer = &mxc_timer,
  84. MACHINE_END