All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suman Anna <s-anna@ti.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Tony Lindgren <tony@atomide.com>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	Dave Gerlach <d-gerlach@ti.com>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH 2/6] mailbox/omap: add support for parsing dt devices
Date: Mon, 30 Jun 2014 14:34:00 -0500	[thread overview]
Message-ID: <53B1BBA8.5090507@ti.com> (raw)
In-Reply-To: <20140630185942.GA5410@amd.pavel.ucw.cz>

Hi Pavel,

>
>>>> The non-DT support has to be maintained for now to not break
>>>> OMAP3 legacy boot, and the legacy-style code will be cleaned
>>>> up once OMAP3 is also converted to DT-boot only.
>>>
>>>> @@ -587,24 +606,157 @@ static int omap_mbox_unregister(struct omap_mbox_device *mdev)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> +static const struct omap_mbox_device_data omap2_data = {
>>>> +	.num_users	= 4,
>>>> +	.num_fifos	= 6,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE1,
>>>> +};
>>>> +
>>>> +static const struct omap_mbox_device_data omap3_data = {
>>>> +	.num_users	= 2,
>>>> +	.num_fifos	= 2,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE1,
>>>> +};
>>>> +
>>>> +static const struct omap_mbox_device_data am335x_data = {
>>>> +	.num_users	= 4,
>>>> +	.num_fifos	= 8,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE2,
>>>> +};
>>>
>>> So you use compatible strings to look up 3 integers. Would it be better to have
>>> num_users/num_fifos/intr_type directly in the device tree? That should be cleaner
>>> and more flexible...
>>>
>>> If you do that, would it be possible to have share compatible string?
>>
>> Yeah, I have actually encoded the .num_users and .num_fifos in DT in the
>> previous version [1] with shared compatible strings, but dropped those
>> properties in favour of adding minimal custom properties to DT based on
>> some offline IRC comments. I have no objections either way, but there is
>> really nothing to be gained from minimizing compatible strings.
> 
> Actually, I'd guess best solution would be to do both: have it encoded
> in device tree _and_ have separate compatible string for each version
> (in case there are other differences). You'd still get rid of the
> table...

Do note that the .intr_type has to with the register layout rather than
a physical property (mainly to distinguish the pre-OMAP4 IP register
layout), so I am not convinced that belongs to DT. This is the reason
why I didn't represent it in DT even in the previous version. The other
two are HW IP design parameters, so in general putting them in DT isn't
completely a bad idea, but I will wait to see if there are any further
comments on this from Tony or DT maintainers before I make changes.

regards
Suman

WARNING: multiple messages have this Message-ID (diff)
From: s-anna@ti.com (Suman Anna)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] mailbox/omap: add support for parsing dt devices
Date: Mon, 30 Jun 2014 14:34:00 -0500	[thread overview]
Message-ID: <53B1BBA8.5090507@ti.com> (raw)
In-Reply-To: <20140630185942.GA5410@amd.pavel.ucw.cz>

Hi Pavel,

>
>>>> The non-DT support has to be maintained for now to not break
>>>> OMAP3 legacy boot, and the legacy-style code will be cleaned
>>>> up once OMAP3 is also converted to DT-boot only.
>>>
>>>> @@ -587,24 +606,157 @@ static int omap_mbox_unregister(struct omap_mbox_device *mdev)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> +static const struct omap_mbox_device_data omap2_data = {
>>>> +	.num_users	= 4,
>>>> +	.num_fifos	= 6,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE1,
>>>> +};
>>>> +
>>>> +static const struct omap_mbox_device_data omap3_data = {
>>>> +	.num_users	= 2,
>>>> +	.num_fifos	= 2,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE1,
>>>> +};
>>>> +
>>>> +static const struct omap_mbox_device_data am335x_data = {
>>>> +	.num_users	= 4,
>>>> +	.num_fifos	= 8,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE2,
>>>> +};
>>>
>>> So you use compatible strings to look up 3 integers. Would it be better to have
>>> num_users/num_fifos/intr_type directly in the device tree? That should be cleaner
>>> and more flexible...
>>>
>>> If you do that, would it be possible to have share compatible string?
>>
>> Yeah, I have actually encoded the .num_users and .num_fifos in DT in the
>> previous version [1] with shared compatible strings, but dropped those
>> properties in favour of adding minimal custom properties to DT based on
>> some offline IRC comments. I have no objections either way, but there is
>> really nothing to be gained from minimizing compatible strings.
> 
> Actually, I'd guess best solution would be to do both: have it encoded
> in device tree _and_ have separate compatible string for each version
> (in case there are other differences). You'd still get rid of the
> table...

Do note that the .intr_type has to with the register layout rather than
a physical property (mainly to distinguish the pre-OMAP4 IP register
layout), so I am not convinced that belongs to DT. This is the reason
why I didn't represent it in DT even in the previous version. The other
two are HW IP design parameters, so in general putting them in DT isn't
completely a bad idea, but I will wait to see if there are any further
comments on this from Tony or DT maintainers before I make changes.

regards
Suman

WARNING: multiple messages have this Message-ID (diff)
From: Suman Anna <s-anna@ti.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Tony Lindgren <tony@atomide.com>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	Dave Gerlach <d-gerlach@ti.com>, <linux-kernel@vger.kernel.org>,
	<linux-omap@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH 2/6] mailbox/omap: add support for parsing dt devices
Date: Mon, 30 Jun 2014 14:34:00 -0500	[thread overview]
Message-ID: <53B1BBA8.5090507@ti.com> (raw)
In-Reply-To: <20140630185942.GA5410@amd.pavel.ucw.cz>

Hi Pavel,

>
>>>> The non-DT support has to be maintained for now to not break
>>>> OMAP3 legacy boot, and the legacy-style code will be cleaned
>>>> up once OMAP3 is also converted to DT-boot only.
>>>
>>>> @@ -587,24 +606,157 @@ static int omap_mbox_unregister(struct omap_mbox_device *mdev)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> +static const struct omap_mbox_device_data omap2_data = {
>>>> +	.num_users	= 4,
>>>> +	.num_fifos	= 6,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE1,
>>>> +};
>>>> +
>>>> +static const struct omap_mbox_device_data omap3_data = {
>>>> +	.num_users	= 2,
>>>> +	.num_fifos	= 2,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE1,
>>>> +};
>>>> +
>>>> +static const struct omap_mbox_device_data am335x_data = {
>>>> +	.num_users	= 4,
>>>> +	.num_fifos	= 8,
>>>> +	.intr_type	= MBOX_INTR_CFG_TYPE2,
>>>> +};
>>>
>>> So you use compatible strings to look up 3 integers. Would it be better to have
>>> num_users/num_fifos/intr_type directly in the device tree? That should be cleaner
>>> and more flexible...
>>>
>>> If you do that, would it be possible to have share compatible string?
>>
>> Yeah, I have actually encoded the .num_users and .num_fifos in DT in the
>> previous version [1] with shared compatible strings, but dropped those
>> properties in favour of adding minimal custom properties to DT based on
>> some offline IRC comments. I have no objections either way, but there is
>> really nothing to be gained from minimizing compatible strings.
> 
> Actually, I'd guess best solution would be to do both: have it encoded
> in device tree _and_ have separate compatible string for each version
> (in case there are other differences). You'd still get rid of the
> table...

Do note that the .intr_type has to with the register layout rather than
a physical property (mainly to distinguish the pre-OMAP4 IP register
layout), so I am not convinced that belongs to DT. This is the reason
why I didn't represent it in DT even in the previous version. The other
two are HW IP design parameters, so in general putting them in DT isn't
completely a bad idea, but I will wait to see if there are any further
comments on this from Tony or DT maintainers before I make changes.

regards
Suman

  reply	other threads:[~2014-06-30 19:34 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25  1:47 [PATCH 0/6] OMAP Mailbox framework adoption & DT support Suman Anna
2014-06-25  1:47 ` Suman Anna
2014-06-25  1:47 ` Suman Anna
2014-06-25  1:47 ` [PATCH 1/6] Documentation: dt: add omap mailbox bindings Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  1:47 ` [PATCH 2/6] mailbox/omap: add support for parsing dt devices Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-28 17:07   ` Pavel Machek
2014-06-28 17:07     ` Pavel Machek
2014-06-30 16:00     ` Suman Anna
2014-06-30 16:00       ` Suman Anna
2014-06-30 16:00       ` Suman Anna
2014-06-30 18:59       ` Pavel Machek
2014-06-30 18:59         ` Pavel Machek
2014-06-30 19:34         ` Suman Anna [this message]
2014-06-30 19:34           ` Suman Anna
2014-06-30 19:34           ` Suman Anna
2014-06-30 20:32           ` Pavel Machek
2014-06-30 20:32             ` Pavel Machek
2014-06-30 20:32             ` Pavel Machek
2014-07-04  6:45             ` Tony Lindgren
2014-07-04  6:45               ` Tony Lindgren
2014-07-04  8:05               ` Pavel Machek
2014-07-04  8:05                 ` Pavel Machek
     [not found]                 ` <20140704080556.GA16274-tWAi6jLit6GreWDznjuHag@public.gmane.org>
2014-07-04  8:23                   ` Tony Lindgren
2014-07-04  8:23                     ` Tony Lindgren
2014-07-04  8:23                     ` Tony Lindgren
     [not found]                     ` <20140704082354.GD28884-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-07-08 17:55                       ` Suman Anna
2014-07-08 17:55                         ` Suman Anna
2014-07-08 17:55                         ` Suman Anna
     [not found]                         ` <53BC3081.9010402-l0cyMroinI0@public.gmane.org>
2014-07-09  8:29                           ` Tony Lindgren
2014-07-09  8:29                             ` Tony Lindgren
2014-07-09  8:29                             ` Tony Lindgren
2014-07-09 15:15                             ` Suman Anna
2014-07-09 15:15                               ` Suman Anna
2014-07-09 15:15                               ` Suman Anna
2014-06-25  1:47 ` [PATCH 3/6] ARM: dts: OMAP2+: Add sub mailboxes device node information Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  1:47 ` [PATCH 4/6] mailbox/omap: adapt to the new mailbox framework Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  1:47 ` [PATCH 5/6] ARM: dts: OMAP2+: Add #mbox-cells property to all mailbox nodes Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  1:47 ` [PATCH 6/6] mailbox/omap: add a custom of_xlate function Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  1:47   ` Suman Anna
2014-06-25  8:39   ` Arnd Bergmann
2014-06-25  8:39     ` Arnd Bergmann
2014-06-25 16:32     ` Suman Anna
2014-06-25 16:32       ` Suman Anna
2014-06-25 16:32       ` Suman Anna

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=53B1BBA8.5090507@ti.com \
    --to=s-anna@ti.com \
    --cc=d-gerlach@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    /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.