LpcDriver.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*++
  2. Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. Module Name:
  5. LpcDriver.h
  6. Abstract:
  7. EFI Lpc Driver for a Generic PC Platform
  8. --*/
  9. #ifndef _LPC_DRIVER_H
  10. #define _LPC_DRIVER_H
  11. #include "LpcSio.h"
  12. #include "LpcIsaAcpi.h"
  13. #include "Protocol/IsaAcpi.h"
  14. #include "Protocol/PciIo.h"
  15. #include "Protocol/DriverBinding.h"
  16. #include "Library/UefiBootServicesTableLib.h"
  17. #include "IsaAcpiDxe/PcatIsaAcpi.h"
  18. #include "IndustryStandard/Pci22.h"
  19. #include "Protocol/LpcWpce791Policy.h"
  20. #include <Library/DebugLib.h>
  21. #define ICH_LPC_BRIDGE_BUS_DEV_FUNC 0x1F0000
  22. //
  23. // LPC device private data structure
  24. //
  25. //#define LPC_DEV_SIGNATURE 'W87X'
  26. #define LPC_DEV_SIGNATURE SIGNATURE_32('X', '7', '8', 'W') //'W87X'
  27. #define EFI_WPCE791_PS2_KEYBOARD_ENABLE 0x01
  28. #define EFI_WPCE791_PS2_KEYBOARD_DISABLE 0x00
  29. #define EFI_WPCE791_PS2_MOUSE_ENABLE 0x01
  30. #define EFI_WPCE791_PS2_MOUSE_DISABLE 0x00
  31. typedef struct {
  32. UINTN Signature;
  33. EFI_HANDLE Handle;
  34. EFI_ISA_ACPI_PROTOCOL IsaAcpi;
  35. EFI_PCI_IO_PROTOCOL *PciIo;
  36. } LPC_DEV;
  37. #define LPC_ISA_ACPI_FROM_THIS(a) BASE_CR (a, LPC_DEV, IsaAcpi)
  38. //
  39. // Driver entry point
  40. //
  41. EFI_STATUS
  42. EFIAPI
  43. LpcDriverEntryPoint (
  44. IN EFI_HANDLE ImageHandle,
  45. IN EFI_SYSTEM_TABLE *SystemTable
  46. );
  47. //
  48. // Prototypes for Driver model protocol interface
  49. //
  50. EFI_STATUS
  51. EFIAPI
  52. LpcDriverSupported (
  53. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  54. IN EFI_HANDLE Controller,
  55. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
  56. );
  57. EFI_STATUS
  58. EFIAPI
  59. LpcDriverStart (
  60. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  61. IN EFI_HANDLE Controller,
  62. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
  63. );
  64. EFI_STATUS
  65. EFIAPI
  66. LpcDriverStop (
  67. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  68. IN EFI_HANDLE Controller,
  69. IN UINTN NumberOfChildren,
  70. IN EFI_HANDLE *ChildHandleBuffer
  71. );
  72. VOID
  73. LpcIoRead8 (
  74. IN UINT16 Port,
  75. OUT UINT8 *Data
  76. );
  77. VOID
  78. LpcIoWrite8 (
  79. IN UINT16 Port,
  80. IN UINT8 Data
  81. );
  82. #endif