You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.6 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * linux/<file location within the kernel tree>
  3. *
  4. * Copyright (C) 2010 Texas Instruments Incorporated
  5. * Author: Ganeshan N
  6. *
  7. * Based on <Give reference of old kernel file from which this file is derived from>
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation version 2.
  12. *
  13. * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
  14. * whether express or implied; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. */
  18. #ifndef _SUART_UTILS_H_
  19. #define _SUART_UTILS_H_
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /*
  24. *====================
  25. * Includes
  26. *====================
  27. */
  28. #include "tistdtypes.h"
  29. /* ************ Serializers ***************** */
  30. #define PRU_SUART_SERIALIZER_0 (0u)
  31. /** Serializer */
  32. #define PRU_SUART_SERIALIZER_1 (1u)
  33. /** Serializer */
  34. #define PRU_SUART_SERIALIZER_2 (2u)
  35. /** Serializer */
  36. #define PRU_SUART_SERIALIZER_3 (3u)
  37. /** Serializer */
  38. #define PRU_SUART_SERIALIZER_4 (4u)
  39. /** Serializer */
  40. #define PRU_SUART_SERIALIZER_5 (5u)
  41. /** Serializer */
  42. #define PRU_SUART_SERIALIZER_6 (6u)
  43. /** Serializer */
  44. #define PRU_SUART_SERIALIZER_7 (7u)
  45. /** Serializer */
  46. #define PRU_SUART_SERIALIZER_8 (8u)
  47. /** Serializer */
  48. #define PRU_SUART_SERIALIZER_9 (9u)
  49. /** Serializer */
  50. #define PRU_SUART_SERIALIZER_10 (10u)
  51. /** Serializer */
  52. #define PRU_SUART_SERIALIZER_11 (11u)
  53. /** Serializer */
  54. #define PRU_SUART_SERIALIZER_12 (12u)
  55. /** Serializer */
  56. #define PRU_SUART_SERIALIZER_13 (13u)
  57. /** Serializer */
  58. #define PRU_SUART_SERIALIZER_14 (14u)
  59. /** Serializer */
  60. #define PRU_SUART_SERIALIZER_15 (15u)
  61. /** Serializer */
  62. #define PRU_SUART_SERIALIZER_NONE (16u)
  63. /* Total number of baud rates supported */
  64. #define SUART_NUM_OF_BAUDS_SUPPORTED 13
  65. #define MCASP_PDIR_VAL ( \
  66. CSL_MCASP_PDIR_AFSR_OUTPUT<<CSL_MCASP_PDIR_AFSR_SHIFT | \
  67. CSL_MCASP_PDIR_AHCLKR_OUTPUT<<CSL_MCASP_PDIR_AHCLKR_SHIFT | \
  68. CSL_MCASP_PDIR_ACLKR_OUTPUT<<CSL_MCASP_PDIR_ACLKR_SHIFT | \
  69. CSL_MCASP_PDIR_AFSX_OUTPUT<<CSL_MCASP_PDIR_AFSX_SHIFT | \
  70. CSL_MCASP_PDIR_AHCLKX_OUTPUT<<CSL_MCASP_PDIR_AHCLKX_SHIFT | \
  71. CSL_MCASP_PDIR_ACLKX_OUTPUT<<CSL_MCASP_PDIR_ACLKX_SHIFT | \
  72. CSL_MCASP_PDIR_AXR8_OUTPUT<<CSL_MCASP_PDIR_AXR8_SHIFT | \
  73. CSL_MCASP_PDIR_AXR7_INPUT<<CSL_MCASP_PDIR_AXR7_SHIFT | \
  74. CSL_MCASP_PDIR_AXR10_OUTPUT<<CSL_MCASP_PDIR_AXR10_SHIFT | \
  75. CSL_MCASP_PDIR_AXR9_INPUT<<CSL_MCASP_PDIR_AXR9_SHIFT | \
  76. CSL_MCASP_PDIR_AXR14_OUTPUT<<CSL_MCASP_PDIR_AXR14_SHIFT | \
  77. CSL_MCASP_PDIR_AXR13_INPUT<<CSL_MCASP_PDIR_AXR13_SHIFT)
  78. extern void suart_mcasp_config(unsigned int mcasp_addr,
  79. unsigned int txBaudValue,
  80. unsigned int rxBaudValue,
  81. unsigned int oversampling,
  82. arm_pru_iomap * pru_arm_iomap);
  83. extern short suart_asp_baud_set(unsigned int txBaudValue,
  84. unsigned int rxBaudValue,
  85. unsigned int oversampling,
  86. arm_pru_iomap * pru_arm_iomap);
  87. extern void suart_mcasp_psc_disable(unsigned int psc1_addr);
  88. extern void suart_mcasp_psc_enable(unsigned int psc1_addr);
  89. extern short suart_asp_serializer_deactivate (unsigned short u16srNum,
  90. arm_pru_iomap * pru_arm_iomap);
  91. extern void suart_mcasp_tx_serialzier_set(unsigned int serializerNum,
  92. arm_pru_iomap * pru_arm_iomap);
  93. #ifdef __cplusplus
  94. } /* End of extern C */
  95. #endif /* #ifdef __cplusplus */
  96. #endif