ixp425.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:9k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* ixp425.h - Ixp425 header file */
  2. /* Copyright 2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,05jun02,jb  initial version...
  7. */
  8. #ifndef INCixpIxp425h
  9. #define INCixpIxp425h
  10. #ifndef _ASMLANGUAGE
  11. #else
  12. #endif
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /*
  17.  * IXP425_SDRAM_CONFIG_BASEDESCRIPTION
  18.  * This file contains Ixp425 register definitions
  19.  */
  20. /* Defintion for Bit macro */
  21. #ifndef BIT    
  22. #define BIT(bitNumber) (1 << (bitNumber))
  23. #endif /* BIT */
  24. /* Chip Level Definitions */
  25. /* Configuration Space Registers */
  26. #define IXP425_SDRAM_CONFIG_BASE (0xCC000000)
  27. #define IXP425_EXP_CONFIG_BASE (0xC4000000)
  28. #define IXP425_PCI_CONFIG_BASE (0xC0000000)
  29. #define IXP425_MAX_PCI_DEVS 4
  30. /* Peripheral Space Registers */
  31. #define IXP425_PERIPHERAL_BASE (0xc8000000)
  32. #define IXP425_QMGR_BASE        (0x60000000)
  33. #define IXP425_UART1_BASE (IXP425_PERIPHERAL_BASE + 0x00000000)
  34.  
  35. #define IXP425_UART2_BASE (IXP425_PERIPHERAL_BASE + 0x00001000)
  36. #define IXP425_PMU_BASE (IXP425_PERIPHERAL_BASE + 0x00002000)
  37. #define IXP425_INTC_BASE (IXP425_PERIPHERAL_BASE + 0x00003000)
  38. #define IXP425_GPIO_BASE (IXP425_PERIPHERAL_BASE + 0x00004000)
  39. #define IXP425_TMR_BASE (IXP425_PERIPHERAL_BASE + 0x00005000)
  40. #define IXP425_PSMA_BASE (IXP425_PERIPHERAL_BASE + 0x00006000)
  41. #define IXP425_PSMB_BASE (IXP425_PERIPHERAL_BASE + 0x00007000)
  42. #define IXP425_PSMC_BASE (IXP425_PERIPHERAL_BASE + 0x00008000)
  43. #define IXP425_EthA_BASE (IXP425_PERIPHERAL_BASE + 0x00009000)
  44. #define IXP425_EthB_BASE (IXP425_PERIPHERAL_BASE + 0x0000A000)
  45. #define IXP425_USB_BASE (IXP425_PERIPHERAL_BASE + 0x0000B000)
  46. #define IXP425_DMA_BASE (IXP425_PERIPHERAL_BASE + 0x0000F000)
  47. /* PCI Memory Space */
  48. #define IXP425_PCI_BASE (0x48000000)
  49. #define IXP425_PCI_SP_SIZE (SZ_128M)
  50. /* Expansion Bus 'lives' at either base1 or base 2 depending on the value of Exp Bus config registers.
  51.  *  exp_cnfg0 : setting bit 31 of 0xC4000020 puts SDRAM at zero, and The expansion bus to IXP425_EXPANSION_BUS_BASE2
  52.  */
  53. #define IXP425_EXPANSION_BUS_BASE1 (0x00000000)
  54. #define IXP425_EXPANSION_BUS_BASE2 (0x50000000)
  55. #define IXP425_SDRAM_BASE (0x00000000)
  56. #define IXP425_SDRAM_BASE_ALT (0x10000000)
  57. #define IXP425_EXPANSION_BUS_CS0_BASE (0x50000000)
  58. #define IXP425_EXPANSION_BUS_CS1_BASE (0x51000000)
  59. #define IXP425_EXPANSION_BUS_CS2_BASE (0x52000000)
  60. #define IXP425_EXPANSION_BUS_CS3_BASE (0x53000000)
  61. #define IXP425_EXPANSION_BUS_CS4_BASE (0x54000000)
  62. #define IXP425_EXPANSION_BUS_CS5_BASE (0x55000000)
  63. #define IXP425_EXPANSION_BUS_CS6_BASE (0x56000000)
  64. #define IXP425_EXPANSION_BUS_CS7_BASE (0x57000000)
  65. /*****************************************************************
  66.  * SDRAM Controller Address 
  67.  *
  68.  *****************************************************************/
  69. #define IXP425_SDRAM_CONFIG ( IXP425_SDRAM_CONFIG_BASE + 0x00000000)
  70. #define IXP425_SDRAM_REFRESH ( IXP425_SDRAM_CONFIG_BASE + 0x00000004)
  71. #define IXP425_SDRAM_INSTRUCTION ( IXP425_SDRAM_CONFIG_BASE + 0x00000008)
  72. /* Bit definitions  - IXP425_SDRAM_CONFIG */
  73. #define IXP425_SDRAM_CAS_3CLKS (0x0008)
  74. #define IXP425_SDRAM_CAS_2CLKS (0x0000)
  75. #define IXP425_SDRAM_32Meg_2Chip (0x0000)
  76. #define IXP425_SDRAM_64Meg_4Chip (0x0001)
  77. #define IXP425_SDRAM_64Meg_2Chip (0x0002)
  78. #define IXP425_SDRAM_128Meg_4Chip (0x0003)
  79. #define IXP425_SDRAM_128Meg_2Chip (0x0004)
  80. #define IXP425_SDRAM_256Meg_4Chip (0x0005)
  81. /* Bit definitions  - IXP425_SDRAM_REFRESH */
  82. #define IXP425_SDRAM_REFRESH_DISABLE  (0x0)
  83. /* Bit definitions  - IXP425_SDRAM_INSTRUCTION */
  84. #define IXP425_SDRAM_IR_MODE_SET_CAS2_CMD  (0x0000)
  85. #define IXP425_SDRAM_IR_MODE_SET_CAS3_CMD  (0x0001)
  86. #define IXP425_SDRAM_IR_PRECHARGE_ALL_CMD  (0x0002)
  87. #define IXP425_SDRAM_IR_NOP_CMD  (0x0003)
  88. #define IXP425_SDRAM_IR_AUTOREFRESH_CMD  (0x0004)
  89. #define IXP425_SDRAM_IR_BURST_TERMINATE_CMD (0x0005)
  90. #define IXP425_SDRAM_IR_NORMAL_OPERATION_CMD (0x0006)
  91. /******************************************************************
  92.   Interrupt Controller Register Definitions.
  93. ******************************************************************/
  94. #include <ixp425IntrCtl.h>
  95. /******************************************************************
  96.   Operating System Timer Register Definitions.
  97. ******************************************************************/
  98. #define IXP425_OSTS ( IXP425_TMR_BASE + 0x0 )  /* Continious TimeStamp Reg. */
  99. #define IXP425_OST1 ( IXP425_TMR_BASE + 0x4 )   /* Timer 1 Timestamp Reg. */
  100. #define IXP425_OSRT1 ( IXP425_TMR_BASE + 0x8 )   /* Timer 1 Reload Reg. */
  101. #define IXP425_OST2 ( IXP425_TMR_BASE + 0xC )   /* Timer 2 Timestamp Reg. */
  102. #define IXP425_OSRT2 ( IXP425_TMR_BASE + 0x10 )  /* Timer 2 Reload Reg. */
  103. #define IXP425_OSWT ( IXP425_TMR_BASE + 0x14 )  /* Watchdog Timer Reg. */
  104. #define IXP425_OSWE ( IXP425_TMR_BASE + 0x18 )  /* Watchdog Enable Reg. */
  105. #define IXP425_OSWK ( IXP425_TMR_BASE + 0x1C )  /* Watchdog Key Reg. */
  106. #define IXP425_OSST ( IXP425_TMR_BASE + 0x20 )  /* Timer Status Reg. */
  107. #define IXP425_OST_ENABLE              BIT(0)
  108. #define IXP425_OST_ONE_SHOT            BIT(1)
  109. #define IXP425_OST_RELOAD_MASK         (0x3)    /* Low order bits of
  110.  * reload value
  111.  * ignored */
  112. #define IXP425_OST_DISABLED            (0x0)
  113. #define IXP425_OSST_TIMER_1_PEND       BIT(0)
  114. #define IXP425_OSST_TIMER_2_PEND       BIT(1)
  115. #define IXP425_OSST_TIMER_TS_PEND      BIT(2)
  116. #define IXP425_OSST_TIMER_WDOG_PEND    BIT(3)
  117. #define IXP425_OSST_TIMER_WARM_RESET   BIT(4)
  118. #define IXP425_OSST_TICKS_PER_SECOND 60
  119. #define IXP425_OSST_ROLLOVER 333330 /* at 66Mhz clock = 60 ticks per sec. */
  120. /* 
  121.  * UART Register Definitions , Offsets only as there are 2 UARTS.
  122.  *   IXP425_UART1_BASE , IXP425_UART2_BASE.
  123.  */
  124. #undef  UART_NO_RX_INTERRUPT
  125. #define IXP425_NUM_UARTS (2)
  126. #define IXP425_UART_XTAL ( 14745600)
  127. #define IXP425_UART_REG_DELTA (4)  /* Uart registers are spread out by 4 bytes */
  128. #define IXP425_UART_RBR_OFFSET (0x00) /* Receive Buffer Register - read only */
  129. #define IXP425_UART_THR_OFFSET (0x00) /* Transmit Hold Register(write buffer) - write only */
  130. #define IXP425_UART_IER_OFFSET (0x04) /* Interrupt Enable */
  131. #define IXP425_UART_IIR_OFFSET (0x08) /* Interrupt ID (read only)  */
  132. #define IXP425_UART_FCR_OFFSET (0x08) /* FIFO Control - (write only)  */
  133. #define IXP425_UART_LCR_OFFSET (0x0C) /* Line Control - r/w  */
  134. #define IXP425_UART_MCR_OFFSET (0x10) /* Modem Control  - r/w */
  135. #define IXP425_UART_LSR_OFFSET (0x14) /* Line Status - read only  */
  136. #define IXP425_UART_MSR_OFFSET (0x18) /* Modem Status - read only  */
  137. #define IXP425_UART_SPR_OFFSET (0x1C) /* Scratch register r/w  */
  138. /* Note The Divisor can only be written to with DLAB bit of the Line
  139.  * Control register is set, Note: for changes of baud rate the device 
  140.  * should be disabled to prevent the s/w from reading the devisor latch 
  141.  * as data 
  142.  */
  143. #define IXP425_UART_DLL_OFFSET (0x00) /* Divisor Latch LSB  */
  144. #define IXP425_UART_DLH_OFFSET (0x04) /* Divisor Latch MSB  */
  145. /* UART BIT DEFINITIONS. */
  146. /* Line control register */
  147. #define IXP425_UART_LCR_WS_5_BIT  (0) /* 5 bit character */
  148. #define IXP425_UART_LCR_WS_6_BIT  (1) /* 6 bit character */
  149. #define IXP425_UART_LCR_WS_7_BIT  (2) /* 7 bit character */
  150. #define IXP425_UART_LCR_WS_8_BIT  (3) /* 8 bit character */
  151. #define IXP425_UART_LCR_STB_BIT  BIT(2) /* 0 = 1 Stop Bit,
  152.   1 = 2 Stop Bits  */ 
  153. #define IXP425_UART_LCR_PEN_BIT  BIT(3) /* Parity Enabled */
  154. #define IXP425_UART_LCR_EPS_BIT  BIT(4) /* Even Parity Select - 1 for even parity, 0 for odd */
  155. #define IXP425_UART_LCR_STKYP_BIT  BIT(5) /* Sticky Parity */
  156. #define IXP425_UART_LCR_SB_BIT  BIT(6) /* Set Break */
  157. #define IXP425_UART_LCR_DLAB_BIT  BIT(7) /* DLAB - Divisor Latch Bit  */
  158. /******************************************************************
  159.   GPIO Register Definitions.
  160.   [Only perform 32bit reads/writes]
  161. ******************************************************************/
  162. #define IXP425_GPIO_GPOUTR (IXP425_GPIO_BASE + 0x0000)
  163. #define IXP425_GPIO_GPOER (IXP425_GPIO_BASE + 0x0004)
  164. #define IXP425_GPIO_GPINR (IXP425_GPIO_BASE + 0x0008)
  165. #define IXP425_GPIO_GPISR (IXP425_GPIO_BASE + 0x000C)
  166. #define IXP425_GPIO_GPIT1R (IXP425_GPIO_BASE + 0x0010)
  167. #define IXP425_GPIO_GPIT2R (IXP425_GPIO_BASE + 0x0014)
  168. #define IXP425_GPIO_GPCLKR (IXP425_GPIO_BASE + 0x0018)
  169. #define IXP425_GPIO_GPDBSELR (IXP425_GPIO_BASE + 0x001C)
  170. /*
  171.  * Expansion Bus Controller registers.
  172.  */
  173. #define IXP425_EXP_CS0_REG (IXP425_EXP_CONFIG_BASE + 0x00)
  174. #define IXP425_EXP_CS1_REG (IXP425_EXP_CONFIG_BASE + 0x04)
  175. #define IXP425_EXP_CS2_REG (IXP425_EXP_CONFIG_BASE + 0x08)
  176. #define IXP425_EXP_CS3_REG (IXP425_EXP_CONFIG_BASE + 0x0C)
  177. #define IXP425_EXP_CS4_REG (IXP425_EXP_CONFIG_BASE + 0x10)
  178. #define IXP425_EXP_CS5_REG (IXP425_EXP_CONFIG_BASE + 0x14)
  179. #define IXP425_EXP_CS6_REG (IXP425_EXP_CONFIG_BASE + 0x18)
  180. #define IXP425_EXP_CS7_REG (IXP425_EXP_CONFIG_BASE + 0x1C)
  181. #define IXP425_EXP_CNFG0 (IXP425_EXP_CONFIG_BASE + 0x20)
  182. #define IXP425_EXP_CNFG1 (IXP425_EXP_CONFIG_BASE + 0x24)
  183. #define IXP425_EXP_CNFG2 (IXP425_EXP_CONFIG_BASE + 0x28)
  184. #define IXP425_EXP_CNFG3 (IXP425_EXP_CONFIG_BASE + 0x2C)
  185. /*
  186.  * Clock Speed Definitions.
  187.  */
  188. #define IXP425_PERIPHERAL_BUS_CLOCK (66) 
  189. #ifdef __cplusplus
  190. }
  191. #endif
  192. #endif /* ixp_ixp425.h */