devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Suman Anna <s-anna-l0cyMroinI0@public.gmane.org>
Cc: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>,
	Jassi Brar
	<jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Jassi Brar
	<jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 2/6] mailbox/omap: add support for parsing dt devices
Date: Wed, 9 Jul 2014 01:29:07 -0700	[thread overview]
Message-ID: <20140709082906.GG28884@atomide.com> (raw)
In-Reply-To: <53BC3081.9010402-l0cyMroinI0@public.gmane.org>

* Suman Anna <s-anna-l0cyMroinI0@public.gmane.org> [140708 10:57]:
> Hi Tony, Pavel,
> 
> On 07/04/2014 03:23 AM, Tony Lindgren wrote:
> > * Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org> [140704 01:07]:
> >> Hi!
> >>
> >>>>>>>>> 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,
> >>>>>>>>> +};
> >>>>>>>>
> >>
> >>>> Aha, ok, then the intr_type should be derived from
> >>>> compatible-string. Or rather... you should have three
> >>>> compatible-strings for the three possibilities? (And then subtype,
> >>>> currently unused, in case there are more hw differences).
> >>>
> >>> The compatible string can and should be separate for each revision
> >>> unless they are the same exacat hardware revision.
> >>
> >> ACK.
> 
> I checked the revision register from all SoCs. OMAP2 and OMAP3 have
> different revisions compared to OMAP4+. All of OMAP4, OMAP5, DRA7,
> AM335x and AM437x have the same version, but with different num-fifos
> and num-users.  So, I can switch back to using omap4-mailbox for all of
> these SoCs only if we encode the num-fifos and num-users in DT.
> 
> >>
> >>>>> 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.
> >>>>
> >>>> Ok, right... I'd vote for putting them into DT.
> >>>
> >>> I would avoid adding custom DT properties where possible and let the
> >>> driver just initialize the right data based on the compatible flag.
> >>
> >> If these are HW IP design parameters, we can expect to see many
> >> different combinations. Yet we know ahead of time how to handle
> >> different parameters HW people select.
> 
> That's right, the above OMAP4+ SoCs already demonstrate this behavior.
> 
> >>
> >> Thus IMO we should do it in the device tree.
> > 
> > Oh you mean from supporting new hardware with just .dts changes?
> > From that point of view it makes sense to have them as DT properties,
> > so I'm fine with that.
> > 
> > Let's just try to use something that's generic like fifosize. No idea
> > how the property for num_fifos should be handled though as that
> > implies some knowledge in the driver which num_users have fifos?
> 
> The fifos are not per num_users, but rather the total number of fifos
> within the IP block. The num_users will be the number of targets the IP
> block can interrupt. I tried looking for generic properties, but there
> weren't any that seem to fit the description. If you want generic names,
> I can use num-fifos and num-users, otherwise will stick to the
> names defined in the previous series.

OK since we already have some .dts entries with ti,mbox-num-fifos and
ti,mbox-num-users I'd use those for now. Adding parsing for a generic
property can be done later on.

> > So unless that can be described clearly in a DT property as well,
> > the binding might be still unusable for new hardware :)
> > 
> 
> I don't expect the OMAP mailbox IP to change much in the future. There
> is a FIFO depth parameter as well, but that's constant in all the
> current versions, and even if they change it, I can already use the
> generic property for that.

OK
 
> Tony,
> Depending on the agreement here, I may have to respin the OMAP
> mailbox DT/hwmod cleanup series [1]

OK let me know.

Regards,

Tony
 
> [1] http://marc.info/?l=linux-omap&m=140365833121612&w=2
> 
--
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:[~2014-07-09  8:29 UTC|newest]

Thread overview: 20+ 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 ` [PATCH 1/6] Documentation: dt: add omap mailbox bindings Suman Anna
2014-06-25  1:47 ` [PATCH 2/6] mailbox/omap: add support for parsing dt devices Suman Anna
2014-06-28 17:07   ` Pavel Machek
2014-06-30 16:00     ` Suman Anna
2014-06-30 18:59       ` Pavel Machek
2014-06-30 19:34         ` Suman Anna
2014-06-30 20:32           ` Pavel Machek
2014-07-04  6:45             ` Tony Lindgren
2014-07-04  8:05               ` Pavel Machek
     [not found]                 ` <20140704080556.GA16274-tWAi6jLit6GreWDznjuHag@public.gmane.org>
2014-07-04  8:23                   ` Tony Lindgren
     [not found]                     ` <20140704082354.GD28884-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-07-08 17:55                       ` Suman Anna
     [not found]                         ` <53BC3081.9010402-l0cyMroinI0@public.gmane.org>
2014-07-09  8:29                           ` Tony Lindgren [this message]
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 ` [PATCH 4/6] mailbox/omap: adapt to the new mailbox framework 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 ` [PATCH 6/6] mailbox/omap: add a custom of_xlate function Suman Anna
2014-06-25  8:39   ` Arnd Bergmann
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=20140709082906.GG28884@atomide.com \
    --to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
    --cc=d-gerlach-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pavel-+ZI9xUNit7I@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=s-anna-l0cyMroinI0@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).