]> git.proxmox.com Git - mirror_edk2.git/blame - DuetPkg/PciBusNoEnumerationDxe/PciPowerManagement.c
Update the copyright notice format
[mirror_edk2.git] / DuetPkg / PciBusNoEnumerationDxe / PciPowerManagement.c
CommitLineData
10590588 1/*++\r
2\r
b1f700a8
HT
3Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
10590588 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 PciPowerManagement.c\r
15 \r
16Abstract:\r
17\r
18 PCI Bus Driver\r
19\r
20Revision History\r
21\r
22--*/\r
23\r
d8bee43c 24#include "PciBus.h"\r
10590588 25\r
26EFI_STATUS\r
d8bee43c 27EFIAPI\r
10590588 28ResetPowerManagementFeature (\r
29 IN PCI_IO_DEVICE *PciIoDevice\r
30 )\r
31/*++\r
32\r
33Routine Description:\r
34\r
35 This function is intended to turn off PWE assertion and\r
36 put the device to D0 state if the device supports\r
37 PCI Power Management.\r
38\r
39Arguments:\r
40\r
41Returns:\r
42 \r
43 None\r
44\r
45--*/\r
46{\r
47 EFI_STATUS Status;\r
48 UINT8 PowerManagementRegBlock;\r
49 UINT16 PMCSR;\r
50\r
51 PowerManagementRegBlock = 0;\r
52\r
53 Status = LocateCapabilityRegBlock (\r
54 PciIoDevice,\r
55 EFI_PCI_CAPABILITY_ID_PMI,\r
56 &PowerManagementRegBlock,\r
57 NULL\r
58 );\r
59\r
60 if (EFI_ERROR (Status)) {\r
61 return EFI_UNSUPPORTED;\r
62 }\r
63\r
64 //\r
65 // Turn off the PWE assertion and put the device into D0 State\r
66 //\r
67 PMCSR = 0x8000;\r
68\r
69 //\r
70 // Write PMCSR\r
71 //\r
72 PciIoDevice->PciIo.Pci.Write (\r
73 &PciIoDevice->PciIo,\r
74 EfiPciIoWidthUint16,\r
75 PowerManagementRegBlock + 4,\r
76 1,\r
77 &PMCSR\r
78 );\r
79\r
80 return EFI_SUCCESS;\r
81}\r