All of lore.kernel.org
 help / color / mirror / Atom feed
From: sf84@laposte.net (Sebastian Frias)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM, SoC: About the use DT-defined properties by 3rd-party drivers
Date: Mon, 12 Sep 2016 15:15:00 +0200	[thread overview]
Message-ID: <57D6AA54.6000208@laposte.net> (raw)
In-Reply-To: <20160912123809.GB13741@leverpostej>

Hi Mark,

On 09/12/2016 02:38 PM, Mark Rutland wrote:
>>
>> 3rd party users of said SoC could then write kernel modules for such HW
>> blocks using the DT description. The DT would thus become the authoritative
>> source of information regarding register programming for the SoC.
> 
> I don't follow this part entirely. Why are you expecting thrid parties
> to write a driver for those blocks rather than upstreaming a driver for
> them?

3rd parties could choose to write a driver (as opposed to use say, a user-mode
library) if it fits their programming model better, if they think they would
have better performance, or other reasons.

The main idea is to make DT the authoritative source of HW description.

> 
>> Currently, HW blocks for which there is no public driver (that it is
>> accessed through user-mode libraries or firmware) require a separate
>> HW description (be it Documentation, headers, etc.)
>>
>> Since the DT describes the HW, it would make sense to expose the HW through
>> DT, that would centralise the HW description.
> 
> I would generally agree that the hardware should be described in DT.
> The difficulty is that without a 'real' user it's not always possible to
> tell if we're describing the thing correctly.
> 

That may be true, but so far we are not discussing changing DT's API so it
should not have big ramifications.
Besides, what "makes sense now" may "not make sense tomorrow" depending on
how the HW is modified.
We have somehow learned the hard-way that "le mieux est l'ennemi du bien"
(the better is the enemy of the good) and we are trying to take a more
practical (and flexible) approach.

> Putting smoething together that's only sufficient to support some
> out-of-tree driver with implicit assumptions that we are not aware of is
> far from fantastic.

That does not seem very positive and it is not the case anyway, otherwise we
would not be consulting here :-)
Agreed, right now this whole thing seems like a really hypothetical question,
but the intention is good.

Actually, I think it would encourage more SoC manufacturers to use DT as a way
to document their HW, which is a good thing.

> 
>> However, after discussing over IRC, it looks like there was no guidance on
>> this. Some people think submitting DT properties/nodes without a corresponding
>> Linux driver is frowned upon, while others thought it was an odd limitation
>> and suggested asking here.
> 
> Unfortunately, I think that the area is sufficiently vague that there
> simply is no clear and general answer.
> 
> For the sake of discussion, an example of a particular block, along with
> what you expect/need to describe would be helpful.

I don't have a more concrete example now.

As I stated, right now HW description is not centralised, and thus different
bits of information are cherry-picked by hand from HW description into DT for
bootloader, DT for Linux, Documentation/headers for 3rd-parties, etc.

But if I understood correctly your comment, you are basically saying that
without an example is hard to say.
Since the question seems understood, do you have an example of other SoC's
doing something similar?

I've seen some big DT descriptions, but it is difficult to know if we are the
first ones trying to use the DT in this way.

Best regards,

Sebastian

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Frias <sf84@laposte.net>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Timur Tabi <timur@tabi.org>,
	devicetree <devicetree@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Mason <slash.tmp@free.fr>
Subject: Re: ARM,SoC: About the use DT-defined properties by 3rd-party drivers
Date: Mon, 12 Sep 2016 15:15:00 +0200	[thread overview]
Message-ID: <57D6AA54.6000208@laposte.net> (raw)
In-Reply-To: <20160912123809.GB13741@leverpostej>

Hi Mark,

On 09/12/2016 02:38 PM, Mark Rutland wrote:
>>
>> 3rd party users of said SoC could then write kernel modules for such HW
>> blocks using the DT description. The DT would thus become the authoritative
>> source of information regarding register programming for the SoC.
> 
> I don't follow this part entirely. Why are you expecting thrid parties
> to write a driver for those blocks rather than upstreaming a driver for
> them?

3rd parties could choose to write a driver (as opposed to use say, a user-mode
library) if it fits their programming model better, if they think they would
have better performance, or other reasons.

The main idea is to make DT the authoritative source of HW description.

> 
>> Currently, HW blocks for which there is no public driver (that it is
>> accessed through user-mode libraries or firmware) require a separate
>> HW description (be it Documentation, headers, etc.)
>>
>> Since the DT describes the HW, it would make sense to expose the HW through
>> DT, that would centralise the HW description.
> 
> I would generally agree that the hardware should be described in DT.
> The difficulty is that without a 'real' user it's not always possible to
> tell if we're describing the thing correctly.
> 

That may be true, but so far we are not discussing changing DT's API so it
should not have big ramifications.
Besides, what "makes sense now" may "not make sense tomorrow" depending on
how the HW is modified.
We have somehow learned the hard-way that "le mieux est l'ennemi du bien"
(the better is the enemy of the good) and we are trying to take a more
practical (and flexible) approach.

> Putting smoething together that's only sufficient to support some
> out-of-tree driver with implicit assumptions that we are not aware of is
> far from fantastic.

That does not seem very positive and it is not the case anyway, otherwise we
would not be consulting here :-)
Agreed, right now this whole thing seems like a really hypothetical question,
but the intention is good.

Actually, I think it would encourage more SoC manufacturers to use DT as a way
to document their HW, which is a good thing.

> 
>> However, after discussing over IRC, it looks like there was no guidance on
>> this. Some people think submitting DT properties/nodes without a corresponding
>> Linux driver is frowned upon, while others thought it was an odd limitation
>> and suggested asking here.
> 
> Unfortunately, I think that the area is sufficiently vague that there
> simply is no clear and general answer.
> 
> For the sake of discussion, an example of a particular block, along with
> what you expect/need to describe would be helpful.

I don't have a more concrete example now.

As I stated, right now HW description is not centralised, and thus different
bits of information are cherry-picked by hand from HW description into DT for
bootloader, DT for Linux, Documentation/headers for 3rd-parties, etc.

But if I understood correctly your comment, you are basically saying that
without an example is hard to say.
Since the question seems understood, do you have an example of other SoC's
doing something similar?

I've seen some big DT descriptions, but it is difficult to know if we are the
first ones trying to use the DT in this way.

Best regards,

Sebastian

  reply	other threads:[~2016-09-12 13:15 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 14:29 ARM,SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias
2016-08-24 14:29 ` Sebastian Frias
2016-08-28 20:36 ` ARM, SoC: " Timur Tabi
2016-08-28 20:36   ` ARM,SoC: " Timur Tabi
2016-08-28 20:36   ` ARM, SoC: " Timur Tabi
2016-09-12 12:29   ` Sebastian Frias
2016-09-12 12:29     ` ARM,SoC: " Sebastian Frias
2016-09-12 12:38     ` ARM, SoC: " Mark Rutland
2016-09-12 12:38       ` ARM,SoC: " Mark Rutland
2016-09-12 12:38       ` Mark Rutland
2016-09-12 13:15       ` Sebastian Frias [this message]
2016-09-12 13:15         ` Sebastian Frias
2016-09-12 13:23         ` ARM, SoC: " Timur Tabi
2016-09-12 13:23           ` ARM,SoC: " Timur Tabi
2016-09-12 14:01         ` ARM, SoC: " Mark Rutland
2016-09-12 14:01           ` Mark Rutland
2016-09-12 14:26           ` Warner Losh
2016-09-12 14:26             ` Warner Losh
2016-09-12 14:26             ` Warner Losh
2016-09-12 16:29             ` Sebastian Frias
2016-09-12 16:29               ` Sebastian Frias
2016-09-12 16:45               ` Warner Losh
2016-09-12 16:45                 ` Warner Losh
2016-09-12 16:49                 ` Timur Tabi
2016-09-12 16:49                   ` Timur Tabi
2016-09-12 17:07                   ` Mark Rutland
2016-09-12 17:07                     ` Mark Rutland
2016-09-12 17:06                 ` Mark Rutland
2016-09-12 17:06                   ` Mark Rutland
2016-09-12 17:06                   ` Mark Rutland
2016-09-12 16:07           ` Sebastian Frias
2016-09-12 16:07             ` Sebastian Frias
2016-09-12 16:07             ` Sebastian Frias
2016-09-12 16:21             ` Timur Tabi
2016-09-12 16:21               ` Timur Tabi
2016-09-12 16:21               ` Timur Tabi
2016-09-12 16:26             ` Sebastian Frias
2016-09-12 16:26               ` Sebastian Frias
2016-09-12 16:26               ` Sebastian Frias
2016-09-12 16:56             ` Mark Rutland
2016-09-12 16:56               ` Mark Rutland
2016-09-12 16:56               ` Mark Rutland
2016-09-13 10:04               ` Sebastian Frias
2016-09-13 10:04                 ` Sebastian Frias
2016-09-13 10:04                 ` Sebastian Frias
2016-09-13 11:37                 ` Timur Tabi
2016-09-13 11:37                   ` Timur Tabi
2016-09-13 11:37                   ` Timur Tabi
2016-09-13 13:23                   ` Mark Rutland
2016-09-13 13:23                     ` Mark Rutland
2016-09-13 13:23                     ` Mark Rutland
2016-09-13 13:12                 ` Mark Rutland
2016-09-13 13:12                   ` Mark Rutland
2016-09-13 13:12                   ` Mark Rutland
2016-09-13 14:22                   ` Sebastian Frias
2016-09-13 14:22                     ` Sebastian Frias
2016-09-13 14:22                     ` Sebastian Frias
2016-09-13 14:51                     ` Mark Rutland
2016-09-13 14:51                       ` Mark Rutland
2016-09-13 14:51                       ` Mark Rutland
2016-09-14  8:32                       ` Sebastian Frias
2016-09-14  8:32                         ` Sebastian Frias
2016-09-14  8:32                         ` Sebastian Frias
2016-09-13 14:55                   ` Sebastian Frias
2016-09-13 14:55                     ` Sebastian Frias
2016-09-13 14:55                     ` Sebastian Frias
2016-09-13 15:47                     ` Mark Rutland
2016-09-13 15:47                       ` Mark Rutland
2016-09-13 15:47                       ` Mark Rutland
2016-09-14  8:24                       ` Sebastian Frias
2016-09-14  8:24                         ` Sebastian Frias

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=57D6AA54.6000208@laposte.net \
    --to=sf84@laposte.net \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.