• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*++
2 
3   Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
4 
5 
6   This program and the accompanying materials are licensed and made available under
7 
8   the terms and conditions of the BSD License that accompanies this distribution.
9 
10   The full text of the license may be found at
11 
12   http://opensource.org/licenses/bsd-license.php.
13 
14 
15 
16   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17 
18   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 
20 
21 
22 
23   Define APIs to retrieve USB Host Controller Info such as controller type and
24   I/O Port Base Address.
25 
26 
27 **/
28 
29 #ifndef _PEI_USB_CONTROLLER_PPI_H_
30 #define _PEI_USB_CONTROLLER_PPI_H_
31 
32 //
33 // Global ID for the PEI_USB_CONTROLLER_PPI.
34 //
35 #define PEI_USB_CONTROLLER_PPI_GUID \
36   { \
37     0x3bc1f6de, 0x693e, 0x4547,{ 0xa3, 0x0, 0x21, 0x82, 0x3c, 0xa4, 0x20, 0xb2} \
38   }
39 
40 //
41 // Forward declaration for the PEI_USB_CONTROLLER_PPI.
42 //
43 typedef struct _PEI_USB_CONTROLLER_PPI PEI_USB_CONTROLLER_PPI;
44 
45 //
46 // This bit is used in the ControllerType return parameter of GetUsbController()
47 // to identify the USB Host Controller type as UHCI
48 //
49 #define PEI_UHCI_CONTROLLER 0x01
50 
51 //
52 // This bit is used in the ControllerType return parameter of GetUsbController()
53 // to identify the USB Host Controller type as OHCI
54 //
55 #define PEI_OHCI_CONTROLLER 0x02
56 
57 //
58 // This bit is used in the ControllerType return parameter of GetUsbController()
59 // to identify the USB Host Controller type as EHCI
60 //
61 #define PEI_EHCI_CONTROLLER 0x03
62 
63 /**
64   Retrieve USB Host Controller Info such as controller type and I/O Base Address.
65 
66   @param[in]  PeiServices      The pointer to the PEI Services Table.
67   @param[in]  This             The pointer to this instance of the PEI_USB_CONTROLLER_PPI.
68   @param[in]  ControllerId     The ID of the USB controller.
69   @param[out] ControllerType   On output, returns the type of the USB controller.
70   @param[out] BaseAddress      On output, returns the base address of UHCI's I/O ports
71                                if UHCI is enabled or the base address of EHCI's MMIO
72                                if EHCI is enabled.
73 
74   @retval EFI_SUCCESS             USB controller attributes were returned successfully.
75   @retval EFI_INVALID_PARAMETER   ControllerId is greater than the maximum number
76                                   of USB controller supported by this platform.
77 
78 **/
79 typedef
80 EFI_STATUS
81 (EFIAPI *PEI_GET_USB_CONTROLLER)(
82   IN  EFI_PEI_SERVICES        **PeiServices,
83   IN  PEI_USB_CONTROLLER_PPI  *This,
84   IN  UINT8                   UsbControllerId,
85   OUT UINTN                   *ControllerType,
86   OUT UINTN                   *BaseAddress
87   );
88 
89 //
90 // This PPI contains a single service to retrieve the USB Host Controller type
91 // and the base address of the I/O ports used to access the USB Host Controller.
92 //
93 struct _PEI_USB_CONTROLLER_PPI {
94   PEI_GET_USB_CONTROLLER  GetUsbController;
95 };
96 
97 extern EFI_GUID gPeiUsbControllerPpiGuid;
98 
99 #endif
100