VirtualBox

Changeset 101322 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Sep 29, 2023 3:47:19 PM (16 months ago)
Author:
vboxsync
Message:

Main/src-client/ConsoleImplConfigArmV8.cpp: Setup the EFI ROM and the FDT using the generic platform device instead of the special efi-armv8 variant (will be used for other things later), bugref:10528

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp

    r101200 r101322  
    432432        InsertConfigNode(pRoot, "Devices", &pDevices);
    433433
    434         InsertConfigNode(pDevices, "efi-armv8",             &pDev);
     434        InsertConfigNode(pDevices, "platform",              &pDev);
    435435        InsertConfigNode(pDev,     "0",                     &pInst);
    436436        InsertConfigNode(pInst,    "Config",                &pCfg);
    437         InsertConfigInteger(pCfg,  "GCPhysLoadAddress",     0);
    438         InsertConfigString(pCfg,   "EfiRom",                "VBoxEFIAArch64.fd");
    439         InsertConfigInteger(pCfg,  "GCPhysFdtAddress",      0x40000000);
    440         InsertConfigString(pCfg,   "FdtId",                 "fdt");
    441437        InsertConfigNode(pInst,    "LUN#0",                 &pLunL0);
    442438        InsertConfigString(pLunL0, "Driver",                "ResourceStore");
     439
     440        /* Add the resources. */
     441        PCFGMNODE pResources = NULL;    /* /Devices/efi-armv8/Config/Resources */
     442        PCFGMNODE pRes = NULL;          /* /Devices/efi-armv8/Config/Resources/<Resource> */
     443        InsertConfigString(pCfg,        "ResourceNamespace",     "resources");
     444        InsertConfigNode(pCfg,          "Resources",             &pResources);
     445        InsertConfigNode(pResources,    "EfiRom",                &pRes);
     446        InsertConfigInteger(pRes,       "RegisterAsRom",         1);
     447        InsertConfigInteger(pRes,       "GCPhysLoadAddress",     0);
     448
     449        /** @todo r=aeichner 32-bit guests and query the firmware type from VBoxSVC. */
     450        /*
     451         * Firmware.
     452         */
     453        FirmwareType_T eFwType =  FirmwareType_EFI64;
     454#ifdef VBOX_WITH_EFI_IN_DD2
     455        const char *pszEfiRomFile = eFwType == FirmwareType_EFIDUAL ? "<INVALID>"
     456                                  : eFwType == FirmwareType_EFI32   ? "VBoxEFIAArch32.fd"
     457                                  :                                   "VBoxEFIAArch64.fd";
     458        const char *pszKey = "ResourceId";
     459#else
     460        Utf8Str efiRomFile;
     461        vrc = findEfiRom(virtualBox, PlatformArchitecture_ARM, eFwType, &efiRomFile);
     462        AssertRCReturn(vrc, vrc);
     463        const char *pszEfiRomFile = efiRomFile.c_str();
     464        const char *pszKey = "Filename";
     465#endif
     466        InsertConfigString(pRes,        pszKey,                  pszEfiRomFile);
     467
     468
     469        InsertConfigNode(pResources,    "Fdt",                   &pRes);
     470        InsertConfigInteger(pRes,       "RegisterAsRom",         0);
     471        InsertConfigInteger(pRes,       "GCPhysLoadAddress",     0x40000000);
     472        InsertConfigString(pRes,        "ResourceId",            "fdt");
    443473
    444474        vrc = RTFdtNodeAddF(hFdt, "platform-bus@%RX32", 0x0c000000);                        VRC();
     
    12621292    RTVfsIoStrmRelease(hVfsIosFdt);
    12631293    if (RT_SUCCESS(vrc))
    1264         vrc = mptrResourceStore->i_addItem("fdt", "fdt", hVfsFileFdt);
     1294        vrc = mptrResourceStore->i_addItem("resources", "fdt", hVfsFileFdt);
    12651295    RTVfsFileRelease(hVfsFileFdt);
    12661296    AssertRCReturnStmt(vrc, RTFdtDestroy(hFdt), vrc);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette