//\r
// The Library classes this module consumes\r
//\r
+#include <Library/BaseMemoryLib.h>\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/HobLib.h>\r
);\r
}\r
\r
+static const UINT8 EmptyFdt[] = {\r
+ 0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x00, 0x48,\r
+ 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x48,\r
+ 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,\r
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09,\r
+};\r
+\r
VOID\r
MicrovmInitialization (\r
VOID\r
\r
Status = QemuFwCfgFindFile ("etc/fdt", &FdtItem, &FdtSize);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg\n", __FUNCTION__));\r
- return;\r
+ DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg, using dummy\n", __FUNCTION__));\r
+ FdtItem = 0;\r
+ FdtSize = sizeof (EmptyFdt);\r
}\r
\r
FdtPages = EFI_SIZE_TO_PAGES (FdtSize);\r
return;\r
}\r
\r
- QemuFwCfgSelectItem (FdtItem);\r
- QemuFwCfgReadBytes (FdtSize, NewBase);\r
+ if (FdtItem) {\r
+ QemuFwCfgSelectItem (FdtItem);\r
+ QemuFwCfgReadBytes (FdtSize, NewBase);\r
+ } else {\r
+ CopyMem (NewBase, EmptyFdt, FdtSize);\r
+ }\r
\r
FdtHobData = BuildGuidHob (&gFdtHobGuid, sizeof (*FdtHobData));\r
if (FdtHobData == NULL) {\r