3 Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include <Library/UefiLib.h>
16 #include <Library/VirtioMmioDeviceLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/UefiBootServicesTableLib.h>
19 #include <Library/ArmShellCmdLib.h>
21 #define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000
25 VENDOR_DEVICE_PATH Vendor
;
26 EFI_DEVICE_PATH_PROTOCOL End
;
27 } VIRTIO_BLK_DEVICE_PATH
;
30 VIRTIO_BLK_DEVICE_PATH mVirtioBlockDevicePath
=
37 (UINT8
)( sizeof(VENDOR_DEVICE_PATH
) ),
38 (UINT8
)((sizeof(VENDOR_DEVICE_PATH
)) >> 8)
45 END_ENTIRE_DEVICE_PATH_SUBTYPE
,
47 sizeof (EFI_DEVICE_PATH_PROTOCOL
),
56 IN EFI_HANDLE ImageHandle
,
57 IN EFI_SYSTEM_TABLE
*SystemTable
62 Status
= gBS
->InstallProtocolInterface (&ImageHandle
,
63 &gEfiDevicePathProtocolGuid
, EFI_NATIVE_INTERFACE
,
64 &mVirtioBlockDevicePath
);
65 if (EFI_ERROR (Status
)) {
69 // Declare the Virtio BlockIo device
70 Status
= VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE
, ImageHandle
);
71 if (EFI_ERROR (Status
)) {
72 DEBUG ((EFI_D_ERROR
, "ArmFvpDxe: Failed to install Virtio block device\n"));
75 // Install dynamic Shell command to run baremetal binaries.
76 Status
= ShellDynCmdRunAxfInstall (ImageHandle
);
77 if (EFI_ERROR (Status
)) {
78 DEBUG ((EFI_D_ERROR
, "ArmFvpDxe: Failed to install ShellDynCmdRunAxf\n"));