Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions python/opae.admin/opae/admin/tools/fpgasupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,21 +825,23 @@ def main():
# The bootpage is read from the fpga_boot_image sysfs entry. The 'fme' object has many sysfs_nodes
# for various items, including the boot_page, so we use that here. It simply returns a string
# indicating the boot page: fpga_factory, fpga_user1, or fpga_user2

boot_page = pac.fme.boot_page
if boot_page is None:

#boot_page only supported by PMCI interface
if pac.fme.spi_bus is None:
boot_page = pac.fme.boot_page
if boot_page is None:
LOG.error('Secure update failed. Could not find **/fpga_boot_image sysfs entry.')
sys.exit(1)

LOG.debug ("Boot page sysfs path: %s\n", boot_page.sysfs_path)
LOG.debug ("Boot page value: %s\n", boot_page.value)
LOG.debug ('Block0 ConType: %s\n', blk0['ConType'])
LOG.debug ("Boot page sysfs path: %s\n", boot_page.sysfs_path)
LOG.debug ("Boot page value: %s\n", boot_page.value)
LOG.debug ('Block0 ConType: %s\n', blk0['ConType'])

# The binary is produced by the PACSign utility.
# CONTENT_FACTORY is the enum that PACSign inserts into the block0 region of
# the binary to indicate that the factory image is targeted. ConType refers to 'content type'
# and indicates if the binary is factoryPR, static region, BMC-related etc.
if ((boot_page.value == 'fpga_factory') and (blk0['ConType'] == CONTENT_FACTORY)):
# The binary is produced by the PACSign utility.
# CONTENT_FACTORY is the enum that PACSign inserts into the block0 region of
# the binary to indicate that the factory image is targeted. ConType refers to 'content type'
# and indicates if the binary is factoryPR, static region, BMC-related etc.
if ((boot_page.value == 'fpga_factory') and (blk0['ConType'] == CONTENT_FACTORY)):
LOG.error('Secure update failed. Cannot update factory image when current boot-page is also factory.')
sys.exit(1)

Expand Down