* [PATCH 0/2] Bypass BAM init if Remotely controlled @ 2016-03-22 9:49 Pramod Gurav 2016-03-22 9:49 ` [PATCH 1/2] dmaengine: qcom_bam_dma: Clear IRQ only if its set Pramod Gurav ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Pramod Gurav @ 2016-03-22 9:49 UTC (permalink / raw) To: andy.gross-QSEj5FYQhm4dnm+yROfE0A, linux-kernel-u79uwXL29TY76Z2rM5mHXA Cc: dmaengine-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w, vinod.koul-ral2JQCrhuEAvxtiuMwx3w, okaya-sgV2jX0FEOL9JmXXK+q4OQ, architt-sgV2jX0FEOL9JmXXK+q4OQ, Pramod Gurav On some QOCM platforms(eg 8996) BAM control registers are managed remotely hence can not be accessed by application processor for writes. So skip the bam_init for any such platform if DT property is set. Tested on 8996 (BAM Global control is through remote) and DB410C boards. Tested with i2c DMA on these targets which uses BAM as DMA controller. Pramod Gurav (2): dmaengine: qcom_bam_dma: Clear IRQ only if its set dmaengine: qcom_bam_dma: Bypass BAM init if not managed locally .../devicetree/bindings/dma/qcom_bam_dma.txt | 3 +++ drivers/dma/qcom/bam_dma.c | 21 +++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -- 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] 9+ messages in thread
* [PATCH 1/2] dmaengine: qcom_bam_dma: Clear IRQ only if its set 2016-03-22 9:49 [PATCH 0/2] Bypass BAM init if Remotely controlled Pramod Gurav @ 2016-03-22 9:49 ` Pramod Gurav 2016-03-22 9:49 ` [PATCH 2/2] dmaengine: qcom_bam_dma: Bypass BAM init if not managed locally Pramod Gurav [not found] ` <1458640151-15150-1-git-send-email-gpramod-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> 2 siblings, 0 replies; 9+ messages in thread From: Pramod Gurav @ 2016-03-22 9:49 UTC (permalink / raw) To: andy.gross, linux-kernel Cc: dmaengine, linux-arm-msm, devicetree, dan.j.williams, vinod.koul, okaya, architt, Pramod Gurav Clear the BAM IRQ bit only if there is a BAM interrupt. Signed-off-by: Pramod Gurav <gpramod@codeaurora.org> --- drivers/dma/qcom/bam_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index d5e0a9c..0880345 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -807,7 +807,8 @@ static irqreturn_t bam_dma_irq(int irq, void *data) /* don't allow reorder of the various accesses to the BAM registers */ mb(); - writel_relaxed(clr_mask, bam_addr(bdev, 0, BAM_IRQ_CLR)); + if (srcs & BAM_IRQ) + writel_relaxed(clr_mask, bam_addr(bdev, 0, BAM_IRQ_CLR)); return IRQ_HANDLED; } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] dmaengine: qcom_bam_dma: Bypass BAM init if not managed locally 2016-03-22 9:49 [PATCH 0/2] Bypass BAM init if Remotely controlled Pramod Gurav 2016-03-22 9:49 ` [PATCH 1/2] dmaengine: qcom_bam_dma: Clear IRQ only if its set Pramod Gurav @ 2016-03-22 9:49 ` Pramod Gurav 2016-03-23 15:09 ` Rob Herring [not found] ` <1458640151-15150-1-git-send-email-gpramod-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> 2 siblings, 1 reply; 9+ messages in thread From: Pramod Gurav @ 2016-03-22 9:49 UTC (permalink / raw) To: andy.gross, linux-kernel Cc: dmaengine, linux-arm-msm, devicetree, dan.j.williams, vinod.koul, okaya, architt, Pramod Gurav On some QOCM platforms BAM control registers are managed remotely hence can not be accessed by application processor for writes. Pass a DT property qcom,bam_ctrl_remote to declare the same to skip bam_init. Move the pipe number initialisation from bam_init to probe functiom as it should be done for all platforms. Signed-off-by: Pramod Gurav <gpramod@codeaurora.org> --- Documentation/devicetree/bindings/dma/qcom_bam_dma.txt | 3 +++ drivers/dma/qcom/bam_dma.c | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt index 1c9d48e..46e33ae 100644 --- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt +++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt @@ -13,6 +13,8 @@ Required properties: - clock-names: must contain "bam_clk" entry - qcom,ee : indicates the active Execution Environment identifier (0-7) used in the secure world. +- qcom,bam_ctrl_remote: Use when BAM global device control is managed remotely + and not locally by the application processor. Example: @@ -24,6 +26,7 @@ Example: clock-names = "bam_clk"; #dma-cells = <1>; qcom,ee = <0>; + qcom,bam_ctrl_remote; }; DMA clients must use the format described in the dma.txt file, using a two cell diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 0880345..04dd446 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -384,6 +384,7 @@ struct bam_device { struct device_dma_parameters dma_parms; struct bam_chan *channels; u32 num_channels; + bool bam_ctrl_remote; /* execution environment ID, from DT */ u32 ee; @@ -1036,9 +1037,6 @@ static int bam_init(struct bam_device *bdev) if (bdev->ee >= val) return -EINVAL; - val = readl_relaxed(bam_addr(bdev, 0, BAM_NUM_PIPES)); - bdev->num_channels = val & BAM_NUM_PIPES_MASK; - /* s/w reset bam */ /* after reset all pipes are disabled and idle */ val = readl_relaxed(bam_addr(bdev, 0, BAM_CTRL)); @@ -1095,7 +1093,7 @@ static int bam_dma_probe(struct platform_device *pdev) struct bam_device *bdev; const struct of_device_id *match; struct resource *iores; - int ret, i; + int ret, i, val; bdev = devm_kzalloc(&pdev->dev, sizeof(*bdev), GFP_KERNEL); if (!bdev) @@ -1136,9 +1134,15 @@ static int bam_dma_probe(struct platform_device *pdev) return ret; } - ret = bam_init(bdev); - if (ret) - goto err_disable_clk; + val = readl_relaxed(bam_addr(bdev, 0, BAM_NUM_PIPES)); + bdev->num_channels = val & BAM_NUM_PIPES_MASK; + + bdev->bam_ctrl_remote = of_property_read_bool(pdev->dev.of_node, + "qcom,bam_ctrl_remote"); + if (bdev->bam_ctrl_remote != true) + ret = bam_init(bdev); + if (ret) + goto err_disable_clk; tasklet_init(&bdev->task, dma_tasklet, (unsigned long)bdev); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] dmaengine: qcom_bam_dma: Bypass BAM init if not managed locally 2016-03-22 9:49 ` [PATCH 2/2] dmaengine: qcom_bam_dma: Bypass BAM init if not managed locally Pramod Gurav @ 2016-03-23 15:09 ` Rob Herring 0 siblings, 0 replies; 9+ messages in thread From: Rob Herring @ 2016-03-23 15:09 UTC (permalink / raw) To: Pramod Gurav Cc: andy.gross, linux-kernel, dmaengine, linux-arm-msm, devicetree, dan.j.williams, vinod.koul, okaya, architt On Tue, Mar 22, 2016 at 03:19:11PM +0530, Pramod Gurav wrote: > On some QOCM platforms BAM control registers are managed remotely s/QOCM/QCOM/ > hence can not be accessed by application processor for writes. Pass > a DT property qcom,bam_ctrl_remote to declare the same to skip bam_init. Is this a property of specific SOCs or a configuration option? If the former, use the SOC specific compatible string to determine this option. > Move the pipe number initialisation from bam_init to probe functiom > as it should be done for all platforms. > > Signed-off-by: Pramod Gurav <gpramod@codeaurora.org> > --- > Documentation/devicetree/bindings/dma/qcom_bam_dma.txt | 3 +++ > drivers/dma/qcom/bam_dma.c | 18 +++++++++++------- > 2 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt > index 1c9d48e..46e33ae 100644 > --- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt > +++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt > @@ -13,6 +13,8 @@ Required properties: > - clock-names: must contain "bam_clk" entry > - qcom,ee : indicates the active Execution Environment identifier (0-7) used in > the secure world. > +- qcom,bam_ctrl_remote: Use when BAM global device control is managed remotely Don't use '_' in property names. > + and not locally by the application processor. > > Example: > > @@ -24,6 +26,7 @@ Example: > clock-names = "bam_clk"; > #dma-cells = <1>; > qcom,ee = <0>; > + qcom,bam_ctrl_remote; > }; > > DMA clients must use the format described in the dma.txt file, using a two cell ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <1458640151-15150-1-git-send-email-gpramod-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>]
* Re: [PATCH 0/2] Bypass BAM init if Remotely controlled [not found] ` <1458640151-15150-1-git-send-email-gpramod-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> @ 2016-03-22 9:55 ` Stanimir Varbanov [not found] ` <56F116AC.2000704-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Stanimir Varbanov @ 2016-03-22 9:55 UTC (permalink / raw) To: Pramod Gurav, andy.gross-QSEj5FYQhm4dnm+yROfE0A, linux-kernel-u79uwXL29TY76Z2rM5mHXA Cc: dmaengine-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w, vinod.koul-ral2JQCrhuEAvxtiuMwx3w, okaya-sgV2jX0FEOL9JmXXK+q4OQ, architt-sgV2jX0FEOL9JmXXK+q4OQ On 03/22/2016 11:49 AM, Pramod Gurav wrote: > On some QOCM platforms(eg 8996) BAM control registers are managed remotely > hence can not be accessed by application processor for writes. So skip the bam_init > for any such platform if DT property is set. > > Tested on 8996 (BAM Global control is through remote) and DB410C boards. > Tested with i2c DMA on these targets which uses BAM as DMA controller. I have similar patches at [1] already, could you check them first. [1] https://lkml.org/lkml/2015/12/1/113 -- regards, Stan -- 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] 9+ messages in thread
[parent not found: <56F116AC.2000704-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 0/2] Bypass BAM init if Remotely controlled [not found] ` <56F116AC.2000704-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> @ 2016-03-22 10:36 ` gpramod-sgV2jX0FEOL9JmXXK+q4OQ 2016-04-05 18:19 ` Vinod Koul 1 sibling, 0 replies; 9+ messages in thread From: gpramod-sgV2jX0FEOL9JmXXK+q4OQ @ 2016-03-22 10:36 UTC (permalink / raw) To: Stanimir Varbanov Cc: andy.gross-QSEj5FYQhm4dnm+yROfE0A, linux-kernel-u79uwXL29TY76Z2rM5mHXA, dmaengine-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w, vinod.koul-ral2JQCrhuEAvxtiuMwx3w, okaya-sgV2jX0FEOL9JmXXK+q4OQ, architt-sgV2jX0FEOL9JmXXK+q4OQ, linux-arm-msm-owner-u79uwXL29TY76Z2rM5mHXA On 2016-03-22 15:25, Stanimir Varbanov wrote: > On 03/22/2016 11:49 AM, Pramod Gurav wrote: >> On some QOCM platforms(eg 8996) BAM control registers are managed >> remotely >> hence can not be accessed by application processor for writes. So skip >> the bam_init >> for any such platform if DT property is set. >> >> Tested on 8996 (BAM Global control is through remote) and DB410C >> boards. >> Tested with i2c DMA on these targets which uses BAM as DMA controller. > > I have similar patches at [1] already, could you check them first. > > > [1] https://lkml.org/lkml/2015/12/1/113 Thanks. I should have known them. Will test them and and provide Tested-by. :) Regards, Pramod -- 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] 9+ messages in thread
* Re: [PATCH 0/2] Bypass BAM init if Remotely controlled [not found] ` <56F116AC.2000704-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> 2016-03-22 10:36 ` gpramod-sgV2jX0FEOL9JmXXK+q4OQ @ 2016-04-05 18:19 ` Vinod Koul 2016-04-05 21:21 ` Andy Gross 1 sibling, 1 reply; 9+ messages in thread From: Vinod Koul @ 2016-04-05 18:19 UTC (permalink / raw) To: Stanimir Varbanov Cc: Pramod Gurav, andy.gross-QSEj5FYQhm4dnm+yROfE0A, linux-kernel-u79uwXL29TY76Z2rM5mHXA, dmaengine-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w, okaya-sgV2jX0FEOL9JmXXK+q4OQ, architt-sgV2jX0FEOL9JmXXK+q4OQ On Tue, Mar 22, 2016 at 11:55:56AM +0200, Stanimir Varbanov wrote: > On 03/22/2016 11:49 AM, Pramod Gurav wrote: > > On some QOCM platforms(eg 8996) BAM control registers are managed remotely > > hence can not be accessed by application processor for writes. So skip the bam_init > > for any such platform if DT property is set. > > > > Tested on 8996 (BAM Global control is through remote) and DB410C boards. > > Tested with i2c DMA on these targets which uses BAM as DMA controller. > > I have similar patches at [1] already, could you check them first. was there an update posted on these? I dont have this series or an update in my queue -- ~Vinod -- 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] 9+ messages in thread
* Re: [PATCH 0/2] Bypass BAM init if Remotely controlled 2016-04-05 18:19 ` Vinod Koul @ 2016-04-05 21:21 ` Andy Gross 2016-04-05 21:27 ` Koul, Vinod 0 siblings, 1 reply; 9+ messages in thread From: Andy Gross @ 2016-04-05 21:21 UTC (permalink / raw) To: Vinod Koul Cc: Stanimir Varbanov, Pramod Gurav, linux-kernel, dmaengine, linux-arm-msm, devicetree, dan.j.williams, okaya, architt On Tue, Apr 05, 2016 at 11:19:50AM -0700, Vinod Koul wrote: > On Tue, Mar 22, 2016 at 11:55:56AM +0200, Stanimir Varbanov wrote: > > On 03/22/2016 11:49 AM, Pramod Gurav wrote: > > > On some QOCM platforms(eg 8996) BAM control registers are managed remotely > > > hence can not be accessed by application processor for writes. So skip the bam_init > > > for any such platform if DT property is set. > > > > > > Tested on 8996 (BAM Global control is through remote) and DB410C boards. > > > Tested with i2c DMA on these targets which uses BAM as DMA controller. > > > > I have similar patches at [1] already, could you check them first. > > was there an update posted on these? I dont have this series or an update in > my queue No updates that I can see. The original is here: https://lkml.org/lkml/2015/12/1/113 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Bypass BAM init if Remotely controlled 2016-04-05 21:21 ` Andy Gross @ 2016-04-05 21:27 ` Koul, Vinod 0 siblings, 0 replies; 9+ messages in thread From: Koul, Vinod @ 2016-04-05 21:27 UTC (permalink / raw) To: andy.gross@linaro.org Cc: linux-kernel@vger.kernel.org, svarbanov@mm-sol.com, architt@codeaurora.org, devicetree@vger.kernel.org, okaya@codeaurora.org, linux-arm-msm@vger.kernel.org, Williams, Dan J, dmaengine@vger.kernel.org, gpramod@codeaurora.org On Tue, 2016-04-05 at 16:21 -0500, Andy Gross wrote: > On Tue, Apr 05, 2016 at 11:19:50AM -0700, Vinod Koul wrote: > > On Tue, Mar 22, 2016 at 11:55:56AM +0200, Stanimir Varbanov wrote: > > > On 03/22/2016 11:49 AM, Pramod Gurav wrote: > > > > On some QOCM platforms(eg 8996) BAM control registers are > > > > managed remotely > > > > hence can not be accessed by application processor for writes. > > > > So skip the bam_init > > > > for any such platform if DT property is set. > > > > > > > > Tested on 8996 (BAM Global control is through remote) and DB410C > > > > boards. > > > > Tested with i2c DMA on these targets which uses BAM as DMA > > > > controller. > > > > > > I have similar patches at [1] already, could you check them first. > > > > was there an update posted on these? I dont have this series or an > > update in > > my queue > > No updates that I can see. The original is here: > > https://lkml.org/lkml/2015/12/1/113 > And that seemed to have some discussion so I dont recall looking at it. -- ~Vinod ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-04-05 21:27 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-22 9:49 [PATCH 0/2] Bypass BAM init if Remotely controlled Pramod Gurav 2016-03-22 9:49 ` [PATCH 1/2] dmaengine: qcom_bam_dma: Clear IRQ only if its set Pramod Gurav 2016-03-22 9:49 ` [PATCH 2/2] dmaengine: qcom_bam_dma: Bypass BAM init if not managed locally Pramod Gurav 2016-03-23 15:09 ` Rob Herring [not found] ` <1458640151-15150-1-git-send-email-gpramod-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> 2016-03-22 9:55 ` [PATCH 0/2] Bypass BAM init if Remotely controlled Stanimir Varbanov [not found] ` <56F116AC.2000704-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> 2016-03-22 10:36 ` gpramod-sgV2jX0FEOL9JmXXK+q4OQ 2016-04-05 18:19 ` Vinod Koul 2016-04-05 21:21 ` Andy Gross 2016-04-05 21:27 ` Koul, Vinod
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).