RFC: aleksander/qmi-firmware-update branch

Aleksander Morgado aleksander at aleksander.es
Tue Dec 6 21:06:50 UTC 2016


Hey,

I took Bjørn's swi-update program and extended it into a
"qmi-firmware-update" which handles the whole firmware update process.

https://cgit.freedesktop.org/libqmi/log/?h=aleksander/qmi-firmware-update

Comments welcome!

BTW; if you run with --verbose you'll get a very detailed output that
will help in case there are problems.

I add here the output of --help and --help-examples for reference:

$ qmi-firmware-update --help
Usage:
  qmi-firmware-update [OPTION...] FILE1 FILE2... - Update firmware in
QMI devices

Generic device selection options
  -s, --busnum-devnum=[BUS:]DEV        Select device by bus and device
number (in decimal).
  -d, --vid-pid=VID:[PID]              Select device by device vendor
and product id (in hexadecimal).

Update options (normal mode)
  -u, --update                         Launch firmware update process.
  -w, --cdc-wdm=[PATH]                 Select device by QMI/MBIM
cdc-wdm device path (e.g. /dev/cdc-wdm0).
  -f, --firmware-version=[VERSION]     Firmware version (e.g. '05.05.58.00').
  -c, --config-version=[VERSION]       Config version (e.g. '005.025_002').
  -C, --carrier=[CARRIER]              Carrier name (e.g. 'Generic').
  -p, --device-open-proxy              Request to use the 'qmi-proxy' proxy.
  --device-open-mbim                   Open an MBIM device with
EXT_QMUX support.

Reset options (normal mode)
  -b, --reset                          Reset device into QDL download mode.
  -a, --at-serial=[PATH]               Select device by AT serial
device path (e.g. /dev/ttyUSB2).

Update options (QDL mode)
  -U, --update-qdl                     Launch firmware update process
in QDL mode.
  -q, --qdl-serial=[PATH]              Select device by QDL serial
device path (e.g. /dev/ttyUSB0).

Verify options
  -z, --verify                         Analyze and verify firmware images.

Application Options:
  -v, --verbose                        Run action with verbose logs,
including the debug ones.
  -S, --silent                         Run action with no logs; not
even the error/warning ones.
  -V, --version                        Print version.
  -h, --help                           Show help.
  -H, --help-examples                  Show help examples.

   ***************************************************************************
                                Warning!
   ***************************************************************************

   Use this program with caution. The authors take *no* responsibility if any
   device gets broken as a result of using this program.

   Please report issues to the libqmi mailing list at:
     libqmi-devel at lists.freedesktop.org

$ qmi-firmware-update --help-examples

********************************************************************************

 Example 1: Updating a Sierra Wireless MC7354.

 The MC7354 is a 9x15 device which requires the firmware updater to specify the
 firmware version string, the config version string and the carrier string, so
 that they are included as identifiers of the firmware images downloaded.

 While in normal operation, the device will expose multiple cdc-wdm ports, and
 the updater application just needs one of those cdc-wdm ports to start the
 operation. The user can explicitly specify the cdc-wdm port to use, or
 otherwise use the generic device selection options (i.e. --busnum-devnum or
 --vid-pid) to do that automatically.

 Note that the firmware for the MC7354 is usually composed of a core
system image
 (.cwe) and a carrier-specific image (.nvu). These two images need to be flashed
 on the same operation.

 1a) An update operation specifying the QMI cdc-wdm device:
 $ sudo qmi-firmware-update \
       --update \
       --cdc-wdm /dev/cdc-wdm0 \
       --firmware-version 05.05.58.00 \
       --config-version 005.025_002 \
       --carrier Generic \
       SWI9X15C_05.05.58.00.cwe \
       SWI9X15C_05.05.58.00_Generic_005.025_002.nvu

 1b) An update operation specifying the vid:pid of the device (fails if multiple
     devices with the same vid:pid are found):
 $ sudo qmi-firmware-update \
       --update \
       -d 1199:68c0 \
       --firmware-version 05.05.58.00 \
       --config-version 005.025_002 \
       --carrier Generic \
       SWI9X15C_05.05.58.00.cwe \
       SWI9X15C_05.05.58.00_Generic_005.025_002.nvu

********************************************************************************

 Example 2: Updating a Sierra Wireless MC7700.

 The MC7700 is a 9200 device which doesn't require the explicit firmware, config
 and carrier strings. Unlike the MC7354, which would reboot itself into QDL
 download mode once these previous strings were configured, the MC7700 requires
 an AT command to be sent in a TTY port to request the reset in QDL download
 mode.

 The user doesn't need to explicitly specify the path to the TTY,
though, it will
 be automatically detected and processed during the firmware update process.

 2a) An update operation specifying the QMI cdc-wdm device:
 $ sudo qmi-firmware-update \
       --update \
       --cdc-wdm /dev/cdc-wdm0 \
       9999999_9999999_9200_03.05.14.00_00_generic_000.000_001_SPKG_MC.cwe

 2b) An update operation specifying the vid:pid of the device (fails if multiple
     devices with the same vid:pid are found):
 $ sudo qmi-firmware-update \
       --update \
       -d 1199:68a2 \
       9999999_9999999_9200_03.05.14.00_00_generic_000.000_001_SPKG_MC.cwe

********************************************************************************

 Example 3: Manual process to update a Sierra Wireless MC7700.

 Instead of letting the qmi-firmware-update manage the full firmware update
 operation, the user can trigger the actions manually as follows:

 3a) Request device to go into QDL download mode:
 $ sudo qmi-firmware-update \
       -d 1199:68a2 \
       --reset

 3b) Run updater operation while in QDL download mode:
 $ sudo qmi-firmware-update \
       -d 1199:68a2 \
       --update-qdl \
       9999999_9999999_9200_03.05.14.00_00_generic_000.000_001_SPKG_MC.cwe

********************************************************************************

 Example 4: Verify firmware images.

 $ sudo qmi-firmware-update \
       --verify \
       SWI9X15C_05.05.58.00.cwe \
       SWI9X15C_05.05.58.00_Generic_005.025_002.nvu


-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list