]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / UfsPciHcPei / UfsPciHcPei.h
1 /** @file
2 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
3 SPDX-License-Identifier: BSD-2-Clause-Patent
4
5 **/
6
7 #ifndef _UFS_PCI_HOST_CONTROLLER_PEI_H_
8 #define _UFS_PCI_HOST_CONTROLLER_PEI_H_
9
10 #include <PiPei.h>
11
12 #include <Ppi/MasterBootMode.h>
13 #include <Ppi/UfsHostController.h>
14
15 #include <IndustryStandard/Pci.h>
16
17 #include <Library/DebugLib.h>
18 #include <Library/BaseLib.h>
19 #include <Library/BaseMemoryLib.h>
20 #include <Library/PciLib.h>
21 #include <Library/PeiServicesLib.h>
22 #include <Library/MemoryAllocationLib.h>
23
24 #define UFS_HC_PEI_SIGNATURE SIGNATURE_32 ('U', 'F', 'S', 'P')
25 #define MAX_UFS_HCS 8
26
27 typedef struct {
28 UINTN Signature;
29 EDKII_UFS_HOST_CONTROLLER_PPI UfsHostControllerPpi;
30 EFI_PEI_PPI_DESCRIPTOR PpiList;
31 UINTN TotalUfsHcs;
32 UINTN UfsHcPciAddr[MAX_UFS_HCS];
33 } UFS_HC_PEI_PRIVATE_DATA;
34
35 #define UFS_HC_PEI_PRIVATE_DATA_FROM_THIS(a) CR (a, UFS_HC_PEI_PRIVATE_DATA, UfsHostControllerPpi, UFS_HC_PEI_SIGNATURE)
36
37 /**
38 Get the MMIO base address of UFS host controller.
39
40 @param[in] This The protocol instance pointer.
41 @param[in] ControllerId The ID of the UFS host controller.
42 @param[out] MmioBar Pointer to the UFS host controller MMIO base address.
43
44 @retval EFI_SUCCESS The operation succeeds.
45 @retval EFI_INVALID_PARAMETER The parameters are invalid.
46
47 **/
48 EFI_STATUS
49 EFIAPI
50 GetUfsHcMmioBar (
51 IN EDKII_UFS_HOST_CONTROLLER_PPI *This,
52 IN UINT8 ControllerId,
53 OUT UINTN *MmioBar
54 );
55
56 #endif