]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/Include/Protocol/UsbPolicy.h
Vlv2TbltDevicePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2TbltDevicePkg / Include / Protocol / UsbPolicy.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9 Module Name:
10 UsbPolicy.h
11
12 Abstract:
13
14 --*/
15
16 #ifndef _USB_POLICY_H_
17 #define _USB_POLICY_H_
18
19 EFI_FORWARD_DECLARATION (EFI_USB_POLICY_PROTOCOL);
20
21 #define USB_POLICY_GUID \
22 {\
23 0xf617b358, 0x12cf, 0x414a, 0xa0, 0x69, 0x60, 0x67, 0x7b, 0xda, 0x13, 0xb4\
24 }
25
26 #define TIANO_CODE_BASE 0x00
27 #define ICBD_CODE_BASE 0x01
28
29 #define ATUO_TYPE 0x00
30 #define USB_FDD_TYPE 0x01
31 #define HDD_TYPE 0x02
32 #define ZIP_TYPE 0x03
33 #define CDROM_TYPE 0x04
34 #define SIZE_TYPE 0x05
35
36 #define ZIP_FDD 0x80
37
38 #define FDD_EMULATION 0x00
39 #define HDD_EMULATION 0x01
40
41 #define HIGH_SPEED 0x00
42 #define FULL_SPEED 0x01
43 #define SUPER_SPEED 0x02
44
45 #define LEGACY_KB_EN 0x01
46 #define LEGACY_KB_DIS 0x00
47 #define LEGACY_MS_EN 0x01
48 #define LEGACY_MS_DIS 0x00
49 #define LEGACY_USB_EN 0x00
50 #define LEGACY_USB_DIS 0x01
51 #define LEGACY_FREE_SUPP 0x01
52 #define LEGACY_FREE_UN_SUPP 0x00
53 #define LEGACY_PERIOD_SUPP 0x01
54 #define LEGACY_PERIOD_UN_SUPP 0x00
55
56 #define LEGACY_USB_TIME_TUE_ENABLE 0x01
57 #define LEGACY_USB_TIME_TUE_DISABLE 0x00
58 #define USB_HAVE_HUB_INTERNEL 0x01
59 #define USB_NOT_HAVE_HUB_INTERNEL 0x00
60
61 #define USB_POLICY_PROTOCOL_REVISION_1 1
62 #define USB_POLICY_PROTOCOL_REVISION_2 2
63
64 #ifndef __GNUC__
65 #pragma warning ( disable : 4306 )
66 #pragma warning ( disable : 4054 )
67 #endif
68
69 #define GET_USB_CFG (UsbCfg);\
70 do{\
71 UINT16 *pSegOfEbda;\
72 UINT32 mToEbda;\
73 pSegOfEbda = (UINT16 *)(UINTN)0x40E;\
74 mToEbda = (UINT32)(((UINTN)(*pSegOfEbda) << 4) + 0x80);\
75 UsbCfg = (USB_CFG *)(UINTN)mToEbda;\
76 }while(0);
77
78 #pragma pack(1)
79 typedef struct {
80 UINT8 HasUSBKeyboard:1;
81 UINT8 HasUSBMouse:1;
82 UINT8 LegacyFreeSupport:1;
83 UINT8 UsbOperationMode:1;
84 UINT8 LegacyKBEnable:1;
85 UINT8 LegacyMSEnable:1;
86 UINT8 USBPeriodSupport:1;
87 UINT8 Reserved:1;
88 } USB_DEVICE_INFOR;
89
90 typedef struct {
91 UINT8 Codebase;
92 UINT8 USBHDDForceType;
93 UINT8 Configurated;
94 UINT8 LpcAcpiBase;
95 UINT8 AcpiTimerReg;
96 UINT8 Reserved1[0x01];
97 UINT8 LegacyUsbEnable;
98 USB_DEVICE_INFOR UsbDeviceInfor;
99 UINT16 UsbEmulationSize;
100 UINT8 Reserved2[0x06];
101 } USB_CFG;
102 #pragma pack()
103
104 typedef struct _EFI_USB_POLICY_PROTOCOL{
105 UINT8 Version;
106 UINT8 UsbMassStorageEmulationType; // 1: FDD_Type; 2: HDD_Type; other:Auto_Type*
107 UINT8 UsbOperationMode; // 0: High_Speed; 1: Full_Speed;
108 UINT8 LegacyKBEnable; // 0: Disabled; 1: Enabled*
109 UINT8 LegacyMSEnable; // 0: Disabled; 1: Enabled*
110 UINT8 USBPeriodSupport; // 0; Unsupport; 1: Support
111 UINT8 LegacyUsbEnable; // 1: Disabled; 0: Enabled*
112 UINT8 LegacyFreeSupport; // 0: Unsupport; 1: Support
113 UINT8 CodeBase;
114 UINT8 LpcAcpiBase; // 40h(default)
115 UINT8 AcpiTimerReg;
116 UINT8 UsbTimeTue;
117 UINT8 InternelHubExist; // 1: Host have internel hub on board; 0: No internel hub on board
118 UINT8 EnumWaitPortStableStall; // Value for wait port stable when enum a new dev.
119 UINT16 UsbEmulationSize; // Mbytes.
120 UINT8 UsbZipEmulationType;
121 UINT8 Reserved[3]; // Reserved fields for future expansion w/o protocol change
122 } EFI_USB_POLICY_PROTOCOL;
123
124 extern EFI_GUID gUsbPolicyGuid;
125
126 #endif