radstone_ppc7d.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. /*
  2. * Board definitions for the Radstone PPC7D boards.
  3. *
  4. * Author: James Chapman <jchapman@katalix.com>
  5. *
  6. * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
  7. * Based on code done by - Mark A. Greer <mgreer@mvista.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. */
  14. /*
  15. * The MV64360 has 2 PCI buses each with 1 window from the CPU bus to
  16. * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
  17. * We'll only use one PCI MEM window on each PCI bus.
  18. *
  19. * This is the CPU physical memory map (windows must be at least 1MB
  20. * and start on a boundary that is a multiple of the window size):
  21. *
  22. * 0xff800000-0xffffffff - Boot window
  23. * 0xff000000-0xff000fff - AFIX registers (DevCS2)
  24. * 0xfef00000-0xfef0ffff - Internal MV64x60 registers
  25. * 0xfef40000-0xfef7ffff - Internal SRAM
  26. * 0xfef00000-0xfef0ffff - MV64360 Registers
  27. * 0x70000000-0x7fffffff - soldered flash (DevCS3)
  28. * 0xe8000000-0xe9ffffff - PCI I/O
  29. * 0x80000000-0xbfffffff - PCI MEM
  30. */
  31. #ifndef __PPC_PLATFORMS_PPC7D_H
  32. #define __PPC_PLATFORMS_PPC7D_H
  33. #include <asm/ppcboot.h>
  34. /*****************************************************************************
  35. * CPU Physical Memory Map setup.
  36. *****************************************************************************/
  37. #define PPC7D_BOOT_WINDOW_BASE 0xff800000
  38. #define PPC7D_AFIX_REG_BASE 0xff000000
  39. #define PPC7D_INTERNAL_SRAM_BASE 0xfef40000
  40. #define PPC7D_FLASH_BASE 0x70000000
  41. #define PPC7D_BOOT_WINDOW_SIZE_ACTUAL 0x00800000 /* 8MB */
  42. #define PPC7D_FLASH_SIZE_ACTUAL 0x10000000 /* 256MB */
  43. #define PPC7D_BOOT_WINDOW_SIZE max(MV64360_WINDOW_SIZE_MIN, \
  44. PPC7D_BOOT_WINDOW_SIZE_ACTUAL)
  45. #define PPC7D_FLASH_SIZE max(MV64360_WINDOW_SIZE_MIN, \
  46. PPC7D_FLASH_SIZE_ACTUAL)
  47. #define PPC7D_AFIX_REG_SIZE max(MV64360_WINDOW_SIZE_MIN, 0xff)
  48. #define PPC7D_PCI0_MEM0_START_PROC_ADDR 0x80000000UL
  49. #define PPC7D_PCI0_MEM0_START_PCI_HI_ADDR 0x00000000UL
  50. #define PPC7D_PCI0_MEM0_START_PCI_LO_ADDR 0x80000000UL
  51. #define PPC7D_PCI0_MEM0_SIZE 0x20000000UL
  52. #define PPC7D_PCI0_MEM1_START_PROC_ADDR 0xe8010000UL
  53. #define PPC7D_PCI0_MEM1_START_PCI_HI_ADDR 0x00000000UL
  54. #define PPC7D_PCI0_MEM1_START_PCI_LO_ADDR 0x00000000UL
  55. #define PPC7D_PCI0_MEM1_SIZE 0x000f0000UL
  56. #define PPC7D_PCI0_IO_START_PROC_ADDR 0xe8000000UL
  57. #define PPC7D_PCI0_IO_START_PCI_ADDR 0x00000000UL
  58. #define PPC7D_PCI0_IO_SIZE 0x00010000UL
  59. #define PPC7D_PCI1_MEM0_START_PROC_ADDR 0xa0000000UL
  60. #define PPC7D_PCI1_MEM0_START_PCI_HI_ADDR 0x00000000UL
  61. #define PPC7D_PCI1_MEM0_START_PCI_LO_ADDR 0xa0000000UL
  62. #define PPC7D_PCI1_MEM0_SIZE 0x20000000UL
  63. #define PPC7D_PCI1_MEM1_START_PROC_ADDR 0xe9800000UL
  64. #define PPC7D_PCI1_MEM1_START_PCI_HI_ADDR 0x00000000UL
  65. #define PPC7D_PCI1_MEM1_START_PCI_LO_ADDR 0x00000000UL
  66. #define PPC7D_PCI1_MEM1_SIZE 0x00800000UL
  67. #define PPC7D_PCI1_IO_START_PROC_ADDR 0xe9000000UL
  68. #define PPC7D_PCI1_IO_START_PCI_ADDR 0x00000000UL
  69. #define PPC7D_PCI1_IO_SIZE 0x00010000UL
  70. #define PPC7D_DEFAULT_BAUD 9600
  71. #define PPC7D_MPSC_CLK_SRC 8 /* TCLK */
  72. #define PPC7D_MPSC_CLK_FREQ 133333333 /* 133.3333... MHz */
  73. #define PPC7D_ETH0_PHY_ADDR 8
  74. #define PPC7D_ETH1_PHY_ADDR 9
  75. #define PPC7D_ETH2_PHY_ADDR 0
  76. #define PPC7D_ETH_TX_QUEUE_SIZE 400
  77. #define PPC7D_ETH_RX_QUEUE_SIZE 400
  78. #define PPC7D_ETH_PORT_CONFIG_VALUE \
  79. MV64340_ETH_UNICAST_NORMAL_MODE | \
  80. MV64340_ETH_DEFAULT_RX_QUEUE_0 | \
  81. MV64340_ETH_DEFAULT_RX_ARP_QUEUE_0 | \
  82. MV64340_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \
  83. MV64340_ETH_RECEIVE_BC_IF_IP | \
  84. MV64340_ETH_RECEIVE_BC_IF_ARP | \
  85. MV64340_ETH_CAPTURE_TCP_FRAMES_DIS | \
  86. MV64340_ETH_CAPTURE_UDP_FRAMES_DIS | \
  87. MV64340_ETH_DEFAULT_RX_TCP_QUEUE_0 | \
  88. MV64340_ETH_DEFAULT_RX_UDP_QUEUE_0 | \
  89. MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_0
  90. #define PPC7D_ETH_PORT_CONFIG_EXTEND_VALUE \
  91. MV64340_ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \
  92. MV64340_ETH_PARTITION_DISABLE
  93. #define GT_ETH_IPG_INT_RX(value) \
  94. ((value & 0x3fff) << 8)
  95. #define PPC7D_ETH_PORT_SDMA_CONFIG_VALUE \
  96. MV64340_ETH_RX_BURST_SIZE_4_64BIT | \
  97. GT_ETH_IPG_INT_RX(0) | \
  98. MV64340_ETH_TX_BURST_SIZE_4_64BIT
  99. #define PPC7D_ETH_PORT_SERIAL_CONTROL_VALUE \
  100. MV64340_ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \
  101. MV64340_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \
  102. MV64340_ETH_ADV_SYMMETRIC_FLOW_CTRL | \
  103. MV64340_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
  104. MV64340_ETH_FORCE_BP_MODE_NO_JAM | \
  105. (1 << 9) | \
  106. MV64340_ETH_DO_NOT_FORCE_LINK_FAIL | \
  107. MV64340_ETH_RETRANSMIT_16_ATTEMPTS | \
  108. MV64340_ETH_ENABLE_AUTO_NEG_SPEED_GMII | \
  109. MV64340_ETH_DTE_ADV_0 | \
  110. MV64340_ETH_DISABLE_AUTO_NEG_BYPASS | \
  111. MV64340_ETH_AUTO_NEG_NO_CHANGE | \
  112. MV64340_ETH_MAX_RX_PACKET_9700BYTE | \
  113. MV64340_ETH_CLR_EXT_LOOPBACK | \
  114. MV64340_ETH_SET_FULL_DUPLEX_MODE | \
  115. MV64340_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX
  116. /*****************************************************************************
  117. * Serial defines.
  118. *****************************************************************************/
  119. #define PPC7D_SERIAL_0 0xe80003f8
  120. #define PPC7D_SERIAL_1 0xe80002f8
  121. #define RS_TABLE_SIZE 2
  122. /* Rate for the 1.8432 Mhz clock for the onboard serial chip */
  123. #define UART_CLK 1843200
  124. #define BASE_BAUD ( UART_CLK / 16 )
  125. #ifdef CONFIG_SERIAL_DETECT_IRQ
  126. #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ)
  127. #else
  128. #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF)
  129. #endif
  130. #define STD_SERIAL_PORT_DFNS \
  131. { 0, BASE_BAUD, PPC7D_SERIAL_0, 4, STD_COM_FLAGS, /* ttyS0 */ \
  132. iomem_base: (u8 *)PPC7D_SERIAL_0, \
  133. io_type: SERIAL_IO_MEM, }, \
  134. { 0, BASE_BAUD, PPC7D_SERIAL_1, 3, STD_COM_FLAGS, /* ttyS1 */ \
  135. iomem_base: (u8 *)PPC7D_SERIAL_1, \
  136. io_type: SERIAL_IO_MEM },
  137. #define SERIAL_PORT_DFNS \
  138. STD_SERIAL_PORT_DFNS
  139. /*****************************************************************************
  140. * CPLD defines.
  141. *
  142. * Register map:-
  143. *
  144. * 0000 to 000F South Bridge DMA 1 Control
  145. * 0020 and 0021 South Bridge Interrupt 1 Control
  146. * 0040 to 0043 South Bridge Counter Control
  147. * 0060 Keyboard
  148. * 0061 South Bridge NMI Status and Control
  149. * 0064 Keyboard
  150. * 0071 and 0072 RTC R/W
  151. * 0078 to 007B South Bridge BIOS Timer
  152. * 0080 to 0090 South Bridge DMA Pages
  153. * 00A0 and 00A1 South Bridge Interrupt 2 Control
  154. * 00C0 to 00DE South Bridge DMA 2 Control
  155. * 02E8 to 02EF COM6 R/W
  156. * 02F8 to 02FF South Bridge COM2 R/W
  157. * 03E8 to 03EF COM5 R/W
  158. * 03F8 to 03FF South Bridge COM1 R/W
  159. * 040A South Bridge DMA Scatter/Gather RO
  160. * 040B DMA 1 Extended Mode WO
  161. * 0410 to 043F South Bridge DMA Scatter/Gather
  162. * 0481 to 048B South Bridge DMA High Pages
  163. * 04D0 and 04D1 South Bridge Edge/Level Control
  164. * 04D6 DMA 2 Extended Mode WO
  165. * 0804 Memory Configuration RO
  166. * 0806 Memory Configuration Extend RO
  167. * 0808 SCSI Activity LED R/W
  168. * 080C Equipment Present 1 RO
  169. * 080E Equipment Present 2 RO
  170. * 0810 Equipment Present 3 RO
  171. * 0812 Equipment Present 4 RO
  172. * 0818 Key Lock RO
  173. * 0820 LEDS R/W
  174. * 0824 COMs R/W
  175. * 0826 RTS R/W
  176. * 0828 Reset R/W
  177. * 082C Watchdog Trig R/W
  178. * 082E Interrupt R/W
  179. * 0830 Interrupt Status RO
  180. * 0832 PCI configuration RO
  181. * 0854 Board Revision RO
  182. * 0858 Extended ID RO
  183. * 0864 ID Link RO
  184. * 0866 Motherboard Type RO
  185. * 0868 FLASH Write control RO
  186. * 086A Software FLASH write protect R/W
  187. * 086E FLASH Control R/W
  188. *****************************************************************************/
  189. #define PPC7D_CPLD_MEM_CONFIG 0x0804
  190. #define PPC7D_CPLD_MEM_CONFIG_EXTEND 0x0806
  191. #define PPC7D_CPLD_SCSI_ACTIVITY_LED 0x0808
  192. #define PPC7D_CPLD_EQUIPMENT_PRESENT_1 0x080C
  193. #define PPC7D_CPLD_EQUIPMENT_PRESENT_2 0x080E
  194. #define PPC7D_CPLD_EQUIPMENT_PRESENT_3 0x0810
  195. #define PPC7D_CPLD_EQUIPMENT_PRESENT_4 0x0812
  196. #define PPC7D_CPLD_KEY_LOCK 0x0818
  197. #define PPC7D_CPLD_LEDS 0x0820
  198. #define PPC7D_CPLD_COMS 0x0824
  199. #define PPC7D_CPLD_RTS 0x0826
  200. #define PPC7D_CPLD_RESET 0x0828
  201. #define PPC7D_CPLD_WATCHDOG_TRIG 0x082C
  202. #define PPC7D_CPLD_INTR 0x082E
  203. #define PPC7D_CPLD_INTR_STATUS 0x0830
  204. #define PPC7D_CPLD_PCI_CONFIG 0x0832
  205. #define PPC7D_CPLD_BOARD_REVISION 0x0854
  206. #define PPC7D_CPLD_EXTENDED_ID 0x0858
  207. #define PPC7D_CPLD_ID_LINK 0x0864
  208. #define PPC7D_CPLD_MOTHERBOARD_TYPE 0x0866
  209. #define PPC7D_CPLD_FLASH_WRITE_CNTL 0x0868
  210. #define PPC7D_CPLD_SW_FLASH_WRITE_PROTECT 0x086A
  211. #define PPC7D_CPLD_FLASH_CNTL 0x086E
  212. /* MEMORY_CONFIG_EXTEND */
  213. #define PPC7D_CPLD_SDRAM_BANK_NUM_MASK 0x02
  214. #define PPC7D_CPLD_SDRAM_BANK_SIZE_MASK 0xc0
  215. #define PPC7D_CPLD_SDRAM_BANK_SIZE_128M 0
  216. #define PPC7D_CPLD_SDRAM_BANK_SIZE_256M 0x40
  217. #define PPC7D_CPLD_SDRAM_BANK_SIZE_512M 0x80
  218. #define PPC7D_CPLD_SDRAM_BANK_SIZE_1G 0xc0
  219. #define PPC7D_CPLD_FLASH_DEV_SIZE_MASK 0x03
  220. #define PPC7D_CPLD_FLASH_BANK_NUM_MASK 0x0c
  221. #define PPC7D_CPLD_FLASH_DEV_SIZE_64M 0
  222. #define PPC7D_CPLD_FLASH_DEV_SIZE_32M 1
  223. #define PPC7D_CPLD_FLASH_DEV_SIZE_16M 3
  224. #define PPC7D_CPLD_FLASH_BANK_NUM_4 0x00
  225. #define PPC7D_CPLD_FLASH_BANK_NUM_3 0x04
  226. #define PPC7D_CPLD_FLASH_BANK_NUM_2 0x08
  227. #define PPC7D_CPLD_FLASH_BANK_NUM_1 0x0c
  228. /* SCSI_LED */
  229. #define PPC7D_CPLD_SCSI_ACTIVITY_LED_OFF 0
  230. #define PPC7D_CPLD_SCSI_ACTIVITY_LED_ON 1
  231. /* EQUIPMENT_PRESENT_1 */
  232. #define PPC7D_CPLD_EQPT_PRES_1_FITTED 0
  233. #define PPC7D_CPLD_EQPT_PRES_1_PMC2_MASK (0x80 >> 2)
  234. #define PPC7D_CPLD_EQPT_PRES_1_PMC1_MASK (0x80 >> 3)
  235. #define PPC7D_CPLD_EQPT_PRES_1_AFIX_MASK (0x80 >> 4)
  236. /* EQUIPMENT_PRESENT_2 */
  237. #define PPC7D_CPLD_EQPT_PRES_2_FITTED !0
  238. #define PPC7D_CPLD_EQPT_PRES_2_UNIVERSE_MASK (0x80 >> 0)
  239. #define PPC7D_CPLD_EQPT_PRES_2_COM36_MASK (0x80 >> 2)
  240. #define PPC7D_CPLD_EQPT_PRES_2_GIGE_MASK (0x80 >> 3)
  241. #define PPC7D_CPLD_EQPT_PRES_2_DUALGIGE_MASK (0x80 >> 4)
  242. /* EQUIPMENT_PRESENT_3 */
  243. #define PPC7D_CPLD_EQPT_PRES_3_PMC2_V_MASK (0x80 >> 3)
  244. #define PPC7D_CPLD_EQPT_PRES_3_PMC2_5V (0 >> 3)
  245. #define PPC7D_CPLD_EQPT_PRES_3_PMC2_3V (0x80 >> 3)
  246. #define PPC7D_CPLD_EQPT_PRES_3_PMC1_V_MASK (0x80 >> 4)
  247. #define PPC7D_CPLD_EQPT_PRES_3_PMC1_5V (0 >> 4)
  248. #define PPC7D_CPLD_EQPT_PRES_3_PMC1_3V (0x80 >> 4)
  249. #define PPC7D_CPLD_EQPT_PRES_3_PMC_POWER_MASK (0x80 >> 5)
  250. #define PPC7D_CPLD_EQPT_PRES_3_PMC_POWER_INTER (0 >> 5)
  251. #define PPC7D_CPLD_EQPT_PRES_3_PMC_POWER_VME (0x80 >> 5)
  252. /* EQUIPMENT_PRESENT_4 */
  253. #define PPC7D_CPLD_EQPT_PRES_4_LPT_MASK (0x80 >> 2)
  254. #define PPC7D_CPLD_EQPT_PRES_4_LPT_FITTED (0x80 >> 2)
  255. #define PPC7D_CPLD_EQPT_PRES_4_PS2_USB2_MASK (0xc0 >> 6)
  256. #define PPC7D_CPLD_EQPT_PRES_4_PS2_FITTED (0x40 >> 6)
  257. #define PPC7D_CPLD_EQPT_PRES_4_USB2_FITTED (0x80 >> 6)
  258. /* CPLD_LEDS */
  259. #define PPC7D_CPLD_LEDS_ON (!0)
  260. #define PPC7D_CPLD_LEDS_OFF (0)
  261. #define PPC7D_CPLD_LEDS_NVRAM_PAGE_MASK (0xc0 >> 2)
  262. #define PPC7D_CPLD_LEDS_DS201_MASK (0x80 >> 4)
  263. #define PPC7D_CPLD_LEDS_DS219_MASK (0x80 >> 5)
  264. #define PPC7D_CPLD_LEDS_DS220_MASK (0x80 >> 6)
  265. #define PPC7D_CPLD_LEDS_DS221_MASK (0x80 >> 7)
  266. /* CPLD_COMS */
  267. #define PPC7D_CPLD_COMS_COM3_TCLKEN (0x80 >> 0)
  268. #define PPC7D_CPLD_COMS_COM3_RTCLKEN (0x80 >> 1)
  269. #define PPC7D_CPLD_COMS_COM3_MODE_MASK (0x80 >> 2)
  270. #define PPC7D_CPLD_COMS_COM3_MODE_RS232 (0)
  271. #define PPC7D_CPLD_COMS_COM3_MODE_RS422 (0x80 >> 2)
  272. #define PPC7D_CPLD_COMS_COM3_TXEN (0x80 >> 3)
  273. #define PPC7D_CPLD_COMS_COM4_TCLKEN (0x80 >> 4)
  274. #define PPC7D_CPLD_COMS_COM4_RTCLKEN (0x80 >> 5)
  275. #define PPC7D_CPLD_COMS_COM4_MODE_MASK (0x80 >> 6)
  276. #define PPC7D_CPLD_COMS_COM4_MODE_RS232 (0)
  277. #define PPC7D_CPLD_COMS_COM4_MODE_RS422 (0x80 >> 6)
  278. #define PPC7D_CPLD_COMS_COM4_TXEN (0x80 >> 7)
  279. /* CPLD_RTS */
  280. #define PPC7D_CPLD_RTS_COM36_LOOPBACK (0x80 >> 0)
  281. #define PPC7D_CPLD_RTS_COM4_SCLK (0x80 >> 1)
  282. #define PPC7D_CPLD_RTS_COM3_TXFUNC_MASK (0xc0 >> 2)
  283. #define PPC7D_CPLD_RTS_COM3_TXFUNC_DISABLED (0 >> 2)
  284. #define PPC7D_CPLD_RTS_COM3_TXFUNC_ENABLED (0x80 >> 2)
  285. #define PPC7D_CPLD_RTS_COM3_TXFUNC_ENABLED_RTG3 (0xc0 >> 2)
  286. #define PPC7D_CPLD_RTS_COM3_TXFUNC_ENABLED_RTG3S (0xc0 >> 2)
  287. #define PPC7D_CPLD_RTS_COM56_MODE_MASK (0x80 >> 4)
  288. #define PPC7D_CPLD_RTS_COM56_MODE_RS232 (0)
  289. #define PPC7D_CPLD_RTS_COM56_MODE_RS422 (0x80 >> 4)
  290. #define PPC7D_CPLD_RTS_COM56_ENABLE_MASK (0x80 >> 5)
  291. #define PPC7D_CPLD_RTS_COM56_DISABLED (0)
  292. #define PPC7D_CPLD_RTS_COM56_ENABLED (0x80 >> 5)
  293. #define PPC7D_CPLD_RTS_COM4_TXFUNC_MASK (0xc0 >> 6)
  294. #define PPC7D_CPLD_RTS_COM4_TXFUNC_DISABLED (0 >> 6)
  295. #define PPC7D_CPLD_RTS_COM4_TXFUNC_ENABLED (0x80 >> 6)
  296. #define PPC7D_CPLD_RTS_COM4_TXFUNC_ENABLED_RTG3 (0x40 >> 6)
  297. #define PPC7D_CPLD_RTS_COM4_TXFUNC_ENABLED_RTG3S (0x40 >> 6)
  298. /* WATCHDOG_TRIG */
  299. #define PPC7D_CPLD_WDOG_CAUSE_MASK (0x80 >> 0)
  300. #define PPC7D_CPLD_WDOG_CAUSE_NORMAL_RESET (0 >> 0)
  301. #define PPC7D_CPLD_WDOG_CAUSE_WATCHDOG (0x80 >> 0)
  302. #define PPC7D_CPLD_WDOG_ENABLE_MASK (0x80 >> 6)
  303. #define PPC7D_CPLD_WDOG_ENABLE_OFF (0 >> 6)
  304. #define PPC7D_CPLD_WDOG_ENABLE_ON (0x80 >> 6)
  305. #define PPC7D_CPLD_WDOG_RESETSW_MASK (0x80 >> 7)
  306. #define PPC7D_CPLD_WDOG_RESETSW_OFF (0 >> 7)
  307. #define PPC7D_CPLD_WDOG_RESETSW_ON (0x80 >> 7)
  308. /* Interrupt mask and status bits */
  309. #define PPC7D_CPLD_INTR_TEMP_MASK (0x80 >> 0)
  310. #define PPC7D_CPLD_INTR_HB8_MASK (0x80 >> 1)
  311. #define PPC7D_CPLD_INTR_PHY1_MASK (0x80 >> 2)
  312. #define PPC7D_CPLD_INTR_PHY0_MASK (0x80 >> 3)
  313. #define PPC7D_CPLD_INTR_ISANMI_MASK (0x80 >> 5)
  314. #define PPC7D_CPLD_INTR_CRITTEMP_MASK (0x80 >> 6)
  315. /* CPLD_INTR */
  316. #define PPC7D_CPLD_INTR_ENABLE_OFF (0)
  317. #define PPC7D_CPLD_INTR_ENABLE_ON (!0)
  318. /* CPLD_INTR_STATUS */
  319. #define PPC7D_CPLD_INTR_STATUS_OFF (0)
  320. #define PPC7D_CPLD_INTR_STATUS_ON (!0)
  321. /* CPLD_PCI_CONFIG */
  322. #define PPC7D_CPLD_PCI_CONFIG_PCI0_MASK 0x70
  323. #define PPC7D_CPLD_PCI_CONFIG_PCI0_PCI33 0x00
  324. #define PPC7D_CPLD_PCI_CONFIG_PCI0_PCI66 0x10
  325. #define PPC7D_CPLD_PCI_CONFIG_PCI0_PCIX33 0x40
  326. #define PPC7D_CPLD_PCI_CONFIG_PCI0_PCIX66 0x50
  327. #define PPC7D_CPLD_PCI_CONFIG_PCI0_PCIX100 0x60
  328. #define PPC7D_CPLD_PCI_CONFIG_PCI0_PCIX133 0x70
  329. #define PPC7D_CPLD_PCI_CONFIG_PCI1_MASK 0x07
  330. #define PPC7D_CPLD_PCI_CONFIG_PCI1_PCI33 0x00
  331. #define PPC7D_CPLD_PCI_CONFIG_PCI1_PCI66 0x01
  332. #define PPC7D_CPLD_PCI_CONFIG_PCI1_PCIX33 0x04
  333. #define PPC7D_CPLD_PCI_CONFIG_PCI1_PCIX66 0x05
  334. #define PPC7D_CPLD_PCI_CONFIG_PCI1_PCIX100 0x06
  335. #define PPC7D_CPLD_PCI_CONFIG_PCI1_PCIX133 0x07
  336. /* CPLD_BOARD_REVISION */
  337. #define PPC7D_CPLD_BOARD_REVISION_NUMBER_MASK 0xe0
  338. #define PPC7D_CPLD_BOARD_REVISION_LETTER_MASK 0x1f
  339. /* CPLD_EXTENDED_ID */
  340. #define PPC7D_CPLD_EXTENDED_ID_PPC7D 0x18
  341. /* CPLD_ID_LINK */
  342. #define PPC7D_CPLD_ID_LINK_VME64_GAP_MASK (0x80 >> 2)
  343. #define PPC7D_CPLD_ID_LINK_VME64_GA4_MASK (0x80 >> 3)
  344. #define PPC7D_CPLD_ID_LINK_E13_MASK (0x80 >> 4)
  345. #define PPC7D_CPLD_ID_LINK_E12_MASK (0x80 >> 5)
  346. #define PPC7D_CPLD_ID_LINK_E7_MASK (0x80 >> 6)
  347. #define PPC7D_CPLD_ID_LINK_E6_MASK (0x80 >> 7)
  348. /* CPLD_MOTHERBOARD_TYPE */
  349. #define PPC7D_CPLD_MB_TYPE_ECC_ENABLE_MASK (0x80 >> 0)
  350. #define PPC7D_CPLD_MB_TYPE_ECC_ENABLED (0x80 >> 0)
  351. #define PPC7D_CPLD_MB_TYPE_ECC_DISABLED (0 >> 0)
  352. #define PPC7D_CPLD_MB_TYPE_ECC_FITTED_MASK (0x80 >> 3)
  353. #define PPC7D_CPLD_MB_TYPE_PLL_MASK 0x0c
  354. #define PPC7D_CPLD_MB_TYPE_PLL_133 0x00
  355. #define PPC7D_CPLD_MB_TYPE_PLL_100 0x08
  356. #define PPC7D_CPLD_MB_TYPE_PLL_64 0x04
  357. #define PPC7D_CPLD_MB_TYPE_HW_ID_MASK 0x03
  358. /* CPLD_FLASH_WRITE_CNTL */
  359. #define PPD7D_CPLD_FLASH_CNTL_WR_LINK_MASK (0x80 >> 0)
  360. #define PPD7D_CPLD_FLASH_CNTL_WR_LINK_FITTED (0x80 >> 0)
  361. #define PPD7D_CPLD_FLASH_CNTL_BOOT_LINK_MASK (0x80 >> 2)
  362. #define PPD7D_CPLD_FLASH_CNTL_BOOT_LINK_FITTED (0x80 >> 2)
  363. #define PPD7D_CPLD_FLASH_CNTL_USER_LINK_MASK (0x80 >> 3)
  364. #define PPD7D_CPLD_FLASH_CNTL_USER_LINK_FITTED (0x80 >> 3)
  365. #define PPD7D_CPLD_FLASH_CNTL_RECO_WR_MASK (0x80 >> 5)
  366. #define PPD7D_CPLD_FLASH_CNTL_RECO_WR_ENABLED (0x80 >> 5)
  367. #define PPD7D_CPLD_FLASH_CNTL_BOOT_WR_MASK (0x80 >> 6)
  368. #define PPD7D_CPLD_FLASH_CNTL_BOOT_WR_ENABLED (0x80 >> 6)
  369. #define PPD7D_CPLD_FLASH_CNTL_USER_WR_MASK (0x80 >> 7)
  370. #define PPD7D_CPLD_FLASH_CNTL_USER_WR_ENABLED (0x80 >> 7)
  371. /* CPLD_SW_FLASH_WRITE_PROTECT */
  372. #define PPC7D_CPLD_SW_FLASH_WRPROT_ENABLED (!0)
  373. #define PPC7D_CPLD_SW_FLASH_WRPROT_DISABLED (0)
  374. #define PPC7D_CPLD_SW_FLASH_WRPROT_SYSBOOT_MASK (0x80 >> 6)
  375. #define PPC7D_CPLD_SW_FLASH_WRPROT_USER_MASK (0x80 >> 7)
  376. /* CPLD_FLASH_WRITE_CNTL */
  377. #define PPC7D_CPLD_FLASH_CNTL_NVRAM_PROT_MASK (0x80 >> 0)
  378. #define PPC7D_CPLD_FLASH_CNTL_NVRAM_DISABLED (0 >> 0)
  379. #define PPC7D_CPLD_FLASH_CNTL_NVRAM_ENABLED (0x80 >> 0)
  380. #define PPC7D_CPLD_FLASH_CNTL_ALTBOOT_LINK_MASK (0x80 >> 1)
  381. #define PPC7D_CPLD_FLASH_CNTL_VMEBOOT_LINK_MASK (0x80 >> 2)
  382. #define PPC7D_CPLD_FLASH_CNTL_RECBOOT_LINK_MASK (0x80 >> 3)
  383. #endif /* __PPC_PLATFORMS_PPC7D_H */