mirror_ubuntu-kernels/drivers/net/ethernet/intel/ice
Jacob Keller d69ea414c9 ice: implement device flash update via devlink
Use the newly added pldmfw library to implement device flash update for
the Intel ice networking device driver. This support uses the devlink
flash update interface.

The main parts of the flash include the Option ROM, the netlist module,
and the main NVM data. The PLDM firmware file contains modules for each
of these components.

Using the pldmfw library, the provided firmware file will be scanned for
the three major components, "fw.undi" for the Option ROM, "fw.mgmt" for
the main NVM module containing the primary device firmware, and
"fw.netlist" containing the netlist module.

The flash is separated into two banks, the active bank containing the
running firmware, and the inactive bank which we use for update. Each
module is updated in a staged process. First, the inactive bank is
erased, preparing the device for update. Second, the contents of the
component are copied to the inactive portion of the flash. After all
components are updated, the driver signals the device to switch the
active bank during the next EMP reset (which would usually occur during
the next reboot).

Although the firmware AdminQ interface does report an immediate status
for each command, the NVM erase and NVM write commands receive status
asynchronously. The driver must not continue writing until previous
erase and write commands have finished. The real status of the NVM
commands is returned over the receive AdminQ. Implement a simple
interface that uses a wait queue so that the main update thread can
sleep until the completion status is reported by firmware. For erasing
the inactive banks, this can take quite a while in practice.

To help visualize the process to the devlink application and other
applications based on the devlink netlink interface, status is reported
via the devlink_flash_update_status_notify. While we do report status
after each 4k block when writing, there is no real status we can report
during erasing. We simply must wait for the complete module erasure to
finish.

With this implementation, basic flash update for the ice hardware is
supported.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-28 17:07:06 -07:00
..
ice_adminq_cmd.h ice: add flags indicating pending update of firmware module 2020-07-28 17:07:06 -07:00
ice_arfs.c ice: Implement aRFS 2020-05-22 22:02:34 -07:00
ice_arfs.h ice: Implement aRFS 2020-05-22 22:02:34 -07:00
ice_base.c ice: replace single-element array used for C struct hack 2020-07-01 16:35:23 -07:00
ice_base.h ice: Add support to enable/disable all Rx queues before waiting 2020-02-15 16:39:55 -08:00
ice_common.c ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00
ice_common.h ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00
ice_controlq.c ice: fix function signature style format 2020-05-31 03:52:25 -07:00
ice_controlq.h ice: Handle critical FW error during admin queue initialization 2020-05-27 17:48:23 -07:00
ice_dcb_lib.c ice: Fix transmit for all software offloaded VLANs 2020-05-31 03:38:20 -07:00
ice_dcb_lib.h ice: Fix transmit for all software offloaded VLANs 2020-05-31 03:38:20 -07:00
ice_dcb_nl.c ice: remove unused macro 2020-05-27 17:03:40 -07:00
ice_dcb_nl.h ice: Implement DCBNL support 2019-11-08 12:02:14 -08:00
ice_dcb.c ice: avoid unnecessary single-member variable-length structs 2020-07-01 16:33:29 -07:00
ice_dcb.h ice: replace single-element array used for C struct hack 2020-07-01 16:35:23 -07:00
ice_devids.h ice: fix define for E822 backplane device 2020-02-19 13:39:33 -08:00
ice_devlink.c ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00
ice_devlink.h ice: add a devlink region for dumping NVM contents 2020-03-26 19:39:26 -07:00
ice_ethtool_fdir.c ice: fix aRFS after flow director delete 2020-05-31 03:58:12 -07:00
ice_ethtool.c ice: update reporting of autoneg capabilities 2020-07-23 15:29:46 -07:00
ice_fdir.c ice: Enable flex-bytes support 2020-05-22 21:44:48 -07:00
ice_fdir.h ice: Enable flex-bytes support 2020-05-22 21:44:48 -07:00
ice_flex_pipe.c ice: replace single-element array used for C struct hack 2020-07-01 16:35:23 -07:00
ice_flex_pipe.h ice: Support IPv4 Flow Director filters 2020-05-22 21:36:27 -07:00
ice_flex_type.h ice: replace single-element array used for C struct hack 2020-07-01 16:35:23 -07:00
ice_flow.c ice: Enable flex-bytes support 2020-05-22 21:44:48 -07:00
ice_flow.h ice: Enable flex-bytes support 2020-05-22 21:44:48 -07:00
ice_fltr.c ice: refactor filter functions 2020-05-21 22:10:04 -07:00
ice_fltr.h ice: refactor filter functions 2020-05-21 22:10:04 -07:00
ice_fw_update.c ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00
ice_fw_update.h ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00
ice_hw_autogen.h ice: Add advanced power mgmt for WoL 2020-07-23 14:59:20 -07:00
ice_lan_tx_rx.h ice: avoid undefined behavior 2020-05-27 17:58:21 -07:00
ice_lib.c ice: Add advanced power mgmt for WoL 2020-07-23 14:59:20 -07:00
ice_lib.h ice: Add advanced power mgmt for WoL 2020-07-23 14:59:20 -07:00
ice_main.c ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00
ice_nvm.c ice: Add AdminQ commands for FW update 2020-07-28 17:07:06 -07:00
ice_nvm.h ice: Add AdminQ commands for FW update 2020-07-28 17:07:06 -07:00
ice_osdep.h ice: Start hardware initialization 2018-03-26 09:59:08 -07:00
ice_protocol_type.h ice: Enable flex-bytes support 2020-05-22 21:44:48 -07:00
ice_sched.c ice: replace single-element array used for C struct hack 2020-07-01 16:35:23 -07:00
ice_sched.h ice: avoid unnecessary single-member variable-length structs 2020-07-01 16:33:29 -07:00
ice_sriov.c ice: remove unnecessary fallthrough comments 2020-02-15 16:56:48 -08:00
ice_sriov.h ice: Add handlers for VF netdevice operations 2018-10-03 07:42:30 -07:00
ice_status.h ice: Handle critical FW error during admin queue initialization 2020-05-27 17:48:23 -07:00
ice_switch.c ice: replace single-element array used for C struct hack 2020-07-01 16:35:23 -07:00
ice_switch.h ice: Initialize Flow Director resources 2020-05-22 21:26:37 -07:00
ice_txrx_lib.c xdp: Rename convert_to_xdp_frame in xdp_convert_buff_to_frame 2020-06-01 15:02:53 -07:00
ice_txrx_lib.h ice: Rename build_ctob to ice_build_ctob 2020-05-21 22:10:04 -07:00
ice_txrx.c ice: Fix transmit for all software offloaded VLANs 2020-05-31 03:38:20 -07:00
ice_txrx.h ice: fix signed vs unsigned comparisons 2020-05-27 17:02:47 -07:00
ice_type.h ice: add flags indicating pending update of firmware module 2020-07-28 17:07:06 -07:00
ice_virtchnl_pf.c ice: Add advanced power mgmt for WoL 2020-07-23 14:59:20 -07:00
ice_virtchnl_pf.h ice: support adding 16 unicast/multicast filter on untrusted VF 2020-05-31 03:36:06 -07:00
ice_xsk.c ice: replace single-element array used for C struct hack 2020-07-01 16:35:23 -07:00
ice_xsk.h ice, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL 2020-05-21 17:31:26 -07:00
ice.h ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00
Makefile ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00