IioUdsDataDxe.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /** @file
  2. Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef _PLATFORM_TYPES_H_
  6. #define _PLATFORM_TYPES_H_
  7. #include <PiDxe.h>
  8. #include <Library/DebugLib.h>
  9. #include <Library/BaseLib.h>
  10. #include <Library/BaseMemoryLib.h>
  11. #include <Library/UefiLib.h>
  12. #include <Library/UefiBootServicesTableLib.h>
  13. #include <Library/HobLib.h>
  14. #include <Library/UefiRuntimeServicesTableLib.h>
  15. #include <Protocol/VariableWrite.h>
  16. #include <Protocol/CpuIo2.h>
  17. #include <Protocol/Spi.h>
  18. #include <Protocol/IioUds.h>
  19. #include <Library/MemoryAllocationLib.h>
  20. #include <Guid/HobList.h>
  21. #include <Register/PchRegsSpi.h>
  22. #include <Register/PchRegsLpc.h>
  23. #include <PchAccess.h>
  24. #include <Platform.h>
  25. #define EFI_PLATFORM_TYPE_DRIVER_PRIVATE_SIGNATURE SIGNATURE_32 ('T', 'Y', 'P', 'P')
  26. #define EFI_IIO_UDS_DRIVER_PRIVATE_SIGNATURE SIGNATURE_32 ('S', 'D', 'U', 'I')
  27. typedef unsigned char BYTE; //!< 8-bit quantities
  28. typedef unsigned short WORD; //!< 16-bit quantities
  29. typedef unsigned long DWORD; //!< 32-bit quantities
  30. typedef enum
  31. {
  32. #ifndef SUCCESS
  33. SUCCESS = 0x00, //!< Packet it good! .data[] is valid
  34. #endif
  35. DEFER = 0x01, //!< Packet is defered. .data[1] = BufID
  36. W_EARLY_NACK = 0x02, //!< Packet mastered on the SMBus by the MCU was NACKed earlier than expected
  37. NOT_RESP = 0x03, //!< Packet mastered on the SMBus by the MCU was NACKed during the address byte
  38. BUFFER_OVERRUN = 0x04, //!< Too many BYTE s were stuffed into the buffer.
  39. NO_BUFFER = 0x05, //!< All the buffers are used
  40. INVALID_BUF = 0x06, //!< Command passed a buffer id that was not in range
  41. BUF_NOT_IN_QUEUE = 0x07, //!< Command passed a buffer id is not being used.
  42. ARBITRATION_LOST = 0x08, //!< While the MCU was mastering a packet on the SMBus it lost arbitration.
  43. TIMEOUT = 0x0B, //!< SMBus timed out.
  44. CHECKSUM_ERR = 0x0C, //!< Operation encountered a checksum mismatch
  45. DATA_NACK = 0x0D, //!< Still don't know what these mean?
  46. BUS_ERR = 0x0E, //!< ?
  47. FAIL = 0x0F, //!< Generic error
  48. BUSY = 0x10, //!< ?
  49. R_EARLY_NACK = 0x11, //!< ?
  50. INVALID_LCD_COL_OFF = 0x12, //!< The cursor on the LCD was set to a column that was out of range.
  51. INVALID_LCD_ROW_OFF = 0x13, //!< The cursor on the LCD was set to a row that was out of range.
  52. INVALID_CK410_SEL = 0x14, //!< ?
  53. CMD_NOT_SUPPORTED = 0x15, //!< This command is not supported
  54. MORE_DATA_AVAILABLE = 0x16, //!< Do the command again to get more data
  55. } STATUS;
  56. typedef struct {
  57. BYTE byte_count;
  58. STATUS status;
  59. BYTE data[31];
  60. } BUFFER_RSLT;
  61. typedef struct {
  62. UINTN Signature;
  63. EFI_HANDLE Handle; // Handle for protocol this driver installs on
  64. EFI_IIO_UDS_PROTOCOL IioUds; // Policy protocol this driver installs
  65. } EFI_IIO_UDS_DRIVER_PRIVATE;
  66. #endif