Index: trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp	(revision 99050)
+++ trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp	(revision 99080)
@@ -63,4 +63,6 @@
     } while (0)
 
+#define DTB_ADDR 0x40000000
+
 
 /*********************************************************************************************************************************
@@ -81,4 +83,5 @@
 static VMSTATE          g_enmVmState        = VMSTATE_CREATING;
 static const char       *g_pszLoadMem       = NULL;
+static const char       *g_pszLoadDtb       = NULL;
 
 /** @todo currently this is only set but never read. */
@@ -237,8 +240,23 @@
      */
     PCFGMNODE pRoot = pVMM->pfnCFGMR3GetRoot(pVM);
-    rc = pVMM->pfnCFGMR3InsertString(pRoot,  "Name",           "Default VM");                UPDATE_RC();
-    rc = pVMM->pfnCFGMR3InsertInteger(pRoot, "RamSize",        g_u32MemorySizeMB * _1M);     UPDATE_RC();
-    rc = pVMM->pfnCFGMR3InsertInteger(pRoot, "RamHoleSize",    512U * _1M);                  UPDATE_RC();
-    rc = pVMM->pfnCFGMR3InsertInteger(pRoot, "TimerMillies",   1000);                        UPDATE_RC();
+    rc = pVMM->pfnCFGMR3InsertString(pRoot,  "Name",           "Default VM");                   UPDATE_RC();
+    rc = pVMM->pfnCFGMR3InsertInteger(pRoot, "TimerMillies",   1000);                           UPDATE_RC();
+
+    /*
+     * Memory setup.
+     */
+    PCFGMNODE pMem = NULL;
+    rc = pVMM->pfnCFGMR3InsertNode(pRoot, "MM", &pMem);                                         UPDATE_RC();
+    rc = pVMM->pfnCFGMR3InsertNode(pMem, "MemRegions", &pMem);                                  UPDATE_RC();
+
+    PCFGMNODE pMemRegion = NULL;
+    rc = pVMM->pfnCFGMR3InsertNode(pMem, "Flash", &pMemRegion);                                 UPDATE_RC();
+    rc = pVMM->pfnCFGMR3InsertInteger(pMemRegion, "GCPhysStart",   0);                          UPDATE_RC();
+    rc = pVMM->pfnCFGMR3InsertInteger(pMemRegion, "Size", 128 * _1M);                           UPDATE_RC();
+
+    rc = pVMM->pfnCFGMR3InsertNode(pMem, "Conventional", &pMemRegion);                          UPDATE_RC();
+    rc = pVMM->pfnCFGMR3InsertInteger(pMemRegion, "GCPhysStart",   DTB_ADDR);                   UPDATE_RC();
+    rc = pVMM->pfnCFGMR3InsertInteger(pMemRegion, "Size", (uint64_t)g_u32MemorySizeMB * _1M);   UPDATE_RC();
+
 
     /*
@@ -314,4 +332,45 @@
 
 
+/**
+ * Loads the content of a given file into guest RAM starting at the given guest physical address.
+ *
+ * @returns VBox status code.
+ * @param   pszFile         The file to load.
+ * @param   GCPhysStart     The physical start address to load the file at.
+ */
+static int vboxbfeLoadFileAtGCPhys(const char *pszFile, RTGCPHYS GCPhysStart)
+{
+    RTFILE hFile = NIL_RTFILE;
+    int rc = RTFileOpen(&hFile, pszFile, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
+    if (RT_SUCCESS(rc))
+    {
+        uint8_t abRead[GUEST_PAGE_SIZE];
+        RTGCPHYS GCPhys = GCPhysStart;
+
+        for (;;)
+        {
+            size_t cbThisRead = 0;
+            rc = RTFileRead(hFile, &abRead[0], sizeof(abRead), &cbThisRead);
+            if (RT_FAILURE(rc))
+                break;
+
+            rc = g_pVMM->pfnPGMPhysSimpleWriteGCPhys(g_pVM, GCPhys, &abRead[0], cbThisRead);
+            if (RT_FAILURE(rc))
+                break;
+
+            GCPhys += cbThisRead;
+            if (cbThisRead < sizeof(abRead))
+                break;
+        }
+
+        RTFileClose(hFile);
+    }
+    else
+        RTPrintf("Loading file %s failed -> %Rrc\n", pszFile, rc);
+
+    return rc;
+}
+
+
 /** VM asynchronous operations thread */
 DECLCALLBACK(int) vboxbfeVMPowerUpThread(RTTHREAD hThread, void *pvUser)
@@ -386,32 +445,12 @@
     if (g_pszLoadMem)
     {
-        RTFILE hFile = NIL_RTFILE;
-        rc = RTFileOpen(&hFile, g_pszLoadMem, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
-        if (RT_SUCCESS(rc))
-        {
-            uint8_t abRead[GUEST_PAGE_SIZE];
-            RTGCPHYS GCPhys = 0;
-
-            for (;;)
-            {
-                size_t cbThisRead = 0;
-                rc = RTFileRead(hFile, &abRead[0], sizeof(abRead), &cbThisRead);
-                if (RT_FAILURE(rc))
-                    break;
-
-                rc = g_pVMM->pfnPGMPhysSimpleWriteGCPhys(g_pVM, GCPhys, &abRead[0], cbThisRead);
-                if (RT_FAILURE(rc))
-                    break;
-
-                GCPhys += cbThisRead;
-                if (cbThisRead < sizeof(abRead))
-                    break;
-            }
-
-            RTFileClose(hFile);
-        }
-        else
-            RTPrintf("Loading file %s failed -> %Rrc\n", g_pszLoadMem, rc);
-
+        rc = vboxbfeLoadFileAtGCPhys(g_pszLoadMem, 0 /*GCPhysStart*/);
+        if (RT_FAILURE(rc))
+            goto failure;
+    }
+
+    if (g_pszLoadDtb)
+    {
+        rc = vboxbfeLoadFileAtGCPhys(g_pszLoadDtb, DTB_ADDR);
         if (RT_FAILURE(rc))
             goto failure;
@@ -494,4 +533,5 @@
         { "--memory-size-mib",    'm', RTGETOPT_REQ_UINT32 },
         { "--load-file-into-ram", 'l', RTGETOPT_REQ_STRING },
+        { "--load-dtb",           'd', RTGETOPT_REQ_STRING },
         { "--load-vmm",           'v', RTGETOPT_REQ_STRING },
     };
@@ -516,4 +556,7 @@
             case 'l':
                 g_pszLoadMem = ValueUnion.psz;
+                break;
+            case 'd':
+                g_pszLoadDtb = ValueUnion.psz;
                 break;
             case 'v':
