1.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 3============================================= 4Netronome Flow Processor (NFP) Kernel Drivers 5============================================= 6 7Copyright (c) 2019, Netronome Systems, Inc. 8 9Contents 10======== 11 12- `Overview`_ 13- `Acquiring Firmware`_ 14 15Overview 16======== 17 18This driver supports Netronome's line of Flow Processor devices, 19including the NFP4000, NFP5000, and NFP6000 models, which are also 20incorporated in the company's family of Agilio SmartNICs. The SR-IOV 21physical and virtual functions for these devices are supported by 22the driver. 23 24Acquiring Firmware 25================== 26 27The NFP4000 and NFP6000 devices require application specific firmware 28to function. Application firmware can be located either on the host file system 29or in the device flash (if supported by management firmware). 30 31Firmware files on the host filesystem contain card type (`AMDA-*` string), media 32config etc. They should be placed in `/lib/firmware/netronome` directory to 33load firmware from the host file system. 34 35Firmware for basic NIC operation is available in the upstream 36`linux-firmware.git` repository. 37 38Firmware in NVRAM 39----------------- 40 41Recent versions of management firmware supports loading application 42firmware from flash when the host driver gets probed. The firmware loading 43policy configuration may be used to configure this feature appropriately. 44 45Devlink or ethtool can be used to update the application firmware on the device 46flash by providing the appropriate `nic_AMDA*.nffw` file to the respective 47command. Users need to take care to write the correct firmware image for the 48card and media configuration to flash. 49 50Available storage space in flash depends on the card being used. 51 52Dealing with multiple projects 53------------------------------ 54 55NFP hardware is fully programmable therefore there can be different 56firmware images targeting different applications. 57 58When using application firmware from host, we recommend placing 59actual firmware files in application-named subdirectories in 60`/lib/firmware/netronome` and linking the desired files, e.g.:: 61 62 $ tree /lib/firmware/netronome/ 63 /lib/firmware/netronome/ 64 ├── bpf 65 │ ├── nic_AMDA0081-0001_1x40.nffw 66 │ └── nic_AMDA0081-0001_4x10.nffw 67 ├── flower 68 │ ├── nic_AMDA0081-0001_1x40.nffw 69 │ └── nic_AMDA0081-0001_4x10.nffw 70 ├── nic 71 │ ├── nic_AMDA0081-0001_1x40.nffw 72 │ └── nic_AMDA0081-0001_4x10.nffw 73 ├── nic_AMDA0081-0001_1x40.nffw -> bpf/nic_AMDA0081-0001_1x40.nffw 74 └── nic_AMDA0081-0001_4x10.nffw -> bpf/nic_AMDA0081-0001_4x10.nffw 75 76 3 directories, 8 files 77 78You may need to use hard instead of symbolic links on distributions 79which use old `mkinitrd` command instead of `dracut` (e.g. Ubuntu). 80 81After changing firmware files you may need to regenerate the initramfs 82image. Initramfs contains drivers and firmware files your system may 83need to boot. Refer to the documentation of your distribution to find 84out how to update initramfs. Good indication of stale initramfs 85is system loading wrong driver or firmware on boot, but when driver is 86later reloaded manually everything works correctly. 87 88Selecting firmware per device 89----------------------------- 90 91Most commonly all cards on the system use the same type of firmware. 92If you want to load specific firmware image for a specific card, you 93can use either the PCI bus address or serial number. Driver will print 94which files it's looking for when it recognizes a NFP device:: 95 96 nfp: Looking for firmware file in order of priority: 97 nfp: netronome/serial-00-12-34-aa-bb-cc-10-ff.nffw: not found 98 nfp: netronome/pci-0000:02:00.0.nffw: not found 99 nfp: netronome/nic_AMDA0081-0001_1x40.nffw: found, loading... 100 101In this case if file (or link) called *serial-00-12-34-aa-bb-5d-10-ff.nffw* 102or *pci-0000:02:00.0.nffw* is present in `/lib/firmware/netronome` this 103firmware file will take precedence over `nic_AMDA*` files. 104 105Note that `serial-*` and `pci-*` files are **not** automatically included 106in initramfs, you will have to refer to documentation of appropriate tools 107to find out how to include them. 108 109Firmware loading policy 110----------------------- 111 112Firmware loading policy is controlled via three HWinfo parameters 113stored as key value pairs in the device flash: 114 115app_fw_from_flash 116 Defines which firmware should take precedence, 'Disk' (0), 'Flash' (1) or 117 the 'Preferred' (2) firmware. When 'Preferred' is selected, the management 118 firmware makes the decision over which firmware will be loaded by comparing 119 versions of the flash firmware and the host supplied firmware. 120 This variable is configurable using the 'fw_load_policy' 121 devlink parameter. 122 123abi_drv_reset 124 Defines if the driver should reset the firmware when 125 the driver is probed, either 'Disk' (0) if firmware was found on disk, 126 'Always' (1) reset or 'Never' (2) reset. Note that the device is always 127 reset on driver unload if firmware was loaded when the driver was probed. 128 This variable is configurable using the 'reset_dev_on_drv_probe' 129 devlink parameter. 130 131abi_drv_load_ifc 132 Defines a list of PF devices allowed to load FW on the device. 133 This variable is not currently user configurable. 134