405_mal.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* include/mal.h, openbios_walnut, walnut_bios 8/6/99 08:48:40 */
  2. /*----------------------------------------------------------------------------+
  3. |
  4. | This source code has been made available to you by IBM on an AS-IS
  5. | basis. Anyone receiving this source is licensed under IBM
  6. | copyrights to use it in any way he or she deems fit, including
  7. | copying it, modifying it, compiling it, and redistributing it either
  8. | with or without modifications. No license under IBM patents or
  9. | patent applications is to be implied by the copyright license.
  10. |
  11. | Any user of this software should understand that IBM cannot provide
  12. | technical support for this software and will not be responsible for
  13. | any consequences resulting from the use of this software.
  14. |
  15. | Any person who transfers this source code or any derivative work
  16. | must include the IBM copyright notice, this paragraph, and the
  17. | preceding two paragraphs in the transferred software.
  18. |
  19. | COPYRIGHT I B M CORPORATION 1999
  20. | LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
  21. +----------------------------------------------------------------------------*/
  22. /*----------------------------------------------------------------------------+
  23. |
  24. | File Name: mal.h
  25. |
  26. | Function: Header file for the MAL (MADMAL) macro on the 405GP.
  27. |
  28. | Author: Mark Wisner
  29. |
  30. | Change Activity-
  31. |
  32. | Date Description of Change BY
  33. | --------- --------------------- ---
  34. | 29-Apr-99 Created MKW
  35. |
  36. +----------------------------------------------------------------------------*/
  37. #ifndef _mal_h_
  38. #define _mal_h_
  39. /* MADMAL transmit and receive status/control bits */
  40. /* for COMMAC bits, refer to the COMMAC header file */
  41. #define MAL_TX_CTRL_READY 0x8000
  42. #define MAL_TX_CTRL_WRAP 0x4000
  43. #define MAL_TX_CTRL_CM 0x2000
  44. #define MAL_TX_CTRL_LAST 0x1000
  45. #define MAL_TX_CTRL_INTR 0x0400
  46. #define MAL_RX_CTRL_EMPTY 0x8000
  47. #define MAL_RX_CTRL_WRAP 0x4000
  48. #define MAL_RX_CTRL_CM 0x2000
  49. #define MAL_RX_CTRL_LAST 0x1000
  50. #define MAL_RX_CTRL_FIRST 0x0800
  51. #define MAL_RX_CTRL_INTR 0x0400
  52. /* Configuration Reg */
  53. #define MAL_CR_MMSR 0x80000000
  54. #define MAL_CR_PLBP_1 0x00400000 /* lowsest is 00 */
  55. #define MAL_CR_PLBP_2 0x00800000
  56. #define MAL_CR_PLBP_3 0x00C00000 /* highest */
  57. #define MAL_CR_GA 0x00200000
  58. #define MAL_CR_OA 0x00100000
  59. #define MAL_CR_PLBLE 0x00080000
  60. #define MAL_CR_PLBLT_1 0x00040000
  61. #define MAL_CR_PLBLT_2 0x00020000
  62. #define MAL_CR_PLBLT_3 0x00010000
  63. #define MAL_CR_PLBLT_4 0x00008000
  64. #define MAL_CR_PLBLT_DEFAULT 0x00078000 /* ????? */
  65. #define MAL_CR_PLBB 0x00004000
  66. #define MAL_CR_OPBBL 0x00000080
  67. #define MAL_CR_EOPIE 0x00000004
  68. #define MAL_CR_LEA 0x00000002
  69. #define MAL_CR_MSD 0x00000001
  70. /* Error Status Reg */
  71. #define MAL_ESR_EVB 0x80000000
  72. #define MAL_ESR_CID 0x40000000
  73. #define MAL_ESR_DE 0x00100000
  74. #define MAL_ESR_ONE 0x00080000
  75. #define MAL_ESR_OTE 0x00040000
  76. #define MAL_ESR_OSE 0x00020000
  77. #define MAL_ESR_PEIN 0x00010000
  78. /* same bit position as the IER */
  79. /* VV VV */
  80. #define MAL_ESR_DEI 0x00000010
  81. #define MAL_ESR_ONEI 0x00000008
  82. #define MAL_ESR_OTEI 0x00000004
  83. #define MAL_ESR_OSEI 0x00000002
  84. #define MAL_ESR_PBEI 0x00000001
  85. /* ^^ ^^ */
  86. /* Mal IER */
  87. #define MAL_IER_DE 0x00000010
  88. #define MAL_IER_NE 0x00000008
  89. #define MAL_IER_TE 0x00000004
  90. #define MAL_IER_OPBE 0x00000002
  91. #define MAL_IER_PLBE 0x00000001
  92. /* MAL Buffer Descriptor structure */
  93. typedef struct {
  94. short ctrl; /* MAL / Commac status control bits */
  95. short data_len; /* Max length is 4K-1 (12 bits) */
  96. char *data_ptr; /* pointer to actual data buffer */
  97. } mal_desc_t;
  98. #endif