Reg9050.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:8k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* -*- linux-c -*- */
  2. #ifndef __REG9050_H
  3. #define __REG9050_H
  4. /*******************************************************************************
  5.  * Copyright (c) 2001 PLX Technology, Inc.
  6.  * 
  7.  * PLX Technology Inc. licenses this software under specific terms and
  8.  * conditions.  Use of any of the software or derviatives thereof in any
  9.  * product without a PLX Technology chip is strictly prohibited. 
  10.  * 
  11.  * PLX Technology, Inc. provides this software AS IS, WITHOUT ANY WARRANTY,
  12.  * EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF
  13.  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  PLX makes no guarantee
  14.  * or representations regarding the use of, or the results of the use of,
  15.  * the software and documentation in terms of correctness, accuracy,
  16.  * reliability, currentness, or otherwise; and you rely on the software,
  17.  * documentation and results solely at your own risk.
  18.  * 
  19.  * IN NO EVENT SHALL PLX BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS,
  20.  * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES
  21.  * OF ANY KIND.  IN NO EVENT SHALL PLX'S TOTAL LIABILITY EXCEED THE SUM
  22.  * PAID TO PLX FOR THE PRODUCT LICENSED HEREUNDER.
  23.  * 
  24.  ******************************************************************************/
  25. /* Modifications and extensions
  26.  * Copyright (C) 2001 By Joachim Martillo, Telford Tools, Inc.
  27.  *
  28.  * This program is free software; you can redistribute it and/or
  29.  * modify it under the terms of the GNU General Public License
  30.  * as published by the Free Software Foundation; either version
  31.  * 2 of the License, or (at your option) any later version.
  32.  **/
  33. /******************************************************************************
  34.  * 
  35.  * File Name:
  36.  *
  37.  *      Reg9050.h
  38.  *
  39.  * Description:
  40.  *
  41.  *      This file defines all the PLX 9050 chip Registers.
  42.  *
  43.  * Revision:
  44.  *
  45.  *      01-30-01 : PCI SDK v3.20
  46.  *
  47.  ******************************************************************************/
  48. #include "PciRegs.h"
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52. /* PCI Configuration Registers */
  53. #define PCI9050_VENDOR_ID            CFG_VENDOR_ID
  54. #define PCI9050_COMMAND              CFG_COMMAND
  55. #define PCI9050_REV_ID               CFG_REV_ID
  56. #define PCI9050_CACHE_SIZE           CFG_CACHE_SIZE
  57. #define PCI9050_PCI_BASE_0           CFG_BAR0
  58. #define PCI9050_PCI_BASE_1           CFG_BAR1
  59. #define PCI9050_PCI_BASE_2           CFG_BAR2
  60. #define PCI9050_PCI_BASE_3           CFG_BAR3
  61. #define PCI9050_PCI_BASE_4           CFG_BAR4
  62. #define PCI9050_PCI_BASE_5           CFG_BAR5
  63. #define PCI9050_CIS_PTR              CFG_CIS_PTR
  64. #define PCI9050_SUB_ID               CFG_SUB_VENDOR_ID
  65. #define PCI9050_PCI_BASE_EXP_ROM     CFG_EXP_ROM_BASE
  66. #define PCI9050_CAP_PTR              CFG_CAP_PTR
  67. #define PCI9050_PCI_RESERVED         CFG_RESERVED2
  68. #define PCI9050_INT_LINE             CFG_INT_LINE
  69. #if 0 /* from PLX header file */
  70. /* Local Configuration Registers */
  71. #define PCI9050_RANGE_SPACE0         0x000
  72. #define PCI9050_RANGE_SPACE1         0x004
  73. #define PCI9050_RANGE_SPACE2         0x008
  74. #define PCI9050_RANGE_SPACE3         0x00C
  75. #define PCI9050_RANGE_EXP_ROM        0x010
  76. #define PCI9050_REMAP_SPACE0         0x014
  77. #define PCI9050_REMAP_SPACE1         0x018
  78. #define PCI9050_REMAP_SPACE2         0x01C
  79. #define PCI9050_REMAP_SPACE3         0x020
  80. #define PCI9050_REMAP_EXP_ROM        0x024
  81. #define PCI9050_DESC_SPACE0          0x028
  82. #define PCI9050_DESC_SPACE1          0x02C
  83. #define PCI9050_DESC_SPACE2          0x030
  84. #define PCI9050_DESC_SPACE3          0x034
  85. #define PCI9050_DESC_EXP_ROM         0x038
  86. #define PCI9050_BASE_CS0             0x03C
  87. #define PCI9050_BASE_CS1             0x040
  88. #define PCI9050_BASE_CS2             0x044
  89. #define PCI9050_BASE_CS3             0x048
  90. #define PCI9050_INT_CTRL_STAT        0x04C
  91. #define PCI9050_EEPROM_CTRL          0x050
  92. #endif
  93. /* Additional register defintions */
  94. #define MAX_PCI9050_REG_OFFSET       0x054
  95. #define PCI9050_EEPROM_SIZE          0x064
  96. /*
  97.  * PLX 9050 registers:
  98.  */
  99. typedef struct plx9050_s 
  100. {
  101. /* Local Address Space */
  102. unsigned int las0; /* 0x00 */
  103. unsigned int las1; /* 0x04 */
  104. unsigned int las2; /* 0x08 */
  105. unsigned int las3; /* 0x0c */
  106. /* Expansion ROM range */
  107. unsigned int e_rom; /* 0x10 */
  108. /* Local Base Adresses */
  109. unsigned int   lba0; /* 0x14 */
  110. unsigned int   lba1; /* 0x18 */
  111. unsigned int   lba2; /* 0x1c */
  112. unsigned int   lba3; /* 0x20 */
  113. unsigned int e_rom_lba; /* 0x24 */
  114. /* Bus region description */
  115. unsigned int brd0; /* 0x28 */
  116. unsigned int brd1; /* 0x2c */
  117. unsigned int brd2; /* 0x30 */
  118. unsigned int brd3; /* 0x34 */
  119. unsigned int e_rom_brd; /* 0x38 */
  120. /* Chip Select X Base address */
  121. unsigned int csba0; /* 0x3c */
  122. unsigned int csba1; /* 0x40 */
  123. unsigned int csba2; /* 0x44 */
  124. unsigned int csba3; /* 0x48 */
  125. /* Interupt Control/Status */
  126. unsigned int   intr; /* 0x4c */
  127. /* Control */
  128. unsigned int ctrl; /* 0x50 */
  129. } plx9050_t, PLX9050;
  130. #define PLX_REG_LAS0RR 0x0
  131. #define PLX_REG_LAS1RR 0x4
  132. #define PLX_REG_LAS2RR 0x8
  133. #define PLX_REG_LAS3RR 0x0c
  134. #define PLX_REG_EROMRR 0x10
  135. #define PLX_REG_LAS0BA 0x14
  136. #define PLX_REG_LAS1BA 0x18
  137. #define PLX_REG_LAS2BA 0x1c
  138. #define PLX_REG_LAS3BA 0x20
  139. #define PLX_REG_EROMBA 0x24
  140. #define PLX_REG_LAS0BRD 0x28
  141. #define PLX_REG_LAS1BRD 0x2c
  142. #define PLX_REG_LAS2BRD 0x30
  143. #define PLX_REG_LAS3BRD 0x34
  144. #define PLX_REG_EROMBRD 0x38
  145. #define PLX_REG_CS0BASE 0x3c
  146. #define PLX_REG_CS1BASE 0x40
  147. #define PLX_REG_CS2BASE 0x44
  148. #define PLX_REG_CS3BASE 0x48
  149. #define PLX_REG_INTCSR 0x4c
  150. #define PLX_REG_CTRL 0x50 
  151. /*
  152.  * Bits within those registers:
  153.  */
  154. /* LAS0    */
  155. #define PLX_LAS0_MEM_MASK 0x0ffffff0
  156. /* INTCSR: */
  157. #define PLX_INT_INTR1ENA 0x00000001   /* Local interrupt 1 enable */
  158. #define PLX_INT_INTR1POL 0x00000002   /* Local interrupt 1 polarity */
  159. #define PLX_INT_INTR1STS 0x00000004   /* Local interrupt 1 status */
  160. #define PLX_INT_INTR2ENA 0x00000008   /* Local interrupt 2 enable */
  161. #define PLX_INT_INTR2POL 0x00000010   /* Local interrupt 2 polarity */
  162. #define PLX_INT_INTR2STS 0x00000020   /* Local interrupt 2 status */
  163. #define PLX_INT_PCIINTRENA 0x00000040   /* PCI interrupt enable */
  164. #define PLX_INT_SOFTINTR 0x00000080   /* Software interrupt */
  165. #if 0
  166. #define PLX_INT_ON         (PLX_INT_INTR1ENA | PLX_INT_PCIINTRENA | PLX_INT_INTR2POL)
  167. #define PLX_INT_OFF         PLX_INT_INTR2POL
  168. #elif 0
  169. #define PLX_INT_ON         PLX_INT_PCIINTRENA
  170. #define PLX_INT_OFF         0
  171. #else
  172. #define PLX_INT_ON (PLX_INT_INTR1ENA | PLX_INT_PCIINTRENA)
  173. #define PLX_INT_OFF 0x0000
  174. #endif
  175. /* BRD */
  176. #define PLX_BRD_BIGEND          0x01000000
  177. #define PLX_BRD_BIGEND_LANE     0x02000000
  178.      /* CTRL: */       /*  87654321 */
  179. #define PLX_CTRL_RESET 0x40000000
  180. #define PLX_CTRL_USERIO3DIR 0x00000400
  181. #define PLX_CTRL_USERIO3DATA 0x00000800
  182. #define PLX_CTRL_SEPCLK 0x01000000
  183. #define PLX_CTRL_SEPCS 0x02000000
  184. #define PLX_CTRL_SEPWD 0x04000000
  185. #define PLX_CTRL_SEPRD 0x08000000
  186. /* Definition for the EPROM */
  187. /* # of addressing bits for NM93CS06, NM93CS46 */
  188. #define NM93_ADDRBITS 6
  189. #define NM93_WENCMD ((u8) 0x00)
  190. #define NM93_WRITECMD ((u8) 0x01)
  191. #define NM93_READCMD ((u8) 0x02)
  192. #define NM93_WRALLCMD ((u8) 0x00) /* same as WEN */
  193. #define NM93_WDSCMD ((u8) 0x00) /* ditto */
  194. #define NM93_WDSADDR ((u8) 0x00)
  195. #define NM93_WRALLADDR ((u8) 0x10)
  196. #define NM93_WENADDR ((u8) 0x30)
  197. #define NM93_BITS_PER_BYTE 8
  198. #define NM93_BITS_PER_WORD 16
  199. #define EPROMPREFETCHOFFSET  9
  200. #define PREFETCHBIT 0x0008
  201. #define EPROM9050_SIZE 0x40 /* for loading the 9050 */
  202. #define AURORA_MULTI_EPROM_SIZE 0x40 /* serial EPROM size */
  203. /* serial EPROM offsets */
  204. #define AURORA_MULTI_EPROM_CLKLSW 0x36 /* clock speed LSW */
  205. #define AURORA_MULTI_EPROM_CLKMSW 0x37 /* clock speed MSW */
  206. #define AURORA_MULTI_EPROM_REV 0x38 /* revision begins here */
  207. #define AURORA_MULTI_EPROM_REVLEN 0x0f /* length (in bytes) */
  208. #define AURORA_MULTI_EPROM_SPDGRD 0x3f /* speed grade is here */
  209. #ifdef __cplusplus
  210. }
  211. #endif
  212. #endif