Re: [PATCH v4] mailbox/omap: adapt to the new mailbox framework
On 4 November 2014 at 04:35, Suman Anna s-a...@ti.com wrote: The OMAP mailbox driver and its existing clients (remoteproc for OMAP4+) are adapted to use the generic mailbox framework. The main changes for the adaptation are: - The tasklet used for Tx is replaced with the state machine from the generic mailbox framework. The workqueue used for processing the received messages stays intact for minimizing the effects on the OMAP mailbox clients. - The existing exported client API, omap_mbox_get, omap_mbox_put and omap_mbox_send_msg are deleted, as the framework provides equivalent functionality. A OMAP-specific omap_mbox_request_channel is added though to support non-DT way of requesting mailboxes. - The OMAP mailbox driver is integrated with the mailbox framework through the proper implementations of mbox_chan_ops, except for .last_tx_done and .peek_data. The OMAP mailbox driver does not need these ops, as it is completely interrupt driven. - The OMAP mailbox driver uses a custom of_xlate controller ops that allows phandles for the pargs specifier instead of indexing to avoid any channel registration order dependencies. - The new framework does not support multiple clients operating on a single channel, so the reference counting logic is simplified. - The remoteproc driver (current client) is adapted to use the new API. The notifier callbacks used within this client is replaced with the regular callbacks from the newer framework. - The exported OMAP mailbox API are limited to omap_mbox_save_ctx, omap_mbox_restore_ctx, omap_mbox_enable_irq omap_mbox_disable_irq, with the signature modified to take in the new mbox_chan handle instead of the OMAP specific omap_mbox handle. The first 2 will be removed when the OMAP mailbox driver is adapted to runtime_pm. The other exported API omap_mbox_request_channel will be removed once existing legacy users are converted to DT. Cc: Jassi Brar jassisinghb...@gmail.com Cc: Ohad Ben-Cohen o...@wizery.com Signed-off-by: Suman Anna s-a...@ti.com --- v3-v4: No code changes, switched the example to use the DSP node instead of WkupM3 in the bindings document minor commit description changes. Other than that, this is a repost of the driver adaptation patch [1] from the OMAP Mailbox framework adaptation series [2]. This patch is intended for the 3.19 merge window, all the dependent patches in [2] are merged as of 3.18-rc2. The DTS patch in [2] will be posted separately. [1] http://marc.info/?l=linux-omapm=141038453917790w=2 [2] http://marc.info/?l=linux-omapm=141038447817775w=2 .../devicetree/bindings/mailbox/omap-mailbox.txt | 23 ++ drivers/mailbox/omap-mailbox.c | 346 - drivers/remoteproc/omap_remoteproc.c | 51 +-- include/linux/omap-mailbox.h | 16 +- 4 files changed, 256 insertions(+), 180 deletions(-) Applied to mailbox-devel, Thanks -Jassi -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4] mailbox/omap: adapt to the new mailbox framework
On 4 November 2014 at 04:35, Suman Anna s-a...@ti.com wrote: The OMAP mailbox driver and its existing clients (remoteproc for OMAP4+) are adapted to use the generic mailbox framework. The main changes for the adaptation are: - The tasklet used for Tx is replaced with the state machine from the generic mailbox framework. The workqueue used for processing the received messages stays intact for minimizing the effects on the OMAP mailbox clients. - The existing exported client API, omap_mbox_get, omap_mbox_put and omap_mbox_send_msg are deleted, as the framework provides equivalent functionality. A OMAP-specific omap_mbox_request_channel is added though to support non-DT way of requesting mailboxes. - The OMAP mailbox driver is integrated with the mailbox framework through the proper implementations of mbox_chan_ops, except for .last_tx_done and .peek_data. The OMAP mailbox driver does not need these ops, as it is completely interrupt driven. - The OMAP mailbox driver uses a custom of_xlate controller ops that allows phandles for the pargs specifier instead of indexing to avoid any channel registration order dependencies. - The new framework does not support multiple clients operating on a single channel, so the reference counting logic is simplified. - The remoteproc driver (current client) is adapted to use the new API. The notifier callbacks used within this client is replaced with the regular callbacks from the newer framework. - The exported OMAP mailbox API are limited to omap_mbox_save_ctx, omap_mbox_restore_ctx, omap_mbox_enable_irq omap_mbox_disable_irq, with the signature modified to take in the new mbox_chan handle instead of the OMAP specific omap_mbox handle. The first 2 will be removed when the OMAP mailbox driver is adapted to runtime_pm. The other exported API omap_mbox_request_channel will be removed once existing legacy users are converted to DT. Cc: Jassi Brar jassisinghb...@gmail.com Cc: Ohad Ben-Cohen o...@wizery.com Signed-off-by: Suman Anna s-a...@ti.com --- v3-v4: No code changes, switched the example to use the DSP node instead of WkupM3 in the bindings document minor commit description changes. Other than that, this is a repost of the driver adaptation patch [1] from the OMAP Mailbox framework adaptation series [2]. This patch is intended for the 3.19 merge window, all the dependent patches in [2] are merged as of 3.18-rc2. The DTS patch in [2] will be posted separately. [1] http://marc.info/?l=linux-omapm=141038453917790w=2 [2] http://marc.info/?l=linux-omapm=141038447817775w=2 .../devicetree/bindings/mailbox/omap-mailbox.txt | 23 ++ drivers/mailbox/omap-mailbox.c | 346 - drivers/remoteproc/omap_remoteproc.c | 51 +-- include/linux/omap-mailbox.h | 16 +- 4 files changed, 256 insertions(+), 180 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt b/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt index 48edc4b..d1a0433 100644 --- a/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt +++ b/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt @@ -43,6 +43,9 @@ Required properties: device. The format is dependent on which interrupt controller the OMAP device uses - ti,hwmods: Name of the hwmod associated with the mailbox +- #mbox-cells: Common mailbox binding property to identify the number + of cells required for the mailbox specifier. Should be + 1 - ti,mbox-num-users: Number of targets (processor devices) that the mailbox device can interrupt - ti,mbox-num-fifos: Number of h/w fifo queues within the mailbox IP block @@ -72,6 +75,18 @@ data that represent the following: Cell #3 (usr_id) - mailbox user id for identifying the interrupt line associated with generating a tx/rx fifo interrupt. +Mailbox Users: +== +A device needing to communicate with a target processor device should specify +them using the common mailbox binding properties, 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 an args specifier that will be the phandle to +the intended sub-mailbox child node to be used for communication. 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: @@ -81,6 +96,7 @@ mailbox: mailbox@4a0f4000 { reg = 0x4a0f4000 0x200; interrupts = GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH; ti,hwmods =
Re: [PATCH v4] mailbox/omap: adapt to the new mailbox framework
Hi Jassi, On 11/24/2014 03:54 AM, Jassi Brar wrote: On 4 November 2014 at 04:35, Suman Anna s-a...@ti.com wrote: The OMAP mailbox driver and its existing clients (remoteproc for OMAP4+) are adapted to use the generic mailbox framework. The main changes for the adaptation are: - The tasklet used for Tx is replaced with the state machine from the generic mailbox framework. The workqueue used for processing the received messages stays intact for minimizing the effects on the OMAP mailbox clients. - The existing exported client API, omap_mbox_get, omap_mbox_put and omap_mbox_send_msg are deleted, as the framework provides equivalent functionality. A OMAP-specific omap_mbox_request_channel is added though to support non-DT way of requesting mailboxes. - The OMAP mailbox driver is integrated with the mailbox framework through the proper implementations of mbox_chan_ops, except for .last_tx_done and .peek_data. The OMAP mailbox driver does not need these ops, as it is completely interrupt driven. - The OMAP mailbox driver uses a custom of_xlate controller ops that allows phandles for the pargs specifier instead of indexing to avoid any channel registration order dependencies. - The new framework does not support multiple clients operating on a single channel, so the reference counting logic is simplified. - The remoteproc driver (current client) is adapted to use the new API. The notifier callbacks used within this client is replaced with the regular callbacks from the newer framework. - The exported OMAP mailbox API are limited to omap_mbox_save_ctx, omap_mbox_restore_ctx, omap_mbox_enable_irq omap_mbox_disable_irq, with the signature modified to take in the new mbox_chan handle instead of the OMAP specific omap_mbox handle. The first 2 will be removed when the OMAP mailbox driver is adapted to runtime_pm. The other exported API omap_mbox_request_channel will be removed once existing legacy users are converted to DT. Cc: Jassi Brar jassisinghb...@gmail.com Cc: Ohad Ben-Cohen o...@wizery.com Signed-off-by: Suman Anna s-a...@ti.com --- v3-v4: No code changes, switched the example to use the DSP node instead of WkupM3 in the bindings document minor commit description changes. Other than that, this is a repost of the driver adaptation patch [1] from the OMAP Mailbox framework adaptation series [2]. This patch is intended for the 3.19 merge window, all the dependent patches in [2] are merged as of 3.18-rc2. The DTS patch in [2] will be posted separately. [1] http://marc.info/?l=linux-omapm=141038453917790w=2 [2] http://marc.info/?l=linux-omapm=141038447817775w=2 .../devicetree/bindings/mailbox/omap-mailbox.txt | 23 ++ drivers/mailbox/omap-mailbox.c | 346 - drivers/remoteproc/omap_remoteproc.c | 51 +-- include/linux/omap-mailbox.h | 16 +- 4 files changed, 256 insertions(+), 180 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt b/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt index 48edc4b..d1a0433 100644 --- a/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt +++ b/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt @@ -43,6 +43,9 @@ Required properties: device. The format is dependent on which interrupt controller the OMAP device uses - ti,hwmods: Name of the hwmod associated with the mailbox +- #mbox-cells: Common mailbox binding property to identify the number + of cells required for the mailbox specifier. Should be + 1 - ti,mbox-num-users: Number of targets (processor devices) that the mailbox device can interrupt - ti,mbox-num-fifos: Number of h/w fifo queues within the mailbox IP block @@ -72,6 +75,18 @@ data that represent the following: Cell #3 (usr_id) - mailbox user id for identifying the interrupt line associated with generating a tx/rx fifo interrupt. +Mailbox Users: +== +A device needing to communicate with a target processor device should specify +them using the common mailbox binding properties, 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 an args specifier that will be the phandle to +the intended sub-mailbox child node to be used for communication. 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: @@ -81,6 +96,7 @@ mailbox: mailbox@4a0f4000 { reg = 0x4a0f4000 0x200;
[PATCH v4] mailbox/omap: adapt to the new mailbox framework
The OMAP mailbox driver and its existing clients (remoteproc for OMAP4+) are adapted to use the generic mailbox framework. The main changes for the adaptation are: - The tasklet used for Tx is replaced with the state machine from the generic mailbox framework. The workqueue used for processing the received messages stays intact for minimizing the effects on the OMAP mailbox clients. - The existing exported client API, omap_mbox_get, omap_mbox_put and omap_mbox_send_msg are deleted, as the framework provides equivalent functionality. A OMAP-specific omap_mbox_request_channel is added though to support non-DT way of requesting mailboxes. - The OMAP mailbox driver is integrated with the mailbox framework through the proper implementations of mbox_chan_ops, except for .last_tx_done and .peek_data. The OMAP mailbox driver does not need these ops, as it is completely interrupt driven. - The OMAP mailbox driver uses a custom of_xlate controller ops that allows phandles for the pargs specifier instead of indexing to avoid any channel registration order dependencies. - The new framework does not support multiple clients operating on a single channel, so the reference counting logic is simplified. - The remoteproc driver (current client) is adapted to use the new API. The notifier callbacks used within this client is replaced with the regular callbacks from the newer framework. - The exported OMAP mailbox API are limited to omap_mbox_save_ctx, omap_mbox_restore_ctx, omap_mbox_enable_irq omap_mbox_disable_irq, with the signature modified to take in the new mbox_chan handle instead of the OMAP specific omap_mbox handle. The first 2 will be removed when the OMAP mailbox driver is adapted to runtime_pm. The other exported API omap_mbox_request_channel will be removed once existing legacy users are converted to DT. Cc: Jassi Brar jassisinghb...@gmail.com Cc: Ohad Ben-Cohen o...@wizery.com Signed-off-by: Suman Anna s-a...@ti.com --- v3-v4: No code changes, switched the example to use the DSP node instead of WkupM3 in the bindings document minor commit description changes. Other than that, this is a repost of the driver adaptation patch [1] from the OMAP Mailbox framework adaptation series [2]. This patch is intended for the 3.19 merge window, all the dependent patches in [2] are merged as of 3.18-rc2. The DTS patch in [2] will be posted separately. [1] http://marc.info/?l=linux-omapm=141038453917790w=2 [2] http://marc.info/?l=linux-omapm=141038447817775w=2 .../devicetree/bindings/mailbox/omap-mailbox.txt | 23 ++ drivers/mailbox/omap-mailbox.c | 346 - drivers/remoteproc/omap_remoteproc.c | 51 +-- include/linux/omap-mailbox.h | 16 +- 4 files changed, 256 insertions(+), 180 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt b/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt index 48edc4b..d1a0433 100644 --- a/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt +++ b/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt @@ -43,6 +43,9 @@ Required properties: device. The format is dependent on which interrupt controller the OMAP device uses - ti,hwmods: Name of the hwmod associated with the mailbox +- #mbox-cells: Common mailbox binding property to identify the number + of cells required for the mailbox specifier. Should be + 1 - ti,mbox-num-users: Number of targets (processor devices) that the mailbox device can interrupt - ti,mbox-num-fifos: Number of h/w fifo queues within the mailbox IP block @@ -72,6 +75,18 @@ data that represent the following: Cell #3 (usr_id) - mailbox user id for identifying the interrupt line associated with generating a tx/rx fifo interrupt. +Mailbox Users: +== +A device needing to communicate with a target processor device should specify +them using the common mailbox binding properties, 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 an args specifier that will be the phandle to +the intended sub-mailbox child node to be used for communication. 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: @@ -81,6 +96,7 @@ mailbox: mailbox@4a0f4000 { reg = 0x4a0f4000 0x200; interrupts = GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH; ti,hwmods = mailbox; + #mbox-cells = 1; ti,mbox-num-users = 3; ti,mbox-num-fifos = 8; mbox_ipu: mbox_ipu { @@ -93,12 +109,19 @@ mailbox: