7

I've learned that the firmware-subsystem uses udevd to copy a firmware to the created sysfs 'data' entry.

But how does this work in case of a built-in driver module where udevd hasn't started yet?

I'am using a 3.14 Kernel.

TIA!

  • 2
    Check CONFIG_EXTRA_FIRMWARE, CONFIG_EXTRA_FIRMWARE_DIR and CONFIG_FIRMWARE_IN_KERNEL. These kernel config option can be used to build the kernel binary with inbult firmware. And then it can be fetched by request_firmware("firmware_name.bin"). – Sanket Parmar Feb 12 '16 at 8:12
  • 1
    Thanks for the quick replies. @Rui F Ribeiro initialization and load onto the device is then driver depended. – steffenp Feb 12 '16 at 8:39
  • 1
    Loading into the device, and how the device is initialized, is certainly device-dependent. How to get the firmware into the driver's hands is standarized as much as possible, for obvious reasons. – vonbrand Feb 12 '16 at 12:50
  • 1
    @EightBitTony your right. I realized that my question must rather be "is udevd really required for request_firmware()". Additionally I found this on LKML – steffenp Feb 12 '16 at 13:19
  • 1
    @vonbrand exactly. Maybe this was a bit misleading: My question only refers to this 'standarized firmware loading process' provided by the kernel. – steffenp Feb 12 '16 at 13:24
1

I read through the kernel sources, especially drivers/base/firmware_class.c, and discovered that

CONFIG_FW_LOADER_USER_HELPER 

would activate the udev firmware loading variant (obviously only usable for loadable modules when udev is running). But as mentioned on LKML this seems to be an obsolete method.

Furthermore firmware required by built-in modules is loaded from initramfs by fw_get_filesystem_firmware() through a kernel_read(), to be precise.

|improve this answer|||||
0

It is possible to build firmware images into the kernel itself by using the CONFIG_FIRMWARE_IN_KERNEL, CONFIG_EXTRA_FIRMWARE_DIR, and CONFIG_EXTRA_FIRMWARE kernel config options. This may be useful for cases where you either cannot or don't want to provide the firmware from userspace at runtime (for example, when the firmware in question is required for accessing the boot device, and you don't want to use an initrd).

Here's a more detailed explanation of the available options for firmware loading: https://wiki.tizen.org/wiki/Usage_and_Mechanism_of_kernel_function_%22request_firmware()%22#Load_firmware_from_kernel_image

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.