From patchwork Fri Dec 21 03:12:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154369 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp417289ljp; Thu, 20 Dec 2018 19:13:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN6KQkyQynNrMaiVX4ZyNBSghX1vi31JWNHGNgSdIvZDl28UG1Uo+hsuSu6Y6+1sBgniMiU6 X-Received: by 2002:a62:c583:: with SMTP id j125mr797502pfg.37.1545361982486; Thu, 20 Dec 2018 19:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545361982; cv=none; d=google.com; s=arc-20160816; b=ut5osvAFp0iL+ZI9qFTPWOwR/hWB/9PJinKsBd07j6cf7ppv60r4NZqOsrLIJugu+w B7VsnLbwD9VCJTIOUaRHycmjqoyW815e4cq2kSBOpgZDtg4NSNngqXXRu7IkuDq2Zc8N JC4FabZSNtKWT1JKeI2d0b0gSlBjIvLiLT5yyuLvKcE/0mBQ1/ee7g4jeJS1aBE0ICcI vCkFAg5TTO1i29rdf9fVpO0CoTx7yuJCSxweX5OayTSqEYmFEh7RWEyIhxznfynbbM51 5p0t5KRBBhJReSHDhZE6/dsOKlnJErGwPdKi3hay/dJ7QuJ/65oOP2xCIf4OEEVE5FBH LWcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=uwc4h7OaYnqTtMRVaURUeVDBjbGaCXyizVdHE15ae9w=; b=v2CPxSuWWYmwuZqaIqBSQaF6S/L2AkCJqHwvTaImhkxuqjTJ5Z/xGB71ubM9w/Q8Pr pCOuJSlwJwwZE0JsqYtQZpSdAosCCcalgiTXYqmNG4XQTo75FuJGnydNUxKn3/Bcq48E bpnEXl6dL++lVoF0Ier6o2CTlPQjUb1Gvp/DktymrU2APWK4BfZpBPRHW0dKGtMst6Da oURYuh7OOMgECA8uXtxEzw156i5QgmXN5tz01EvI6SbPoyFfuGJ6mM3JgzdAXPEVIUQM kfq0MngH7vWBXAyJ8FEDBuSFuE9Swq3+4s3n2RdSMHFui30ylA++3Hwh61vrX6+ySUTf LoEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=CsBEesqd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si18960615pls.73.2018.12.20.19.13.02; Thu, 20 Dec 2018 19:13:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=CsBEesqd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389063AbeLUDM7 (ORCPT + 31 others); Thu, 20 Dec 2018 22:12:59 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:53264 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388689AbeLUDM6 (ORCPT ); Thu, 20 Dec 2018 22:12:58 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id wBL3Ci1o003819; Fri, 21 Dec 2018 12:12:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com wBL3Ci1o003819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545361964; bh=uwc4h7OaYnqTtMRVaURUeVDBjbGaCXyizVdHE15ae9w=; h=From:To:Cc:Subject:Date:From; b=CsBEesqdpFekSo+Xj8X1sNVps9vZvdQXIjGppBx/mJ58EWAa3UWQpWvIKEqi/KOp4 6jCqTtOyWgbVivuW/df/R0+hU/hvYGEKOPSSpPdj7ryGaNXpfroA/nYnsEbQ7IunVe 9NdgmsPbQKYBOMmRimkSicmlranskbalqTfiMzkMdkmaRYH8GK911uOXSIyl0ie9mG nrpWtUcej4qwd+ydx+8jfoLoMnLxIIQoGCNeGteKUb7COhgbIvN2MrIxgh8eN662W+ yQoCxHEkE/22HVEuujax2guA1/FhMAxNJgDvvufXRkne02AVkIjHVbYkB5Abx0jNOI tAIdcL4MC2LzA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] scripts: remove unnecessary ihex2fw and check-lc_ctypes from .gitignore Date: Fri, 21 Dec 2018 12:12:39 +0900 Message-Id: <1545361961-31990-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit c512d2544c68 ("gitignore: ignore scripts/ihex2fw") was unneeded because ihex2fw was generated in firmware/ instead of scripts/ at that time. I guess it was accidentally added because ihex2fw.c was pushed back and forth between those two directories according to 8b249b6856f1 ("fix modules_install via NFS") and 556b0f58bbcd (Revert "fix modules_install via NFS"). Of course, you may cross file-moves during git-bisect, but we do not generally add removed binaries to the .gitignore file. check-lc_ctype was removed by commit cb43fb5775df ("docs: remove DocBook from the building system"). Signed-off-by: Masahiro Yamada --- scripts/.gitignore | 2 -- 1 file changed, 2 deletions(-) -- 2.7.4 diff --git a/scripts/.gitignore b/scripts/.gitignore index 12d302d..17f8cef 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -6,9 +6,7 @@ conmakehash kallsyms pnmtologo unifdef -ihex2fw recordmcount -check-lc_ctype sortextable asn1_compiler extract-cert From patchwork Fri Dec 21 03:12:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154371 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp417381ljp; Thu, 20 Dec 2018 19:13:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN7VrMuop2wLWSgzrASFAu9vZfor19GPY3TpZ0Z2S25P65IjWa5EKgmRhsryIOaCQoveYd1J X-Received: by 2002:a65:4946:: with SMTP id q6mr728803pgs.201.1545361990340; Thu, 20 Dec 2018 19:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545361990; cv=none; d=google.com; s=arc-20160816; b=sPsVh9yEaQ5cJSLMeeh5jSxwIx+wmw5DSv0bNsLCUyws4c91N2zYl0WdSKBV0xmzp1 dONYW9Rwgl6XtRDveRuvXdr/PdsLyZWom62v1+35TQsHeD89m8QbraU8tCbt0t0rH5Br JiKJ9tn7RVXdmmN3Mve6jRxzWW7aWi8ZQnkfw52vdRTaTRjkYmLrTjlkiPdmRSXRfN31 ULI8oZKRu36Hl34KZbNorP2RomswoJlTWPnRlHR4ECB6CqcgYEFMQyFzE2dFpQbX8eET dvHH/WUXCC91A61GAT6/UVuzFLG9ZfKsJTeGmXVW8oQPlGrD7k3CvtOOBnUbwnqaFxj4 hYjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=sPoUWgm9HoTObFyYcNyHA9wD9gNx+jYnO+blEKMDeJA=; b=dJRS+/x69f/J/uZ7hQ/l50yectxna6lEj0ENYlwM95Egrxkj9cV9Vsj55a0AURx2eS z1znLIklZfzCnPv/HUcWMgZlQ4auYPAhGX62tnu6jltbU8Aew+j5UdAXiSNPSDlmxV87 /U3m7cVFNFG585vvnEY7b/+6BHZM0p+laIc+aCwfpnx21Zi9ael+uwwz7STE2sU+CczO 1MB2CCfUHski/GUyVK4Wbq/NqJDH/SuLQKYK40uKul1z+YwpEpaCeWnzJft9AyaeIr2k qKeqoomipCsEAn+HRfrDvT9KLbw0HzAnzaiKwll3qGlWWK417ywoO71KZv9v5Oegab2B m/Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=D1+COK9R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s84si19796251pgs.306.2018.12.20.19.13.10; Thu, 20 Dec 2018 19:13:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=D1+COK9R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389038AbeLUDM7 (ORCPT + 31 others); Thu, 20 Dec 2018 22:12:59 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:53265 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731785AbeLUDM6 (ORCPT ); Thu, 20 Dec 2018 22:12:58 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id wBL3Ci1p003819; Fri, 21 Dec 2018 12:12:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com wBL3Ci1p003819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545361965; bh=sPoUWgm9HoTObFyYcNyHA9wD9gNx+jYnO+blEKMDeJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D1+COK9RzxFZQJvuqL19LNaQDQdet8mQnLEhTxsnijMbqjWv14oiJB+swLCchj5ek 8y0wHpPWfdyHs540RyRIBdBlN0tHhwmM7W2Rq+4Lg95o/TYbu51bT4+nh9kFNnlGZn ZuR24M39PzexLa7Qba9+dqF3LKTWhVsYgpS78+O/QzGVfa7orS9m/GTPMWjjRObbg5 1Orz8QSuiwsEIIhz0qKiw2hywauQUIk2J7PpM3obJ1QZNy2Mkmg0sjpvombKvqqe/0 XcdTBc8SPJk6ZjGtPguSIIsUeO3FITl7vRipy38FuoUctC9YrKJZZUTLatNz542NFl yMEh0w6AWEY2Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] firmware: remove unnecessary patterns in .gitignore Date: Fri, 21 Dec 2018 12:12:40 +0900 Message-Id: <1545361961-31990-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545361961-31990-1-git-send-email-yamada.masahiro@socionext.com> References: <1545361961-31990-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit df85b2d767aa ("firmware: Restore support for built-in firmware") should not have restored this .gitignore blindly. What git should ignore is merely *.gen.S now. Signed-off-by: Masahiro Yamada --- firmware/.gitignore | 5 ----- 1 file changed, 5 deletions(-) -- 2.7.4 diff --git a/firmware/.gitignore b/firmware/.gitignore index d9c6901..9c8bdb9 100644 --- a/firmware/.gitignore +++ b/firmware/.gitignore @@ -1,6 +1 @@ *.gen.S -*.fw -*.bin -*.csp -*.dsp -ihex2fw From patchwork Fri Dec 21 03:12:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154370 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp417344ljp; Thu, 20 Dec 2018 19:13:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN6wJ7CL2lm3bBRSfoXhlv6Tw+KT+ZRP35BbQXYezJgJ9lkoJuIauWOmcNS0IMUSB8dLhH7V X-Received: by 2002:a17:902:930b:: with SMTP id bc11mr822409plb.17.1545361986362; Thu, 20 Dec 2018 19:13:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545361986; cv=none; d=google.com; s=arc-20160816; b=vW56APo96gTA0z1W7qCHXx/PF6Y4aZevhGpuilkm5QtoHVzpTlpT1OyPs4/g5zQc/A 3g7b9mBjcWPOJx9qLtZizaHDMkwM1HjqfMj3LWA0utcGKqtdM/ouAVybofhF0GETrqfU RKaMVD3/OYQdiLukdyBfpssOi4ey+u908trL11v+hHBtF8cgUphJNNpiAphm2OC7dVq1 99F553PVwse14BOmdgLfryMseFwFgM9l/xFlfAsxGGRVnkaqi1Dn0SqSSvOBJGeU3nTF Xhl80yNngsPxWGKPR5uni/PAh3lZKi3fBQI7YrYLx7fVMx+R3Pd8if9INqnxpkLxhjvC fNuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=7BUcAm2kzh0Oah2K4UpaMEeLxvXGjrdT7tbi0/n1Edg=; b=vgQP0RvgOmmmjD3E/sZIicSi1e6LtGI2WzW5aECiuPRjiFHnJ+brmMsBtWjdQHxTyY T2yiYaa4H9+yv9sk5qhjlRA8lkI2j24iX7vEWyqQd6ZkxOwbkaK8NXS0HTSjl+dasKCx bWuAcRGjpjc63JJwA1pAqpQSS8V4bPvO8oBBpk7j2nPIbEpcgy1iMkUPmWBC+VSw82x/ 3OL6DQ0mf0SlcF5m8FzCikWEtxf//ekPtGgO7UEl2Rf605cFFkdRZViTKveRPmADGrFG gvdkYUPjcKbp5lfC8uxGQ8o1y4JR1nNTIbJa0TLmeMyxDvqqWQE+kUIYZ46yjV09RNP+ Peqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gnVyb9KH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si19788863pgg.1.2018.12.20.19.13.06; Thu, 20 Dec 2018 19:13:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gnVyb9KH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390883AbeLUDND (ORCPT + 31 others); Thu, 20 Dec 2018 22:13:03 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:53266 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731899AbeLUDM7 (ORCPT ); Thu, 20 Dec 2018 22:12:59 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id wBL3Ci1q003819; Fri, 21 Dec 2018 12:12:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com wBL3Ci1q003819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545361965; bh=7BUcAm2kzh0Oah2K4UpaMEeLxvXGjrdT7tbi0/n1Edg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gnVyb9KH6yRmJOX41ZPUv0rd2BP3fB2xGmD5eq2LQDmAcuLqczoe2QoICGZwUJKiV OUw16z3JdKl3BSKtfxvlxWkZgHRckpyHENNOQuJZ6qowoGRAXA2hrXyfQQlMCHRjwh 6TaYsoBtn/VEGEPwaFzM2zLNz90bJb2T4U60S4Ue0VUnpE+UCrmcAPxfinAg2aB/VV olZkbE/HrPNF4Jna61XSI2JK3RwE3IyvPTUhK6XRSXjp5+mO0gmOFDl6tacHgI+6XD ctgB9eTFzWaytP8eHHi7kU3T/LKv0K/oaDpVAOjPrfMnQLVOniBC7ZniraYD8FUgIg CX5qgEySgNvmQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] firmware: rewrite Makefile Date: Fri, 21 Dec 2018 12:12:41 +0900 Message-Id: <1545361961-31990-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545361961-31990-1-git-send-email-yamada.masahiro@socionext.com> References: <1545361961-31990-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clean up the Makefile. Equivalent *.gen.S files are produced. - Use filechk to remove ugly wordsize_deps - Get FWNAME, FWSTR, ASM_WORD, ASM_ALIGN, and PROGBITS out of the recipe for readability - Move mkdir into the recipe - Clean up generated directories by 'make clean' Signed-off-by: Masahiro Yamada --- For this patch to work correctly, the following prerequisite is necessary: https://patchwork.kernel.org/patch/10707461/ So, I will queue this series to kbuild tree. BTW, my next plan is to move firmware/ to more relevant place, for example, drivers/base/firmware_loader/builtin. firmware/Makefile | 89 ++++++++++++++++++++++--------------------------------- 1 file changed, 35 insertions(+), 54 deletions(-) -- 2.7.4 diff --git a/firmware/Makefile b/firmware/Makefile index 2964138..18d1c84 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -1,61 +1,42 @@ # SPDX-License-Identifier: GPL-2.0 -# -# kbuild file for firmware/ -# -# Create $(fwabs) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a +# Create $(fwdir) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a # leading /, it's relative to $(srctree). fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR)) -fwabs := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir)) - -fw-external-y := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE)) - -quiet_cmd_fwbin = MK_FW $@ - cmd_fwbin = FWNAME="$(patsubst firmware/%.gen.S,%,$@)"; \ - FWSTR="$(subst /,_,$(subst .,_,$(subst -,_,$(patsubst \ - firmware/%.gen.S,%,$@))))"; \ - ASM_WORD=$(if $(CONFIG_64BIT),.quad,.long); \ - ASM_ALIGN=$(if $(CONFIG_64BIT),3,2); \ - PROGBITS=$(if $(CONFIG_ARM),%,@)progbits; \ - echo "/* Generated by firmware/Makefile */" > $@;\ - echo " .section .rodata" >>$@;\ - echo " .p2align $${ASM_ALIGN}" >>$@;\ - echo "_fw_$${FWSTR}_bin:" >>$@;\ - echo " .incbin \"$(2)\"" >>$@;\ - echo "_fw_end:" >>$@;\ - echo " .section .rodata.str,\"aMS\",$${PROGBITS},1" >>$@;\ - echo " .p2align $${ASM_ALIGN}" >>$@;\ - echo "_fw_$${FWSTR}_name:" >>$@;\ - echo " .string \"$$FWNAME\"" >>$@;\ - echo " .section .builtin_fw,\"a\",$${PROGBITS}" >>$@;\ - echo " .p2align $${ASM_ALIGN}" >>$@;\ - echo " $${ASM_WORD} _fw_$${FWSTR}_name" >>$@;\ - echo " $${ASM_WORD} _fw_$${FWSTR}_bin" >>$@;\ - echo " $${ASM_WORD} _fw_end - _fw_$${FWSTR}_bin" >>$@; - -# One of these files will change, or come into existence, whenever -# the configuration changes between 32-bit and 64-bit. The .S files -# need to change when that happens. -wordsize_deps := $(wildcard include/config/64bit.h include/config/32bit.h \ - include/config/ppc32.h include/config/ppc64.h \ - include/config/superh32.h include/config/superh64.h \ - include/config/x86_32.h include/config/x86_64.h \ - firmware/Makefile) - -$(patsubst %,$(obj)/%.gen.S, $(fw-external-y)): %: $(wordsize_deps) \ - include/config/extra/firmware/dir.h - $(call cmd,fwbin,$(fwabs)/$(patsubst $(obj)/%.gen.S,%,$@)) +fwdir := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir)) + +obj-y := $(addsuffix .gen.o, $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE))) + +FWNAME = $(patsubst $(obj)/%.gen.S,%,$@) +FWSTR = $(subst /,_,$(subst .,_,$(subst -,_,$(FWNAME)))) +ASM_WORD = $(if $(CONFIG_64BIT),.quad,.long) +ASM_ALIGN = $(if $(CONFIG_64BIT),3,2) +PROGBITS = $(if $(CONFIG_ARM),%,@)progbits + +filechk_fwbin = { \ + echo "/* Generated by $(src)/Makefile */" ;\ + echo " .section .rodata" ;\ + echo " .p2align $(ASM_ALIGN)" ;\ + echo "_fw_$(FWSTR)_bin:" ;\ + echo " .incbin \"$(fwdir)/$(FWNAME)\"" ;\ + echo "_fw_end:" ;\ + echo " .section .rodata.str,\"aMS\",$(PROGBITS),1" ;\ + echo " .p2align $(ASM_ALIGN)" ;\ + echo "_fw_$(FWSTR)_name:" ;\ + echo " .string \"$(FWNAME)\"" ;\ + echo " .section .builtin_fw,\"a\",$(PROGBITS)" ;\ + echo " .p2align $(ASM_ALIGN)" ;\ + echo " $(ASM_WORD) _fw_$(FWSTR)_name" ;\ + echo " $(ASM_WORD) _fw_$(FWSTR)_bin" ;\ + echo " $(ASM_WORD) _fw_end - _fw_$(FWSTR)_bin" ;\ +} + +$(obj)/%.gen.S: FORCE + @mkdir -p $(dir $@) + $(call filechk,fwbin) # The .o files depend on the binaries directly; the .S files don't. -$(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/% - -obj-y += $(patsubst %,%.gen.o, $(fw-external-y)) - -ifeq ($(KBUILD_SRC),) -# Makefile.build only creates subdirectories for O= builds, but external -# firmware might live outside the kernel source tree -_dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))), $(shell [ -d $(d) ] || mkdir -p $(d))) -endif +$(addprefix $(obj)/, $(obj-y)): $(obj)/%.gen.o: $(fwdir)/% -targets := $(patsubst $(obj)/%,%, \ - $(shell find $(obj) -name \*.gen.S 2>/dev/null)) +targets := $(shell cd $(obj) && find * -name '*.gen.S') +clean-dirs := $(shell cd $(obj) && find * -maxdepth 0 -type d)