Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware support to allow booting Windows 8.x #1

Open
wants to merge 2 commits into
base: ms-iot
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 49 additions & 46 deletions ArmPlatformPkg/Bds/Bds.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,61 +701,64 @@ DefineDefaultBootAppBootEntries (
{
EFI_STATUS Status;
UINTN Index = 0;
CHAR16 *UnicodeBootAppPath = NULL;
CHAR8 *AsciiBootAppPath;
UINTN PathIndex = 1;
UINTN PathIterator;
CHAR16 *UnicodeBootAppPath[2] = { NULL, L"\\EFI\\BOOT\\BOOTARM.EFI" };
CHAR8 *AsciiBootAppPath[2] = { NULL, "\\EFI\\BOOT\\BOOTARM.EFI" };
EFI_DEVICE_PATH *FullPath = NULL;
BDS_LOAD_OPTION *BdsLoadOption = NULL;

AsciiBootAppPath = (CHAR8*)PcdGetPtr (PcdDefaultBootAppPath);
if (AsciiBootAppPath == NULL) {
return EFI_UNSUPPORTED;
}

Status = ConvertAllocAsciiStrToUnicodeStr (
AsciiBootAppPath,
&UnicodeBootAppPath);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "FAIL to cconvert boot app path to unicode format\n"));
goto Exit;
AsciiBootAppPath[0] = (CHAR8*)PcdGetPtr (PcdDefaultBootAppPath);
if (AsciiBootAppPath[0] == NULL || !AsciiStriCmp(AsciiBootAppPath[0], AsciiBootAppPath[1])) {
PathIndex = 1;
} else {
Status = ConvertAllocAsciiStrToUnicodeStr (
AsciiBootAppPath[0],
&UnicodeBootAppPath[0]);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "FAIL to cconvert boot app path to unicode format\n"));
PathIndex = 1;
}
}

// Attempt to create boot option if the boot app if found. Will add multiple
// option if the boot app is found in multiple file system.
do {
Status = FindFileFullDevicePath (
&Index,
AsciiBootAppPath,
UnicodeBootAppPath,
&FullPath
);
if (Status == EFI_SUCCESS) {
Status = BootOptionCreate (LOAD_OPTION_ACTIVE | LOAD_OPTION_CATEGORY_BOOT,
L"Default EFI Boot Application",
FullPath,
BDS_LOADER_EFI_APPLICATION,
NULL,
0,
&BdsLoadOption
);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fail to create boot option for %s\n", AsciiBootAppPath));
} else {
DEBUG ((DEBUG_INIT, "Created boot option for %s\n", AsciiBootAppPath));
}
if (BdsLoadOption) {
FreePool (BdsLoadOption);
BdsLoadOption = NULL;
}
if (FullPath) {
FreePool (FullPath);
FullPath = NULL;
for (PathIterator = PathIndex; PathIterator < 2; PathIterator++) {
do {
Status = FindFileFullDevicePath (
&Index,
AsciiBootAppPath[PathIterator],
UnicodeBootAppPath[PathIterator],
&FullPath
);
if (Status == EFI_SUCCESS) {
Status = BootOptionCreate (LOAD_OPTION_ACTIVE | LOAD_OPTION_CATEGORY_BOOT,
L"Default EFI Boot Application",
FullPath,
BDS_LOADER_EFI_APPLICATION,
NULL,
0,
&BdsLoadOption
);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fail to create boot option for %s\n", AsciiBootAppPath));
} else {
DEBUG ((DEBUG_INIT, "Created boot option for %s\n", AsciiBootAppPath));
}
if (BdsLoadOption) {
FreePool (BdsLoadOption);
BdsLoadOption = NULL;
}
if (FullPath) {
FreePool (FullPath);
FullPath = NULL;
}
}
}
} while (Status != EFI_NOT_FOUND);
} while (Status != EFI_NOT_FOUND);
}

Exit:
if (UnicodeBootAppPath) {
FreePool (UnicodeBootAppPath);
if (UnicodeBootAppPath[0]) {
FreePool (UnicodeBootAppPath[0]);
}
return Status;
}
Expand Down
36 changes: 35 additions & 1 deletion Pi2BoardPkg/AcpiTables/Common/CSRT.aslc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ typedef struct
// Standard ACPI Header
EFI_ACPI_DESCRIPTION_HEADER CsrtHeader;

// Timer resource group (GIT for M2-M3)
EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER TimerResourceGroup;

// Interrupt controller resource group
EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER InterruptControllerResourceGroup;

// DMA Resource Group
RG_DMA DmaResourceGroup;

Expand All @@ -93,7 +99,7 @@ EFI_ACPI_5_0_CSRT_TABLE Csrt =
//------------------------------------------------------------------------
{
EFI_ACPI_5_0_CORE_SYSTEM_RESOURCE_TABLE_SIGNATURE, // Signature "CSRT"
sizeof(EFI_ACPI_DESCRIPTION_HEADER) + sizeof(RG_DMA), // was sizeof(EFI_ACPI_5_0_CSRT_TABLE), // Length
sizeof(EFI_ACPI_DESCRIPTION_HEADER) + sizeof(EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER) + sizeof(EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER) + sizeof(RG_DMA), // was sizeof(EFI_ACPI_5_0_CSRT_TABLE), // Length
EFI_ACPI_5_0_CSRT_REVISION, // Revision
0x00, // Checksum calculated at runtime.
EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field "BC2836"
Expand All @@ -103,6 +109,34 @@ EFI_ACPI_5_0_CSRT_TABLE Csrt =
EFI_ACPI_CREATOR_REVISION // ASL compiler revision number.
},

//------------------------------------------------------------------------
// Timer Resource Group (GIT for M2-M3) -- halextgit.dll
//------------------------------------------------------------------------
{
sizeof(EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER), // Resource Group Length
SIGNATURE_32('A','R','M','.'), // VendorId
0, // SubvendorId
1, // DeviceId 1
0, // SubdeviceId
0, // Revision
0, // Reserved
0 // SharedInfoLength
},

//------------------------------------------------------------------------
// Interrupt Controller Resource Group - halextbcm2709.dll
//------------------------------------------------------------------------
{
sizeof(EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER), // Resource Group Length
SIGNATURE_32('B','R','C','M'), // VendorId
0, // SubvendorId
0x2709, // DeviceId 0x2709
0, // SubdeviceId
0, // Revision
0, // Reserved
0 // SharedInfoLength
},

//------------------------------------------------------------------------
// DMA Resource Group
//------------------------------------------------------------------------
Expand Down