Skip to content

Commit d172e7f

Browse files
dwmw2David Woodhouse
authored andcommitted
firmware: Add CONFIG_FIRMWARE_IN_KERNEL option.
This will control whether we build firmware into the kernel image for _every_ driver which we convert to request_firmware(), to avoid a proliferation of 'CONFIG_XXX_FIRMWARE' options for each one. Default to 'y' for now, which is the wrong thing to do but people seem to be insisting on it and refusing to even review patches until it's done. And it does preserve the existing behaviour for built-in drivers. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
1 parent 4d2acfb commit d172e7f

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎drivers/base/Kconfig‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,31 @@ config FW_LOADER
3434
require userspace firmware loading support, but a module built outside
3535
the kernel tree does.
3636

37+
config FIRMWARE_IN_KERNEL
38+
bool "Include in-kernel firmware blobs in kernel binary"
39+
depends on FW_LOADER
40+
default y
41+
help
42+
The kernel source tree includes a number of firmware 'blobs'
43+
which are used by various drivers. The recommended way to
44+
use these is to run "make firmware_install" and to copy the
45+
resulting binary files created in usr/lib/firmware directory
46+
of the kernel tree to the /lib/firmware on your system so
47+
that they can be loaded by userspace helpers on request.
48+
49+
Enabling this option will build each required firmware blob
50+
into the kernel directly, where request_firmware() will find
51+
them without having to call out to userspace. This may be
52+
useful if your root file system requires a device which uses
53+
such firmware, and do not wish to use an initrd.
54+
55+
This single option controls the inclusion of firmware for
56+
every driver which usees request_firmare() and ships its
57+
firmware in the kernel source tree, to avoid a proliferation
58+
of 'Include firmware for xxx device' options.
59+
60+
Say 'N' and let firmware be loaded from userspace.
61+
3762
config EXTRA_FIRMWARE
3863
string "External firmware blobs to build into the kernel binary"
3964
depends on FW_LOADER

‎firmware/Makefile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ fwabs := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir))
99

1010
fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE))
1111

12+
# If CONFIG_FIRMWARE_IN_KERNEL is not set, then don't include any firmware
13+
ifneq ($(CONFIG_FIRMWARE_IN_KERNEL),y)
14+
fw-shipped-y :=
15+
endif
16+
1217
firmware-y := $(fw-external-y) $(fw-shipped-y)
1318
firmware-dirs := $(sort $(patsubst %,$(objtree)/$(obj)/%/,$(dir $(firmware-y) $(fw-shipped-))))
1419

0 commit comments

Comments
 (0)