* Re: [PATCHv5 2/4] mailbox: Introduce framework for mailbox [not found] ` <CABb+yY3ZYqtT+R0PwZDtpW0O0SsbxTyiYmXaseZHoj4Nr6UBPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-06-02 22:04 ` Matt Porter 0 siblings, 0 replies; 4+ messages in thread From: Matt Porter @ 2014-06-02 22:04 UTC (permalink / raw) To: Jassi Brar Cc: Jassi Brar, Arnd Bergmann, lkml, Greg Kroah-Hartman, Anna, Suman, Loic Pallardy, LeyFoon Tan, Craig McGeachie, Courtney Cavin, Rob Herring, Josh Cartwright, Linus Walleij, Kumar Gala, ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, Devicetree List [Adding devicetree list] On Mon, Jun 02, 2014 at 10:41:44PM +0530, Jassi Brar wrote: > On Mon, Jun 2, 2014 at 8:44 PM, Matt Porter <mporter-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote: > > On Fri, May 30, 2014 at 11:01:55AM +0530, Jassi Brar wrote: > > > >> Being more specific to your platform, I think you need some server > >> code (mailbox's client) that every driver (like clock, pmu, pinmux > >> etc) registers with to send messages to remote and receive commands > >> from remote ... perhaps by registering some filter to sort out > >> messages for each driver. > > > > Right, and here's where you hit on the problem. This server you mention > > is not a piece of hardware, it would be a software construct. As such, it > > doesn't fit into the DT binding as it exists. It's probably best to > > illustrate in DT syntax. > > > > If I were to represent the hardware relationship in the DT binding now > > it would look like this: > > > > --- > > cpm: mailbox@deadbeef { > > compatible = "brcm,bcm-cpm-mailbox"; > > reg = <...>; > > #mbox-cells <1>; > > interrupts = <...>; > > }; > > > > /* clock complex */ > > ccu { > > compatible = "brcm,bcm-foo-ccu"; > > mbox = <&cpm CPM_SYSTEM_CHANNEL>; > > mbox-names = "system"; > > /* leaving out other mailboxes for brevity */ > > #clock-cells <1>; > > clock-output-names = "bar", > > "baz"; > > }; > > > > pmu { > > compatible = "brcm,bcm-foo-pmu" > > mbox = <&cpm CPM_SYSTEM_CHANNEL>; > > mbox-names = "system"; > > }; > > > > pinmux { > > compatible = "brcm,bcm-foo-pinctrl"; > > mbox = <&cpm CPM_SYSTEM_CHANNEL>; > > mbox-names = "system"; > > }; > > --- > Yeah, I too don't think its a good idea. > > > > What we would need to do is completely ignore this information in each > > of the of the client drivers associated with the clock, pmu, and pinmux > > devices. This IPC server would need to be instantiated and get the > > mailbox information from some source. mbox_request_channel() only works > > when the client has an of_node with the mbox-names property present. > > Let's say we follow this model and represent it in DT: > > > > -- > > cpm: mailbox@deadbeef { > > compatible = "brcm,bcm-cpm-mailbox"; > > reg = <...>; > > #mbox-cells <1>; > > interrupts = <...>; > > }; > > > > cpm_ipc { > > compatible = "brcm,bcm-cpm-ipc"; > > mbox = <&cpm CPM_SYSTEM_CHANNEL>; > > mbox-names = "system"; > > /* leaving out other mailboxes for brevity */ > > }; > > --- > > > > This would allow an ipc driver to exclusively own this system channel, > > but now we've invented a binding that doesn't reflect the hardware at > > all. It's describing software so I don't believe the DT maintainers will > > allow this type of construct. > > > Must the server node specify MMIO and an IRQ, to be acceptable? Like ... My bad, that was a cut and paste typo..I intended to remove those properties as you do below. > > cpm_ipc : cpm@deadbeef { > compatible = "brcm,bcm-cpm-ipc"; > /* reg = <0xdeadbeef 0x100>; */ > /* interrupts = <0 123 4>; */ > mbox = <&cpm CPM_SYSTEM_CHANNEL>; > mbox-names = "system"; > }; Correct, this should have been: cpm_ipc { compatible = "brcm,bcm-cpm-ipc"; mbox = <&cpm CPM_SYSTEM_CHANNEL>; mbox-names = "system"; }; > cpm_ipc already specifies a hardware resource (mbox) that its driver > needs, I think that should be enough reason. If it were some purely > soft property for the driver like > mode = "poll"; //or "irq" > then the node wouldn't be justified because that is the job of a > build-time config or run-time module option. Hrm, this is where I'd like to hear from the DT maintainers since we have to live with this generic binding. If they are ok with us creating bindings for a virtual device that exists only to match with our ipc driver then it will work. I'm not aware of other similar examples though. -Matt -- 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <CAPKp9uZTnWCojeZHyvrm=vTuY15dAHiW1CWP18JUfuKU-mfH0Q@mail.gmail.com>]
[parent not found: <CAJe_ZheA_2PwzFGwx2rdba0oVsAKRnwK02XE-8nPY6K5NKpdTw@mail.gmail.com>]
[parent not found: <CAJe_ZheA_2PwzFGwx2rdba0oVsAKRnwK02XE-8nPY6K5NKpdTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCHv5 2/4] mailbox: Introduce framework for mailbox [not found] ` <CAJe_ZheA_2PwzFGwx2rdba0oVsAKRnwK02XE-8nPY6K5NKpdTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-06-05 11:12 ` Matt Porter 2014-06-05 11:39 ` Jassi Brar 2014-06-11 16:07 ` Mark Brown 0 siblings, 2 replies; 4+ messages in thread From: Matt Porter @ 2014-06-05 11:12 UTC (permalink / raw) To: Jassi Brar Cc: Sudeep Holla, Jassi Brar, Arnd Bergmann, lkml, Greg Kroah-Hartman, Anna, Suman, Loic Pallardy, LeyFoon Tan, Craig McGeachie, Courtney Cavin, Rob Herring, Josh Cartwright, Linus Walleij, Kumar Gala, ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, Devicetree List On Tue, Jun 03, 2014 at 03:51:55PM +0530, Jassi Brar wrote: > On 3 June 2014 15:05, Sudeep Holla <sudeep.holla-5wv7dgnIgG8@public.gmane.org> wrote: > > Hi Jassi, > > > > On Mon, Jun 2, 2014 at 6:11 PM, Jassi Brar <jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> On Mon, Jun 2, 2014 at 8:44 PM, Matt Porter <mporter-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote: > >>> On Fri, May 30, 2014 at 11:01:55AM +0530, Jassi Brar wrote: > >>> > >>>> Being more specific to your platform, I think you need some server > >>>> code (mailbox's client) that every driver (like clock, pmu, pinmux > >>>> etc) registers with to send messages to remote and receive commands > >>>> from remote ... perhaps by registering some filter to sort out > >>>> messages for each driver. > >>> > >>> Right, and here's where you hit on the problem. This server you mention > >>> is not a piece of hardware, it would be a software construct. As such, it > >>> doesn't fit into the DT binding as it exists. It's probably best to > >>> illustrate in DT syntax. > >>> > >>> If I were to represent the hardware relationship in the DT binding now > >>> it would look like this: > >>> > >>> --- > >>> cpm: mailbox@deadbeef { > >>> compatible = "brcm,bcm-cpm-mailbox"; > >>> reg = <...>; > >>> #mbox-cells <1>; > >>> interrupts = <...>; > >>> }; > >>> > >>> /* clock complex */ > >>> ccu { > >>> compatible = "brcm,bcm-foo-ccu"; > >>> mbox = <&cpm CPM_SYSTEM_CHANNEL>; > >>> mbox-names = "system"; > >>> /* leaving out other mailboxes for brevity */ > >>> #clock-cells <1>; > >>> clock-output-names = "bar", > >>> "baz"; > >>> }; > >>> > >>> pmu { > >>> compatible = "brcm,bcm-foo-pmu" > >>> mbox = <&cpm CPM_SYSTEM_CHANNEL>; > >>> mbox-names = "system"; > >>> }; > >>> > >>> pinmux { > >>> compatible = "brcm,bcm-foo-pinctrl"; > >>> mbox = <&cpm CPM_SYSTEM_CHANNEL>; > >>> mbox-names = "system"; > >>> }; > >>> --- > >> Yeah, I too don't think its a good idea. > >> > >> > >>> What we would need to do is completely ignore this information in each > >>> of the of the client drivers associated with the clock, pmu, and pinmux > >>> devices. This IPC server would need to be instantiated and get the > >>> mailbox information from some source. mbox_request_channel() only works > >>> when the client has an of_node with the mbox-names property present. > >>> Let's say we follow this model and represent it in DT: > >>> > >>> -- > >>> cpm: mailbox@deadbeef { > >>> compatible = "brcm,bcm-cpm-mailbox"; > >>> reg = <...>; > >>> #mbox-cells <1>; > >>> interrupts = <...>; > >>> }; > >>> > >>> cpm_ipc { > >>> compatible = "brcm,bcm-cpm-ipc"; > >>> mbox = <&cpm CPM_SYSTEM_CHANNEL>; > >>> mbox-names = "system"; > >>> /* leaving out other mailboxes for brevity */ > >>> }; > >>> --- > >>> > >>> This would allow an ipc driver to exclusively own this system channel, > >>> but now we've invented a binding that doesn't reflect the hardware at > >>> all. It's describing software so I don't believe the DT maintainers will > >>> allow this type of construct. > >>> > >> Must the server node specify MMIO and an IRQ, to be acceptable? Like ... > >> > >> cpm_ipc : cpm@deadbeef { > >> compatible = "brcm,bcm-cpm-ipc"; > >> /* reg = <0xdeadbeef 0x100>; */ > >> /* interrupts = <0 123 4>; */ > >> mbox = <&cpm CPM_SYSTEM_CHANNEL>; > >> mbox-names = "system"; > >> }; > >> > >> cpm_ipc already specifies a hardware resource (mbox) that its driver > >> needs, I think that should be enough reason. If it were some purely > >> soft property for the driver like > >> mode = "poll"; //or "irq" > >> then the node wouldn't be justified because that is the job of a > >> build-time config or run-time module option. > >> > > > > Like Matt, I am also in similar situation where there's a lot of common > > code necessary to construct/parse IPCs for each of the drivers using the > > mailbox. > > > > As per your suggestion if we have single DT node to specify both the > > controller and the client, we might still have to pollute this node with > > software specific compatibles. > > > I am afraid you misunderstood me. I don't suggest single node for > mailbox controller and client, and IIUC, neither did Matt. Please note > the controller is cpm and client is cpm_ipc. Correct, I had separate controller and consumer nodes as written above...to match the binding. > BTW, here we at least have a hardware resource to specify in the DT > node, there are examples in kernel where the DT nodes are purely > virtual. For ex, grep for "linux,spdif-dit". So I think we should be > ok. > There's a bit of a difference between my concern over a virtual node and this example you've cited. In the dummy spdif transmitter, it's defining a virtual device that plugs in for a codec, a hardware concept well defined in the audio bindings. I agree that there are many examples of this type of virtual node, including dummy phys, but in all cases they are stubbing out a real hardware concept. I find it to be distinctly different to create a node that doesn't represent the hardware's use of mailboxes. I'd be happy if a DT maintainer could say that this is acceptable though. ;) -Matt -- 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv5 2/4] mailbox: Introduce framework for mailbox 2014-06-05 11:12 ` Matt Porter @ 2014-06-05 11:39 ` Jassi Brar 2014-06-11 16:07 ` Mark Brown 1 sibling, 0 replies; 4+ messages in thread From: Jassi Brar @ 2014-06-05 11:39 UTC (permalink / raw) To: Matt Porter Cc: Sudeep Holla, Jassi Brar, Arnd Bergmann, lkml, Greg Kroah-Hartman, Anna, Suman, Loic Pallardy, LeyFoon Tan, Craig McGeachie, Courtney Cavin, Rob Herring, Josh Cartwright, Linus Walleij, Kumar Gala, ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, Devicetree List On 5 June 2014 16:42, Matt Porter <mporter-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote: > On Tue, Jun 03, 2014 at 03:51:55PM +0530, Jassi Brar wrote: > >> BTW, here we at least have a hardware resource to specify in the DT >> node, there are examples in kernel where the DT nodes are purely >> virtual. For ex, grep for "linux,spdif-dit". So I think we should be >> ok. >> > > There's a bit of a difference between my concern over a virtual node and > this example you've cited. In the dummy spdif transmitter, it's defining > a virtual device that plugs in for a codec, a hardware concept well > defined in the audio bindings. I agree that there are many examples of > this type of virtual node, including dummy phys, but in all cases they > are stubbing out a real hardware concept. > > I find it to be distinctly different to create a node that doesn't > represent the hardware's use of mailboxes. > The way I see "cpm_ipc" is that it represents a device that doesn't need MMIO or an IRQ, but only the mailbox hardware resource. "linux,spdif-dit" needs no hardware resource at all. So if anything, more "virtual" than cpm_ipc. > I'd be happy if a DT > maintainer could say that this is acceptable though. ;) > OK, though it becomes clear only after reading this ;) Cheers -Jassi -- 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv5 2/4] mailbox: Introduce framework for mailbox 2014-06-05 11:12 ` Matt Porter 2014-06-05 11:39 ` Jassi Brar @ 2014-06-11 16:07 ` Mark Brown 1 sibling, 0 replies; 4+ messages in thread From: Mark Brown @ 2014-06-11 16:07 UTC (permalink / raw) To: Matt Porter Cc: Jassi Brar, Sudeep Holla, Jassi Brar, Arnd Bergmann, lkml, Greg Kroah-Hartman, Anna, Suman, Loic Pallardy, LeyFoon Tan, Craig McGeachie, Courtney Cavin, Rob Herring, Josh Cartwright, Linus Walleij, Kumar Gala, ks.giri@samsung.com, Devicetree List [-- Attachment #1: Type: text/plain, Size: 1162 bytes --] On Thu, Jun 05, 2014 at 07:12:05AM -0400, Matt Porter wrote: > On Tue, Jun 03, 2014 at 03:51:55PM +0530, Jassi Brar wrote: > > BTW, here we at least have a hardware resource to specify in the DT > > node, there are examples in kernel where the DT nodes are purely > > virtual. For ex, grep for "linux,spdif-dit". So I think we should be > > ok. > There's a bit of a difference between my concern over a virtual node and > this example you've cited. In the dummy spdif transmitter, it's defining > a virtual device that plugs in for a codec, a hardware concept well > defined in the audio bindings. I agree that there are many examples of > this type of virtual node, including dummy phys, but in all cases they > are stubbing out a real hardware concept. Well, really it's an actual physical thing - it's something that appears in the schematic and can be pointed at on the board but just doesn't have software control. From that point of view if the software that's being interacted with on the remote processor is in ROM/flash which won't or can't be realistically be updated (which seems to be mostly the case) then you can reasonably say the same thing. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-11 16:07 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1400134105-3847-1-git-send-email-jaswinder.singh@linaro.org> [not found] ` <1400134260-3962-1-git-send-email-jaswinder.singh@linaro.org> [not found] ` <7978295.UBGxYvcnvH@wuerfel> [not found] ` <CAJe_Zhe_VFTpPW0sKBsqit347MR7QmEDvzvQTyh1DWr3v991tg@mail.gmail.com> [not found] ` <20140529154348.GH32082@beef> [not found] ` <CABb+yY2PiGpqy2uevCFexAKeS4aZxJxZHEDJTRN1SW6VVjBzGQ@mail.gmail.com> [not found] ` <20140602151454.GK32082@beef> [not found] ` <CABb+yY3ZYqtT+R0PwZDtpW0O0SsbxTyiYmXaseZHoj4Nr6UBPQ@mail.gmail.com> [not found] ` <CABb+yY3ZYqtT+R0PwZDtpW0O0SsbxTyiYmXaseZHoj4Nr6UBPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2014-06-02 22:04 ` [PATCHv5 2/4] mailbox: Introduce framework for mailbox Matt Porter [not found] ` <CAPKp9uZTnWCojeZHyvrm=vTuY15dAHiW1CWP18JUfuKU-mfH0Q@mail.gmail.com> [not found] ` <CAJe_ZheA_2PwzFGwx2rdba0oVsAKRnwK02XE-8nPY6K5NKpdTw@mail.gmail.com> [not found] ` <CAJe_ZheA_2PwzFGwx2rdba0oVsAKRnwK02XE-8nPY6K5NKpdTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2014-06-05 11:12 ` Matt Porter 2014-06-05 11:39 ` Jassi Brar 2014-06-11 16:07 ` Mark Brown
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).