]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.c
ArmPlatformPkg/ArmShellCmdRunAxf: Added 'runaxf' cmd to shell
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / ArmVExpressDxe / ArmFvpDxe.c
CommitLineData
94caa81c 1/** @file\r
2\r
a4ab7df4 3 Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
94caa81c 4\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <Library/UefiLib.h>\r
16#include <Library/VirtioMmioDeviceLib.h>\r
17#include <Library/DebugLib.h>\r
18#include <Library/UefiBootServicesTableLib.h>\r
ced216f8 19#include <Library/ArmShellCmdLib.h>\r
94caa81c 20\r
21#define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000\r
22\r
23#pragma pack(1)\r
24typedef struct {\r
25 VENDOR_DEVICE_PATH Vendor;\r
26 EFI_DEVICE_PATH_PROTOCOL End;\r
27} VIRTIO_BLK_DEVICE_PATH;\r
28#pragma pack()\r
29\r
30VIRTIO_BLK_DEVICE_PATH mVirtioBlockDevicePath =\r
31{\r
32 {\r
33 {\r
34 HARDWARE_DEVICE_PATH,\r
35 HW_VENDOR_DP,\r
36 {\r
37 (UINT8)( sizeof(VENDOR_DEVICE_PATH) ),\r
38 (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8)\r
39 }\r
40 },\r
41 EFI_CALLER_ID_GUID,\r
42 },\r
43 {\r
44 END_DEVICE_PATH_TYPE,\r
45 END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
46 {\r
47 sizeof (EFI_DEVICE_PATH_PROTOCOL),\r
48 0\r
49 }\r
50 }\r
51};\r
52\r
53EFI_STATUS\r
54EFIAPI\r
55ArmFvpInitialise (\r
56 IN EFI_HANDLE ImageHandle,\r
57 IN EFI_SYSTEM_TABLE *SystemTable\r
58 )\r
59{\r
60 EFI_STATUS Status;\r
61\r
62 Status = gBS->InstallProtocolInterface (&ImageHandle,\r
63 &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,\r
64 &mVirtioBlockDevicePath);\r
65 if (EFI_ERROR (Status)) {\r
66 return Status;\r
67 }\r
68\r
69 // Declare the Virtio BlockIo device\r
70 Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle);\r
71 if (EFI_ERROR (Status)) {\r
72 DEBUG ((EFI_D_ERROR, "ArmFvpDxe: Failed to install Virtio block device\n"));\r
73 }\r
74\r
ced216f8
HL
75 // Install dynamic Shell command to run baremetal binaries.\r
76 Status = ShellDynCmdRunAxfInstall (ImageHandle);\r
77 if (EFI_ERROR (Status)) {\r
78 DEBUG ((EFI_D_ERROR, "ArmFvpDxe: Failed to install ShellDynCmdRunAxf\n"));\r
79 }\r
80\r
94caa81c 81 return Status;\r
82}\r