ocotea.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * (C) Copyright 2004
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /* Board specific FPGA stuff ... */
  24. #define FPGA_REG0 (CONFIG_SYS_FPGA_BASE + 0x00)
  25. #define FPGA_REG0_SSCG_MASK 0x80
  26. #define FPGA_REG0_SSCG_DISABLE 0x00
  27. #define FPGA_REG0_SSCG_ENABLE 0x80
  28. #define FPGA_REG0_BOOT_MASK 0x40
  29. #define FPGA_REG0_BOOT_LARGE_FLASH 0x00
  30. #define FPGA_REG0_BOOT_SMALL_FLASH 0x40
  31. #define FPGA_REG0_ECLS_MASK 0x38 /* New for Ocotea Rev 2 */
  32. #define FPGA_REG0_ECLS_0 0x20 /* New for Ocotea Rev 2 */
  33. #define FPGA_REG0_ECLS_1 0x10 /* New for Ocotea Rev 2 */
  34. #define FPGA_REG0_ECLS_2 0x08 /* New for Ocotea Rev 2 */
  35. #define FPGA_REG0_ECLS_VER1 0x00 /* New for Ocotea Rev 2 */
  36. #define FPGA_REG0_ECLS_VER3 0x08 /* New for Ocotea Rev 2 */
  37. #define FPGA_REG0_ECLS_VER4 0x10 /* New for Ocotea Rev 2 */
  38. #define FPGA_REG0_ECLS_VER5 0x18 /* New for Ocotea Rev 2 */
  39. #define FPGA_REG0_ECLS_VER2 0x20 /* New for Ocotea Rev 2 */
  40. #define FPGA_REG0_ECLS_VER6 0x28 /* New for Ocotea Rev 2 */
  41. #define FPGA_REG0_ECLS_VER7 0x30 /* New for Ocotea Rev 2 */
  42. #define FPGA_REG0_ECLS_VER8 0x38 /* New for Ocotea Rev 2 */
  43. #define FPGA_REG0_ARBITER_MASK 0x04
  44. #define FPGA_REG0_ARBITER_EXT 0x00
  45. #define FPGA_REG0_ARBITER_INT 0x04
  46. #define FPGA_REG0_ONBOARD_FLASH_MASK 0x02
  47. #define FPGA_REG0_ONBOARD_FLASH_ENABLE 0x00
  48. #define FPGA_REG0_ONBOARD_FLASH_DISABLE 0x02
  49. #define FPGA_REG0_FLASH 0x01
  50. #define FPGA_REG1 (CONFIG_SYS_FPGA_BASE + 0x01)
  51. #define FPGA_REG1_9772_FSELFBX_MASK 0x80
  52. #define FPGA_REG1_9772_FSELFBX_6 0x00
  53. #define FPGA_REG1_9772_FSELFBX_10 0x80
  54. #define FPGA_REG1_9531_SX_MASK 0x60
  55. #define FPGA_REG1_9531_SX_33MHZ 0x00
  56. #define FPGA_REG1_9531_SX_100MHZ 0x20
  57. #define FPGA_REG1_9531_SX_66MHZ 0x40
  58. #define FPGA_REG1_9531_SX_133MHZ 0x60
  59. #define FPGA_REG1_9772_FSELBX_MASK 0x18
  60. #define FPGA_REG1_9772_FSELBX_4 0x00
  61. #define FPGA_REG1_9772_FSELBX_6 0x08
  62. #define FPGA_REG1_9772_FSELBX_8 0x10
  63. #define FPGA_REG1_9772_FSELBX_10 0x18
  64. #define FPGA_REG1_SOURCE_MASK 0x07
  65. #define FPGA_REG1_SOURCE_TC 0x00
  66. #define FPGA_REG1_SOURCE_66MHZ 0x01
  67. #define FPGA_REG1_SOURCE_50MHZ 0x02
  68. #define FPGA_REG1_SOURCE_33MHZ 0x03
  69. #define FPGA_REG1_SOURCE_25MHZ 0x04
  70. #define FPGA_REG1_SOURCE_SSDIV1 0x05
  71. #define FPGA_REG1_SOURCE_SSDIV2 0x06
  72. #define FPGA_REG1_SOURCE_SSDIV4 0x07
  73. #define FPGA_REG2 (CONFIG_SYS_FPGA_BASE + 0x02)
  74. #define FPGA_REG2_TC0 0x80
  75. #define FPGA_REG2_TC1 0x40
  76. #define FPGA_REG2_TC2 0x20
  77. #define FPGA_REG2_TC3 0x10
  78. #define FPGA_REG2_GIGABIT_RESET_DISABLE 0x08 /*Use on Ocotea pass 2 boards*/
  79. #define FPGA_REG2_EXT_INTFACE_MASK 0x04
  80. #define FPGA_REG2_EXT_INTFACE_ENABLE 0x00
  81. #define FPGA_REG2_EXT_INTFACE_DISABLE 0x04
  82. #define FPGA_REG2_SMII_RESET_DISABLE 0x02 /*Use on Ocotea pass 3 boards*/
  83. #define FPGA_REG2_DEFAULT_UART1_N 0x01
  84. #define FPGA_REG3 (CONFIG_SYS_FPGA_BASE + 0x03)
  85. #define FPGA_REG3_GIGABIT_RESET_DISABLE 0x80 /*Use on Ocotea pass 1 boards*/
  86. #define FPGA_REG3_ENET_MASK1 0x70 /*Use on Ocotea pass 1 boards*/
  87. #define FPGA_REG3_ENET_MASK2 0xF0 /*Use on Ocotea pass 2 boards*/
  88. #define FPGA_REG3_ENET_GROUP0 0x00
  89. #define FPGA_REG3_ENET_GROUP1 0x10
  90. #define FPGA_REG3_ENET_GROUP2 0x20
  91. #define FPGA_REG3_ENET_GROUP3 0x30
  92. #define FPGA_REG3_ENET_GROUP4 0x40
  93. #define FPGA_REG3_ENET_GROUP5 0x50
  94. #define FPGA_REG3_ENET_GROUP6 0x60
  95. #define FPGA_REG3_ENET_GROUP7 0x70
  96. #define FPGA_REG3_ENET_GROUP8 0x80 /*Use on Ocotea pass 2 boards*/
  97. #define FPGA_REG3_ENET_ENCODE1(n) ((((unsigned long)(n))&0x07)<<4) /*pass1*/
  98. #define FPGA_REG3_ENET_DECODE1(n) ((((unsigned long)(n))>>4)&0x07) /*pass1*/
  99. #define FPGA_REG3_ENET_ENCODE2(n) ((((unsigned long)(n))&0x0F)<<4) /*pass2*/
  100. #define FPGA_REG3_ENET_DECODE2(n) ((((unsigned long)(n))>>4)&0x0F) /*pass2*/
  101. #define FPGA_REG3_STAT_MASK 0x0F
  102. #define FPGA_REG3_STAT_LED8_ENAB 0x08
  103. #define FPGA_REG3_STAT_LED4_ENAB 0x04
  104. #define FPGA_REG3_STAT_LED2_ENAB 0x02
  105. #define FPGA_REG3_STAT_LED1_ENAB 0x01
  106. #define FPGA_REG3_STAT_LED8_DISAB 0x00
  107. #define FPGA_REG3_STAT_LED4_DISAB 0x00
  108. #define FPGA_REG3_STAT_LED2_DISAB 0x00
  109. #define FPGA_REG3_STAT_LED1_DISAB 0x00
  110. #define FPGA_REG4 (CONFIG_SYS_FPGA_BASE + 0x04)
  111. #define FPGA_REG4_GPHY_MODE10 0x80
  112. #define FPGA_REG4_GPHY_MODE100 0x40
  113. #define FPGA_REG4_GPHY_MODE1000 0x20
  114. #define FPGA_REG4_GPHY_FRC_DPLX 0x10
  115. #define FPGA_REG4_GPHY_ANEG_DIS 0x08
  116. #define FPGA_REG4_CONNECT_PHYS 0x04
  117. #define SDR0_CUST0_ENET3_MASK 0x00000080
  118. #define SDR0_CUST0_ENET3_COPPER 0x00000000
  119. #define SDR0_CUST0_ENET3_FIBER 0x00000080
  120. #define SDR0_CUST0_RGMII3_MASK 0x00000070
  121. #define SDR0_CUST0_RGMII3_ENCODE(n) ((((unsigned long)(n))&0x7)<<4)
  122. #define SDR0_CUST0_RGMII3_DECODE(n) ((((unsigned long)(n))>>4)&0x07)
  123. #define SDR0_CUST0_RGMII3_DISAB 0x00000000
  124. #define SDR0_CUST0_RGMII3_RTBI 0x00000040
  125. #define SDR0_CUST0_RGMII3_RGMII 0x00000050
  126. #define SDR0_CUST0_RGMII3_TBI 0x00000060
  127. #define SDR0_CUST0_RGMII3_GMII 0x00000070
  128. #define SDR0_CUST0_ENET2_MASK 0x00000008
  129. #define SDR0_CUST0_ENET2_COPPER 0x00000000
  130. #define SDR0_CUST0_ENET2_FIBER 0x00000008
  131. #define SDR0_CUST0_RGMII2_MASK 0x00000007
  132. #define SDR0_CUST0_RGMII2_ENCODE(n) ((((unsigned long)(n))&0x7)<<0)
  133. #define SDR0_CUST0_RGMII2_DECODE(n) ((((unsigned long)(n))>>0)&0x07)
  134. #define SDR0_CUST0_RGMII2_DISAB 0x00000000
  135. #define SDR0_CUST0_RGMII2_RTBI 0x00000004
  136. #define SDR0_CUST0_RGMII2_RGMII 0x00000005
  137. #define SDR0_CUST0_RGMII2_TBI 0x00000006
  138. #define SDR0_CUST0_RGMII2_GMII 0x00000007