From patchwork Fri Apr 23 18:58:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Voss X-Patchwork-Id: 1469772 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rockwellcollins.com header.i=@rockwellcollins.com header.a=rsa-sha256 header.s=hrcrc2020 header.b=KQ7z7cA/; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FRk8t2vdQz9sVb for ; Sat, 24 Apr 2021 04:58:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B9030605CB; Fri, 23 Apr 2021 18:58:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0hz4uPUJu0QO; Fri, 23 Apr 2021 18:58:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 11E13605DE; Fri, 23 Apr 2021 18:58:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D59681BF476 for ; Fri, 23 Apr 2021 18:58:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id D1F3283CB9 for ; Fri, 23 Apr 2021 18:58:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=rockwellcollins.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jFxdmVa_QYu5 for ; Fri, 23 Apr 2021 18:58:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from secvs04.rockwellcollins.com (secvs04.rockwellcollins.com [205.175.225.130]) by smtp1.osuosl.org (Postfix) with ESMTPS id 653D283CB7 for ; Fri, 23 Apr 2021 18:58:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rockwellcollins.com; s=hrcrc2020; h=from:to:cc:subject:date:message-id; bh=rNDE39IqYvhLBBkOtFdkggPtL0vcZdx4ztmzT+8YCB8=; b=KQ7z7cA/hv2wzou7359KamRLWyDlMIfwBJM7+GM6INpziwIZS83sGwLP zU5hr0GqSL53Lsbtj9KaCCGiZxgX5Vrx9aTus84gtY5pGYt3jVbOHnW18 GFB7FQiwdjYPHXAyJzXxE6Pd58MYIcCkx/pLtPschJl7b9kf/EdNs+Sbe +yJvvuyJr8NHe6kLh9s7U2YCQWlzosHDFmUUrSIMlbRXrOwCerb5O3rLF o/js81ASM1QXuvucJu56DXoZrE8iTXdWejofscFOdQHVWyRZecVfCXZTG KK8g7WdTSRX2M9M3QkrpOuEsukZ0DvVWKzNMkzrkmNs0aXjR+Tljv+sEK g==; IronPort-SDR: mTau+TAeu2BHUhzqYAsZPCUovtNjcOS0dNwQ7oBh4fYISyfO5XZ85U95ysD812NhvZj5FlX0A7 1YkMcxYJCVKdfsF+NhPK5SUQ9daomFuUj0RyZOkYQmdDED5IOT2MU35sYTw4EsYXN6BktxjmBm 9VWZo8Zf0+a2zBAYw1PaHwUl7nAyn6nHcM/RzpF1PhTuREjrtrjuH19VArZBlnVHnk+5dKx1bg rjf+tigkeYyMnkOLCqtUNrltlYQlqgmsoE21YkN4WKWyK2/k6kMud9wElPNEAa+VYzzhgPF+QG QLE= Received: from ofwgwc03.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.225.12]) by secvs04.rockwellcollins.com with ESMTP; 23 Apr 2021 13:58:42 -0500 X-Received: from eggs.rockwellcollins.com (eggs.rockwellcollins.lab [10.148.117.42]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id 9D79520092; Fri, 23 Apr 2021 13:58:42 -0500 (CDT) From: Sam Voss To: buildroot@buildroot.org Date: Fri, 23 Apr 2021 13:58:42 -0500 Message-Id: <20210423185842.50143-1-sam.voss@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH v3 1/1] linux: allow firmware to be included in kernel X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sam Voss MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add functionality to use the kernel's built-in options to allow binary blobs to be included with the kernel. This is equivalent to the blobs existing in /lib/firmware, however are available earlier in the boot process. This may be useful in situations where a device probes before the rootfs is fully available (such as a squashfs not being loaded before a usb device probing). Signed-off-by: Sam Voss --- v2->v3: Rebase onto master, take master's dependency of linux-firmware in all cases where enabled. v1->v2: Add warning for GPL implications of building a blog into kernel. linux/Config.in | 20 ++++++++++++++++++++ linux/linux.mk | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/linux/Config.in b/linux/Config.in index cf790963dd..d6ad91db1a 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -470,6 +470,26 @@ config BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". +config BR2_LINUX_KERNEL_EXTRA_FIRMWARE + bool "Build firmware binaries into the kernel" + help + Include the firmware from linux-firmware into the kernel + using the CONFIG_EXTRA_FIRMWARE option. + + WARNING: If you include additional firmware files into your + binary kernel image that are not available under the terms + of the GPL, then it may be a violation of the GPL to + distribute the resulting image since it combines both GPL + and non-GPL work. You should consult a lawyer of your own + before distributing such an image. + +config BR2_LINUX_KERNEL_EXTRA_FIRMWARE_BINARIES + string "External firmware blobs to build into the kernel binary" + depends on BR2_LINUX_KERNEL_EXTRA_FIRMWARE + help + Space delimited list of firmware to be built into the kernel. + These files must exist in the target's /lib/firmware. + # Linux extensions source "linux/Config.ext.in" diff --git a/linux/linux.mk b/linux/linux.mk index 1457228eb9..59f876c41e 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -372,6 +372,10 @@ define LINUX_KCONFIG_FIXUP_CMDS $(call KCONFIG_ENABLE_OPT,CONFIG_FB) $(call KCONFIG_ENABLE_OPT,CONFIG_LOGO) $(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224)) + $(if $(BR2_LINUX_KERNEL_EXTRA_FIRMWARE), + $(call KCONFIG_ENABLE_OPT,CONFIG_FIRMWARE_IN_KERNEL) + $(call KCONFIG_SET_OPT,CONFIG_EXTRA_FIRMWARE,$(BR2_LINUX_KERNEL_EXTRA_FIRMWARE_BINARIES)) + $(call KCONFIG_SET_OPT,CONFIG_EXTRA_FIRMWARE_DIR,"$(TARGET_DIR)/lib/firmware")) $(call KCONFIG_DISABLE_OPT,CONFIG_GCC_PLUGINS) $(PACKAGES_LINUX_CONFIG_FIXUPS) endef