boardergo.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* $Id: boardergo.h,v 1.2.6.1 2001/09/23 22:24:54 kai Exp $
  2. *
  3. * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..).
  4. *
  5. * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
  6. * Copyright 1999 by Werner Cornelius (werner@titro.de)
  7. *
  8. * This software may be used and distributed according to the terms
  9. * of the GNU General Public License, incorporated herein by reference.
  10. *
  11. */
  12. /************************************************/
  13. /* defines for the dual port memory of the card */
  14. /************************************************/
  15. #define ERG_DPRAM_PAGE_SIZE 0x2000 /* DPRAM occupies a 8K page */
  16. #define BOOT_IMG_SIZE 4096
  17. #define ERG_DPRAM_FILL_SIZE (ERG_DPRAM_PAGE_SIZE - BOOT_IMG_SIZE)
  18. #define ERG_TO_HY_BUF_SIZE 0x0E00 /* 3072 bytes buffer size to card */
  19. #define ERG_TO_PC_BUF_SIZE 0x0E00 /* 3072 bytes to PC, too */
  20. /* following DPRAM layout copied from OS2-driver boarderg.h */
  21. typedef struct ErgDpram_tag {
  22. /*0000 */ unsigned char ToHyBuf[ERG_TO_HY_BUF_SIZE];
  23. /*0E00 */ unsigned char ToPcBuf[ERG_TO_PC_BUF_SIZE];
  24. /*1C00 */ unsigned char bSoftUart[SIZE_RSV_SOFT_UART];
  25. /* size 0x1B0 */
  26. /*1DB0 *//* tErrLogEntry */ unsigned char volatile ErrLogMsg[64];
  27. /* size 64 bytes */
  28. /*1DB0 unsigned long ulErrType; */
  29. /*1DB4 unsigned long ulErrSubtype; */
  30. /*1DB8 unsigned long ucTextSize; */
  31. /*1DB9 unsigned long ucText[ERRLOG_TEXT_SIZE]; *//* ASCIIZ of len ucTextSize-1 */
  32. /*1DF0 */
  33. /*1DF0 */ unsigned short volatile ToHyChannel;
  34. /*1DF2 */ unsigned short volatile ToHySize;
  35. /*1DF4 */ unsigned char volatile ToHyFlag;
  36. /* !=0: msg for Hy waiting */
  37. /*1DF5 */ unsigned char volatile ToPcFlag;
  38. /* !=0: msg for PC waiting */
  39. /*1DF6 */ unsigned short volatile ToPcChannel;
  40. /*1DF8 */ unsigned short volatile ToPcSize;
  41. /*1DFA */ unsigned char bRes1DBA[0x1E00 - 0x1DFA];
  42. /* 6 bytes */
  43. /*1E00 */ unsigned char bRestOfEntryTbl[0x1F00 - 0x1E00];
  44. /*1F00 */ unsigned long TrapTable[62];
  45. /*1FF8 */ unsigned char bRes1FF8[0x1FFB - 0x1FF8];
  46. /* low part of reset vetor */
  47. /*1FFB */ unsigned char ToPcIntMetro;
  48. /* notes:
  49. * - metro has 32-bit boot ram - accessing
  50. * ToPcInt and ToHyInt would be the same;
  51. * so we moved ToPcInt to 1FFB.
  52. * Because on the PC side both vars are
  53. * readonly (reseting on int from E1 to PC),
  54. * we can read both vars on both cards
  55. * without destroying anything.
  56. * - 1FFB is the high byte of the reset vector,
  57. * so E1 side should NOT change this byte
  58. * when writing!
  59. */
  60. /*1FFC */ unsigned char volatile ToHyNoDpramErrLog;
  61. /* note: ToHyNoDpramErrLog is used to inform
  62. * boot loader, not to use DPRAM based
  63. * ErrLog; when DOS driver is rewritten
  64. * this becomes obsolete
  65. */
  66. /*1FFD */ unsigned char bRes1FFD;
  67. /*1FFE */ unsigned char ToPcInt;
  68. /* E1_intclear; on CHAMP2: E1_intset */
  69. /*1FFF */ unsigned char ToHyInt;
  70. /* E1_intset; on CHAMP2: E1_intclear */
  71. } tErgDpram;
  72. /**********************************************/
  73. /* PCI9050 controller local register offsets: */
  74. /* copied from boarderg.c */
  75. /**********************************************/
  76. #define PCI9050_INTR_REG 0x4C /* Interrupt register */
  77. #define PCI9050_USER_IO 0x51 /* User I/O register */
  78. /* bitmask for PCI9050_INTR_REG: */
  79. #define PCI9050_INTR_REG_EN1 0x01 /* 1= enable (def.), 0= disable */
  80. #define PCI9050_INTR_REG_POL1 0x02 /* 1= active high (def.), 0= active low */
  81. #define PCI9050_INTR_REG_STAT1 0x04 /* 1= intr. active, 0= intr. not active (def.) */
  82. #define PCI9050_INTR_REG_ENPCI 0x40 /* 1= PCI interrupts enable (def.) */
  83. /* bitmask for PCI9050_USER_IO: */
  84. #define PCI9050_USER_IO_EN3 0x02 /* 1= disable , 0= enable (def.) */
  85. #define PCI9050_USER_IO_DIR3 0x04 /* 1= output (def.), 0= input */
  86. #define PCI9050_USER_IO_DAT3 0x08 /* 1= high (def.) , 0= low */
  87. #define PCI9050_E1_RESET (PCI9050_USER_IO_DIR3) /* 0x04 */
  88. #define PCI9050_E1_RUN (PCI9050_USER_IO_DAT3 | PCI9050_USER_IO_DIR3) /* 0x0C */