devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Enrico Weigelt, metux IT consult" <metux-Mmb7MZpHnFY@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: RFC: build config via DT names
Date: Mon, 12 Feb 2018 15:24:54 -0800	[thread overview]
Message-ID: <52140da5-0d49-c861-d752-8de9e4927380@gmail.com> (raw)
In-Reply-To: <d55f95cc-228b-e65f-b46c-2f314f4fa582-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi Enrico,

On 02/12/18 15:13, Frank Rowand wrote:
> + devicetree mail list
> 
> On 02/10/18 07:52, Enrico Weigelt, metux IT consult wrote:
>> Hi folks,
>>
>> I've regularily have the task of configuring a kernel for a given DT.
>> To make this a little bit easier, I'd like to do this automatically.
>>
>> The tuff task here is getting a mapping between dt compatible strings
>> and corresponding CONFIG_* flags. Automatically extracting it from the
>> source code seems pretty tricky, especially w/ corner cases (eg. some
>> drivers support groups of devices, depending on config options) - IMHO
>> it will need some code changes anyways.
>>
>> Therefore I propose a simple approach using the existing Kconfig system:
>>
>> Add an extra (toplevel) menu and config flag naming scheme which
>> directly map DT compatible strings to config flags. For example:
>>
>>> fsl,mpc5200-gpio <=> CONFIG_DTDEV_FSL_MPC5200_GPIO
>>
>>> config CONFIG_DTDEV_FSL_MPC5200_GPIO
>>>     tristate "fsl,mpc5200-gpio"
>>>     select GPIO_MPC5200
>>
>> Note that these flags are separate from the actual drivers - they just
>> enable them automatically. Of course they'll have to be maintained by
>> the driver maintainers.
>>
>>
>> What do you think about this idea ?
>>
>>
>> --mtx

As you note, it can be quite tricky getting the correct kernel configuration
for a given devicetree.

There is a tool to aid this process: scripts/dtc/dt_to_config.  It is not
a 100% solution, but it is very helpful.

The problem is difficult enough that this tool led to a conference talk.
The slides are at https://elinux.org/images/5/50/Dt_debugging_part_2.pdf
which is linked to from
https://elinux.org/Device_Tree_presentations_papers_articles#linux_kernel_configuration

dt_to_config and configuration issues are discussed in slides 33 - 80.

-Frank
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-02-12 23:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <63f25fea-f163-f9cc-b5b2-f6f291d7f8d2@gmx.de>
2018-02-12 23:13 ` RFC: build config via DT names Frank Rowand
     [not found]   ` <d55f95cc-228b-e65f-b46c-2f314f4fa582-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-12 23:24     ` Frank Rowand [this message]
     [not found]       ` <52140da5-0d49-c861-d752-8de9e4927380-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-13 13:16         ` Enrico Weigelt, metux IT consult
2018-02-13 15:19     ` Rob Herring
     [not found]       ` <CAL_JsqJXJA+Z7b6SoUx=MVK_C=vcMRAibapriOi+Wss6L1ahsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-13 16:21         ` Enrico Weigelt

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=52140da5-0d49-c861-d752-8de9e4927380@gmail.com \
    --to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=metux-Mmb7MZpHnFY@public.gmane.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).