m54xxgpt.h 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * File: m54xxgpt.h
  4. * Purpose: Register and bit definitions for the MCF54XX
  5. *
  6. * Notes:
  7. *
  8. */
  9. #ifndef m54xxgpt_h
  10. #define m54xxgpt_h
  11. /*********************************************************************
  12. *
  13. * General Purpose Timers (GPT)
  14. *
  15. *********************************************************************/
  16. /* Register read/write macros */
  17. #define MCF_GPT_GMS0 (MCF_MBAR + 0x000800)
  18. #define MCF_GPT_GCIR0 (MCF_MBAR + 0x000804)
  19. #define MCF_GPT_GPWM0 (MCF_MBAR + 0x000808)
  20. #define MCF_GPT_GSR0 (MCF_MBAR + 0x00080C)
  21. #define MCF_GPT_GMS1 (MCF_MBAR + 0x000810)
  22. #define MCF_GPT_GCIR1 (MCF_MBAR + 0x000814)
  23. #define MCF_GPT_GPWM1 (MCF_MBAR + 0x000818)
  24. #define MCF_GPT_GSR1 (MCF_MBAR + 0x00081C)
  25. #define MCF_GPT_GMS2 (MCF_MBAR + 0x000820)
  26. #define MCF_GPT_GCIR2 (MCF_MBAR + 0x000824)
  27. #define MCF_GPT_GPWM2 (MCF_MBAR + 0x000828)
  28. #define MCF_GPT_GSR2 (MCF_MBAR + 0x00082C)
  29. #define MCF_GPT_GMS3 (MCF_MBAR + 0x000830)
  30. #define MCF_GPT_GCIR3 (MCF_MBAR + 0x000834)
  31. #define MCF_GPT_GPWM3 (MCF_MBAR + 0x000838)
  32. #define MCF_GPT_GSR3 (MCF_MBAR + 0x00083C)
  33. #define MCF_GPT_GMS(x) (MCF_MBAR + 0x000800 + ((x) * 0x010))
  34. #define MCF_GPT_GCIR(x) (MCF_MBAR + 0x000804 + ((x) * 0x010))
  35. #define MCF_GPT_GPWM(x) (MCF_MBAR + 0x000808 + ((x) * 0x010))
  36. #define MCF_GPT_GSR(x) (MCF_MBAR + 0x00080C + ((x) * 0x010))
  37. /* Bit definitions and macros for MCF_GPT_GMS */
  38. #define MCF_GPT_GMS_TMS(x) (((x)&0x00000007)<<0)
  39. #define MCF_GPT_GMS_GPIO(x) (((x)&0x00000003)<<4)
  40. #define MCF_GPT_GMS_IEN (0x00000100)
  41. #define MCF_GPT_GMS_OD (0x00000200)
  42. #define MCF_GPT_GMS_SC (0x00000400)
  43. #define MCF_GPT_GMS_CE (0x00001000)
  44. #define MCF_GPT_GMS_WDEN (0x00008000)
  45. #define MCF_GPT_GMS_ICT(x) (((x)&0x00000003)<<16)
  46. #define MCF_GPT_GMS_OCT(x) (((x)&0x00000003)<<20)
  47. #define MCF_GPT_GMS_OCPW(x) (((x)&0x000000FF)<<24)
  48. #define MCF_GPT_GMS_OCT_FRCLOW (0x00000000)
  49. #define MCF_GPT_GMS_OCT_PULSEHI (0x00100000)
  50. #define MCF_GPT_GMS_OCT_PULSELO (0x00200000)
  51. #define MCF_GPT_GMS_OCT_TOGGLE (0x00300000)
  52. #define MCF_GPT_GMS_ICT_ANY (0x00000000)
  53. #define MCF_GPT_GMS_ICT_RISE (0x00010000)
  54. #define MCF_GPT_GMS_ICT_FALL (0x00020000)
  55. #define MCF_GPT_GMS_ICT_PULSE (0x00030000)
  56. #define MCF_GPT_GMS_GPIO_INPUT (0x00000000)
  57. #define MCF_GPT_GMS_GPIO_OUTLO (0x00000020)
  58. #define MCF_GPT_GMS_GPIO_OUTHI (0x00000030)
  59. #define MCF_GPT_GMS_GPIO_MASK (0x00000030)
  60. #define MCF_GPT_GMS_TMS_DISABLE (0x00000000)
  61. #define MCF_GPT_GMS_TMS_INCAPT (0x00000001)
  62. #define MCF_GPT_GMS_TMS_OUTCAPT (0x00000002)
  63. #define MCF_GPT_GMS_TMS_PWM (0x00000003)
  64. #define MCF_GPT_GMS_TMS_GPIO (0x00000004)
  65. #define MCF_GPT_GMS_TMS_MASK (0x00000007)
  66. /* Bit definitions and macros for MCF_GPT_GCIR */
  67. #define MCF_GPT_GCIR_CNT(x) (((x)&0x0000FFFF)<<0)
  68. #define MCF_GPT_GCIR_PRE(x) (((x)&0x0000FFFF)<<16)
  69. /* Bit definitions and macros for MCF_GPT_GPWM */
  70. #define MCF_GPT_GPWM_LOAD (0x00000001)
  71. #define MCF_GPT_GPWM_PWMOP (0x00000100)
  72. #define MCF_GPT_GPWM_WIDTH(x) (((x)&0x0000FFFF)<<16)
  73. /* Bit definitions and macros for MCF_GPT_GSR */
  74. #define MCF_GPT_GSR_CAPT (0x00000001)
  75. #define MCF_GPT_GSR_COMP (0x00000002)
  76. #define MCF_GPT_GSR_PWMP (0x00000004)
  77. #define MCF_GPT_GSR_TEXP (0x00000008)
  78. #define MCF_GPT_GSR_PIN (0x00000100)
  79. #define MCF_GPT_GSR_OVF(x) (((x)&0x00000007)<<12)
  80. #define MCF_GPT_GSR_CAPTURE(x) (((x)&0x0000FFFF)<<16)
  81. /********************************************************************/
  82. #endif /* m54xxgpt_h */