iosm.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ====================
  3. iosm devlink support
  4. ====================
  5. This document describes the devlink features implemented by the ``iosm``
  6. device driver.
  7. Parameters
  8. ==========
  9. The ``iosm`` driver implements the following driver-specific parameters.
  10. .. list-table:: Driver-specific parameters implemented
  11. :widths: 5 5 5 85
  12. * - Name
  13. - Type
  14. - Mode
  15. - Description
  16. * - ``erase_full_flash``
  17. - u8
  18. - runtime
  19. - erase_full_flash parameter is used to check if full erase is required for
  20. the device during firmware flashing.
  21. If set, Full nand erase command will be sent to the device. By default,
  22. only conditional erase support is enabled.
  23. Flash Update
  24. ============
  25. The ``iosm`` driver implements support for flash update using the
  26. ``devlink-flash`` interface.
  27. It supports updating the device flash using a combined flash image which contains
  28. the Bootloader images and other modem software images.
  29. The driver uses DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT to identify type of
  30. firmware image that need to be flashed as requested by user space application.
  31. Supported firmware image types.
  32. .. list-table:: Firmware Image types
  33. :widths: 15 85
  34. * - Name
  35. - Description
  36. * - ``PSI RAM``
  37. - Primary Signed Image
  38. * - ``EBL``
  39. - External Bootloader
  40. * - ``FLS``
  41. - Modem Software Image
  42. PSI RAM and EBL are the RAM images which are injected to the device when the
  43. device is in BOOT ROM stage. Once this is successful, the actual modem firmware
  44. image is flashed to the device. The modem software image contains multiple files
  45. each having one secure bin file and at least one Loadmap/Region file. For flashing
  46. these files, appropriate commands are sent to the modem device along with the
  47. data required for flashing. The data like region count and address of each region
  48. has to be passed to the driver using the devlink param command.
  49. If the device has to be fully erased before firmware flashing, user application
  50. need to set the erase_full_flash parameter using devlink param command.
  51. By default, conditional erase feature is supported.
  52. Flash Commands:
  53. ===============
  54. 1) When modem is in Boot ROM stage, user can use below command to inject PSI RAM
  55. image using devlink flash command.
  56. $ devlink dev flash pci/0000:02:00.0 file <PSI_RAM_File_name>
  57. 2) If user want to do a full erase, below command need to be issued to set the
  58. erase full flash param (To be set only if full erase required).
  59. $ devlink dev param set pci/0000:02:00.0 name erase_full_flash value true cmode runtime
  60. 3) Inject EBL after the modem is in PSI stage.
  61. $ devlink dev flash pci/0000:02:00.0 file <EBL_File_name>
  62. 4) Once EBL is injected successfully, then the actual firmware flashing takes
  63. place. Below is the sequence of commands used for each of the firmware images.
  64. a) Flash secure bin file.
  65. $ devlink dev flash pci/0000:02:00.0 file <Secure_bin_file_name>
  66. b) Flashing the Loadmap/Region file
  67. $ devlink dev flash pci/0000:02:00.0 file <Load_map_file_name>
  68. Regions
  69. =======
  70. The ``iosm`` driver supports dumping the coredump logs.
  71. In case a firmware encounters an exception, a snapshot will be taken by the
  72. driver. Following regions are accessed for device internal data.
  73. .. list-table:: Regions implemented
  74. :widths: 15 85
  75. * - Name
  76. - Description
  77. * - ``report.json``
  78. - The summary of exception details logged as part of this region.
  79. * - ``coredump.fcd``
  80. - This region contains the details related to the exception occurred in the
  81. device (RAM dump).
  82. * - ``cdd.log``
  83. - This region contains the logs related to the modem CDD driver.
  84. * - ``eeprom.bin``
  85. - This region contains the eeprom logs.
  86. * - ``bootcore_trace.bin``
  87. - This region contains the current instance of bootloader logs.
  88. * - ``bootcore_prev_trace.bin``
  89. - This region contains the previous instance of bootloader logs.
  90. Region commands
  91. ===============
  92. $ devlink region show
  93. $ devlink region new pci/0000:02:00.0/report.json
  94. $ devlink region dump pci/0000:02:00.0/report.json snapshot 0
  95. $ devlink region del pci/0000:02:00.0/report.json snapshot 0
  96. $ devlink region new pci/0000:02:00.0/coredump.fcd
  97. $ devlink region dump pci/0000:02:00.0/coredump.fcd snapshot 1
  98. $ devlink region del pci/0000:02:00.0/coredump.fcd snapshot 1
  99. $ devlink region new pci/0000:02:00.0/cdd.log
  100. $ devlink region dump pci/0000:02:00.0/cdd.log snapshot 2
  101. $ devlink region del pci/0000:02:00.0/cdd.log snapshot 2
  102. $ devlink region new pci/0000:02:00.0/eeprom.bin
  103. $ devlink region dump pci/0000:02:00.0/eeprom.bin snapshot 3
  104. $ devlink region del pci/0000:02:00.0/eeprom.bin snapshot 3
  105. $ devlink region new pci/0000:02:00.0/bootcore_trace.bin
  106. $ devlink region dump pci/0000:02:00.0/bootcore_trace.bin snapshot 4
  107. $ devlink region del pci/0000:02:00.0/bootcore_trace.bin snapshot 4
  108. $ devlink region new pci/0000:02:00.0/bootcore_prev_trace.bin
  109. $ devlink region dump pci/0000:02:00.0/bootcore_prev_trace.bin snapshot 5
  110. $ devlink region del pci/0000:02:00.0/bootcore_prev_trace.bin snapshot 5