board-mx51_efikamx.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (C) 2010 Linaro Limited
  3. *
  4. * based on code from the following
  5. * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
  6. * Copyright 2009-2010 Pegatron Corporation. All Rights Reserved.
  7. * Copyright 2009-2010 Genesi USA, Inc. All Rights Reserved.
  8. *
  9. * The code contained herein is licensed under the GNU General Public
  10. * License. You may obtain a copy of the GNU General Public License
  11. * Version 2 or later at the following locations:
  12. *
  13. * http://www.opensource.org/licenses/gpl-license.html
  14. * http://www.gnu.org/copyleft/gpl.html
  15. */
  16. #include <linux/init.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/i2c.h>
  19. #include <linux/gpio.h>
  20. #include <linux/delay.h>
  21. #include <linux/io.h>
  22. #include <linux/fsl_devices.h>
  23. #include <mach/common.h>
  24. #include <mach/hardware.h>
  25. #include <mach/iomux-mx51.h>
  26. #include <mach/i2c.h>
  27. #include <mach/mxc_ehci.h>
  28. #include <asm/irq.h>
  29. #include <asm/setup.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/mach/arch.h>
  32. #include <asm/mach/time.h>
  33. #include "devices-imx51.h"
  34. #include "devices.h"
  35. static struct pad_desc mx51efikamx_pads[] = {
  36. /* UART1 */
  37. MX51_PAD_UART1_RXD__UART1_RXD,
  38. MX51_PAD_UART1_TXD__UART1_TXD,
  39. MX51_PAD_UART1_RTS__UART1_RTS,
  40. MX51_PAD_UART1_CTS__UART1_CTS,
  41. };
  42. /* Serial ports */
  43. #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
  44. static const struct imxuart_platform_data uart_pdata = {
  45. .flags = IMXUART_HAVE_RTSCTS,
  46. };
  47. static inline void mxc_init_imx_uart(void)
  48. {
  49. imx51_add_imx_uart(0, &uart_pdata);
  50. imx51_add_imx_uart(1, &uart_pdata);
  51. imx51_add_imx_uart(2, &uart_pdata);
  52. }
  53. #else /* !SERIAL_IMX */
  54. static inline void mxc_init_imx_uart(void)
  55. {
  56. }
  57. #endif /* SERIAL_IMX */
  58. static void __init mxc_board_init(void)
  59. {
  60. mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
  61. ARRAY_SIZE(mx51efikamx_pads));
  62. mxc_init_imx_uart();
  63. }
  64. static void __init mx51_efikamx_timer_init(void)
  65. {
  66. mx51_clocks_init(32768, 24000000, 22579200, 24576000);
  67. }
  68. static struct sys_timer mxc_timer = {
  69. .init = mx51_efikamx_timer_init,
  70. };
  71. MACHINE_START(MX51_EFIKAMX, "Genesi EfikaMX nettop")
  72. /* Maintainer: Amit Kucheria <amit.kucheria@linaro.org> */
  73. .phys_io = MX51_AIPS1_BASE_ADDR,
  74. .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
  75. .boot_params = MX51_PHYS_OFFSET + 0x100,
  76. .map_io = mx51_map_io,
  77. .init_irq = mx51_init_irq,
  78. .init_machine = mxc_board_init,
  79. .timer = &mxc_timer,
  80. MACHINE_END