ArmPlatformPkg/ArmVExpressDxe: Change FDT default file names.

On the FVP base and foundation models, the default file name
used to retrieve the FDT depended on the values assigned to
model parameters (GIC related model parameters).

Now, in addition to the fallback "fdt.dtb" file name (used for legacy
 reason), only one default file name is used :
- "fvp-base.dtb" for the base model.
- "fvp-foundation.dtb" for the foundation model.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17862 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Olivier Martin
2015-07-07 15:45:36 +00:00
committed by oliviermartin
parent 03931908e2
commit b836204e78
7 changed files with 71 additions and 74 deletions

View File

@@ -24,6 +24,7 @@
#include <Protocol/FirmwareVolume2.h>
#define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000
STATIC CONST CHAR16 *mFdtFallbackName = L"fdt.dtb";
#pragma pack(1)
typedef struct {
@@ -155,16 +156,20 @@ ArmFvpInitialise (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
CONST ARM_VEXPRESS_PLATFORM* Platform;
EFI_STATUS Status;
CHAR16 *TextDevicePath;
CONST ARM_VEXPRESS_PLATFORM *Platform;
BOOLEAN NeedFallback;
UINTN TextDevicePathBaseSize;
UINTN TextDevicePathSize;
CHAR16 *TextDevicePath;
VOID *Buffer;
EFI_DEVICE_PATH *FdtDevicePath;
Status = gBS->InstallProtocolInterface (&ImageHandle,
&gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,
&mVirtioBlockDevicePath);
Status = gBS->InstallProtocolInterface (
&ImageHandle,
&gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,
&mVirtioBlockDevicePath
);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -180,13 +185,32 @@ ArmFvpInitialise (
}
FreePool (FdtDevicePath);
} else {
TextDevicePathSize = StrSize ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)) - sizeof (CHAR16);
TextDevicePathSize += StrSize (Platform->FdtName);
//
// In the case of the FVP base and foundation platforms, two default
// text device paths for the FDT are defined. The first one, like every
// other platform, ends with a file name that identifies the platform. The
// second one ends with the fallback file name "fdt.dtb" for historical
// backward compatibility reasons.
//
NeedFallback = (Platform->Id == ARM_FVP_BASE) ||
(Platform->Id == ARM_FVP_FOUNDATION);
TextDevicePathBaseSize = StrSize ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)) - sizeof (CHAR16);
TextDevicePathSize = TextDevicePathBaseSize + StrSize (Platform->FdtName);
if (NeedFallback) {
TextDevicePathSize += TextDevicePathBaseSize + StrSize (mFdtFallbackName);
}
TextDevicePath = AllocatePool (TextDevicePathSize);
if (TextDevicePath != NULL) {
StrCpy (TextDevicePath, ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)));
StrCat (TextDevicePath, Platform->FdtName);
if (NeedFallback) {
StrCat (TextDevicePath, L";");
StrCat (TextDevicePath, ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)));
StrCat (TextDevicePath, mFdtFallbackName);
}
}
}
if (TextDevicePath != NULL) {
@@ -198,6 +222,11 @@ ArmFvpInitialise (
));
}
FreePool (TextDevicePath);
} else {
DEBUG ((
EFI_D_ERROR,
"ArmFvpDxe: Setting of FDT device path in PcdFdtDevicePaths failed - %r\n", EFI_OUT_OF_RESOURCES
));
}
}