Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1323114 > unrolled thread
| Started by | Leo Yan <leo.yan@linaro.org> |
|---|---|
| First post | 2016-02-01 14:40 +0100 |
| Last post | 2016-02-02 10:30 +0100 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v5 0/4] mailbox: hisilicon: add Hi6220 mailbox driver Leo Yan <leo.yan@linaro.org> - 2016-02-01 14:40 +0100
[PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver Leo Yan <leo.yan@linaro.org> - 2016-02-01 14:40 +0100
Re: [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver Rob Herring <robh@kernel.org> - 2016-02-01 15:10 +0100
Re: [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver Leo Yan <leo.yan@linaro.org> - 2016-02-01 16:30 +0100
Re: [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver Jassi Brar <jassisinghbrar@gmail.com> - 2016-02-01 17:20 +0100
Re: [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver Leo Yan <leo.yan@linaro.org> - 2016-02-02 10:30 +0100
| From | Leo Yan <leo.yan@linaro.org> |
|---|---|
| Date | 2016-02-01 14:40 +0100 |
| Subject | [PATCH v5 0/4] mailbox: hisilicon: add Hi6220 mailbox driver |
| Message-ID | <qXmRX-3vq-3@gated-at.bofh.it> |
Hi6220 mailbox supports up to 32 channels. Each channel is unidirectional with a maximum message size of 8 words. I/O is performed using register access (there is no DMA) and the cell raises an interrupt when messages are received. This patch series is to implement Hi6220 mailbox driver. It registers two channels into framework for communication with MCU, one is tx channel and another is rx channel. Now mailbox driver is used to send message to MCU to control dynamic voltage and frequency scaling for CPU, GPU and DDR. Changes from v4: * According to Jassi's suggestion, using DT binding to register channels * Change to use operating-points-v2 to register operating points Changes from v3: * The patch series for enabling idle state for Hi6220 has reserved memory regions, so this series will not include it anymore * Refined mailbox driver according to Jassi's suggestion; Removed kfifo from mailbox driver; Removed spinlock for ipc registers accessing, due every channel has its own dedicated bit in ipc register and readl/writel will introduce memory barrier, so don't need spinlock to protect ipc registers accessing * After mailbox driver is ready, can use patch 4 to enable CPU's OPPs and stub clock driver; finally can enable CPUFreq driver for CPU frequency scaling Changes from v2: * Get rid of unused memory regions from memory node in DT, and don't use reserved-memory node according to Mark and Leif's suggestion; Haojian also has updated UEFI for efi memory info Changes from v1: * Correct lock usage for SMP scenario Changes from RFC: * According to Jassi's review, totally remove the abstract common driver layer and only commit driver dedicated for Hi6220 * According to Paul Bolle's review, fix typo issue for Kconfig and remove unnecessary dependency with OF and fix minor for mailbox driver * Refine a little for dts nodes Leo Yan (4): dt-bindings: mailbox: Document Hi6220 mailbox driver mailbox: Hi6220: add mailbox driver arm64: dts: add mailbox node for Hi6220 arm64: dts: add Hi6220's stub clock node .../bindings/mailbox/hisilicon,hi6220-mailbox.txt | 90 +++++ arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 67 ++++ drivers/mailbox/Kconfig | 8 + drivers/mailbox/Makefile | 2 + drivers/mailbox/hi6220-mailbox.c | 407 +++++++++++++++++++++ 5 files changed, 574 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt create mode 100644 drivers/mailbox/hi6220-mailbox.c -- 1.9.1
[toc] | [next] | [standalone]
| From | Leo Yan <leo.yan@linaro.org> |
|---|---|
| Date | 2016-02-01 14:40 +0100 |
| Subject | [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver |
| Message-ID | <qXmS0-3vq-37@gated-at.bofh.it> |
| In reply to | #1323114 |
Document DT binding for Hisilicon Hi6220 mailbox driver.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
.../bindings/mailbox/hisilicon,hi6220-mailbox.txt | 90 ++++++++++++++++++++++
1 file changed, 90 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
diff --git a/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
new file mode 100644
index 0000000..96e6acc
--- /dev/null
+++ b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
@@ -0,0 +1,90 @@
+Hisilicon Hi6220 Mailbox Driver
+===============================
+
+Hisilicon Hi6220 mailbox supports up to 32 channels. Each channel
+is unidirectional with a maximum message size of 8 words. I/O is
+performed using register access (there is no DMA) and the cell
+raises an interrupt when messages are received.
+
+Mailbox Device Node:
+====================
+
+Required properties:
+--------------------
+- compatible: Shall be "hisilicon,hi6220-mbox"
+- reg: Contains the mailbox register address range (base
+ address and length); the first item is for IPC
+ registers, the second item is shared buffer for
+ slots.
+- #mbox-cells Common mailbox binding property to identify the number
+ of cells required for the mailbox specifier. Should be 1.
+- interrupts: Contains the interrupt information for the mailbox
+ device. The format is dependent on which interrupt
+ controller the SoCs use.
+
+Optional Properties:
+--------------------
+- hi6220,mbox-tx-noirq: Flag to allow the client user of this mailbox driver
+ to send messages without triggering a TX completion
+ interrupt.
+
+Child Nodes:
+============
+A child node is used for representing the actual sub-mailbox device that is
+used for the communication between the host processor and a remote processor.
+Each child node should have a unique node name across all the different
+mailbox device nodes.
+
+Required properties:
+--------------------
+- hi6220,mbox-tx: sub-mailbox descriptor property defining Tx channel
+- hi6220,mbox-rx: sub-mailbox descriptor property defining Rx channel
+
+Sub-mailbox Descriptor Data
+---------------------------
+Each of the above hi6220,mbox-tx and hi6220,mbox-rx properties should have 3
+cells of data that represent the following:
+ Cell #1 (slot_id) - mailbox slot id used either for transmitting
+ (hi6220,mbox-tx) or for receiving (hi6220,mbox-rx)
+ Cell #2 (dst_irq) - irq identifier index number which used by MCU.
+ Cell #3 (ack_irq) - irq identifier index number with generating a tx/rx
+ interrupt to application processor, mailbox driver
+ used this id to acknowledge interrupt.
+
+Example:
+--------
+
+ mailbox: mailbox@F7510000 {
+ #mbox-cells = <1>;
+ compatible = "hisilicon,hi6220-mbox";
+ reg = <0x0 0xF7510000 0x0 0x1000>, /* IPC_S */
+ <0x0 0x06DFF800 0x0 0x0800>; /* Mailbox */
+ interrupt-parent = <&gic>;
+ interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
+ mbox_stub_clock: mbox_stub_clock {
+ hi6220,mbox-rx = <0 1 10>;
+ hi6220,mbox-tx = <1 0 11>;
+ };
+ };
+
+
+Mailbox client
+===============
+
+"mboxes" and the optional "mbox-names" (please see
+Documentation/devicetree/bindings/mailbox/mailbox.txt for details). Each value
+of the mboxes property should contain a phandle to the mailbox controller
+device node and second argument is the channel index. It must be 0 (hardware
+support only one channel). The equivalent "mbox-names" property value can be
+used to give a name to the communication channel to be used by the client user.
+
+Example:
+--------
+
+ stub_clock: stub_clock {
+ compatible = "hisilicon,hi6220-stub-clk";
+ hisilicon,hi6220-clk-sram = <&sram>;
+ #clock-cells = <1>;
+ mbox-names = "mbox-tx";
+ mboxes = <&mailbox 1>;
+ };
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2016-02-01 15:10 +0100 |
| Subject | Re: [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver |
| Message-ID | <qXnl0-3Xr-11@gated-at.bofh.it> |
| In reply to | #1323121 |
On Mon, Feb 01, 2016 at 09:34:44PM +0800, Leo Yan wrote:
> Document DT binding for Hisilicon Hi6220 mailbox driver.
>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> .../bindings/mailbox/hisilicon,hi6220-mailbox.txt | 90 ++++++++++++++++++++++
> 1 file changed, 90 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
>
> diff --git a/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
> new file mode 100644
> index 0000000..96e6acc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
> @@ -0,0 +1,90 @@
> +Hisilicon Hi6220 Mailbox Driver
> +===============================
> +
> +Hisilicon Hi6220 mailbox supports up to 32 channels. Each channel
> +is unidirectional with a maximum message size of 8 words. I/O is
> +performed using register access (there is no DMA) and the cell
> +raises an interrupt when messages are received.
> +
> +Mailbox Device Node:
> +====================
> +
> +Required properties:
> +--------------------
> +- compatible: Shall be "hisilicon,hi6220-mbox"
> +- reg: Contains the mailbox register address range (base
> + address and length); the first item is for IPC
> + registers, the second item is shared buffer for
> + slots.
> +- #mbox-cells Common mailbox binding property to identify the number
> + of cells required for the mailbox specifier. Should be 1.
> +- interrupts: Contains the interrupt information for the mailbox
> + device. The format is dependent on which interrupt
> + controller the SoCs use.
> +
> +Optional Properties:
> +--------------------
> +- hi6220,mbox-tx-noirq: Flag to allow the client user of this mailbox driver
> + to send messages without triggering a TX completion
> + interrupt.
I don't think this belongs in DT. This should be a flag the client
driver sets when it sends messages.
> +
> +Child Nodes:
> +============
> +A child node is used for representing the actual sub-mailbox device that is
> +used for the communication between the host processor and a remote processor.
> +Each child node should have a unique node name across all the different
> +mailbox device nodes.
> +
> +Required properties:
> +--------------------
> +- hi6220,mbox-tx: sub-mailbox descriptor property defining Tx channel
> +- hi6220,mbox-rx: sub-mailbox descriptor property defining Rx channel
> +
> +Sub-mailbox Descriptor Data
> +---------------------------
> +Each of the above hi6220,mbox-tx and hi6220,mbox-rx properties should have 3
> +cells of data that represent the following:
> + Cell #1 (slot_id) - mailbox slot id used either for transmitting
> + (hi6220,mbox-tx) or for receiving (hi6220,mbox-rx)
> + Cell #2 (dst_irq) - irq identifier index number which used by MCU.
> + Cell #3 (ack_irq) - irq identifier index number with generating a tx/rx
> + interrupt to application processor, mailbox driver
> + used this id to acknowledge interrupt.
> +
> +Example:
> +--------
> +
> + mailbox: mailbox@F7510000 {
> + #mbox-cells = <1>;
> + compatible = "hisilicon,hi6220-mbox";
> + reg = <0x0 0xF7510000 0x0 0x1000>, /* IPC_S */
> + <0x0 0x06DFF800 0x0 0x0800>; /* Mailbox */
> + interrupt-parent = <&gic>;
> + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
> + mbox_stub_clock: mbox_stub_clock {
> + hi6220,mbox-rx = <0 1 10>;
> + hi6220,mbox-tx = <1 0 11>;
> + };
> + };
> +
> +
> +Mailbox client
> +===============
> +
> +"mboxes" and the optional "mbox-names" (please see
> +Documentation/devicetree/bindings/mailbox/mailbox.txt for details). Each value
> +of the mboxes property should contain a phandle to the mailbox controller
> +device node and second argument is the channel index. It must be 0 (hardware
0? But the example has 1.
> +support only one channel). The equivalent "mbox-names" property value can be
> +used to give a name to the communication channel to be used by the client user.
> +
> +Example:
> +--------
> +
> + stub_clock: stub_clock {
> + compatible = "hisilicon,hi6220-stub-clk";
> + hisilicon,hi6220-clk-sram = <&sram>;
> + #clock-cells = <1>;
> + mbox-names = "mbox-tx";
> + mboxes = <&mailbox 1>;
> + };
> --
> 1.9.1
>
[toc] | [prev] | [next] | [standalone]
| From | Leo Yan <leo.yan@linaro.org> |
|---|---|
| Date | 2016-02-01 16:30 +0100 |
| Subject | Re: [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver |
| Message-ID | <qXoAr-4Of-29@gated-at.bofh.it> |
| In reply to | #1323147 |
Hi Rob,
Thanks for reviewing, please see below inline comments.
On Mon, Feb 01, 2016 at 08:08:28AM -0600, Rob Herring wrote:
> On Mon, Feb 01, 2016 at 09:34:44PM +0800, Leo Yan wrote:
> > Document DT binding for Hisilicon Hi6220 mailbox driver.
> >
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > ---
> > .../bindings/mailbox/hisilicon,hi6220-mailbox.txt | 90 ++++++++++++++++++++++
> > 1 file changed, 90 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
> >
> > diff --git a/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
> > new file mode 100644
> > index 0000000..96e6acc
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
> > @@ -0,0 +1,90 @@
> > +Hisilicon Hi6220 Mailbox Driver
> > +===============================
> > +
> > +Hisilicon Hi6220 mailbox supports up to 32 channels. Each channel
> > +is unidirectional with a maximum message size of 8 words. I/O is
> > +performed using register access (there is no DMA) and the cell
> > +raises an interrupt when messages are received.
> > +
> > +Mailbox Device Node:
> > +====================
> > +
> > +Required properties:
> > +--------------------
> > +- compatible: Shall be "hisilicon,hi6220-mbox"
> > +- reg: Contains the mailbox register address range (base
> > + address and length); the first item is for IPC
> > + registers, the second item is shared buffer for
> > + slots.
> > +- #mbox-cells Common mailbox binding property to identify the number
> > + of cells required for the mailbox specifier. Should be 1.
> > +- interrupts: Contains the interrupt information for the mailbox
> > + device. The format is dependent on which interrupt
> > + controller the SoCs use.
> > +
> > +Optional Properties:
> > +--------------------
> > +- hi6220,mbox-tx-noirq: Flag to allow the client user of this mailbox driver
> > + to send messages without triggering a TX completion
> > + interrupt.
>
> I don't think this belongs in DT. This should be a flag the client
> driver sets when it sends messages.
The client driver can set "tx_block = true" so use this flag indicates
the client thread should be blocked until data is transmitted.
But low level mailbox driver can use two method to support "tx_block"
mode:
- One method is to avoid using interrupt and mailbox framework will
poll with mailbox's idle flag which is set by remote processor
automatically;
- Another method is to use interrupt to notify data has been
transmitted and interrupt handler will call completion function to
wake up blocked client thread;
So this flag is to distinguish these two different hardware mechanism.
Do you think this is make sense or have other suggestion?
> > +
> > +Child Nodes:
> > +============
> > +A child node is used for representing the actual sub-mailbox device that is
> > +used for the communication between the host processor and a remote processor.
> > +Each child node should have a unique node name across all the different
> > +mailbox device nodes.
> > +
> > +Required properties:
> > +--------------------
> > +- hi6220,mbox-tx: sub-mailbox descriptor property defining Tx channel
> > +- hi6220,mbox-rx: sub-mailbox descriptor property defining Rx channel
> > +
> > +Sub-mailbox Descriptor Data
> > +---------------------------
> > +Each of the above hi6220,mbox-tx and hi6220,mbox-rx properties should have 3
> > +cells of data that represent the following:
> > + Cell #1 (slot_id) - mailbox slot id used either for transmitting
> > + (hi6220,mbox-tx) or for receiving (hi6220,mbox-rx)
> > + Cell #2 (dst_irq) - irq identifier index number which used by MCU.
> > + Cell #3 (ack_irq) - irq identifier index number with generating a tx/rx
> > + interrupt to application processor, mailbox driver
> > + used this id to acknowledge interrupt.
> > +
> > +Example:
> > +--------
> > +
> > + mailbox: mailbox@F7510000 {
> > + #mbox-cells = <1>;
> > + compatible = "hisilicon,hi6220-mbox";
> > + reg = <0x0 0xF7510000 0x0 0x1000>, /* IPC_S */
> > + <0x0 0x06DFF800 0x0 0x0800>; /* Mailbox */
> > + interrupt-parent = <&gic>;
> > + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
> > + mbox_stub_clock: mbox_stub_clock {
> > + hi6220,mbox-rx = <0 1 10>;
> > + hi6220,mbox-tx = <1 0 11>;
> > + };
> > + };
> > +
> > +
> > +Mailbox client
> > +===============
> > +
> > +"mboxes" and the optional "mbox-names" (please see
> > +Documentation/devicetree/bindings/mailbox/mailbox.txt for details). Each value
> > +of the mboxes property should contain a phandle to the mailbox controller
> > +device node and second argument is the channel index. It must be 0 (hardware
>
> 0? But the example has 1.
Will fix.
Thanks,
Leo Yan
> > +support only one channel). The equivalent "mbox-names" property value can be
> > +used to give a name to the communication channel to be used by the client user.
> > +
> > +Example:
> > +--------
> > +
> > + stub_clock: stub_clock {
> > + compatible = "hisilicon,hi6220-stub-clk";
> > + hisilicon,hi6220-clk-sram = <&sram>;
> > + #clock-cells = <1>;
> > + mbox-names = "mbox-tx";
> > + mboxes = <&mailbox 1>;
> > + };
> > --
> > 1.9.1
> >
[toc] | [prev] | [next] | [standalone]
| From | Jassi Brar <jassisinghbrar@gmail.com> |
|---|---|
| Date | 2016-02-01 17:20 +0100 |
| Subject | Re: [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver |
| Message-ID | <qXpmO-5sL-21@gated-at.bofh.it> |
| In reply to | #1323232 |
On Mon, Feb 1, 2016 at 8:53 PM, Leo Yan <leo.yan@linaro.org> wrote:
> Hi Rob,
>
> Thanks for reviewing, please see below inline comments.
>
> On Mon, Feb 01, 2016 at 08:08:28AM -0600, Rob Herring wrote:
>> On Mon, Feb 01, 2016 at 09:34:44PM +0800, Leo Yan wrote:
>> > Document DT binding for Hisilicon Hi6220 mailbox driver.
>> >
>> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
>> > ---
>> > .../bindings/mailbox/hisilicon,hi6220-mailbox.txt | 90 ++++++++++++++++++++++
>> > 1 file changed, 90 insertions(+)
>> > create mode 100644 Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
>> >
>> > diff --git a/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
>> > new file mode 100644
>> > index 0000000..96e6acc
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
>> > @@ -0,0 +1,90 @@
>> > +Hisilicon Hi6220 Mailbox Driver
>> > +===============================
>> > +
>> > +Hisilicon Hi6220 mailbox supports up to 32 channels. Each channel
>> > +is unidirectional with a maximum message size of 8 words. I/O is
>> > +performed using register access (there is no DMA) and the cell
>> > +raises an interrupt when messages are received.
>> > +
>> > +Mailbox Device Node:
>> > +====================
>> > +
>> > +Required properties:
>> > +--------------------
>> > +- compatible: Shall be "hisilicon,hi6220-mbox"
>> > +- reg: Contains the mailbox register address range (base
>> > + address and length); the first item is for IPC
>> > + registers, the second item is shared buffer for
>> > + slots.
>> > +- #mbox-cells Common mailbox binding property to identify the number
>> > + of cells required for the mailbox specifier. Should be 1.
>> > +- interrupts: Contains the interrupt information for the mailbox
>> > + device. The format is dependent on which interrupt
>> > + controller the SoCs use.
>> > +
>> > +Optional Properties:
>> > +--------------------
>> > +- hi6220,mbox-tx-noirq: Flag to allow the client user of this mailbox driver
>> > + to send messages without triggering a TX completion
>> > + interrupt.
>>
>> I don't think this belongs in DT. This should be a flag the client
>> driver sets when it sends messages.
>
> The client driver can set "tx_block = true" so use this flag indicates
> the client thread should be blocked until data is transmitted.
>
Yes, but the 'tx_block' feature is provided by the core. The
controller driver should not need to know how the client works.
> But low level mailbox driver can use two method to support "tx_block"
> mode:
>
No, as I said, provider shouldn't care about consumers..
> - One method is to avoid using interrupt and mailbox framework will
> poll with mailbox's idle flag which is set by remote processor
> automatically;
> - Another method is to use interrupt to notify data has been
> transmitted and interrupt handler will call completion function to
> wake up blocked client thread;
>
If it is possible to have either 'idle flag set' or irq generated (not
both) by the remote, then you may sell the hi6220,mbox-tx-noirq
property as a "f/w feature" ... but still not for the sake of
tx_block.
>> > +
>> > +Child Nodes:
>> > +============
>> > +A child node is used for representing the actual sub-mailbox device that is
>> > +used for the communication between the host processor and a remote processor.
>> > +Each child node should have a unique node name across all the different
>> > +mailbox device nodes.
>> > +
>> > +Required properties:
>> > +--------------------
>> > +- hi6220,mbox-tx: sub-mailbox descriptor property defining Tx channel
>> > +- hi6220,mbox-rx: sub-mailbox descriptor property defining Rx channel
>> > +
>> > +Sub-mailbox Descriptor Data
>> > +---------------------------
>> > +Each of the above hi6220,mbox-tx and hi6220,mbox-rx properties should have 3
>> > +cells of data that represent the following:
>> > + Cell #1 (slot_id) - mailbox slot id used either for transmitting
>> > + (hi6220,mbox-tx) or for receiving (hi6220,mbox-rx)
>> > + Cell #2 (dst_irq) - irq identifier index number which used by MCU.
>> > + Cell #3 (ack_irq) - irq identifier index number with generating a tx/rx
>> > + interrupt to application processor, mailbox driver
>> > + used this id to acknowledge interrupt.
>> > +
>> > +Example:
>> > +--------
>> > +
>> > + mailbox: mailbox@F7510000 {
>> > + #mbox-cells = <1>;
>> > + compatible = "hisilicon,hi6220-mbox";
>> > + reg = <0x0 0xF7510000 0x0 0x1000>, /* IPC_S */
>> > + <0x0 0x06DFF800 0x0 0x0800>; /* Mailbox */
>> > + interrupt-parent = <&gic>;
>> > + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
>> > + mbox_stub_clock: mbox_stub_clock {
>> > + hi6220,mbox-rx = <0 1 10>;
>> > + hi6220,mbox-tx = <1 0 11>;
>
This looks like meant for the client node...
mbox-names = "mbox-tx", "mbox-rx";
mboxes = <&mailbox 1 0 11>, <&mailbox 0 1 10>;
[toc] | [prev] | [next] | [standalone]
| From | Leo Yan <leo.yan@linaro.org> |
|---|---|
| Date | 2016-02-02 10:30 +0100 |
| Subject | Re: [PATCH v5 1/4] dt-bindings: mailbox: Document Hi6220 mailbox driver |
| Message-ID | <qXFrA-sR-21@gated-at.bofh.it> |
| In reply to | #1323291 |
On Mon, Feb 01, 2016 at 09:46:39PM +0530, Jassi Brar wrote:
> On Mon, Feb 1, 2016 at 8:53 PM, Leo Yan <leo.yan@linaro.org> wrote:
> > On Mon, Feb 01, 2016 at 08:08:28AM -0600, Rob Herring wrote:
> >> On Mon, Feb 01, 2016 at 09:34:44PM +0800, Leo Yan wrote:
[...]
> >> > +Optional Properties:
> >> > +--------------------
> >> > +- hi6220,mbox-tx-noirq: Flag to allow the client user of this mailbox driver
> >> > + to send messages without triggering a TX completion
> >> > + interrupt.
> >>
> >> I don't think this belongs in DT. This should be a flag the client
> >> driver sets when it sends messages.
> >
> > The client driver can set "tx_block = true" so use this flag indicates
> > the client thread should be blocked until data is transmitted.
> >
> Yes, but the 'tx_block' feature is provided by the core. The
> controller driver should not need to know how the client works.
>
> > But low level mailbox driver can use two method to support "tx_block"
> > mode:
> >
> No, as I said, provider shouldn't care about consumers..
>
> > - One method is to avoid using interrupt and mailbox framework will
> > poll with mailbox's idle flag which is set by remote processor
> > automatically;
> > - Another method is to use interrupt to notify data has been
> > transmitted and interrupt handler will call completion function to
> > wake up blocked client thread;
> >
> If it is possible to have either 'idle flag set' or irq generated (not
> both) by the remote, then you may sell the hi6220,mbox-tx-noirq
> property as a "f/w feature" ... but still not for the sake of
> tx_block.
Indeed and totally agree. MCU can support two modes for "automatic idle
flag" or IRQ generated mode, so we can take "hi6220,mbox-tx-noirq" as a
firmware's property.
> >> > +
> >> > +Child Nodes:
> >> > +============
> >> > +A child node is used for representing the actual sub-mailbox device that is
> >> > +used for the communication between the host processor and a remote processor.
> >> > +Each child node should have a unique node name across all the different
> >> > +mailbox device nodes.
> >> > +
> >> > +Required properties:
> >> > +--------------------
> >> > +- hi6220,mbox-tx: sub-mailbox descriptor property defining Tx channel
> >> > +- hi6220,mbox-rx: sub-mailbox descriptor property defining Rx channel
> >> > +
> >> > +Sub-mailbox Descriptor Data
> >> > +---------------------------
> >> > +Each of the above hi6220,mbox-tx and hi6220,mbox-rx properties should have 3
> >> > +cells of data that represent the following:
> >> > + Cell #1 (slot_id) - mailbox slot id used either for transmitting
> >> > + (hi6220,mbox-tx) or for receiving (hi6220,mbox-rx)
> >> > + Cell #2 (dst_irq) - irq identifier index number which used by MCU.
> >> > + Cell #3 (ack_irq) - irq identifier index number with generating a tx/rx
> >> > + interrupt to application processor, mailbox driver
> >> > + used this id to acknowledge interrupt.
> >> > +
> >> > +Example:
> >> > +--------
> >> > +
> >> > + mailbox: mailbox@F7510000 {
> >> > + #mbox-cells = <1>;
> >> > + compatible = "hisilicon,hi6220-mbox";
> >> > + reg = <0x0 0xF7510000 0x0 0x1000>, /* IPC_S */
> >> > + <0x0 0x06DFF800 0x0 0x0800>; /* Mailbox */
> >> > + interrupt-parent = <&gic>;
> >> > + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
> >> > + mbox_stub_clock: mbox_stub_clock {
> >> > + hi6220,mbox-rx = <0 1 10>;
> >> > + hi6220,mbox-tx = <1 0 11>;
> >
> This looks like meant for the client node...
> mbox-names = "mbox-tx", "mbox-rx";
> mboxes = <&mailbox 1 0 11>, <&mailbox 0 1 10>;
Good suggestion. Will refine with this way.
Thanks,
Leo Yan
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web