提交 63216a61 编写于 作者: V vit9696

OpenCorePlatform: FirmwareFeatures and FirmwareFeaturesMask are set from PlatformInfo

上级 d39dc34e
......@@ -1369,6 +1369,12 @@ A continuously updated variable list can be found in a corresponding document:
\subsection{Mandatory Variables}\label{nvramvars}
\emph{Warning}: These variables may be added by
\hyperref[platforminfonvram]{PlatformNVRAM} or
\hyperref[platforminfogeneric]{Generic} subsections of
\hyperref[platforminfo]{PlatformInfo} section.
Using \texttt{PlatformInfo} is the recommend way of setting these variables.
The following variables are mandatory for macOS functioning:
\begin{itemize}
......@@ -1660,6 +1666,7 @@ for system configuration.
\textbf{Default value}: all zero\\
\textbf{Description}: Refer to
\texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:ROM}.
\end{enumerate}
\subsection{DataHub Properties}\label{platforminfodatahub}
......@@ -1840,6 +1847,30 @@ for system configuration.
\texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:HW\_MLB} and
\texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:MLB}.
\item
\texttt{FirmwareFeatures}\\
\textbf{Type}: \texttt{plist\ data}, 8 bytes\\
\textbf{Default value}: Not installed\\
\textbf{Description}: This variable comes in pair with \texttt{FirmwareFeaturesMask}.
Specifies the values of NVRAM variables:
\begin{itemize}
\tightlist
\item \texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:FirmwareFeatures}
\item \texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:ExtendedFirmwareFeatures}
\end{itemize}
\item
\texttt{FirmwareFeaturesMask}\\
\textbf{Type}: \texttt{plist\ data}, 8 bytes\\
\textbf{Default value}: Not installed\\
\textbf{Description}: This variable comes in pair with \texttt{FirmwareFeatures}.
Specifies the values of NVRAM variables:
\begin{itemize}
\tightlist
\item \texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:FirmwareFeaturesMask}
\item \texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:ExtendedFirmwareFeaturesMask}
\end{itemize}
\end{enumerate}
\subsection{SMBIOS Properties}\label{platforminfosmbios}
......
......@@ -454,13 +454,6 @@
<dict>
<key>Add</key>
<dict>
<key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key>
<dict>
<key>FirmwareFeatures</key>
<data>N+EP6A==</data>
<key>FirmwareFeaturesMask</key>
<data>P/8f/w==</data>
</dict>
<key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key>
<dict>
<key>boot-args</key>
......@@ -537,6 +530,10 @@
<string>M000000000001</string>
<key>ROM</key>
<data>ESIzAAAA</data>
<key>FirmwareFeatures</key>
<data>N+EP6AAAAAA=</data>
<key>FirmwareFeaturesMask</key>
<data>P/8f/wAAAAA=</data>
</dict>
<key>SMBIOS</key>
<dict>
......
......@@ -243,13 +243,21 @@ OcPlatformUpdateNvram (
)
{
EFI_STATUS Status;
CHAR8 *Bid;
CHAR8 *Mlb;
UINT8 *Rom;
Bid = OC_BLOB_GET (&Config->PlatformInfo.Nvram.Bid);
Mlb = OC_BLOB_GET (&Config->PlatformInfo.Nvram.Mlb);
Rom = &Config->PlatformInfo.Nvram.Rom[0];
CHAR8 *Bid;
CHAR8 *Mlb;
UINT8 *Rom;
UINT64 ExFeatures;
UINT64 ExFeaturesMask;
UINT32 Features;
UINT32 FeaturesMask;
Bid = OC_BLOB_GET (&Config->PlatformInfo.Nvram.Bid);
Mlb = OC_BLOB_GET (&Config->PlatformInfo.Nvram.Mlb);
Rom = &Config->PlatformInfo.Nvram.Rom[0];
ExFeatures = Config->PlatformInfo.Nvram.FirmwareFeatures;
ExFeaturesMask = Config->PlatformInfo.Nvram.FirmwareFeaturesMask;
Features = (UINT32) ExFeatures;
FeaturesMask = (UINT32) ExFeaturesMask;
if (Bid[0] != '\0') {
Status = gRT->SetVariable (
......@@ -277,8 +285,8 @@ OcPlatformUpdateNvram (
);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting HW_ROM %a - %r\n",
Bid,
"OC: Setting HW_ROM %02x:%02x:%02x:%02x:%02x:%02x - %r\n",
Rom[0], Rom[1], Rom[2], Rom[3], Rom[4], Rom[5],
Status
));
......@@ -291,8 +299,8 @@ OcPlatformUpdateNvram (
);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting ROM %a - %r\n",
Bid,
"OC: Setting ROM %02x:%02x:%02x:%02x:%02x:%02x - %r\n",
Rom[0], Rom[1], Rom[2], Rom[3], Rom[4], Rom[5],
Status
));
}
......@@ -308,7 +316,7 @@ OcPlatformUpdateNvram (
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting HW_MLB %a - %r\n",
Bid,
Mlb,
Status
));
......@@ -322,7 +330,65 @@ OcPlatformUpdateNvram (
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting MLB %a - %r\n",
Bid,
Mlb,
Status
));
}
if (ExFeatures != 0 || ExFeaturesMask != 0) {
Status = gRT->SetVariable (
L"FirmwareFeatures",
&gAppleVendorVariableGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
sizeof (Features),
&Features
);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting FirmwareFeatures %08x - %r\n",
Features,
Status
));
Status = gRT->SetVariable (
L"ExtendedFirmwareFeatures",
&gAppleVendorVariableGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
sizeof (ExFeatures),
&ExFeatures
);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting ExtendedFirmwareFeatures %016Lx - %r\n",
ExFeatures,
Status
));
Status = gRT->SetVariable (
L"FirmwareFeaturesMask",
&gAppleVendorVariableGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
sizeof (FeaturesMask),
&FeaturesMask
);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting FirmwareFeaturesMask %08x - %r\n",
FeaturesMask,
Status
));
Status = gRT->SetVariable (
L"ExtendedFirmwareFeaturesMask",
&gAppleVendorVariableGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
sizeof (ExFeaturesMask),
&ExFeaturesMask
);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting ExtendedFirmwareFeaturesMask %016Lx - %r\n",
ExFeaturesMask,
Status
));
}
......
......@@ -249,7 +249,7 @@ OcLoadUefiSupport (
OcLoadDrivers (Storage, Config);
DEBUG ((DEBUG_INFO, "OC: Connecting drivers..."));
DEBUG ((DEBUG_INFO, "OC: Connecting drivers...\n"));
if (Config->Uefi.ConnectDrivers) {
OcConnectDrivers ();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册