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

FIX: flashupdate.py fix for intel PAC n3000 cards - boot_page #3060

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 13 additions & 11 deletions python/opae.admin/opae/admin/tools/fpgasupdate.py
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