ipmi_picmg.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*
  2. (C) Kontron
  3. */
  4. #ifndef _IPMI_PICMG_H_
  5. #define _IPMI_PICMG_H_
  6. #include <ipmitool/ipmi.h>
  7. /* PICMG version */
  8. #define PICMG_CPCI_MAJOR_VERSION 1
  9. #define PICMG_ATCA_MAJOR_VERSION 2
  10. #define PICMG_AMC_MAJOR_VERSION 4
  11. /* PICMG commands */
  12. #define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
  13. #define PICMG_GET_ADDRESS_INFO_CMD 0x01
  14. #define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02
  15. #define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03
  16. #define PICMG_FRU_CONTROL_CMD 0x04
  17. #define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05
  18. #define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06
  19. #define PICMG_SET_FRU_LED_STATE_CMD 0x07
  20. #define PICMG_GET_FRU_LED_STATE_CMD 0x08
  21. #define PICMG_SET_IPMB_CMD 0x09
  22. #define PICMG_SET_FRU_POLICY_CMD 0x0A
  23. #define PICMG_GET_FRU_POLICY_CMD 0x0B
  24. #define PICMG_FRU_ACTIVATION_CMD 0x0C
  25. #define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D
  26. #define PICMG_SET_PORT_STATE_CMD 0x0E
  27. #define PICMG_GET_PORT_STATE_CMD 0x0F
  28. #define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10
  29. #define PICMG_SET_POWER_LEVEL_CMD 0x11
  30. #define PICMG_GET_POWER_LEVEL_CMD 0x12
  31. #define PICMG_RENEGOTIATE_POWER_CMD 0x13
  32. #define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14
  33. #define PICMG_SET_FAN_LEVEL_CMD 0x15
  34. #define PICMG_GET_FAN_LEVEL_CMD 0x16
  35. #define PICMG_BUSED_RESOURCE_CMD 0x17
  36. /* AMC.0 commands */
  37. #define PICMG_AMC_SET_PORT_STATE_CMD 0x19
  38. #define PICMG_AMC_GET_PORT_STATE_CMD 0x1A
  39. /* AMC.0 R2.0 commands */
  40. #define PICMG_AMC_SET_CLK_STATE_CMD 0x2C
  41. #define PICMG_AMC_GET_CLK_STATE_CMD 0x2D
  42. /* Site Types */
  43. #define PICMG_ATCA_BOARD 0x00
  44. #define PICMG_POWER_ENTRY 0x01
  45. #define PICMG_SHELF_FRU 0x02
  46. #define PICMG_DEDICATED_SHMC 0x03
  47. #define PICMG_FAN_TRAY 0x04
  48. #define PICMG_FAN_FILTER_TRAY 0x05
  49. #define PICMG_ALARM 0x06
  50. #define PICMG_AMC 0x07
  51. #define PICMG_PMC 0x08
  52. #define PICMG_RTM 0x09
  53. #ifdef HAVE_PRAGMA_PACK
  54. #pragma pack(1)
  55. #endif
  56. struct picmg_set_fru_activation_cmd {
  57. unsigned char picmg_id; /* always 0*/
  58. unsigned char fru_id; /* threshold setting mask */
  59. unsigned char fru_state; /* fru activation/deactivation */
  60. } ATTRIBUTE_PACKING;
  61. #ifdef HAVE_PRAGMA_PACK
  62. #pragma pack(0)
  63. #endif
  64. typedef enum picmg_busres_board_cmd_types {
  65. PICMG_BUSRES_BOARD_CMD_QUERY =0,
  66. PICMG_BUSRES_BOARD_CMD_RELEASE,
  67. PICMG_BUSRES_BOARD_CMD_FORCE,
  68. PICMG_BUSRES_BOARD_CMD_BUS_FREE
  69. } t_picmg_busres_board_cmd_types ;
  70. typedef enum picmg_busres_shmc_cmd_types {
  71. PICMG_BUSRES_SHMC_CMD_REQUEST =0,
  72. PICMG_BUSRES_SHMC_CMD_RELINQUISH,
  73. PICMG_BUSRES_SHMC_CMD_NOTIFY
  74. } t_picmg_busres_shmc_cmd_types ;
  75. typedef enum picmg_busres_resource_id {
  76. PICMG_BUSRES_METAL_TEST_BUS_1=0,
  77. PICMG_BUSRES_METAL_TEST_BUS_2,
  78. PICMG_BUSRES_SYNC_CLOCK_GROUP_1,
  79. PICMG_BUSRES_SYNC_CLOCK_GROUP_2,
  80. PICMG_BUSRES_SYNC_CLOCK_GROUP_3
  81. } t_picmg_busres_resource_id;
  82. /* the LED color capabilities */
  83. static const char* led_color_str[] __attribute__((unused)) = {
  84. "reserved",
  85. "BLUE",
  86. "RED",
  87. "GREEN",
  88. "AMBER",
  89. "ORANGE",
  90. "WHITE",
  91. "reserved"
  92. };
  93. static const char* amc_link_type_str[] __attribute__((unused)) = {
  94. "RESERVED",
  95. "RESERVED1",
  96. "PCI EXPRESS",
  97. "ADVANCED SWITCHING1",
  98. "ADVANCED SWITCHING2",
  99. "ETHERNET",
  100. "RAPIDIO",
  101. "STORAGE",
  102. };
  103. static const char* amc_link_type_ext_str[][16] __attribute__((unused)) = {
  104. /* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED */
  105. {
  106. "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
  107. },
  108. /* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 */
  109. {
  110. "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
  111. },
  112. /* FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS */
  113. {
  114. "Gen 1 - NSSC",
  115. "Gen 1 - SSC",
  116. "Gen 2 - NSSC",
  117. "Gen 2 - SSC",
  118. "", "", "", "",
  119. "", "", "", "",
  120. "", "", "", ""
  121. },
  122. /* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 */
  123. {
  124. "Gen 1 - NSSC",
  125. "Gen 1 - SSC",
  126. "Gen 2 - NSSC",
  127. "Gen 2 - SSC",
  128. "", "", "", "",
  129. "", "", "", "",
  130. "", "", "", ""
  131. },
  132. /* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 */
  133. {
  134. "Gen 1 - NSSC",
  135. "Gen 1 - SSC",
  136. "Gen 2 - NSSC",
  137. "Gen 2 - SSC",
  138. "", "", "", "",
  139. "", "", "", "",
  140. "", "", "", ""
  141. },
  142. /* FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET */
  143. {
  144. "1000BASE-BX (SerDES Gigabit)",
  145. "10GBASE-BX410 Gigabit XAUI",
  146. "", "",
  147. "", "", "", "",
  148. "", "", "", "",
  149. "", "", "", ""
  150. },
  151. /* FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO */
  152. {
  153. "1.25 Gbaud transmission rate",
  154. "2.5 Gbaud transmission rate",
  155. "3.125 Gbaud transmission rate",
  156. "", "", "", "", "",
  157. "", "", "", "", "", "", "", ""
  158. },
  159. /* FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE */
  160. {
  161. "Fibre Channel",
  162. "Serial ATA",
  163. "Serial Attached SCSI",
  164. "", "", "", "", "",
  165. "", "", "", "", "", "", "", ""
  166. }
  167. };
  168. struct sAmcPortState {
  169. #ifndef WORDS_BIGENDIAN
  170. unsigned short lane0 : 1;
  171. unsigned short lane1 : 1;
  172. unsigned short lane2 : 1;
  173. unsigned short lane3 : 1;
  174. unsigned short type : 8;
  175. unsigned short type_ext : 4;
  176. unsigned char group_id : 8;
  177. #else
  178. unsigned char group_id : 8;
  179. unsigned short type_ext : 4;
  180. unsigned short type : 8;
  181. unsigned short lane3 : 1;
  182. unsigned short lane2 : 1;
  183. unsigned short lane1 : 1;
  184. unsigned short lane0 : 1;
  185. #endif
  186. unsigned char state;
  187. };
  188. int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
  189. uint8_t picmg_discover(struct ipmi_intf *intf);
  190. uint8_t ipmi_picmg_ipmb_address(struct ipmi_intf *intf);
  191. #endif