github.com/linuxboot/fiano@v1.2.0/pkg/amd/psb/common.go (about)

     1  // Copyright 2023 the LinuxBoot Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package psb
     6  
     7  import (
     8  	"fmt"
     9  
    10  	amd_manifest "github.com/linuxboot/fiano/pkg/amd/manifest"
    11  )
    12  
    13  // ParseAMDFirmware parses AMD firmware from the image bytes
    14  func ParseAMDFirmware(image []byte) (*amd_manifest.AMDFirmware, error) {
    15  	amdFw, err := amd_manifest.NewAMDFirmware(amd_manifest.FirmwareImage(image))
    16  	if err != nil {
    17  		return nil, fmt.Errorf("could not parse AMD Firmware: %w", err)
    18  	}
    19  	return amdFw, nil
    20  }