162306a36Sopenharmony_ci.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 262306a36Sopenharmony_ci 362306a36Sopenharmony_ci============ 462306a36Sopenharmony_ciDevlink Info 562306a36Sopenharmony_ci============ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ciThe ``devlink-info`` mechanism enables device drivers to report device 862306a36Sopenharmony_ci(hardware and firmware) information in a standard, extensible fashion. 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ciThe original motivation for the ``devlink-info`` API was twofold: 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci - making it possible to automate device and firmware management in a fleet 1362306a36Sopenharmony_ci of machines in a vendor-independent fashion (see also 1462306a36Sopenharmony_ci :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`); 1562306a36Sopenharmony_ci - name the per component FW versions (as opposed to the crowded ethtool 1662306a36Sopenharmony_ci version string). 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci``devlink-info`` supports reporting multiple types of objects. Reporting driver 1962306a36Sopenharmony_civersions is generally discouraged - here, and via any other Linux API. 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci.. list-table:: List of top level info objects 2262306a36Sopenharmony_ci :widths: 5 95 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci * - Name 2562306a36Sopenharmony_ci - Description 2662306a36Sopenharmony_ci * - ``driver`` 2762306a36Sopenharmony_ci - Name of the currently used device driver, also available through sysfs. 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci * - ``serial_number`` 3062306a36Sopenharmony_ci - Serial number of the device. 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci This is usually the serial number of the ASIC, also often available 3362306a36Sopenharmony_ci in PCI config space of the device in the *Device Serial Number* 3462306a36Sopenharmony_ci capability. 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci The serial number should be unique per physical device. 3762306a36Sopenharmony_ci Sometimes the serial number of the device is only 48 bits long (the 3862306a36Sopenharmony_ci length of the Ethernet MAC address), and since PCI DSN is 64 bits long 3962306a36Sopenharmony_ci devices pad or encode additional information into the serial number. 4062306a36Sopenharmony_ci One example is adding port ID or PCI interface ID in the extra two bytes. 4162306a36Sopenharmony_ci Drivers should make sure to strip or normalize any such padding 4262306a36Sopenharmony_ci or interface ID, and report only the part of the serial number 4362306a36Sopenharmony_ci which uniquely identifies the hardware. In other words serial number 4462306a36Sopenharmony_ci reported for two ports of the same device or on two hosts of 4562306a36Sopenharmony_ci a multi-host device should be identical. 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci * - ``board.serial_number`` 4862306a36Sopenharmony_ci - Board serial number of the device. 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci This is usually the serial number of the board, often available in 5162306a36Sopenharmony_ci PCI *Vital Product Data*. 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci * - ``fixed`` 5462306a36Sopenharmony_ci - Group for hardware identifiers, and versions of components 5562306a36Sopenharmony_ci which are not field-updatable. 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci Versions in this section identify the device design. For example, 5862306a36Sopenharmony_ci component identifiers or the board version reported in the PCI VPD. 5962306a36Sopenharmony_ci Data in ``devlink-info`` should be broken into the smallest logical 6062306a36Sopenharmony_ci components, e.g. PCI VPD may concatenate various information 6162306a36Sopenharmony_ci to form the Part Number string, while in ``devlink-info`` all parts 6262306a36Sopenharmony_ci should be reported as separate items. 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci This group must not contain any frequently changing identifiers, 6562306a36Sopenharmony_ci such as serial numbers. See 6662306a36Sopenharmony_ci :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>` 6762306a36Sopenharmony_ci to understand why. 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci * - ``running`` 7062306a36Sopenharmony_ci - Group for information about currently running software/firmware. 7162306a36Sopenharmony_ci These versions often only update after a reboot, sometimes device reset. 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci * - ``stored`` 7462306a36Sopenharmony_ci - Group for software/firmware versions in device flash. 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ci Stored values must update to reflect changes in the flash even 7762306a36Sopenharmony_ci if reboot has not yet occurred. If device is not capable of updating 7862306a36Sopenharmony_ci ``stored`` versions when new software is flashed, it must not report 7962306a36Sopenharmony_ci them. 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ciEach version can be reported at most once in each version group. Firmware 8262306a36Sopenharmony_cicomponents stored on the flash should feature in both the ``running`` and 8362306a36Sopenharmony_ci``stored`` sections, if device is capable of reporting ``stored`` versions 8462306a36Sopenharmony_ci(see :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`). 8562306a36Sopenharmony_ciIn case software/firmware components are loaded from the disk (e.g. 8662306a36Sopenharmony_ci``/lib/firmware``) only the running version should be reported via 8762306a36Sopenharmony_cithe kernel API. 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ciGeneric Versions 9062306a36Sopenharmony_ci================ 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ciIt is expected that drivers use the following generic names for exporting 9362306a36Sopenharmony_civersion information. If a generic name for a given component doesn't exist yet, 9462306a36Sopenharmony_cidriver authors should consult existing driver-specific versions and attempt 9562306a36Sopenharmony_cireuse. As last resort, if a component is truly unique, using driver-specific 9662306a36Sopenharmony_cinames is allowed, but these should be documented in the driver-specific file. 9762306a36Sopenharmony_ci 9862306a36Sopenharmony_ciAll versions should try to use the following terminology: 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci.. list-table:: List of common version suffixes 10162306a36Sopenharmony_ci :widths: 10 90 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci * - Name 10462306a36Sopenharmony_ci - Description 10562306a36Sopenharmony_ci * - ``id``, ``revision`` 10662306a36Sopenharmony_ci - Identifiers of designs and revision, mostly used for hardware versions. 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci * - ``api`` 10962306a36Sopenharmony_ci - Version of API between components. API items are usually of limited 11062306a36Sopenharmony_ci value to the user, and can be inferred from other versions by the vendor, 11162306a36Sopenharmony_ci so adding API versions is generally discouraged as noise. 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci * - ``bundle_id`` 11462306a36Sopenharmony_ci - Identifier of a distribution package which was flashed onto the device. 11562306a36Sopenharmony_ci This is an attribute of a firmware package which covers multiple versions 11662306a36Sopenharmony_ci for ease of managing firmware images (see 11762306a36Sopenharmony_ci :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`). 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci ``bundle_id`` can appear in both ``running`` and ``stored`` versions, 12062306a36Sopenharmony_ci but it must not be reported if any of the components covered by the 12162306a36Sopenharmony_ci ``bundle_id`` was changed and no longer matches the version from 12262306a36Sopenharmony_ci the bundle. 12362306a36Sopenharmony_ci 12462306a36Sopenharmony_ciboard.id 12562306a36Sopenharmony_ci-------- 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_ciUnique identifier of the board design. 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ciboard.rev 13062306a36Sopenharmony_ci--------- 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ciBoard design revision. 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ciasic.id 13562306a36Sopenharmony_ci------- 13662306a36Sopenharmony_ci 13762306a36Sopenharmony_ciASIC design identifier. 13862306a36Sopenharmony_ci 13962306a36Sopenharmony_ciasic.rev 14062306a36Sopenharmony_ci-------- 14162306a36Sopenharmony_ci 14262306a36Sopenharmony_ciASIC design revision/stepping. 14362306a36Sopenharmony_ci 14462306a36Sopenharmony_ciboard.manufacture 14562306a36Sopenharmony_ci----------------- 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ciAn identifier of the company or the facility which produced the part. 14862306a36Sopenharmony_ci 14962306a36Sopenharmony_cifw 15062306a36Sopenharmony_ci-- 15162306a36Sopenharmony_ci 15262306a36Sopenharmony_ciOverall firmware version, often representing the collection of 15362306a36Sopenharmony_cifw.mgmt, fw.app, etc. 15462306a36Sopenharmony_ci 15562306a36Sopenharmony_cifw.mgmt 15662306a36Sopenharmony_ci------- 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ciControl unit firmware version. This firmware is responsible for house 15962306a36Sopenharmony_cikeeping tasks, PHY control etc. but not the packet-by-packet data path 16062306a36Sopenharmony_cioperation. 16162306a36Sopenharmony_ci 16262306a36Sopenharmony_cifw.mgmt.api 16362306a36Sopenharmony_ci----------- 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ciFirmware interface specification version of the software interfaces between 16662306a36Sopenharmony_cidriver and firmware. 16762306a36Sopenharmony_ci 16862306a36Sopenharmony_cifw.app 16962306a36Sopenharmony_ci------ 17062306a36Sopenharmony_ci 17162306a36Sopenharmony_ciData path microcode controlling high-speed packet processing. 17262306a36Sopenharmony_ci 17362306a36Sopenharmony_cifw.undi 17462306a36Sopenharmony_ci------- 17562306a36Sopenharmony_ci 17662306a36Sopenharmony_ciUNDI software, may include the UEFI driver, firmware or both. 17762306a36Sopenharmony_ci 17862306a36Sopenharmony_cifw.ncsi 17962306a36Sopenharmony_ci------- 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ciVersion of the software responsible for supporting/handling the 18262306a36Sopenharmony_ciNetwork Controller Sideband Interface. 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_cifw.psid 18562306a36Sopenharmony_ci------- 18662306a36Sopenharmony_ci 18762306a36Sopenharmony_ciUnique identifier of the firmware parameter set. These are usually 18862306a36Sopenharmony_ciparameters of a particular board, defined at manufacturing time. 18962306a36Sopenharmony_ci 19062306a36Sopenharmony_cifw.roce 19162306a36Sopenharmony_ci------- 19262306a36Sopenharmony_ci 19362306a36Sopenharmony_ciRoCE firmware version which is responsible for handling roce 19462306a36Sopenharmony_cimanagement. 19562306a36Sopenharmony_ci 19662306a36Sopenharmony_cifw.bundle_id 19762306a36Sopenharmony_ci------------ 19862306a36Sopenharmony_ci 19962306a36Sopenharmony_ciUnique identifier of the entire firmware bundle. 20062306a36Sopenharmony_ci 20162306a36Sopenharmony_cifw.bootloader 20262306a36Sopenharmony_ci------------- 20362306a36Sopenharmony_ci 20462306a36Sopenharmony_ciVersion of the bootloader. 20562306a36Sopenharmony_ci 20662306a36Sopenharmony_ciFuture work 20762306a36Sopenharmony_ci=========== 20862306a36Sopenharmony_ci 20962306a36Sopenharmony_ciThe following extensions could be useful: 21062306a36Sopenharmony_ci 21162306a36Sopenharmony_ci - on-disk firmware file names - drivers list the file names of firmware they 21262306a36Sopenharmony_ci may need to load onto devices via the ``MODULE_FIRMWARE()`` macro. These, 21362306a36Sopenharmony_ci however, are per module, rather than per device. It'd be useful to list 21462306a36Sopenharmony_ci the names of firmware files the driver will try to load for a given device, 21562306a36Sopenharmony_ci in order of priority. 216