/** @file\r
\r
- Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
+ Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
#include <Library/VirtioMmioDeviceLib.h>\r
#include <Library/ArmShellCmdLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
\r
#define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000\r
\r
}\r
};\r
\r
+/**\r
+ * Generic UEFI Entrypoint for 'ArmFvpDxe' driver\r
+ * See UEFI specification for the details of the parameters\r
+ */\r
EFI_STATUS\r
EFIAPI\r
ArmFvpInitialise (\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- EFI_STATUS Status;\r
+ CONST ARM_VEXPRESS_PLATFORM* Platform;\r
+ EFI_STATUS Status;\r
+ CHAR16 *TextDevicePath;\r
+ UINTN TextDevicePathSize;\r
+ VOID *Buffer;\r
\r
Status = gBS->InstallProtocolInterface (&ImageHandle,\r
&gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,\r
return Status;\r
}\r
\r
+ Status = ArmVExpressGetPlatform (&Platform);\r
+ if (!EFI_ERROR (Status)) {\r
+ TextDevicePathSize = StrSize ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)) - sizeof (CHAR16);\r
+ TextDevicePathSize += StrSize (Platform->FdtName);\r
+\r
+ TextDevicePath = AllocatePool (TextDevicePathSize);\r
+ if (TextDevicePath != NULL) {\r
+ StrCpy (TextDevicePath, ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)));\r
+ StrCat (TextDevicePath, Platform->FdtName);\r
+ Buffer = PcdSetPtr (PcdFdtDevicePaths, &TextDevicePathSize, TextDevicePath);\r
+ if (Buffer == NULL) {\r
+ DEBUG ((\r
+ EFI_D_ERROR,\r
+ "ArmFvpDxe: Setting of FDT device path in PcdFdtDevicePaths failed - %r\n", EFI_BUFFER_TOO_SMALL\r
+ ));\r
+ }\r
+ FreePool (TextDevicePath);\r
+ }\r
+ }\r
+\r
// Declare the Virtio BlockIo device\r
Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle);\r
if (EFI_ERROR (Status)) {\r