ArmPlatformPkg Bds

Jordan Justen edited this page Nov 10, 2014 · 2 revisions
Clone this wiki locally

Specify the default Console I/O devices

The UEFI Boot Manager expects all the console peripherals to be defined by the UEFI environment variables ConInDev and ConOutDev. At the time of the first boot of the platform, these variables are not defined yet. To answer this limitation, two PCDs have been introduced for the ARM Boot Manager (ArmPlatformPkg/Bds), the PCDs gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths and gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths define which devices have to be initialized before the Boot Manager displays its menu.

Example from ARM Versatile Express Cortex A9x4 Core Tile:

# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi()"
  • VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi(): Device Path of the UART I/O
  • VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085): Device Path of the CLCD on the VExpress motherboard

Add an EFI Application to the ArmPlatformPkg BDS

If your EFI Application is in your EFI Firmware, you can follow the same mechanism as EBL. Add your EFI Application to the the list defined by the BootMainEntries variable in [EDK2_ROOT]/ArmPlatformPkg/Bds/BootMenu.c. Example:

EFI_STATUS
BootEFIShell (
  IN LIST_ENTRY *BootOptionsList
  )
{
  EFI_STATUS Status;

  // Need to connect every drivers to ensure no dependencies are missing for the application
  BdsConnectAllDrivers();

  // Start EFI Shell
  Status = BdsLoadApplication (mImageHandle, L"ShellFull", 0, NULL);
  if (Status == EFI_NOT_FOUND) {
    Print (L"Error: EFI Application not found.\n");
  } else if (EFI_ERROR(Status)) {
    Print (L"Error: Status Code: 0x%X\n",(UINT32)Status);
  }

  return Status;
}

struct BOOT_MAIN_ENTRY {
  CONST CHAR16* Description;
  EFI_STATUS (*Callback) (IN LIST_ENTRY *BootOptionsList);
} BootMainEntries[] = {
    { L"EBL", BootEBL },
    { L"EFI Shell", BootEFIShell },
};

Or if your EFI application is located on a storage accessible by UEFI (eg: FileSystem) use the Boot Menu to create a new boot entry:

[1] Linux from SemiHosting
[2] EBL
[3] Boot Manager

Start: 3

Boot Manager options:

[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Update FDT path
[5] Return to main menu

Choose option 1-5:

Boot Manager options:

[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Update FDT path
[5] Return to main menu

Choose option 1-5: 1
[1] SemihostFs (512 MB)
[2] MMC_SD_CARD (127 MB)
[3] NOR Flash Driver [0x08000000;0x0BFC0000]
[4] Return to previous menu

Select the Boot Device: 2
File path of the EFI Application or the kernel: ShellFull.efi