mx31pdk.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #include <linux/types.h>
  19. #include <linux/init.h>
  20. #include <linux/clk.h>
  21. #include <linux/irq.h>
  22. #include <mach/hardware.h>
  23. #include <asm/mach-types.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/time.h>
  26. #include <asm/memory.h>
  27. #include <asm/mach/map.h>
  28. #include <mach/common.h>
  29. #include <mach/board-mx31pdk.h>
  30. #include <mach/imx-uart.h>
  31. #include <mach/iomux-mx3.h>
  32. #include "devices.h"
  33. /*!
  34. * @file mx31pdk.c
  35. *
  36. * @brief This file contains the board-specific initialization routines.
  37. *
  38. * @ingroup System
  39. */
  40. static struct imxuart_platform_data uart_pdata = {
  41. .flags = IMXUART_HAVE_RTSCTS,
  42. };
  43. static inline void mxc_init_imx_uart(void)
  44. {
  45. mxc_iomux_mode(MX31_PIN_CTS1__CTS1);
  46. mxc_iomux_mode(MX31_PIN_RTS1__RTS1);
  47. mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
  48. mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
  49. mxc_register_device(&mxc_uart_device0, &uart_pdata);
  50. }
  51. /*!
  52. * This structure defines static mappings for the i.MX31PDK board.
  53. */
  54. static struct map_desc mx31pdk_io_desc[] __initdata = {
  55. {
  56. .virtual = AIPS1_BASE_ADDR_VIRT,
  57. .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
  58. .length = AIPS1_SIZE,
  59. .type = MT_DEVICE_NONSHARED
  60. }, {
  61. .virtual = AIPS2_BASE_ADDR_VIRT,
  62. .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
  63. .length = AIPS2_SIZE,
  64. .type = MT_DEVICE_NONSHARED
  65. },
  66. };
  67. /*!
  68. * Set up static virtual mappings.
  69. */
  70. static void __init mx31pdk_map_io(void)
  71. {
  72. mxc_map_io();
  73. iotable_init(mx31pdk_io_desc, ARRAY_SIZE(mx31pdk_io_desc));
  74. }
  75. /*!
  76. * Board specific initialization.
  77. */
  78. static void __init mxc_board_init(void)
  79. {
  80. mxc_init_imx_uart();
  81. }
  82. static void __init mx31pdk_timer_init(void)
  83. {
  84. mxc_clocks_init(26000000);
  85. mxc_timer_init("ipg_clk.0");
  86. }
  87. static struct sys_timer mx31pdk_timer = {
  88. .init = mx31pdk_timer_init,
  89. };
  90. /*
  91. * The following uses standard kernel macros defined in arch.h in order to
  92. * initialize __mach_desc_MX31PDK data structure.
  93. */
  94. MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
  95. /* Maintainer: Freescale Semiconductor, Inc. */
  96. .phys_io = AIPS1_BASE_ADDR,
  97. .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
  98. .boot_params = PHYS_OFFSET + 0x100,
  99. .map_io = mx31pdk_map_io,
  100. .init_irq = mxc_init_irq,
  101. .init_machine = mxc_board_init,
  102. .timer = &mx31pdk_timer,
  103. MACHINE_END