Platform.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*****************************************************************
  2. *****************************************************************
  3. *** **
  4. *** (C)Copyright 2005-2006, American Megatrends Inc. **
  5. *** **
  6. *** All Rights Reserved. **
  7. *** **
  8. *** 6145-F, Northbelt Parkway, Norcross, **
  9. *** **
  10. *** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. *** **
  12. *****************************************************************
  13. *****************************************************************
  14. ******************************************************************
  15. *
  16. * PlatformPort.h
  17. * Platform porting functions and defines.
  18. *
  19. * Author: Govind Kothandapani <govindk@ami.com>
  20. ******************************************************************/
  21. #ifndef PLATFORM_PORT_H
  22. #define PLATFORM_PORT_H
  23. #include "Types.h"
  24. //#include "icc_what.h"
  25. #ifdef ICC_OS_LINUX
  26. //#include "OSPort.h"
  27. #endif
  28. /**
  29. * @def htoipmi_u32
  30. * @brief Converts unsigned 32 bit data from Host format to IPMI format.
  31. * @param Val 32bit value to be converted.
  32. **/
  33. //#if IS_PLATFORM_X86() || IS_PLATFORM_ARM() || IS_PLATFORM_SH()
  34. #define htoipmi_u32(Val) (Val)
  35. //#elif IS_PLATFORM_PPC() || IS_PLATFORM_MIPS()
  36. //#define htoipmi_u32(Val) ipmitoh_u32(Val)
  37. //#endif
  38. /**
  39. * @def ipmitoh_u32
  40. * @brief Converts unsigned 32 bit data from IPMI format to Host format.
  41. * @param Val 32bit value to be converted.
  42. **/
  43. //#if IS_PLATFORM_X86() || IS_PLATFORM_ARM() || IS_PLATFORM_SH()
  44. #define ipmitoh_u32(Val) (Val)
  45. //#elif IS_PLATFORM_PPC() || IS_PLATFORM_MIPS()
  46. //#define ipmitoh_u32(Val) (((Val & 0xFF000000) >> 24)| \
  47. ((Val & 0x00FF0000) >> 8) | \
  48. ((Val & 0x0000FF00) << 8) | \
  49. ((Val & 0x000000FF) << 24 ))
  50. //#endif
  51. /**
  52. * @def htoipmi_u16
  53. * @brief Converts unsigned 16 bit data from Host format to IPMI format.
  54. * @param Val 16bit value to be converted.
  55. **/
  56. //#if IS_PLATFORM_X86() || IS_PLATFORM_ARM() || IS_PLATFORM_SH()
  57. #define htoipmi_u16(Val) (Val)
  58. //#elif IS_PLATFORM_PPC() || IS_PLATFORM_MIPS()
  59. //#define htoipmi_u16(Val) ipmitoh_u16(Val)
  60. //#endif
  61. /**
  62. * @def htoipmi_u16
  63. * @brief Converts unsigned 16 bit data from IPMI format to Host format.
  64. * @param Val 16bit value to be converted.
  65. **/
  66. //#if IS_PLATFORM_X86() || IS_PLATFORM_ARM() || IS_PLATFORM_SH()
  67. #define ipmitoh_u16(Val) (Val)
  68. //#elif IS_PLATFORM_PPC() || IS_PLATFORM_MIPS()
  69. //#define ipmitoh_u16(Val) (INT16U)(((INT16U)(Val) & 0xFF00) >> 8 | ((INT16U)(Val) & 0x00FF) << 8)
  70. //#endif
  71. /*** Extern Declarations ***/
  72. extern int InitMultiplePlatform(void);
  73. /*** Functions Prototypes ***/
  74. /**
  75. * @brief Initialises the Platform.
  76. * @return 0 if success else -1
  77. **/
  78. extern int Platform_Init (void);
  79. /**
  80. * @brief Platform setup performed after shared memory initialized.
  81. * @return 0 if success else -1
  82. **/
  83. extern int Platform_Init_SharedMem (void);
  84. /**
  85. * @brief Platform setup performed after IPMI stack running.
  86. * @return 0 if success else -1
  87. **/
  88. extern int Platform_Init_Done (void);
  89. /**
  90. * @brief Warm resets the BMC.
  91. **/
  92. extern void Platform_WarmReset (int BMCInst);
  93. /**
  94. * @brief Cold resets the BMC.
  95. **/
  96. extern void Platform_ColdReset (int BMCInst);
  97. /**
  98. * @brief Powers up the Host.
  99. **/
  100. extern void Platform_HostPowerUp (int BMCInst);
  101. /**
  102. * @brief Powers Off the Host.
  103. **/
  104. extern void Platform_HostPowerOff (int BMCInst);
  105. /**
  106. * @brief Powers on the Host.
  107. * @return 0 if success else -1.
  108. **/
  109. extern BOOL Platform_HostPowerOn (int BMCInst);
  110. /**
  111. * @brief Power cycles the Host.
  112. **/
  113. extern void Platform_HostPowerCycle (int BMCInst);
  114. /**
  115. * @brief Soft Shutdowns the Host.
  116. **/
  117. extern void Platform_HostSoftShutDown (int BMCInst);
  118. /**
  119. * @brief Resets the Host.
  120. **/
  121. extern void Platform_HostColdReset (int BMCInst);
  122. /**
  123. * @brief Generates the Diagnodtic (NMI) interrupt.
  124. **/
  125. extern void Platform_HostDiagInt (int BMCInst);
  126. /**
  127. * @brief Identifies the platform
  128. **/
  129. extern void Platform_Identify (INT32U Timeout, int Force, int BMCInst);
  130. extern void ResetSetInProgressParam (int BMCInst);
  131. #endif /* PLATFORM_PORT_H */