Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read VBT from edk2/cbfs #20

Open
crawfxrd opened this issue Dec 12, 2024 · 1 comment · May be fixed by #23
Open

Read VBT from edk2/cbfs #20

crawfxrd opened this issue Dec 12, 2024 · 1 comment · May be fixed by #23
Assignees

Comments

@crawfxrd
Copy link
Member

crawfxrd commented Dec 12, 2024

Do not embed the VBT binary into the driver.
Attempt to read it from edk2 FFS or cbfs.
This will make the driver the same for all models.

@crawfxrd crawfxrd changed the title Read VBT from edk2 file Read VBT from edk2/cbfs Dec 12, 2024
@crawfxrd
Copy link
Member Author

crawfxrd commented Dec 16, 2024

This is how the file would be added in edk2:

FILE FREEFORM = 56752da9-de6b-4895-8819-1945b6b76c22 {
  SECTION RAW = vbt.rom
  SECTION UI = "IntelGopVbt"
}

We would need to read the raw section from the FV based on that GUID.

// LocateHandleBuffer: FirmwareVolume2Protocol
// for each handle:

gBS->OpenProtocol(
        <???>,                                  // Handle
        &gEfiFirmwareVolume2ProtocolGuid,       // Protocol
        &fv,                                    // Interface
        <???>,                                  // AgentHandle
        NULL,                                   // ControllerHandle
        EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL    // Attributes
);

fv->ReadSection(
    fv,                 // This
    VBT_FILE_GUID,      // NameGuid
    EFI_SECTION_RAW,    // SectionType
    0,                  // SectionInstance
    &buffer,            // Buffer
    &size,              // BufferSize
    &auth_status        // AuthenticationStatus
);

// if success, set VBT data and break

There's at least 2 FVs (UefiPayloadPkg.fdf) so we'd need to check all instances of EFI_FIRMWARE_VOLUME2_PROTOCOL.

Ref: UEFI-PI 1.9: III-3.4.1 Firmware Volume2 Protocol

@crawfxrd crawfxrd linked a pull request Dec 18, 2024 that will close this issue
@crawfxrd crawfxrd self-assigned this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant