// Copyright (c) 2018, Intel Corporation.
// SPDX-License-Identifier: BSD-3-Clause

ifdef::manpage[]
ipmctl-update-firmware(1)
=========================
endif::manpage[]

NAME
----
ipmctl-update-firmware - Updates the firmware on one or more DCPMMs

SYNOPSIS
--------
[verse]
ipmctl load [OPTIONS] -source (path) -dimm [TARGETS]

DESCRIPTION
-----------
Updates the firmware on one or more DCPMMs. On the next power cycle, the
firmware will become active.

NOTE: If Address Range Scrub (ARS) is in progress on any target DCPMM,
an attempt will be made to abort ARS and then proceed with the firmware update.

NOTE: A power cycle reboot is required to activate the updated firmware image and is
recommended to ensure ARS runs to completion.

OPTIONS
-------
-x::
-examine::
  Verifies the target DCPMMs are compatible and ready to receive the
  firmware image specified in the source option. Returns the firmware
  image version.

-f::
-force::
  Downgrading the firmware to an older version is a potentially destructive
  operation which requires confirmation from the user for each DCPMM. This
  option suppresses the confirmation when attempting to downgrade.

-h::
-help::
  Displays help for the command.

-ddrt::
  Used to specify DDRT as the desired transport protocol for the current invocation of ipmctl.

-smbus::
  Used to specify SMBUS as the desired transport protocol for the current invocation of ipmctl.

NOTE: The -ddrt and -smbus options are mutually exclusive and may not be used together.

-lpmb::
  Used to specify large transport payload size for the current invocation of ipmctl.

-spmb::
  Used to specify small transport payload size for the current invocation of ipmctl.

NOTE: The -lpmb and -spmb options are mutually exclusive and may not be used together.

-source::
  Specifies the firmware image binary to upload to the DCPMM.

-recover::
  *--DEPRECATED--* +
  This flag is no longer necessary to run firmware update on DCPMMs
  where the DDRT link is not trained. These untrained DCPMMs are now automatically
  included when the command is run without the '-recover' option.. However, this
  flag is still maintained for backwards compatibility.

ifndef::os_build[]
-recover FlashSPI::
  The FlashSPI option is a modifier that forces an update of the entire SPI
  Flash. This requires a specific flash image that is intended as a full SPI flash
  update. This update method is only possible if the existing firmware images
  on the DCPMM SPI flash are all corrupt and cannot be loaded by the DCPMM's ROM.
endif::os_build[]

ifdef::os_build[]
-o (text|nvmxml)::
-output (text|nvmxml)::
    Changes the output format. One of: "text" (default) or "nvmxml".
endif::os_build[]

TARGETS
-------
-dimm [DimmIDs]::
  Updates the firmware on specific DCPMMs by supplying one or more
  comma-separated DCPMM identifiers. However, this is not recommended as it may
  put the system in an undesirable state. The default is to update all
  manageable DCPMMs.

EXAMPLES
--------
Updates the firmware on all DCPMMs in the system to the image in sourcefile.bin on
the next power cycle.
[verse]
ipmctl load -source sourcefile.bin -dimm

Checks the firmware image in sourcefile.bin and retrieves the version.
[verse]
ipmctl load -examine -source sourcefile.bin -dimm


LIMITATIONS
-----------
In order to successfully execute this command:

- The caller must have the appropriate privileges.

- The specified DCPMM(s) must be manageable by the host software.

Firmware version (PN.RN.SV.bbbb) updates are supported as follows:

  - The product number (PN) cannot be changed.
  - The revision number (RN) can be upgraded when PN is the same.
  - The security revision number (SV) can be upgraded when PN.RN is the same. In
    some configurations it can also be downgraded when PN.RN is the same; use the
    examine option to determine if the security revision number can be downgraded.
  - The build number (bbbb) can be upgraded or downgraded. However, if the firmware
    API version in the firmware image is lower than is supported by the host software
    and would make the DCPMM become unmanageable, the downgrade is not supported.

NOTE: Once a firmware image is staged for execution, a power cycle is required
before another firmware image of the same type (production or debug) can be
staged for execution using this command.

RETURN DATA
-----------
When the examine option is provided, the firmware image is checked and the
version number and firmware type is provided. The firmware will either be
valid for the DCPMM, a downgrade or invalid meaning it cannot be used for that
DCPMM.

SAMPLE OUTPUT
-------------
[verse]
(file path): MM.mm.hh.bbbb
Load FW on DIMM (DimmID): (Valid|Downgrade) [(with
confirmation or the force option)]

If the firmware is being downgraded and the force option is not provided, the user will
be prompted to confirm the downgrade for each DCPMM. Otherwise, for each DCPMM,
the CLI will indicate the status of the operation.

[verse]
Downgrade firmware on DIMM (DimmID)? (y or [n]) Downgrade firmware
on DIMM (DimmID)? (y or [n])

If a failure occurs when updating multiple DCPMMs, the process will continue
attempting to update the remaining DCPMMs requested. The firmware will not
become active until the next power cycle. Use the command Section
<<Show Device Firmware>> to view more detailed information about the active
and staged firmware.

[verse]
Load FW on DIMM (DimmID): Success, a power cycle is required to
activate the FW.

[verse]
Load FW on DIMM (DimmID): Error (Code) - (Description)
