summaryrefslogtreecommitdiff
path: root/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h
blob: aca9593a846953b8d4b7c26d90fe3f5574c210ed (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
/** @file
  This library identifies the firmware boot media device.

  The firmware boot media device is used to make system initialization decisions in the boot flow dependent
  upon firmware boot media. Note that the firmware boot media is the storage media that the boot firmware is stored on.
  It is not the OS storage media which may be stored upon a different non-volatile storage device.

Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#ifndef _FIRMWARE_BOOT_MEDIA_LIB_H_
#define _FIRMWARE_BOOT_MEDIA_LIB_H_

#include <Uefi.h>

typedef enum {
  FwBootMediaSpi,
  FwBootMediaUfs,
  FwBootMediaEmmc,
  FwBootMediaNvme,
  FwBootMediaMax
} FW_BOOT_MEDIA_TYPE;

typedef struct {
  FW_BOOT_MEDIA_TYPE BootMedia;
} FW_BOOT_MEDIA_HOB_DATA;

/**
  Determines the current platform firmware boot media device.

  @param[out] FwBootMediaType The current platform Boot Media type.

  @retval     EFI_SUCCESS     The operation completed successfully.
  @retval     EFI_NOT_FOUND   The boot media type could not be found.
**/
EFI_STATUS
EFIAPI
GetFirmwareBootMediaType (
  OUT FW_BOOT_MEDIA_TYPE   *FwBootMediaType
  );

/**
  Indicates whether the boot media is presently known.

  Note: Very early in boot this data may not be available.

  @retval TRUE        Boot media is known
  @retval FALSE       Boot media is not known
**/
BOOLEAN
EFIAPI
FirmwareBootMediaIsKnown (
  VOID
  );

/**
  Determines if the platform firmware is booting from SPI.

  @retval TRUE        Platform firmware is booting from SPI
  @retval FALSE       Platform firmware is booting from a non-SPI device or the boot media is unknown
**/
BOOLEAN
EFIAPI
FirmwareBootMediaIsSpi (
  VOID
  );

/**
  Determines if the platform firmware is booting from UFS.

  @retval TRUE        Platform firmware is booting from UFS
  @retval FALSE       Platform firmware is booting from a non-UFS device or the boot media is unknown
**/
BOOLEAN
EFIAPI
FirmwareBootMediaIsUfs (
  VOID
  );

/**
  Determines if the platform firmware is booting from eMMC.

  @retval TRUE        Platform firmware is booting from eMMC
  @retval FALSE       Platform firmware is booting from a non-eMMC device or the boot media is unknown
**/
BOOLEAN
EFIAPI
FirmwareBootMediaIsEmmc (
  VOID
  );

/**
  Determines if the platform firmware is booting from NVMe.

  @retval TRUE        Platform firmware is booting from NVMe.
  @retval FALSE       Platform firmware is booting from a non-NVMe device or the boot media is unknown
**/
BOOLEAN
EFIAPI
FirmwareBootMediaIsNvme (
  VOID
  );

#endif