diff mbox

[2/2] arm64: dts: exynos: added mailbox node

Message ID 1395057839-23871-3-git-send-email-ks.giri@samsung.com
State Superseded, archived
Headers show

Commit Message

Girish K S March 17, 2014, 12:03 p.m. UTC
This patch adds the dt node for the mailbox IP

Signed-off-by: Girish K S <ks.giri@samsung.com>

Change-Id: I35e45e9a62592887a84a909aee54f259a2f731fa
---
 .../bindings/mailbox/samsung-mailbox.txt           |   24 +++++++
 arch/arm64/boot/dts/samsung-gh7.dtsi               |   66 ++++++++++++++++++++
 arch/arm64/boot/dts/samsung-ssdk-gh7.dts           |    3 +
 3 files changed, 93 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt

Comments

girishks2000@gmail.com March 17, 2014, 12:08 p.m. UTC | #1
On Mon, Mar 17, 2014 at 5:33 PM, Girish K S <ks.giri@samsung.com> wrote:
> This patch adds the dt node for the mailbox IP
>
> Signed-off-by: Girish K S <ks.giri@samsung.com>
>
> Change-Id: I35e45e9a62592887a84a909aee54f259a2f731fa

Sorry for this. will modify in the v2 with other comments

> ---
>  .../bindings/mailbox/samsung-mailbox.txt           |   24 +++++++
>  arch/arm64/boot/dts/samsung-gh7.dtsi               |   66 ++++++++++++++++++++
>  arch/arm64/boot/dts/samsung-ssdk-gh7.dts           |    3 +
>  3 files changed, 93 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
>
> diff --git a/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt b/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
> new file mode 100644
> index 0000000..1908d71
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
> @@ -0,0 +1,24 @@
> +
> +Samsung Mailbox Driver
> +
> +Required properties:
> +- compatible:          Should be one of the following,
> +                           "samsung,gh7-mailbox" for
> +                               Samsung GH7 SoC series
> +                           "samsung,exynos-mailbox" for
> +                               exynosx SoC series
> +- reg:                 Contains the mailbox register address range (base address
> +                       and length)
> +- interrupts:          Contains the interrupt information for the mailbox
> +                       device.
> +- samsung,mbox-names:  Array of the names of the mailboxes
> +
> +Example:
> +
> +/* Samsung GH7 SoC */
> +mailbox@100a0000 {
> +       compatible = "samsung,gh7-mailbox";
> +       reg = <0x0 0x100a0000 0x0 0x1000>;
> +       interrupts = <0 310 0>;
> +       samsung,mbox-names = "a7q-scp";
> +};
> diff --git a/arch/arm64/boot/dts/samsung-gh7.dtsi b/arch/arm64/boot/dts/samsung-gh7.dtsi
> index c3610bd..be4cce9 100644
> --- a/arch/arm64/boot/dts/samsung-gh7.dtsi
> +++ b/arch/arm64/boot/dts/samsung-gh7.dtsi
> @@ -107,5 +107,71 @@
>                         interrupts = <0 420 0>;
>                         arm,primecell-periphid = <0x341011>; /* HACK */
>                 };
> +
> +       };
> +
> +       mailbox@100a0000 {
> +               compatible = "samsung,gh7-mailbox";
> +               reg = <0x0 0x100a0000 0x0 0x1000>;
> +               interrupts = <0 310 0>;
> +               samsung,mbox-names = "a7q-scp";
> +               status = "disabled";
> +       };
> +
> +       mailbox@24100000 {
> +               compatible = "samsung,exynos-mailbox";
> +               reg =   < 0x0 0x24100000 0x0 0x10000>;
> +               interrupts = <0 251 0>;
> +               samsung,mbox-names = "ncp-a7q-0";
> +               status = "disabled";
> +       };
> +       mailbox@24110000 {
> +               compatible = "samsung,exynos-mailbox";
> +               reg =   <0x0 0x24110000 0x0 0x10000>;
> +               interrupts = <0 252 0>;
> +               samsung,mbox-names = "ncp-a7q-1";
> +               status = "disabled";
> +       };
> +       mailbox@24120000 {
> +               compatible = "samsung,exynos-mailbox";
> +               reg =   <0x0 0x24120000 0x0 0x10000>;
> +               interrupts = <0 253 0>;
> +               samsung,mbox-names = "ncp-a7q-2";
> +               status = "disabled";
> +       };
> +       mailbox@24130000 {
> +               compatible = "samsung,exynos-mailbox";
> +               reg =   <0x0 0x24130000 0x0 0x10000>;
> +               interrupts = <0 254 0>;
> +               samsung,mbox-names = "ncp-a7q-3";
> +               status = "disabled";
> +       };
> +       mailbox@24140000 {
> +               compatible = "samsung,exynos-mailbox";
> +               reg =   <0x0 0x24140000 0x0 0x10000>;
> +               interrupts = <0 255 0>;
> +               samsung,mbox-names = "ncp-a7q-4";
> +               status = "disabled";
> +       };
> +       mailbox@24150000 {
> +               compatible = "samsung,exynos-mailbox";
> +               reg =   <0x0 0x24150000 0x0 0x10000>;
> +               interrupts = <0 256 0>;
> +               samsung,mbox-names = "ncp-a7q-5";
> +               status = "disabled";
> +       };
> +       mailbox@24160000 {
> +               compatible = "samsung,exynos-mailbox";
> +               reg =   <0x0 0x24160000 0x0 0x10000>;
> +               interrupts = <0 257 0>;
> +               samsung,mbox-names = "ncp-a7q-6";
> +               status = "disabled";
> +       };
> +       mailbox@24170000 {
> +               compatible = "samsung,exynos-mailbox";
> +               reg =   <0x0 0x24170000 0x0 0x10000>;
> +               interrupts = <0 258 0>;
> +               samsung,mbox-names = "ncp-a7q-7";
> +               status = "disabled";
>         };
>  };
> diff --git a/arch/arm64/boot/dts/samsung-ssdk-gh7.dts b/arch/arm64/boot/dts/samsung-ssdk-gh7.dts
> index 4ce7d67..bfe5455 100644
> --- a/arch/arm64/boot/dts/samsung-ssdk-gh7.dts
> +++ b/arch/arm64/boot/dts/samsung-ssdk-gh7.dts
> @@ -23,4 +23,7 @@
>                 device_type = "memory";
>                 reg = <0x00000000 0x80000000 0 0x20000000>;
>         };
> +       mailbox@100a0000 {
> +               status = "okay";
> +       };
>  };
> --
> 1.7.10.4
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann March 17, 2014, 12:15 p.m. UTC | #2
On Monday 17 March 2014 17:33:59 Girish K S wrote:
> +Samsung Mailbox Driver
> +
> +Required properties:
> +- compatible:          Should be one of the following,
> +                           "samsung,gh7-mailbox" for
> +                               Samsung GH7 SoC series
> +                           "samsung,exynos-mailbox" for
> +                               exynosx SoC series
> +- reg:                 Contains the mailbox register address range (base address
> +                       and length)
> +- interrupts:          Contains the interrupt information for the mailbox
> +                       device.
> +- samsung,mbox-names:  Array of the names of the mailboxes
> 

I think we should not allow new mailbox drivers that don't conform to
the framework that is currently under discussion. In particular, this
means don't do a "samsung,mbox-names" property. The current consensus
seems to be to have a #mbox-cells" property that allows to pass extra
parameters from the client driver, and uses an "mboxes" property
to reference the mailbox provided.

It would be good if you follow up for the subsystem discussion and
ensure it gets merged in time, and supports all the use cases you are
interested in. The interface is not entirely nailed down yet, so
it's a good time to contribute. However, I can already promise that
it won't use matching by strings.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Rutland March 17, 2014, 2:06 p.m. UTC | #3
On Mon, Mar 17, 2014 at 12:03:59PM +0000, Girish K S wrote:
> This patch adds the dt node for the mailbox IP
> 
> Signed-off-by: Girish K S <ks.giri@samsung.com>
> 
> Change-Id: I35e45e9a62592887a84a909aee54f259a2f731fa
> ---
>  .../bindings/mailbox/samsung-mailbox.txt           |   24 +++++++
>  arch/arm64/boot/dts/samsung-gh7.dtsi               |   66 ++++++++++++++++++++
>  arch/arm64/boot/dts/samsung-ssdk-gh7.dts           |    3 +
>  3 files changed, 93 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt b/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
> new file mode 100644
> index 0000000..1908d71
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
> @@ -0,0 +1,24 @@
> +
> +Samsung Mailbox Driver
> +
> +Required properties:
> +- compatible:		Should be one of the following,
> +			    "samsung,gh7-mailbox" for
> +				Samsung GH7 SoC series
> +			    "samsung,exynos-mailbox" for
> +				exynosx SoC series
> +- reg:			Contains the mailbox register address range (base address
> +			and length)
> +- interrupts: 		Contains the interrupt information for the mailbox
> +			device.

How many interrupts?

What are they for?

> +- samsung,mbox-names:	Array of the names of the mailboxes

Juding by the code there is one name per reg entry, but the description
above implies a single entry (as all the dt fragments have).

What values are expected? What is the consumer of these values? What are
they used for?

> +
> +Example:
> +
> +/* Samsung GH7 SoC */
> +mailbox@100a0000 {
> +	compatible = "samsung,gh7-mailbox";
> +	reg = <0x0 0x100a0000 0x0 0x1000>;
> +	interrupts = <0 310 0>;
> +	samsung,mbox-names = "a7q-scp";
> +};
> diff --git a/arch/arm64/boot/dts/samsung-gh7.dtsi b/arch/arm64/boot/dts/samsung-gh7.dtsi
> index c3610bd..be4cce9 100644
> --- a/arch/arm64/boot/dts/samsung-gh7.dtsi
> +++ b/arch/arm64/boot/dts/samsung-gh7.dtsi
> @@ -107,5 +107,71 @@
>  			interrupts = <0 420 0>;
>  			arm,primecell-periphid = <0x341011>; /* HACK */

This looks odd.

What tree is this against?

Cheers,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jassi Brar March 17, 2014, 2:58 p.m. UTC | #4
On Mon, Mar 17, 2014 at 5:45 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 17 March 2014 17:33:59 Girish K S wrote:
>> +Samsung Mailbox Driver
>> +
>> +Required properties:
>> +- compatible:          Should be one of the following,
>> +                           "samsung,gh7-mailbox" for
>> +                               Samsung GH7 SoC series
>> +                           "samsung,exynos-mailbox" for
>> +                               exynosx SoC series
>> +- reg:                 Contains the mailbox register address range (base address
>> +                       and length)
>> +- interrupts:          Contains the interrupt information for the mailbox
>> +                       device.
>> +- samsung,mbox-names:  Array of the names of the mailboxes
>>
>
> I think we should not allow new mailbox drivers that don't conform to
> the framework that is currently under discussion. In particular, this
> means don't do a "samsung,mbox-names" property. The current consensus
> seems to be to have a #mbox-cells" property that allows to pass extra
> parameters from the client driver, and uses an "mboxes" property
> to reference the mailbox provided.
>
> It would be good if you follow up for the subsystem discussion and
> ensure it gets merged in time, and supports all the use cases you are
> interested in. The interface is not entirely nailed down yet, so
> it's a good time to contribute. However, I can already promise that
> it won't use matching by strings.
>
I was just about to submit next revision of framework that this
Samsung driver conforms to. Now I think I need some expert opinion ...
(sorry if following is repetition)

  As Kumar Gala pointed out in the other thread, the mailbox/ipc chain
is going to be _very_ platform specific so much so that one rethinks
if a common api is even warranted : because the client driver will be
different even if just the remote api(which is going to be
proprietary) changes, keeping everything else same. For example, a
client driver for Highbank is highly unlikely to be reusable on
Exynos, even if both used the same mailbox controller. By my limited
foresight, mailbox assignment via DT doesn't bring us much benefit but
only ritual code.

  Perhaps the mailbox controller driver should name its links as it
wants. By how the remote works with the mailbox links, the client
driver asks for a specific mailbox link (which maybe a hardcoded
string in the driver or be gotten alongside other data via client's
DT) ?

  IOW we can't have a generic API/DT-bindings that could get us
reusable client drivers. But only common framework/code that would
otherwise be duplicated by every platform.

Thanks
Jassi
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
girishks2000@gmail.com March 19, 2014, 4:06 a.m. UTC | #5
On Mon, Mar 17, 2014 at 7:36 PM, Mark Rutland <mark.rutland@arm.com> wrote:
> On Mon, Mar 17, 2014 at 12:03:59PM +0000, Girish K S wrote:
>> This patch adds the dt node for the mailbox IP
>>
>> Signed-off-by: Girish K S <ks.giri@samsung.com>
>>
>> Change-Id: I35e45e9a62592887a84a909aee54f259a2f731fa
>> ---
>>  .../bindings/mailbox/samsung-mailbox.txt           |   24 +++++++
>>  arch/arm64/boot/dts/samsung-gh7.dtsi               |   66 ++++++++++++++++++++
>>  arch/arm64/boot/dts/samsung-ssdk-gh7.dts           |    3 +
>>  3 files changed, 93 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
>>
>> diff --git a/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt b/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
>> new file mode 100644
>> index 0000000..1908d71
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
>> @@ -0,0 +1,24 @@
>> +
>> +Samsung Mailbox Driver
>> +
>> +Required properties:
>> +- compatible:                Should be one of the following,
>> +                         "samsung,gh7-mailbox" for
>> +                             Samsung GH7 SoC series
>> +                         "samsung,exynos-mailbox" for
>> +                             exynosx SoC series
>> +- reg:                       Contains the mailbox register address range (base address
>> +                     and length)
>> +- interrupts:                Contains the interrupt information for the mailbox
>> +                     device.
>
> How many interrupts?
just one receive interrupt
I will update this detail in binding doc
>
> What are they for?
It is only for receive from remote processor
>
>> +- samsung,mbox-names:        Array of the names of the mailboxes
>
> Juding by the code there is one name per reg entry, but the description
> above implies a single entry (as all the dt fragments have).
>
> What values are expected? What is the consumer of these values? What are
> they used for?
These names are used to mention the links in the platform. tx and rx
link via mailbox.
i can mention of 2 consumers now. the ipmi driver and the cpu freq
driver. They are used
to exchange information with the remote processor
>
>> +
>> +Example:
>> +
>> +/* Samsung GH7 SoC */
>> +mailbox@100a0000 {
>> +     compatible = "samsung,gh7-mailbox";
>> +     reg = <0x0 0x100a0000 0x0 0x1000>;
>> +     interrupts = <0 310 0>;
>> +     samsung,mbox-names = "a7q-scp";
>> +};
>> diff --git a/arch/arm64/boot/dts/samsung-gh7.dtsi b/arch/arm64/boot/dts/samsung-gh7.dtsi
>> index c3610bd..be4cce9 100644
>> --- a/arch/arm64/boot/dts/samsung-gh7.dtsi
>> +++ b/arch/arm64/boot/dts/samsung-gh7.dtsi
>> @@ -107,5 +107,71 @@
>>                       interrupts = <0 420 0>;
>>                       arm,primecell-periphid = <0x341011>; /* HACK */
>
> This looks odd.
>
> What tree is this against?

Sorry this was based on a internal tree. Will base it on Kukjin's gh7 base patch

>
> Cheers,
> Mark.
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann March 19, 2014, 5:46 p.m. UTC | #6
On Monday 17 March 2014, Jassi Brar wrote:
> On Mon, Mar 17, 2014 at 5:45 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 17 March 2014 17:33:59 Girish K S wrote:
> >> +Samsung Mailbox Driver
> >> +
> >> +Required properties:
> >> +- compatible:          Should be one of the following,
> >> +                           "samsung,gh7-mailbox" for
> >> +                               Samsung GH7 SoC series
> >> +                           "samsung,exynos-mailbox" for
> >> +                               exynosx SoC series
> >> +- reg:                 Contains the mailbox register address range (base address
> >> +                       and length)
> >> +- interrupts:          Contains the interrupt information for the mailbox
> >> +                       device.
> >> +- samsung,mbox-names:  Array of the names of the mailboxes
> >>
> >
> > I think we should not allow new mailbox drivers that don't conform to
> > the framework that is currently under discussion. In particular, this
> > means don't do a "samsung,mbox-names" property. The current consensus
> > seems to be to have a #mbox-cells" property that allows to pass extra
> > parameters from the client driver, and uses an "mboxes" property
> > to reference the mailbox provided.
> >
> > It would be good if you follow up for the subsystem discussion and
> > ensure it gets merged in time, and supports all the use cases you are
> > interested in. The interface is not entirely nailed down yet, so
> > it's a good time to contribute. However, I can already promise that
> > it won't use matching by strings.
> >
> I was just about to submit next revision of framework that this
> Samsung driver conforms to. Now I think I need some expert opinion ...
> (sorry if following is repetition)
> 
>   As Kumar Gala pointed out in the other thread, the mailbox/ipc chain
> is going to be _very_ platform specific so much so that one rethinks
> if a common api is even warranted : because the client driver will be
> different even if just the remote api(which is going to be
> proprietary) changes, keeping everything else same. For example, a
> client driver for Highbank is highly unlikely to be reusable on
> Exynos, even if both used the same mailbox controller. By my limited
> foresight, mailbox assignment via DT doesn't bring us much benefit but
> only ritual code.

I don't see what that would change. Doing a cross-device binding in DT
is hard, as we see by lots of people (e.g. the above "samsung,mbox-names"
crap) getting it wrong. If we do it properly once, everyone can use the
same binding, and common code to parse the connection between the
mailbox driver and the user.

>   Perhaps the mailbox controller driver should name its links as it
> wants. By how the remote works with the mailbox links, the client
> driver asks for a specific mailbox link (which maybe a hardcoded
> string in the driver or be gotten alongside other data via client's
> DT) ?

I don't see why we should do it any different from the other bindings.
Let's just stick with mboxes/mbox-names or mailboxes/mailbox-names
if you prefer.

>   IOW we can't have a generic API/DT-bindings that could get us
> reusable client drivers. But only common framework/code that would
> otherwise be duplicated by every platform.

That is a major benefit though.
Also even if most drivers won't work across multiple platforms, there
is still a reasonable chance that /some/ drivers will.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jassi Brar March 20, 2014, 4:09 p.m. UTC | #7
On Wed, Mar 19, 2014 at 11:16 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 17 March 2014, Jassi Brar wrote:

>>   Perhaps the mailbox controller driver should name its links as it
>> wants. By how the remote works with the mailbox links, the client
>> driver asks for a specific mailbox link (which maybe a hardcoded
>> string in the driver or be gotten alongside other data via client's
>> DT) ?
>
> I don't see why we should do it any different from the other bindings.
> Let's just stick with mboxes/mbox-names or mailboxes/mailbox-names
> if you prefer.
>
>>   IOW we can't have a generic API/DT-bindings that could get us
>> reusable client drivers. But only common framework/code that would
>> otherwise be duplicated by every platform.
>
> That is a major benefit though.
> Also even if most drivers won't work across multiple platforms, there
> is still a reasonable chance that /some/ drivers will.
>
It seems those /some/ drivers will have to work with everything same
but the channel name (which the client could get from its DT node when
the second platform appears).

Anyways, I accept your opinion and I will specify DT binding for
mailbox<->client in next revision.

Also I just read the new requirement of 'peek_message' for QMTM
driver, which isn't supported atm but should be easy.

Thanks
-Jassi
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann March 20, 2014, 4:12 p.m. UTC | #8
On Thursday 20 March 2014 21:39:56 Jassi Brar wrote:
> On Wed, Mar 19, 2014 at 11:16 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 17 March 2014, Jassi Brar wrote:
> 
> >>   Perhaps the mailbox controller driver should name its links as it
> >> wants. By how the remote works with the mailbox links, the client
> >> driver asks for a specific mailbox link (which maybe a hardcoded
> >> string in the driver or be gotten alongside other data via client's
> >> DT) ?
> >
> > I don't see why we should do it any different from the other bindings.
> > Let's just stick with mboxes/mbox-names or mailboxes/mailbox-names
> > if you prefer.
> >
> >>   IOW we can't have a generic API/DT-bindings that could get us
> >> reusable client drivers. But only common framework/code that would
> >> otherwise be duplicated by every platform.
> >
> > That is a major benefit though.
> > Also even if most drivers won't work across multiple platforms, there
> > is still a reasonable chance that /some/ drivers will.
> >
> It seems those /some/ drivers will have to work with everything same
> but the channel name (which the client could get from its DT node when
> the second platform appears).

Why would you ever have varying channel names? I would expect that
the name is always fixed in the binding of the client driver, like
we do for clocks or interrupts for instance.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jassi Brar March 20, 2014, 4:31 p.m. UTC | #9
On Thu, Mar 20, 2014 at 9:42 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 20 March 2014 21:39:56 Jassi Brar wrote:
>> On Wed, Mar 19, 2014 at 11:16 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Monday 17 March 2014, Jassi Brar wrote:
>>
>> >>   Perhaps the mailbox controller driver should name its links as it
>> >> wants. By how the remote works with the mailbox links, the client
>> >> driver asks for a specific mailbox link (which maybe a hardcoded
>> >> string in the driver or be gotten alongside other data via client's
>> >> DT) ?
>> >
>> > I don't see why we should do it any different from the other bindings.
>> > Let's just stick with mboxes/mbox-names or mailboxes/mailbox-names
>> > if you prefer.
>> >
>> >>   IOW we can't have a generic API/DT-bindings that could get us
>> >> reusable client drivers. But only common framework/code that would
>> >> otherwise be duplicated by every platform.
>> >
>> > That is a major benefit though.
>> > Also even if most drivers won't work across multiple platforms, there
>> > is still a reasonable chance that /some/ drivers will.
>> >
>> It seems those /some/ drivers will have to work with everything same
>> but the channel name (which the client could get from its DT node when
>> the second platform appears).
>
> Why would you ever have varying channel names? I would expect that
> the name is always fixed in the binding of the client driver, like
> we do for clocks or interrupts for instance.
>
I meant across platforms and without generic DT bindings for
mailboxes. Not during runtime.

-jassi
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt b/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
new file mode 100644
index 0000000..1908d71
--- /dev/null
+++ b/Documentation/devicetree/bindings/mailbox/samsung-mailbox.txt
@@ -0,0 +1,24 @@ 
+
+Samsung Mailbox Driver
+
+Required properties:
+- compatible:		Should be one of the following,
+			    "samsung,gh7-mailbox" for
+				Samsung GH7 SoC series
+			    "samsung,exynos-mailbox" for
+				exynosx SoC series
+- reg:			Contains the mailbox register address range (base address
+			and length)
+- interrupts: 		Contains the interrupt information for the mailbox
+			device.
+- samsung,mbox-names:	Array of the names of the mailboxes
+
+Example:
+
+/* Samsung GH7 SoC */
+mailbox@100a0000 {
+	compatible = "samsung,gh7-mailbox";
+	reg = <0x0 0x100a0000 0x0 0x1000>;
+	interrupts = <0 310 0>;
+	samsung,mbox-names = "a7q-scp";
+};
diff --git a/arch/arm64/boot/dts/samsung-gh7.dtsi b/arch/arm64/boot/dts/samsung-gh7.dtsi
index c3610bd..be4cce9 100644
--- a/arch/arm64/boot/dts/samsung-gh7.dtsi
+++ b/arch/arm64/boot/dts/samsung-gh7.dtsi
@@ -107,5 +107,71 @@ 
 			interrupts = <0 420 0>;
 			arm,primecell-periphid = <0x341011>; /* HACK */
 		};
+
+	};
+
+	mailbox@100a0000 {
+		compatible = "samsung,gh7-mailbox";
+		reg = <0x0 0x100a0000 0x0 0x1000>;
+		interrupts = <0 310 0>;
+		samsung,mbox-names = "a7q-scp";
+		status = "disabled";
+	};
+
+	mailbox@24100000 {
+		compatible = "samsung,exynos-mailbox";
+		reg = 	< 0x0 0x24100000 0x0 0x10000>;
+		interrupts = <0 251 0>;
+		samsung,mbox-names = "ncp-a7q-0";
+		status = "disabled";
+	};
+	mailbox@24110000 {
+		compatible = "samsung,exynos-mailbox";
+		reg = 	<0x0 0x24110000 0x0 0x10000>;
+		interrupts = <0 252 0>;
+		samsung,mbox-names = "ncp-a7q-1";
+		status = "disabled";
+	};
+	mailbox@24120000 {
+		compatible = "samsung,exynos-mailbox";
+		reg = 	<0x0 0x24120000 0x0 0x10000>;
+		interrupts = <0 253 0>;
+		samsung,mbox-names = "ncp-a7q-2";
+		status = "disabled";
+	};
+	mailbox@24130000 {
+		compatible = "samsung,exynos-mailbox";
+		reg = 	<0x0 0x24130000 0x0 0x10000>;
+		interrupts = <0 254 0>;
+		samsung,mbox-names = "ncp-a7q-3";
+		status = "disabled";
+	};
+	mailbox@24140000 {
+		compatible = "samsung,exynos-mailbox";
+		reg = 	<0x0 0x24140000 0x0 0x10000>;
+		interrupts = <0 255 0>;
+		samsung,mbox-names = "ncp-a7q-4";
+		status = "disabled";
+	};
+	mailbox@24150000 {
+		compatible = "samsung,exynos-mailbox";
+		reg = 	<0x0 0x24150000 0x0 0x10000>;
+		interrupts = <0 256 0>;
+		samsung,mbox-names = "ncp-a7q-5";
+		status = "disabled";
+	};
+	mailbox@24160000 {
+		compatible = "samsung,exynos-mailbox";
+		reg = 	<0x0 0x24160000 0x0 0x10000>;
+		interrupts = <0 257 0>;
+		samsung,mbox-names = "ncp-a7q-6";
+		status = "disabled";
+	};
+	mailbox@24170000 {
+		compatible = "samsung,exynos-mailbox";
+		reg = 	<0x0 0x24170000 0x0 0x10000>;
+		interrupts = <0 258 0>;
+		samsung,mbox-names = "ncp-a7q-7";
+		status = "disabled";
 	};
 };
diff --git a/arch/arm64/boot/dts/samsung-ssdk-gh7.dts b/arch/arm64/boot/dts/samsung-ssdk-gh7.dts
index 4ce7d67..bfe5455 100644
--- a/arch/arm64/boot/dts/samsung-ssdk-gh7.dts
+++ b/arch/arm64/boot/dts/samsung-ssdk-gh7.dts
@@ -23,4 +23,7 @@ 
 		device_type = "memory";
 		reg = <0x00000000 0x80000000 0 0x20000000>;
 	};
+	mailbox@100a0000 {
+		status = "okay";
+	};
 };