mcf5225x_clock.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright 2012 by Embedded Technologies s.r.o
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the copyright holders nor the names of
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * For additional information see http://www.ethernut.de/
  31. */
  32. #ifndef MCF5225X_CLOCK_H_
  33. #define MCF5225X_CLOCK_H_
  34. /* CLOCK Registers */
  35. #define MCF_CLOCK_SYNCR (*(volatile uint16_t*)(0x40120000))
  36. #define MCF_CLOCK_SYNSR (*(volatile uint8_t *)(0x40120002))
  37. #define MCF_CLOCK_ROCR (*(volatile uint16_t*)(0x40120004))
  38. #define MCF_CLOCK_LPDR (*(volatile uint8_t *)(0x40120007))
  39. #define MCF_CLOCK_CCHR (*(volatile uint8_t *)(0x40120008))
  40. #define MCF_CLOCK_CCLR (*(volatile uint8_t *)(0x40120009))
  41. #define MCF_CLOCK_OCHR (*(volatile uint8_t *)(0x4012000A))
  42. #define MCF_CLOCK_OCLR (*(volatile uint8_t *)(0x4012000B))
  43. #define MCF_CLOCK_RTCCR (*(volatile uint8_t *)(0x40120012))
  44. #define MCF_CLOCK_BWCR (*(volatile uint8_t *)(0x40120013))
  45. /* Bit definitions and macros for MCF_CLOCK_SYNCR */
  46. #define MCF_CLOCK_SYNCR_PLLEN (0x1)
  47. #define MCF_CLOCK_SYNCR_PLLMODE (0x2)
  48. #define MCF_CLOCK_SYNCR_CLKSRC (0x4)
  49. #define MCF_CLOCK_SYNCR_FWKUP (0x20)
  50. #define MCF_CLOCK_SYNCR_DISCLK (0x40)
  51. #define MCF_CLOCK_SYNCR_LOCEN (0x80)
  52. #define MCF_CLOCK_SYNCR_RFD(x) (((x)&0x7)<<0x8)
  53. #define MCF_CLOCK_SYNCR_LOCRE (0x800)
  54. #define MCF_CLOCK_SYNCR_MFD(x) (((x)&0x7)<<0xC)
  55. #define MCF_CLOCK_SYNCR_LOLRE (0x8000)
  56. /* Bit definitions and macros for MCF_CLOCK_SYNSR */
  57. #define MCF_CLOCK_SYNSR_LOCS (0x4)
  58. #define MCF_CLOCK_SYNSR_LOCK (0x8)
  59. #define MCF_CLOCK_SYNSR_LOCKS (0x10)
  60. #define MCF_CLOCK_SYNSR_CRYOSC (0x20)
  61. #define MCF_CLOCK_SYNSR_OCOSC (0x40)
  62. #define MCF_CLOCK_SYNSR_EXTOSC (0x80)
  63. /* Bit definitions and macros for MCF_CLOCK_ROCR */
  64. #define MCF_CLOCK_ROCR_TRIM(x) (((x)&0x3FF)<<0)
  65. /* Bit definitions and macros for MCF_CLOCK_LPDR */
  66. #define MCF_CLOCK_LPDR_LPD(x) (((x)&0xF)<<0)
  67. /* Bit definitions and macros for MCF_CLOCK_CCHR */
  68. #define MCF_CLOCK_CCHR_CCHR(x) (((x)&0x7)<<0)
  69. /* Bit definitions and macros for MCF_CLOCK_CCLR */
  70. #define MCF_CLOCK_CCLR_OSCSEL0 (0x1)
  71. #define MCF_CLOCK_CCLR_OSCSEL1 (0x2)
  72. /* Bit definitions and macros for MCF_CLOCK_OCHR */
  73. #define MCF_CLOCK_OCHR_STBY (0x40)
  74. #define MCF_CLOCK_OCHR_OCOEN (0x80)
  75. /* Bit definitions and macros for MCF_CLOCK_OCLR */
  76. #define MCF_CLOCK_OCLR_RANGE (0x10)
  77. #define MCF_CLOCK_OCLR_LPEN (0x20)
  78. #define MCF_CLOCK_OCLR_REFS (0x40)
  79. #define MCF_CLOCK_OCLR_OSCEN (0x80)
  80. /* Bit definitions and macros for MCF_CLOCK_RTCCR */
  81. #define MCF_CLOCK_RTCCR_RTCSEL (0x1)
  82. #define MCF_CLOCK_RTCCR_LPEN (0x2)
  83. #define MCF_CLOCK_RTCCR_REFS (0x4)
  84. #define MCF_CLOCK_RTCCR_KHZEN (0x8)
  85. #define MCF_CLOCK_RTCCR_OSCEN (0x10)
  86. #define MCF_CLOCK_RTCCR_EXTALEN (0x40)
  87. /* Bit definitions and macros for MCF_CLOCK_BWCR */
  88. #define MCF_CLOCK_BWCR_BWDSEL (0x1)
  89. #define MCF_CLOCK_BWCR_BWDSTOP (0x2)
  90. #endif /* MCF5225X_CLOCK_H_ */