pq2ads_pd.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #ifndef __PQ2ADS_PD_H
  2. #define __PQ2ADS_PD_H
  3. /*
  4. * arch/ppc/platforms/82xx/pq2ads_pd.h
  5. *
  6. * Some defines for MPC82xx board-specific PlatformDevice descriptions
  7. *
  8. * 2005 (c) MontaVista Software, Inc.
  9. * Vitaly Bordug <vbordug@ru.mvista.com>
  10. *
  11. * This file is licensed under the terms of the GNU General Public License
  12. * version 2. This program is licensed "as is" without any warranty of any
  13. * kind, whether express or implied.
  14. */
  15. /* FCC1 Clock Source Configuration. These can be redefined in the board specific file.
  16. Can only choose from CLK9-12 */
  17. #define F1_RXCLK 11
  18. #define F1_TXCLK 10
  19. /* FCC2 Clock Source Configuration. These can be redefined in the board specific file.
  20. Can only choose from CLK13-16 */
  21. #define F2_RXCLK 15
  22. #define F2_TXCLK 16
  23. /* FCC3 Clock Source Configuration. These can be redefined in the board specific file.
  24. Can only choose from CLK13-16 */
  25. #define F3_RXCLK 13
  26. #define F3_TXCLK 14
  27. /* Automatically generates register configurations */
  28. #define PC_CLK(x) ((uint)(1<<(x-1))) /* FCC CLK I/O ports */
  29. #define CMXFCR_RF1CS(x) ((uint)((x-5)<<27)) /* FCC1 Receive Clock Source */
  30. #define CMXFCR_TF1CS(x) ((uint)((x-5)<<24)) /* FCC1 Transmit Clock Source */
  31. #define CMXFCR_RF2CS(x) ((uint)((x-9)<<19)) /* FCC2 Receive Clock Source */
  32. #define CMXFCR_TF2CS(x) ((uint)((x-9)<<16)) /* FCC2 Transmit Clock Source */
  33. #define CMXFCR_RF3CS(x) ((uint)((x-9)<<11)) /* FCC3 Receive Clock Source */
  34. #define CMXFCR_TF3CS(x) ((uint)((x-9)<<8)) /* FCC3 Transmit Clock Source */
  35. #define PC_F1RXCLK PC_CLK(F1_RXCLK)
  36. #define PC_F1TXCLK PC_CLK(F1_TXCLK)
  37. #define CMX1_CLK_ROUTE (CMXFCR_RF1CS(F1_RXCLK) | CMXFCR_TF1CS(F1_TXCLK))
  38. #define CMX1_CLK_MASK ((uint)0xff000000)
  39. #define PC_F2RXCLK PC_CLK(F2_RXCLK)
  40. #define PC_F2TXCLK PC_CLK(F2_TXCLK)
  41. #define CMX2_CLK_ROUTE (CMXFCR_RF2CS(F2_RXCLK) | CMXFCR_TF2CS(F2_TXCLK))
  42. #define CMX2_CLK_MASK ((uint)0x00ff0000)
  43. #define PC_F3RXCLK PC_CLK(F3_RXCLK)
  44. #define PC_F3TXCLK PC_CLK(F3_TXCLK)
  45. #define CMX3_CLK_ROUTE (CMXFCR_RF3CS(F3_RXCLK) | CMXFCR_TF3CS(F3_TXCLK))
  46. #define CMX3_CLK_MASK ((uint)0x0000ff00)
  47. /* I/O Pin assignment for FCC1. I don't yet know the best way to do this,
  48. * but there is little variation among the choices.
  49. */
  50. #define PA1_COL 0x00000001U
  51. #define PA1_CRS 0x00000002U
  52. #define PA1_TXER 0x00000004U
  53. #define PA1_TXEN 0x00000008U
  54. #define PA1_RXDV 0x00000010U
  55. #define PA1_RXER 0x00000020U
  56. #define PA1_TXDAT 0x00003c00U
  57. #define PA1_RXDAT 0x0003c000U
  58. #define PA1_PSORA0 (PA1_RXDAT | PA1_TXDAT)
  59. #define PA1_PSORA1 (PA1_COL | PA1_CRS | PA1_TXER | PA1_TXEN | \
  60. PA1_RXDV | PA1_RXER)
  61. #define PA1_DIRA0 (PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
  62. #define PA1_DIRA1 (PA1_TXDAT | PA1_TXEN | PA1_TXER)
  63. /* I/O Pin assignment for FCC2. I don't yet know the best way to do this,
  64. * but there is little variation among the choices.
  65. */
  66. #define PB2_TXER 0x00000001U
  67. #define PB2_RXDV 0x00000002U
  68. #define PB2_TXEN 0x00000004U
  69. #define PB2_RXER 0x00000008U
  70. #define PB2_COL 0x00000010U
  71. #define PB2_CRS 0x00000020U
  72. #define PB2_TXDAT 0x000003c0U
  73. #define PB2_RXDAT 0x00003c00U
  74. #define PB2_PSORB0 (PB2_RXDAT | PB2_TXDAT | PB2_CRS | PB2_COL | \
  75. PB2_RXER | PB2_RXDV | PB2_TXER)
  76. #define PB2_PSORB1 (PB2_TXEN)
  77. #define PB2_DIRB0 (PB2_RXDAT | PB2_CRS | PB2_COL | PB2_RXER | PB2_RXDV)
  78. #define PB2_DIRB1 (PB2_TXDAT | PB2_TXEN | PB2_TXER)
  79. /* I/O Pin assignment for FCC3. I don't yet know the best way to do this,
  80. * but there is little variation among the choices.
  81. */
  82. #define PB3_RXDV 0x00004000U
  83. #define PB3_RXER 0x00008000U
  84. #define PB3_TXER 0x00010000U
  85. #define PB3_TXEN 0x00020000U
  86. #define PB3_COL 0x00040000U
  87. #define PB3_CRS 0x00080000U
  88. #define PB3_TXDAT 0x0f000000U
  89. #define PB3_RXDAT 0x00f00000U
  90. #define PB3_PSORB0 (PB3_RXDAT | PB3_TXDAT | PB3_CRS | PB3_COL | \
  91. PB3_RXER | PB3_RXDV | PB3_TXER | PB3_TXEN)
  92. #define PB3_PSORB1 0
  93. #define PB3_DIRB0 (PB3_RXDAT | PB3_CRS | PB3_COL | PB3_RXER | PB3_RXDV)
  94. #define PB3_DIRB1 (PB3_TXDAT | PB3_TXEN | PB3_TXER)
  95. #define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
  96. #define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
  97. #define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
  98. #endif