Revision: 17299
http://sourceforge.net/p/edk2/code/17299
Author: oliviermartin
Date: 2015-05-05 15:23:02 +0000 (Tue, 05 May 2015)
Log Message:
-----------
ArmPlatformPkg/FdtPlatformDxe: 'setfdt' command, add display of FDT device
paths.
Add the display of the device paths that the FDT installation
process goes through when the 'setfdt' EFI Shell command is
called without any parameter.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <[email protected]>
Reviewed-by: Olivier Martin <[email protected]>
Modified Paths:
--------------
trunk/edk2/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.c
Modified: trunk/edk2/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.c
===================================================================
--- trunk/edk2/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.c 2015-05-05
15:12:58 UTC (rev 17298)
+++ trunk/edk2/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.c 2015-05-05
15:23:02 UTC (rev 17299)
@@ -50,6 +50,10 @@
IN CONST CHAR8 *Language
);
+STATIC VOID DisplayFdtDevicePaths (
+ VOID
+ );
+
STATIC SHELL_STATUS UpdateFdtTextDevicePath (
IN EFI_SHELL_PROTOCOL *Shell,
IN CONST CHAR16 *FilePath
@@ -478,10 +482,10 @@
switch (ShellCommandLineGetCount (ParamPackage)) {
case 1:
//
- // Case "setfdt -i"
+ // Case "setfdt" or "setfdt -i"
//
if (!ShellCommandLineGetFlag (ParamPackage, L"-i")) {
- Status = EFI_INVALID_PARAMETER;
+ DisplayFdtDevicePaths ();
}
break;
@@ -557,6 +561,7 @@
Status
);
}
+ DisplayFdtDevicePaths ();
}
}
@@ -602,6 +607,109 @@
}
/**
+ Display FDT device paths.
+
+ Display in text form the device paths used to install the FDT from the
+ highest to the lowest priority.
+
+**/
+STATIC
+VOID
+DisplayFdtDevicePaths (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ UINTN DataSize;
+ CHAR16 *TextDevicePath;
+ CHAR16 *TextDevicePaths;
+ CHAR16 *TextDevicePathSeparator;
+
+ ShellPrintHiiEx (
+ -1, -1, NULL,
+ STRING_TOKEN (STR_SETFDT_DEVICE_PATH_LIST),
+ mFdtPlatformDxeHiiHandle
+ );
+
+ if (FeaturePcdGet (PcdOverridePlatformFdt)) {
+ DataSize = 0;
+ Status = gRT->GetVariable (
+ L"Fdt",
+ &gFdtVariableGuid,
+ NULL,
+ &DataSize,
+ NULL
+ );
+
+ //
+ // Keep going only if the "Fdt" variable is defined.
+ //
+
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ TextDevicePath = AllocatePool (DataSize);
+ if (TextDevicePath == NULL) {
+ return;
+ }
+
+ Status = gRT->GetVariable (
+ L"Fdt",
+ &gFdtVariableGuid,
+ NULL,
+ &DataSize,
+ TextDevicePath
+ );
+ if (!EFI_ERROR (Status)) {
+ ShellPrintHiiEx (
+ -1, -1, NULL,
+ STRING_TOKEN (STR_SETFDT_DEVICE_PATH),
+ mFdtPlatformDxeHiiHandle,
+ TextDevicePath
+ );
+ }
+
+ FreePool (TextDevicePath);
+ }
+ }
+
+ //
+ // Loop over the device path list provided by "PcdFdtDevicePaths". The device
+ // paths are in text form and separated by a semi-colon.
+ //
+
+ TextDevicePaths = AllocateCopyPool (
+ StrSize ((CHAR16*)PcdGetPtr (PcdFdtDevicePaths)),
+ (CHAR16*)PcdGetPtr (PcdFdtDevicePaths)
+ );
+ if (TextDevicePaths == NULL) {
+ return;
+ }
+
+ for (TextDevicePath = TextDevicePaths;
+ *TextDevicePath != L'\0' ; ) {
+ TextDevicePathSeparator = StrStr (TextDevicePath, L";");
+
+ if (TextDevicePathSeparator != NULL) {
+ *TextDevicePathSeparator = L'\0';
+ }
+
+ ShellPrintHiiEx (
+ -1, -1, NULL,
+ STRING_TOKEN (STR_SETFDT_DEVICE_PATH),
+ mFdtPlatformDxeHiiHandle,
+ TextDevicePath
+ );
+
+ if (TextDevicePathSeparator == NULL) {
+ break;
+ }
+ TextDevicePath = TextDevicePathSeparator + 1;
+ }
+
+ FreePool (TextDevicePaths);
+
+}
+
+/**
Update the text device path stored in the "Fdt" UEFI variable given
an EFI Shell file path or a text device path.
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits