From 71ac166f5ecbccaf1b8b81782cdd2e71c90a5263 Mon Sep 17 00:00:00 2001 From: Matthew Gerlach Date: Mon, 12 Feb 2024 14:39:46 -0800 Subject: [PATCH] fpgasupdate: fix PR on boards without BMC interface. Refactor code so that Partial Reconfiguration (PR) can be done with the fpgasupdate command on boards without an interface to an on-board Board Management Controller (BMC). Signed-off-by: Matthew Gerlach --- python/opae.admin/opae/admin/tools/fpgasupdate.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/opae.admin/opae/admin/tools/fpgasupdate.py b/python/opae.admin/opae/admin/tools/fpgasupdate.py index 80ec44261d50..2db83402c7a6 100755 --- a/python/opae.admin/opae/admin/tools/fpgasupdate.py +++ b/python/opae.admin/opae/admin/tools/fpgasupdate.py @@ -813,11 +813,6 @@ def main(): LOG.error('PR interface uuid mismatch.') sys.exit(1) - # Check for 'update/filename' to determine if we use sysfs or ioctl - if (pac.upload_dev.find_one(os.path.join('update', 'filename')) or - pac.upload_dev.find_one('loading')): - use_ioctl = False - # The BMC disallows updating the factory image if the current boot-page is also 'factory'. # The idea is to always have at least one known-good image in the flash so that # you can recover from subsequent bad images. @@ -863,6 +858,11 @@ def main(): stat, mesg = do_partial_reconf(pac.pci_node.pci_address, args.file.name) elif blk0 is not None: + # Check for 'update/filename' to determine if we use sysfs or ioctl + if (pac.upload_dev.find_one(os.path.join('update', 'filename')) or + pac.upload_dev.find_one('loading')): + use_ioctl = False + sec_dev = pac.upload_dev if not sec_dev: LOG.error('Failed to find secure '