uart_iomux_config.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright (c) 2012, Freescale Semiconductor, Inc.
  3. * All rights reserved.
  4. *
  5. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  6. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  7. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  8. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  9. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  10. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  11. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  12. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  13. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  14. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15. */
  16. // File: uart_iomux_config.c
  17. /* ------------------------------------------------------------------------------
  18. * <auto-generated>
  19. * This code was generated by a tool.
  20. * Runtime Version:3.4.0.0
  21. *
  22. * Changes to this file may cause incorrect behavior and will be lost if
  23. * the code is regenerated.
  24. * </auto-generated>
  25. * ------------------------------------------------------------------------------
  26. */
  27. #include "iomux_config.h"
  28. #include "registers/regsuart.h"
  29. #include "iomux_register.h"
  30. #include "io.h"
  31. #include <assert.h>
  32. #define MX6UL_PAD_UART1_TX_DATA__UART1_TX1 (IOMUXC_BASE_ADDR+0x084)
  33. #define MX6UL_PAD_UART1_RX_DATA__UART1_RX1 (IOMUXC_BASE_ADDR+0x088)
  34. #define IOMUXC_UART1_UART_RXD_MUX_SELECT_INPUT1 (IOMUXC_BASE_ADDR+0x624)
  35. #define PIN_CFG(mux_ctl_offset, pad_ctl_offset, select_input_offset, mux_mode, daisy, pad_setting) \
  36. do {\
  37. writel(mux_mode, IOMUXC_BASE_ADDR + mux_ctl_offset);\
  38. if (select_input_offset != 0)\
  39. writel(daisy, IOMUXC_BASE_ADDR + select_input_offset);\
  40. writel(pad_setting, IOMUXC_BASE_ADDR + pad_ctl_offset);\
  41. } while(0);
  42. #define MX6UL_PAD_UART1_TX_DATA__UART1_TX(p) PIN_CFG(0x0084, 0x0310, 0x0624, 0x0, 0x2, p)
  43. #define MX6UL_PAD_UART1_RX_DATA__UART1_RX(p) PIN_CFG(0x0088, 0x0314, 0x0624, 0x0, 0x3, p)
  44. void uart1_iomux_config(void)
  45. {
  46. /* UART1 TXD */
  47. MX6UL_PAD_UART1_TX_DATA__UART1_TX(0x10b0);
  48. /* UART1 RXD */
  49. MX6UL_PAD_UART1_RX_DATA__UART1_RX(0x10b0);
  50. }
  51. void uart2_iomux_config(void)
  52. {
  53. }
  54. void uart3_iomux_config(void)
  55. {
  56. }
  57. void uart4_iomux_config(void)
  58. {
  59. }
  60. void uart5_iomux_config(void)
  61. {
  62. }
  63. void uart6_iomux_config(void)
  64. {
  65. }
  66. void uart7_iomux_config(void)
  67. {
  68. }
  69. void uart8_iomux_config(void)
  70. {
  71. }
  72. void uart_iomux_config(int instance)
  73. {
  74. switch (instance)
  75. {
  76. case HW_UART1:
  77. return uart1_iomux_config();
  78. case HW_UART2:
  79. return uart2_iomux_config();
  80. case HW_UART3:
  81. return uart3_iomux_config();
  82. case HW_UART4:
  83. return uart4_iomux_config();
  84. case HW_UART5:
  85. return uart5_iomux_config();
  86. case HW_UART6:
  87. return uart5_iomux_config();
  88. case HW_UART7:
  89. return uart5_iomux_config();
  90. case HW_UART8:
  91. return uart5_iomux_config();
  92. default:
  93. assert(false);
  94. }
  95. }