net/ice/base: implement inactive NVM version get
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 15 Dec 2020 02:44:39 +0000 (10:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 15:03:06 +0000 (16:03 +0100)
commit3c66b6c531f777bb288c6ce807d25568f700859d
tree7b6d9376312ecc8a5a3551993c218ef6988c461c
parentb1d08cb258cd3e7757f2727381f59fa66d9d78b5
net/ice/base: implement inactive NVM version get

Similar to ice_get_inactive_orom_ver, add a function to read the NVM
version data from the inactive section of flash. The primary motivation
of this function is to allow the driver to report the version of
a pending update that has not yet been activated.

To do this, refactor ice_get_nvm_ver_info to allow it to take a bank
parameter. Read from the copy of the Shadow RAM in the NVM bank, rather
than reading from the RAM copy that is loaded by the device. This
ensures we get the accurate value when reading the inactive section.

Note that the start of the Shadow RAM copy is not directly following the
CSS header, but is actually aligned to the next 64-byte boundary. The
correct word offset must be rounded up to 32-bytes.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_nvm.c
drivers/net/ice/base/ice_nvm.h
drivers/net/ice/base/ice_type.h