Kconfig 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. menu "Firmware loader"
  2. config FW_LOADER
  3. tristate "Firmware loading facility" if EXPERT
  4. default y
  5. help
  6. This enables the firmware loading facility in the kernel. The kernel
  7. will first look for built-in firmware, if it has any. Next, it will
  8. look for the requested firmware in a series of filesystem paths:
  9. o firmware_class path module parameter or kernel boot param
  10. o /lib/firmware/updates/UTS_RELEASE
  11. o /lib/firmware/updates
  12. o /lib/firmware/UTS_RELEASE
  13. o /lib/firmware
  14. Enabling this feature only increases your kernel image by about
  15. 828 bytes, enable this option unless you are certain you don't
  16. need firmware.
  17. You typically want this built-in (=y) but you can also enable this
  18. as a module, in which case the firmware_class module will be built.
  19. You also want to be sure to enable this built-in if you are going to
  20. enable built-in firmware (CONFIG_EXTRA_FIRMWARE).
  21. if FW_LOADER
  22. config EXTRA_FIRMWARE
  23. string "Build named firmware blobs into the kernel binary"
  24. help
  25. Device drivers which require firmware can typically deal with
  26. having the kernel load firmware from the various supported
  27. /lib/firmware/ paths. This option enables you to build into the
  28. kernel firmware files. Built-in firmware searches are preceded
  29. over firmware lookups using your filesystem over the supported
  30. /lib/firmware paths documented on CONFIG_FW_LOADER.
  31. This may be useful for testing or if the firmware is required early on
  32. in boot and cannot rely on the firmware being placed in an initrd or
  33. initramfs.
  34. This option is a string and takes the (space-separated) names of the
  35. firmware files -- the same names that appear in MODULE_FIRMWARE()
  36. and request_firmware() in the source. These files should exist under
  37. the directory specified by the EXTRA_FIRMWARE_DIR option, which is
  38. /lib/firmware by default.
  39. For example, you might set CONFIG_EXTRA_FIRMWARE="usb8388.bin", copy
  40. the usb8388.bin file into /lib/firmware, and build the kernel. Then
  41. any request_firmware("usb8388.bin") will be satisfied internally
  42. inside the kernel without ever looking at your filesystem at runtime.
  43. WARNING: If you include additional firmware files into your binary
  44. kernel image that are not available under the terms of the GPL,
  45. then it may be a violation of the GPL to distribute the resulting
  46. image since it combines both GPL and non-GPL work. You should
  47. consult a lawyer of your own before distributing such an image.
  48. config EXTRA_FIRMWARE_DIR
  49. string "Firmware blobs root directory"
  50. depends on EXTRA_FIRMWARE != ""
  51. default "/lib/firmware"
  52. help
  53. This option controls the directory in which the kernel build system
  54. looks for the firmware files listed in the EXTRA_FIRMWARE option.
  55. config FW_LOADER_USER_HELPER
  56. bool "Enable the firmware sysfs fallback mechanism"
  57. help
  58. This option enables a sysfs loading facility to enable firmware
  59. loading to the kernel through userspace as a fallback mechanism
  60. if and only if the kernel's direct filesystem lookup for the
  61. firmware failed using the different /lib/firmware/ paths, or the
  62. path specified in the firmware_class path module parameter, or the
  63. firmware_class path kernel boot parameter if the firmware_class is
  64. built-in. For details on how to work with the sysfs fallback mechanism
  65. refer to Documentation/driver-api/firmware/fallback-mechanisms.rst.
  66. The direct filesystem lookup for firmware is always used first now.
  67. If the kernel's direct filesystem lookup for firmware fails to find
  68. the requested firmware a sysfs fallback loading facility is made
  69. available and userspace is informed about this through uevents.
  70. The uevent can be suppressed if the driver explicitly requested it,
  71. this is known as the driver using the custom fallback mechanism.
  72. If the custom fallback mechanism is used userspace must always
  73. acknowledge failure to find firmware as the timeout for the fallback
  74. mechanism is disabled, and failed requests will linger forever.
  75. This used to be the default firmware loading facility, and udev used
  76. to listen for uvents to load firmware for the kernel. The firmware
  77. loading facility functionality in udev has been removed, as such it
  78. can no longer be relied upon as a fallback mechanism. Linux no longer
  79. relies on or uses a fallback mechanism in userspace. If you need to
  80. rely on one refer to the permissively licensed firmwared:
  81. https://github.com/teg/firmwared
  82. Since this was the default firmware loading facility at one point,
  83. old userspace may exist which relies upon it, and as such this
  84. mechanism can never be removed from the kernel.
  85. You should only enable this functionality if you are certain you
  86. require a fallback mechanism and have a userspace mechanism ready to
  87. load firmware in case it is not found. One main reason for this may
  88. be if you have drivers which require firmware built-in and for
  89. whatever reason cannot place the required firmware in initramfs.
  90. Another reason kernels may have this feature enabled is to support a
  91. driver which explicitly relies on this fallback mechanism. Only two
  92. drivers need this today:
  93. o CONFIG_LEDS_LP55XX_COMMON
  94. o CONFIG_DELL_RBU
  95. Outside of supporting the above drivers, another reason for needing
  96. this may be that your firmware resides outside of the paths the kernel
  97. looks for and cannot possibly be specified using the firmware_class
  98. path module parameter or kernel firmware_class path boot parameter
  99. if firmware_class is built-in.
  100. A modern use case may be to temporarily mount a custom partition
  101. during provisioning which is only accessible to userspace, and then
  102. to use it to look for and fetch the required firmware. Such type of
  103. driver functionality may not even ever be desirable upstream by
  104. vendors, and as such is only required to be supported as an interface
  105. for provisioning. Since udev's firmware loading facility has been
  106. removed you can use firmwared or a fork of it to customize how you
  107. want to load firmware based on uevents issued.
  108. Enabling this option will increase your kernel image size by about
  109. 13436 bytes.
  110. If you are unsure about this, say N here, unless you are Linux
  111. distribution and need to support the above two drivers, or you are
  112. certain you need to support some really custom firmware loading
  113. facility in userspace.
  114. config FW_LOADER_USER_HELPER_FALLBACK
  115. bool "Force the firmware sysfs fallback mechanism when possible"
  116. depends on FW_LOADER_USER_HELPER
  117. help
  118. Enabling this option forces a sysfs userspace fallback mechanism
  119. to be used for all firmware requests which explicitly do not disable a
  120. a fallback mechanism. Firmware calls which do prohibit a fallback
  121. mechanism is request_firmware_direct(). This option is kept for
  122. backward compatibility purposes given this precise mechanism can also
  123. be enabled by setting the proc sysctl value to true:
  124. /proc/sys/kernel/firmware_config/force_sysfs_fallback
  125. If you are unsure about this, say N here.
  126. endif # FW_LOADER
  127. endmenu