Home | History | Annotate | Download | only in Tools

Lines Matching refs:fsp

23 This utility supports some operations for Intel FSP 2.0 image.

25 - Display FSP 2.0 information header
26 - Split FSP 2.0 image into individual FSP-T/M/S/O component
27 - Rebase FSP 2.0 components to a different base address
28 - Generate FSP mapping C header file
34 * FSP mapping file
434 # Don't count the FSP base address patch entry appended at the end
468 for fsp in self.FspList:
469 if fsp.Fih.HeaderRevision < 3:
470 raise Exception("ERROR: FSP 1.x is not supported by this tool !")
472 fih = fsp.Fih
474 newfih = fsp.Fih
476 raise Exception("ERROR: Inconsistent FSP ImageId or ImageRevision detected !")
481 # Check if this FV contains FSP header
513 fsp = FspImage (fspoffset, fih, fihoffset, plist)
514 fsp.AppendFv (idx)
515 self.FspList.append(fsp)
516 flen = fsp.Fih.ImageSize - fv.FvHdr.FvLength
518 fsp.AppendFv (idx)
613 print ("\nFound the following %d Firmware Volumes in FSP binary:" % (len(fd.FvList)))
627 for fsp in fd.FspList:
628 fvlist = map(lambda x : 'FV%d' % x, fsp.FvIdxList)
629 print ("FSP_%s contains %s" % (fsp.Type, ','.join(fvlist)))
630 print ("%s" % (OutputStruct(fsp.Fih, 0, fsp.Fih.HeaderLength)))
645 for fsp in fd.FspList:
646 fih = fsp.Fih
651 fv = fd.FvList[fsp.FvIdxList[0]]
652 hfsp.write ('#define FSP%s_BASE 0x%08X\n' % (fsp.Type, fih.ImageBase))
653 hfsp.write ('#define FSP%s_OFFSET 0x%08X\n' % (fsp.Type, fv.Offset))
654 hfsp.write ('#define FSP%s_LENGTH 0x%08X\n\n' % (fsp.Type, fih.ImageSize))
663 for fsp in fd.FspList:
664 ftype = fsp.Type
668 filename = os.path.join(outdir, fspname + '_' + fsp.Type + ext)
670 print ("Ceate FSP component file '%s'" % filename)
671 for fvidx in fsp.FvIdxList:
684 print "ERROR: Required number of base does not match number of FSP component !"
692 for fsp in fd.FspList:
693 ftype = fsp.Type.lower()
707 oldbase = fsp.Fih.ImageBase
709 print "Rebase FSP-%c from 0x%08X to 0x%08X:" % (ftype.upper(),oldbase,newbase)
712 for fvidx in fsp.FvIdxList:
730 (count, applied) = fsp.Patch(delta, newfspbin)
731 print " Patched %d entries using FSP patch table." % applied
750 parser_rebase = subparsers.add_parser('rebase', help='rebase a FSP into a new base address')
752 parser_rebase.add_argument('-f', '--fspbin' , dest='FspBinary', type=str, help='FSP binary file path', required = True)
753 parser_rebase.add_argument('-c', '--fspcomp', choices=['t','m','s','o'], nargs='+', dest='FspComponent', type=str, help='FSP component to rebase', default = "['t']", required = True)
754 parser_rebase.add_argument('-b', '--newbase', dest='FspBase', nargs='+', type=str, help='Rebased FSP binary file name', default = '', required = True)
756 parser_rebase.add_argument('-n', '--outfile', dest='OutputFile', type=str, help='Rebased FSP binary file name', default = '')
758 parser_split = subparsers.add_parser('split', help='split a FSP into multiple components')
760 parser_split.add_argument('-f', '--fspbin' , dest='FspBinary', type=str, help='FSP binary file path', required = True)
764 parser_genhdr = subparsers.add_parser('genhdr', help='generate a header file for FSP binary')
766 parser_genhdr.add_argument('-f', '--fspbin' , dest='FspBinary', type=str, help='FSP binary file path', required = True)
770 parser_info = subparsers.add_parser('info', help='display FSP information')
772 parser_info.add_argument('-f', '--fspbin' , dest='FspBinary', type=str, help='FSP binary file path', required = True)
777 raise Exception ("ERROR: Could not locate FSP binary file '%s' !" % args.FspBinary)