]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.c
ArmPlatformPkg/ArmVExpressDxe: Identify the current platform
[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
dff72027
OM
15#include "ArmVExpressInternal.h"\r
16\r
94caa81c 17#include <Library/VirtioMmioDeviceLib.h>\r
ced216f8 18#include <Library/ArmShellCmdLib.h>\r
94caa81c 19\r
20#define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000\r
21\r
22#pragma pack(1)\r
23typedef struct {\r
24 VENDOR_DEVICE_PATH Vendor;\r
25 EFI_DEVICE_PATH_PROTOCOL End;\r
26} VIRTIO_BLK_DEVICE_PATH;\r
27#pragma pack()\r
28\r
29VIRTIO_BLK_DEVICE_PATH mVirtioBlockDevicePath =\r
30{\r
31 {\r
32 {\r
33 HARDWARE_DEVICE_PATH,\r
34 HW_VENDOR_DP,\r
35 {\r
36 (UINT8)( sizeof(VENDOR_DEVICE_PATH) ),\r
37 (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8)\r
38 }\r
39 },\r
40 EFI_CALLER_ID_GUID,\r
41 },\r
42 {\r
43 END_DEVICE_PATH_TYPE,\r
44 END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
45 {\r
46 sizeof (EFI_DEVICE_PATH_PROTOCOL),\r
47 0\r
48 }\r
49 }\r
50};\r
51\r
52EFI_STATUS\r
53EFIAPI\r
54ArmFvpInitialise (\r
55 IN EFI_HANDLE ImageHandle,\r
56 IN EFI_SYSTEM_TABLE *SystemTable\r
57 )\r
58{\r
59 EFI_STATUS Status;\r
60\r
61 Status = gBS->InstallProtocolInterface (&ImageHandle,\r
62 &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,\r
63 &mVirtioBlockDevicePath);\r
64 if (EFI_ERROR (Status)) {\r
65 return Status;\r
66 }\r
67\r
68 // Declare the Virtio BlockIo device\r
69 Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle);\r
70 if (EFI_ERROR (Status)) {\r
71 DEBUG ((EFI_D_ERROR, "ArmFvpDxe: Failed to install Virtio block device\n"));\r
72 }\r
73\r
ced216f8
HL
74 // Install dynamic Shell command to run baremetal binaries.\r
75 Status = ShellDynCmdRunAxfInstall (ImageHandle);\r
76 if (EFI_ERROR (Status)) {\r
77 DEBUG ((EFI_D_ERROR, "ArmFvpDxe: Failed to install ShellDynCmdRunAxf\n"));\r
78 }\r
79\r
94caa81c 80 return Status;\r
81}\r