Skip to content

Commit

Permalink
dpu-tools: Consume bfb for BF
Browse files Browse the repository at this point in the history
  • Loading branch information
SamD2021 committed Nov 8, 2024
1 parent 65ee3dd commit 0d4c92b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dpu-tools
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ from utils.common_ipu import (
minicom_get_version,
)
from utils.common_ipu import console_ipu
from utils.common_bf import bf_reset, console_bf, bf_get_mode, bf_set_mode
from utils.common_bf import bf_reset, console_bf, bf_get_mode, bf_set_mode, download_bfb
from utils.common import (
DPUType,
detect_dpu_type,
Expand Down Expand Up @@ -48,6 +48,7 @@ class DPUTools:
"mode": self.mode,
"pxeboot": self.pxeboot,
"cx-fwup": cx_fwup,
"bfb": self.bfb,
}
# Execute the selected command
if self.args.subcommand in command_map:
Expand Down Expand Up @@ -152,6 +153,10 @@ class DPUTools:
px = Pxeboot(self.args)
px.start_pxeboot()

def bfb(self) -> None:
if self.dpu_type == DPUType.BF.name:
download_bfb(self.args.bf_id)


def main() -> None:
detected = detect_dpu_type()
Expand Down Expand Up @@ -258,7 +263,10 @@ def main() -> None:
"cx-fwup", help="Used for upgrading Nvidia cx Smart Nics"
)
cx_fwup_parser.set_defaults(subcommand="cx-fwup")

bfb_parser = utils_subparser.add_parser(
"bfb", help="Downloads BFB images and sends it to BF"
)
bfb_parser.set_defaults(subcommand="bfb")
# Parse arguments and initialize DPUTools
args = parser.parse_args()
setup_logging(args.verbose)
Expand Down

0 comments on commit 0d4c92b

Please sign in to comment.