From: Frank Rowand <frowand.list@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Grant Likely <grant.likely@linaro.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH] scripts/dtc: dt_to_config - report kernel config options for a devicetree
Date: Fri, 29 Apr 2016 08:54:12 -0700 [thread overview]
Message-ID: <572383A4.2030808@gmail.com> (raw)
In-Reply-To: <CAMuHMdUBq7XUTDrWenNy7tsnvLQdp9H5hUmzqUZ2F6wVUQn21g@mail.gmail.com>
On 4/28/2016 11:44 PM, Geert Uytterhoeven wrote:
> On Fri, Apr 29, 2016 at 8:39 AM, Gaurav Minocha
> <gaurav.minocha.os@gmail.com> wrote:
>> On Thu, Apr 28, 2016 at 3:32 PM, Rob Herring <robh+dt@kernel.org> wrote:
>>> On Thu, Apr 28, 2016 at 4:46 PM, Frank Rowand <frowand.list@gmail.com> wrote:
>>>> From: Frank Rowand <frank.rowand@am.sony.com>
>>>>
>>>> Determining which kernel config options need to be enabled for a
>>>> given devicetree can be a painful process. Create a new tool to
>>>> find the drivers that may match a devicetree node compatible,
>>>> find the kernel config options that enable the driver, and
>>>> optionally report whether the kernel config option is enabled.
>>>
>>> I would find this more useful to output a config fragment with all the
>>> options enabled. The hard part there is enabling the options a given
>>> option is dependent on which I don't think kbuild takes care of.
>>
>> Do you mean to generate something like .config? If yes, then IMO it would
>> not be a correct configuration file.
>
> A fragment to be appended to your current .config.
>
> After that, an additional run of "make oldconfig" should (hopefully) bring
> everything into good shape.
$ scripts/dtc/dt_to_config \
--config=$KBUILD_OUTPUT/.config \
arch/arm/boot/dts/qcom-apq8074-dragonboard.dts \
| grep "^............F" \
| cut -d ":" -f5 \
| sed -e 's| $|=y|' \
| sed -e 's| ||g'
CONFIG_ARCH_U300=y
CONFIG_SOC_IMX27=y
CONFIG_SOC_IMX31=y
CONFIG_ARCH_U300=y
CONFIG_SOC_IMX27=y
CONFIG_SOC_IMX31=y
CONFIG_ARM_BIG_LITTLE_CPUIDLE=y
CONFIG_QCOM_SMP2P=y
CONFIG_QCOM_SMP2P=y
CONFIG_QCOM_SMSM=y
CONFIG_QCOM_SPMI_TEMP_ALARM=y
CONFIG_QCOM_SPMI_IADC=y
CONFIG_INPUT_PM8941_PWRKEY=y
CONFIG_QCOM_SPMI_TEMP_ALARM=y
CONFIG_QCOM_SPMI_VADC=y
CONFIG_BACKLIGHT_PM8941_WLED=y
But Gaurav is correct. The answer is not this easy. For example, there
may be multiple drivers that match a compatible value. But only one of
those drivers will be the correct one. That is just one example, some
cases become are much more complex.
I started writing code to try to score how good each compatible match is
so the best match could be picked. At the moment, it is 255 lines and
not very functional. I may continue experimenting with scoring in the
future.
-Frank
next prev parent reply other threads:[~2016-04-29 15:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-28 21:46 [PATCH] scripts/dtc: dt_to_config - report kernel config options for a devicetree Frank Rowand
[not found] ` <572284AB.102-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-28 21:52 ` [PATCH] scripts/dtc: dt_to_config - example 1 Frank Rowand
2016-04-28 21:53 ` [PATCH] scripts/dtc: dt_to_config - example 2 Frank Rowand
2016-04-28 21:54 ` [PATCH] scripts/dtc: dt_to_config - report kernel config options for a devicetree Frank Rowand
2016-04-28 21:55 ` [PATCH] scripts/dtc: dt_to_config - usage message Frank Rowand
2016-04-28 22:32 ` [PATCH] scripts/dtc: dt_to_config - report kernel config options for a devicetree Rob Herring
[not found] ` <CAL_JsqKGcc_wXV2_-3ZVS7gzfo2ao9z+eATdnKVsyRnW2O5e4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-28 23:31 ` Frank Rowand
[not found] ` <57229D47.6070704-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-28 23:44 ` Gaurav Minocha
2016-04-29 6:39 ` Gaurav Minocha
[not found] ` <CA+rpMbJkWM+bsvXT77eyLGewtKHjX1inc0vjsWxYQTCgzmpDGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-29 6:44 ` Geert Uytterhoeven
2016-04-29 15:54 ` Frank Rowand [this message]
2016-04-30 20:38 ` Rob Herring
[not found] ` <CAL_Jsq+v3r1dNY1+CK=_Atyyysq=JAFfk0q7i6YVhKS1zTZMVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-05 16:25 ` Gaurav Minocha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=572383A4.2030808@gmail.com \
--to=frowand.list@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=gaurav.minocha.os@gmail.com \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=grant.likely@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).