summaryrefslogtreecommitdiff
path: root/Include/Protocol/AhciSmmProtocol.h
blob: a93aca091cb5e003bbd569cd7ad9e30f4e575932 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**         5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************
//**********************************************************************
// $Header: /Alaska/SOURCE/Modules/AHCI/AhciSmm/AhciSmmProtocol.h 7     11/24/14 11:57p Kapilporwal $
//
// $Revision: 7 $
//
// $Date: 11/24/14 11:57p $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/AHCI/AhciSmm/AhciSmmProtocol.h $
// 
// 7     11/24/14 11:57p Kapilporwal
// [TAG]  		EIP191939
// [Category]  	Improvement
// [Description]  	Issue about BIG_REAL_MODE_MMIO_ACCESS of AHCI module
// [Files]  		AI13.bin
// AHCIACC.ASM
// AhciInt13Dxe.c
// AhciInt13Dxe.dxs
// AhciInt13Smm.c
// AhciInt13Smm.cif
// AhciInt13Smm.dxs
// AhciInt13Smm.h
// AhciInt13Smm.mak
// AhciInt13Smm.sdl
// AInt13.c
// Aint13.cif
// AInt13.h
// AhciSmm.c
// AhciSmm.h
// AhciSmmProtocol.h
// 
// 6     5/05/11 7:39a Rameshr
// [TAG]  		EIP51884
// [Category]  	Bug Fix
// [Severity]  	Minor
// [Symptom]  	Build error in pervious EIP 51884 check-in
// [RootCause]  	Atapi structure was missing.
// [Solution]  	Added Atapi Structure into AHCI_BUS_SMM_PROTOCOL
// [Files]  		AhciSmmProtocol.h
// 
// 5     3/15/11 4:13a Rameshr
// [TAG]- EIP 51884
// [Category]- New Feature
// [Description]- Added packet command function in AhciSMM for sending
// command in SMM handler
// [Files]- AhciSmm.c, AhciSmm.h, AhciSmmProtocols.h
// 
// 4     2/11/11 4:12a Rameshr
// [TAG]  		EIP53704
// [Category]  	Improvement
// [Description]  	AMI headers update for Alaska Ahci Driver
// [Files]  		AhciSmmProtocol.h
// 
// 3     5/07/10 2:31p Krishnakumarg
// Updated the date in AMI header
// 
// 2     5/07/10 11:48a Krishnakumarg
// Updated the AMI Header
// 
// 1     4/28/09 6:39p Rameshr
// Initial Check-in
// 
// 
//**********************************************************************

//<AMI_FHDR_START>
//--------------------------------------------------------------------------
//
// Name: AHCISmmProtocol.h
//
// Description: Protocol definition
//
//--------------------------------------------------------------------------
//<AMI_FHDR_END>

#ifndef _EFI_AHCI_SMM_PROTOCOLS_H_
#define _EFI_AHCI_SMM_PROTOCOLS_H_

#ifdef __cplusplus
extern "C" {
#endif

#define AHCI_SMM_PROTOCOL_GUID \
        {0xB2FA5764, 0x3B6E, 0x43D3, 0x91, 0xDF, 0x87, 0xD1, 0x5A, 0x3E, 0x56, 0x68}

GUID_VARIABLE_DECLARATION(gAhciSmmProtocolGuid,AHCI_SMM_PROTOCOL_GUID);

#ifndef GUID_VARIABLE_DEFINITION

#include <Protocol\PAhciBus.h>

typedef struct _AHCI_BUS_SMM_PROTOCOL AHCI_BUS_SMM_PROTOCOL;

typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_PIO_DATA_IN) (
    IN AHCI_BUS_SMM_PROTOCOL                    *SataDevInterface, 
    IN OUT COMMAND_STRUCTURE                    *CommandStructure,
    UINT8                                       PortNumber,
    UINT8                                       PMPortNumber, 
    DEVICE_TYPE                                 DeviceType,
    IN BOOLEAN                                  READWRITE

);

typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_DMA_DATA_IN) (
    IN AHCI_BUS_SMM_PROTOCOL                   *SataDevInterface, 
    IN OUT COMMAND_STRUCTURE                    *CommandStructure,
    UINT8                                       PortNumber,
    UINT8                                       PMPortNumber, 
    DEVICE_TYPE                                 DeviceType,
    IN BOOLEAN                                  READWRITE
);

typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_NON_DATA_CMD) (
    IN AHCI_BUS_SMM_PROTOCOL                    *SataDevInterface, 
    IN COMMAND_STRUCTURE                        CommandStructure,
    UINT8                                       PortNumber,
    UINT8                                       PMPortNumber, 
   	DEVICE_TYPE                                 DeviceType
);

typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_PACKET_CMD) (
    IN AHCI_BUS_SMM_PROTOCOL                    *SataDevInterface, 
    IN COMMAND_STRUCTURE                        *CommandStructure,
    IN BOOLEAN                                  READWRITE,
    UINT8                                       PortNumber,
    UINT8                                       PMPortNumber, 
   	DEVICE_TYPE                                 DeviceType
);

typedef EFI_STATUS (*EFI_AHCI_SMM_INIT_ON_S3) (
    IN AHCI_BUS_SMM_PROTOCOL                    *SataDevInterface, 
    IN UINT8                                    Port
);

typedef struct _AHCI_BUS_SMM_PROTOCOL{
    UINT64                                      AhciBaseAddress;
    UINT32                                      PortCommandTableBaseAddr;
    UINT32                                      PortCommandListBaseAddr;
    UINT32                                      PortFISBaseAddr;
    UINT8                                       PortNumber;
    UINT8                                       PMPortNumber; 
   	DEVICE_TYPE                                 DeviceType;
	ATAPI_DEVICE			                    AtapiDevice;
    EFI_AHCI_SMM_INIT_ON_S3                     AhciSmmInitPortOnS3Resume;
    EFI_AHCI_SMM_SATA_DEV_PIO_DATA_IN           AhciSmmExecutePioDataCommand;
    EFI_AHCI_SMM_SATA_DEV_DMA_DATA_IN           AhciSmmExecuteDmaDataCommand;
    EFI_AHCI_SMM_SATA_DEV_NON_DATA_CMD          AhciSmmExecuteNonDataCommand;
    EFI_AHCI_SMM_SATA_DEV_PACKET_CMD            AhciSmmExecutePacketCommand;
}AHCI_BUS_SMM_PROTOCOL;

#endif // #ifndef GUID_VARIABLE_DEFINITION
#ifdef __cplusplus
}
#endif
#endif

//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**         5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************