Skip to content
  1. Dec 16, 2021
    • Jacob Keller's avatar
      ice: reduce time to read Option ROM CIVD data · af18d886
      Jacob Keller authored
      
      
      During probe and device reset, the ice driver reads some data from the
      NVM image as part of ice_init_nvm. Part of this data includes a section
      of the Option ROM which contains version information.
      
      The function ice_get_orom_civd_data is used to locate the '$CIV' data
      section of the Option ROM.
      
      Timing of ice_probe and ice_rebuild indicate that the
      ice_get_orom_civd_data function takes about 10 seconds to finish
      executing.
      
      The function locates the section by scanning the Option ROM every 512
      bytes. This requires a significant number of NVM read accesses, since
      the Option ROM bank is 500KB. In the worst case it would take about 1000
      reads. Worse, all PFs serialize this operation during reload because of
      acquiring the NVM semaphore.
      
      The CIVD section is located at the end of the Option ROM image data.
      Unfortunately, the driver has no easy method to determine the offset
      manually. Practical experiments have shown that the data could be at
      a variety of locations, so simply reversing the scanning order is not
      sufficient to reduce the overall read time.
      
      Instead, copy the entire contents of the Option ROM into memory. This
      allows reading the data using 4Kb pages instead of 512 bytes at a time.
      This reduces the total number of firmware commands by a factor of 8. In
      addition, reading the whole section together at once allows better
      indication to firmware of when we're "done".
      
      Re-write ice_get_orom_civd_data to allocate virtual memory to store the
      Option ROM data. Copy the entire OptionROM contents at once using
      ice_read_flash_module. Finally, use this memory copy to scan for the
      '$CIV' section.
      
      This change significantly reduces the time to read the Option ROM CIVD
      section from ~10 seconds down to ~1 second. This has a significant
      impact on the total time to complete a driver rebuild or probe.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      af18d886
    • Jacob Keller's avatar
      ice: move ice_devlink_flash_update and merge with ice_flash_pldm_image · c9f7a483
      Jacob Keller authored
      
      
      The ice_devlink_flash_update function performs a few upfront checks and
      then calls ice_flash_pldm_image.
      
      Most if these checks make more sense in the context of code within
      ice_flash_pldm_image. Merge ice_devlink_flash_update and
      ice_flash_pldm_image into one function, placing it in ice_fw_update.c
      
      Since this is still the entry point for devlink, call the function
      ice_devlink_flash_update instead of ice_flash_pldm_image. This leaves a
      single function which handles the devlink parameters and then initiates
      a PLDM update.
      
      With this change, the ice_devlink_flash_update function in
      ice_fw_update.c becomes the main entry point for flash update. It
      elimintes some unnecessary boiler plate code between the two previous
      functions. The ultimate motivation for this is that it eases supporting
      a dry run with the PLDM library in a future change.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      c9f7a483
    • Jacob Keller's avatar
      ice: move and rename ice_check_for_pending_update · c356eaa8
      Jacob Keller authored
      
      
      The ice_devlink_flash_update function performs a few checks and then
      calls ice_flash_pldm_image. One of these checks is to call
      ice_check_for_pending_update. This function checks if the device has
      a pending update, and cancels it if so. This is necessary to allow
      a new flash update to proceed.
      
      We want to refactor the ice code to eliminate ice_devlink_flash_update,
      moving its checks into ice_flash_pldm_image.
      
      To do this, ice_check_for_pending_update will become static, and only
      called by ice_flash_pldm_image. To make this change easier to review,
      first just move the function up within the ice_fw_update.c file.
      
      While at it, note that the function has a misleading name. Its primary
      action is to cancel a pending update. Using the verb "check" does not
      imply this. Rename it to ice_cancel_pending_update.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      c356eaa8
    • Jacob Keller's avatar
      ice: devlink: add shadow-ram region to snapshot Shadow RAM · 78ad87da
      Jacob Keller authored
      
      
      We have a region for reading the contents of the NVM flash as
      a snapshot. This region does not allow reading the Shadow RAM, as it
      always passes the FLASH_ONLY bit to the low level firmware interface.
      
      Add a separate shadow-ram region which will allow snapshot of the
      current contents of the Shadow RAM. This data is built from the NVM
      contents but is distinct as the device builds up the Shadow RAM during
      initialization, so being able to snapshot its contents can be useful
      when attempting to debug flash related issues.
      
      Fix the comment description of the nvm-flash region which incorrectly
      stated that it filled the shadow-ram region, and add a comment
      explaining that the nvm-flash region does not actually read the Shadow
      RAM.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      78ad87da
  2. Dec 15, 2021