]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkSocPkg/QuarkNorthCluster/QNCInit/Dxe/QNCRootPorts.c
QuarkSocPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / QuarkSocPkg / QuarkNorthCluster / QNCInit / Dxe / QNCRootPorts.c
1 /** @file
2 PciHostBridge driver module, part of QNC module.
3
4 Provides the basic interfaces to abstract a PCI Host Bridge Resource Allocation.
5
6 Copyright (c) 2013-2015 Intel Corporation.
7
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10 **/
11 #include "CommonHeader.h"
12 #include "QNCInit.h"
13
14 UINT32 mS3ParameterRootPortDownstream = 0;
15 EFI_QNC_S3_DISPATCH_ITEM mS3DispatchItem = {
16 QncS3ItemTypeInitPcieRootPortDownstream,
17 &mS3ParameterRootPortDownstream
18 };
19
20 EFI_STATUS
21 QncInitRootPorts (
22 )
23 /*++
24
25 Routine Description:
26
27 Perform Initialization of the Downstream Root Ports
28
29 Arguments:
30
31 Returns:
32
33 EFI_SUCCESS The function completed successfully
34
35 --*/
36 {
37 EFI_STATUS Status;
38 EFI_QNC_S3_SUPPORT_PROTOCOL *QncS3Support;
39 VOID *Context;
40 VOID *S3DispatchEntryPoint;
41
42 Status = PciExpressInit ();
43 ASSERT_EFI_ERROR (Status);
44
45 //
46 // Get the QNC S3 Support Protocol
47 //
48 Status = gBS->LocateProtocol (
49 &gEfiQncS3SupportProtocolGuid,
50 NULL,
51 (VOID **) &QncS3Support
52 );
53 ASSERT_EFI_ERROR (Status);
54 if (EFI_ERROR (Status)) {
55 return Status;
56 }
57
58 //
59 // Get the QNC S3 Support Protocol
60 //
61 Status = QncS3Support->SetDispatchItem (
62 QncS3Support,
63 &mS3DispatchItem,
64 &S3DispatchEntryPoint,
65 &Context
66 );
67 ASSERT_EFI_ERROR (Status);
68
69 //
70 // Save the script dispatch item in the Boot Script
71 //
72 Status = S3BootScriptSaveDispatch2 (S3DispatchEntryPoint, Context);
73 ASSERT_EFI_ERROR (Status);
74
75 return Status;
76 }