From: Matt Porter <mporter-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Jassi Brar <jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Jassi Brar
<jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
"Anna, Suman" <s-anna-l0cyMroinI0@public.gmane.org>,
Loic Pallardy <loic.pallardy-qxv4g6HH51o@public.gmane.org>,
LeyFoon Tan <lftan.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Craig McGeachie <slapdau-/E1597aS9LT0CCvOHzKKcA@public.gmane.org>,
Courtney Cavin
<courtney.cavin-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>,
Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Josh Cartwright <joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
"ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
<ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Devicetree List
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCHv5 2/4] mailbox: Introduce framework for mailbox
Date: Mon, 2 Jun 2014 18:04:02 -0400 [thread overview]
Message-ID: <20140602220402.GU32082@beef> (raw)
In-Reply-To: <CABb+yY3ZYqtT+R0PwZDtpW0O0SsbxTyiYmXaseZHoj4Nr6UBPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[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
next parent reply other threads:[~2014-06-02 22:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 ` Matt Porter [this message]
[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 ` [PATCHv5 2/4] mailbox: Introduce framework for mailbox Matt Porter
2014-06-05 11:39 ` Jassi Brar
2014-06-11 16:07 ` Mark Brown
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=20140602220402.GU32082@beef \
--to=mporter-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=courtney.cavin-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=lftan.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=loic.pallardy-qxv4g6HH51o@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=s-anna-l0cyMroinI0@public.gmane.org \
--cc=slapdau-/E1597aS9LT0CCvOHzKKcA@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).