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

VxWorks

开发平台:

C/C++

  1. /* iPiix4Pci.h - 82371AB PCI ISA IDE Xcelerator (PIIX4) header */
  2. /*
  3. modification history
  4. --------------------
  5. 01a,28mar00,mks  written.
  6. */
  7. /*
  8. This file contains IO address and related constants for the
  9. PIIX4 (PCI to ISA/IDE bridge).
  10. */
  11. #ifndef INCipiix4pcih
  12. #define INCipiix4pcih
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif /* __cplusplus */
  16. /* defines */
  17.     
  18. /* PCI to ISA/IDE bridge */
  19. #define IPIIX4_PCI_VENID         0x8086   /* PCI config spec for PIIX4 device */
  20.   
  21. #define IPIIX4_PCI_DEV0          0x7110                    
  22. #define IPIIX4_PCI_DEV1          0x7111
  23. #define IPIIX4_PCI_DEV2          0x7112              
  24. #define IPIIX4_PCI_DEV3          0x7113
  25. #define IPIIX4_PCI_FUNC0         0x0
  26. #define IPIIX4_PCI_FUNC1         0x1              
  27. #define IPIIX4_PCI_FUNC2         0x2
  28. #define IPIIX4_PCI_FUNC3         0x3  
  29. #define IPIIX4_PCI_INST0         0x0
  30. #define IPIIX4_PCI_NOIDX         -1
  31. #define IPIIX4_PCI_NOINT         0xFF         
  32. #ifndef IPIIX4_PCI_DEVMAX          
  33. #define IPIIX4_PCI_DEVMAX        0x1       /* Max # of PIIX4 on board */
  34. #endif
  35.     
  36. /* PIRQ[A:D]- Interrupt routing */
  37. #define IPIIX4_PCI_XINT1_LVL     0x9
  38. #define IPIIX4_PCI_XINT2_LVL     0xA
  39. #define IPIIX4_PCI_XINT3_LVL     0xB
  40. #define IPIIX4_PCI_XINT4_LVL     0xC
  41. #ifndef IPIIX4_PCI_XINT_MAX          
  42. #define IPIIX4_PCI_XINT_MAX      0x4      /* Max # of interrupt to route */
  43. #endif
  44.     
  45. #define IPIIX4_PCI_DEVRESD       0x50      /* PCI based PIIX4 registers */
  46. #define IPIIX4_PCI_DEVRESA       0x5C
  47. #define IPIIX4_PCI_DEVRESB       0x60
  48. #define IPIIX4_PCI_PCICMD        0x04
  49. #define IPIIX4_PCI_MLT           0x0D
  50. #define IPIIX4_PCI_BMIBA         0x20
  51. #define IPIIX4_PCI_IDETIM        0x40
  52. #define IPIIX4_PCI_PIRQRCA       0x60
  53. #define IPIIX4_PCI_PIRQRCB       0x61
  54. #define IPIIX4_PCI_PIRQRCC       0x62
  55. #define IPIIX4_PCI_PIRQRCD       0x63          
  56. #define IPIIX4_PCI_ELCR1         0x4D0
  57. #define IPIIX4_PCI_ELCR2         0x4D1          
  58.           
  59. #define IPIIX4_PCI_IRQ1ENDEV11   0x0800          /* bit #19 - DEVRESD */
  60. #define IPIIX4_PCI_RESENDEV5     0x08            /* bit #11 - DEVRESD */          
  61. #define IPIIX4_PCI_KBCENDEV11    0x10000000      /* bit #28 - DEVRESA */
  62. #define IPIIX4_PCI_KBCEIOEN      0x40000000      /* bit #30 - DEVRESB */
  63. #define IPIIX4_PCI_PCICMD_BME    0x04            /* bit #2  - PCICMD  */
  64. #define IPIIX4_PCI_PCICMD_IOSE   0x01            /* bit #0  - PCICMD  */
  65. #define IPIIX4_PCI_MLT_MLTCV     0x40            /* bit [7:4] - MLT   */
  66. #define IPIIX4_PCI_BMIBA_RTE     0x1             /* bit #0  - BMIBA   */
  67. #define IPIIX4_PCI_IDETIM_VAL    0xa307a307      /* Pri + Sec Chans   */
  68. #define IPIIX4_PCI_FD_DCM               0xD6     /* DMA Channel Mode Register */
  69. #define IPIIX4_PCI_FD_RWAMB             0xDE     /* Read/Write All Mask Bits */
  70. #define IPIIX4_PCI_FD_DCM_CASCADE       0xC0     /* bits [7:6] of DCM */
  71. #define IPIIX4_PCI_FD_DCM_AUTOINIT      0x10     /* bit [4] of DCM */    
  72. #define IPIIX4_PCI_FD_RWAMB_MASKALL     0x00
  73. /* typedefs */
  74. typedef struct iPiix4PciHandle
  75.     {
  76.     int   busId;
  77.     int   devId;
  78.     short instance; 
  79.     short handleInUse;
  80.     } IPIIX4PCI_HANDLE;
  81.     
  82. /* function declarations */
  83. extern STATUS iPiix4PciLibInit (VOID);
  84. extern int    iPiix4PciDevCreate (int instance);    
  85. extern STATUS iPiix4PciIntrRoute (int handle);
  86. extern STATUS iPiix4PciFdInit (int handle);
  87. extern STATUS iPiix4PciKbdInit (int handle);
  88. extern STATUS iPiix4PciAtaInit (int handle);
  89. extern int    iPiix4PciGetIntr (int handle);
  90. extern int    iPiix4PciGetHandle (int vendId, int devId, int instance);
  91. #ifdef __cplusplus
  92. }
  93. #endif /* __cplusplus */
  94. #endif /* INCipiix4pcih */