cgu.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * CGU Masks
  3. */
  4. #ifndef __BFIN_PERIPHERAL_CGU__
  5. #define __BFIN_PERIPHERAL_CGU__
  6. /* CGU_CTL Masks */
  7. #define DF (1 << 0)
  8. #define MSEL (0x7f << MSEL_P)
  9. #define WIDLE (1 << WIDLE_P)
  10. #define LOCK (1 << LOCK_P)
  11. #define DF_P 0
  12. #define MSEL_P 8
  13. #define WIDLE_P 30
  14. #define LOCK_P 31
  15. #define MSEL_MASK 0x7F00
  16. #define DF_MASK 0x1
  17. /* CGU_STAT Masks */
  18. #define PLLEN (1 << 0)
  19. #define PLLBP (1 << 1)
  20. #define PLLLK (1 << 2)
  21. #define CLKSALGN (1 << 3)
  22. #define CCBF0EN (1 << 4)
  23. #define CCBF1EN (1 << 5)
  24. #define SCBF0EN (1 << 6)
  25. #define SCBF1EN (1 << 7)
  26. #define DCBFEN (1 << 8)
  27. #define OCBFEN (1 << 9)
  28. #define ADRERR (1 << 16)
  29. #define LWERR (1 << 17)
  30. #define DIVERR (1 << 18)
  31. #define WDFMSERR (1 << 19)
  32. #define WDIVERR (1 << 20)
  33. #define PLLLKERR (1 << 21)
  34. /* CGU_DIV Masks */
  35. #define CSEL (0x1f << CSEL_P)
  36. #define S0SEL (3 << S0SEL_P)
  37. #define SYSSEL (0x1f << SYSSEL_P)
  38. #define S1SEL (3 << S1SEL_P)
  39. #define DSEL (0x1f << DSEL_P)
  40. #define OSEL (0x7f << OSEL_P)
  41. #define ALGN (1 << ALGN_P)
  42. #define UPDT (1 << UPDT_P)
  43. #define LOCK (1 << LOCK_P)
  44. #define CSEL_P 0
  45. #define S0SEL_P 5
  46. #define SYSSEL_P 8
  47. #define S1SEL_P 13
  48. #define DSEL_P 16
  49. #define OSEL_P 22
  50. #define ALGN_P 29
  51. #define UPDT_P 30
  52. #define LOCK_P 31
  53. /* CGU_CLKOUTSEL Masks */
  54. #define CLKOUTSEL (0xf << 0)
  55. #define USBCLKSEL (0x3f << 16)
  56. #define LOCK (1 << LOCK_P)
  57. #define LOCK_P 31
  58. #define CLKOUTSEL_CLKIN 0x0
  59. #define CLKOUTSEL_CCLK 0x1
  60. #define CLKOUTSEL_SYSCLK 0x2
  61. #define CLKOUTSEL_SCLK0 0x3
  62. #define CLKOUTSEL_SCLK1 0x4
  63. #define CLKOUTSEL_DCLK 0x5
  64. #define CLKOUTSEL_USB_PLL 0x6
  65. #define CLKOUTSEL_OUTCLK 0x7
  66. #define CLKOUTSEL_USB_CLKIN 0x8
  67. #define CLKOUTSEL_WDOG 0x9
  68. #define CLKOUTSEL_PMON 0xA
  69. #define CLKOUTSEL_GND 0xB
  70. #endif