* [4/4] dmaengine: qcom: bam_dma: Add num-ees dt binding for remotely controlled
@ 2018-01-16 19:02 Srinivas Kandagatla
0 siblings, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2018-01-16 19:02 UTC (permalink / raw)
To: Vinod Koul, Andy Gross, dmaengine
Cc: Rob Herring, Mark Rutland, David Brown, Dan Williams, devicetree,
linux-kernel, linux-arm-msm, linux-soc, yanhe, ramkri, sdharia,
Srinivas Kandagatla
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
When Linux is master of BAM, it can directly read registers to know number
of supported execution enviroments, however when its remotely controlled
reading these registers would trigger a crash if the BAM is not yet
intialized/powered up on the remote side.
This patch adds new binding num-ees to specify supported number of
Execution Environments when BAM is remotely controlled.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Documentation/devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++
drivers/dma/qcom/bam_dma.c | 15 ++++++++++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
index aa6822cbb230..f0d10c2b393e 100644
--- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
+++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
@@ -17,6 +17,8 @@ Required properties:
remote proccessor i.e. execution environment.
- num-channels : optional, indicates supported number of DMA channels in a
remotely controlled bam.
+- num-ees : optional, indicates supported number of Execution Environments in a
+ remotely controlled bam.
Example:
diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index bbbb755d7549..7a8727271d60 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -387,6 +387,7 @@ struct bam_device {
struct device_dma_parameters dma_parms;
struct bam_chan *channels;
u32 num_channels;
+ u32 num_ees;
/* execution environment ID, from DT */
u32 ee;
@@ -1079,11 +1080,14 @@ static int bam_init(struct bam_device *bdev)
u32 val;
/* read revision and configuration information */
- val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION)) >> NUM_EES_SHIFT;
- val &= NUM_EES_MASK;
+ if (!bdev->num_ees) {
+ val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION)) >> NUM_EES_SHIFT;
+ val &= NUM_EES_MASK;
+ bdev->num_ees = val;
+ }
/* check that configured EE is within range */
- if (bdev->ee >= val)
+ if (bdev->ee >= bdev->num_ees)
return -EINVAL;
if (!bdev->num_channels) {
@@ -1189,6 +1193,11 @@ static int bam_dma_probe(struct platform_device *pdev)
&bdev->num_channels);
if (ret)
dev_err(bdev->dev, "num-channels unspecified in dt\n");
+
+ ret = of_property_read_u32(pdev->dev.of_node, "num-ees",
+ &bdev->num_ees);
+ if (ret)
+ dev_err(bdev->dev, "num-ees unspecified in dt\n");
}
bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [4/4] dmaengine: qcom: bam_dma: Add num-ees dt binding for remotely controlled
@ 2018-01-29 16:21 Rob Herring
0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2018-01-29 16:21 UTC (permalink / raw)
To: srinivas.kandagatla
Cc: Vinod Koul, Andy Gross, dmaengine, Mark Rutland, David Brown,
Dan Williams, devicetree, linux-kernel, linux-arm-msm, linux-soc,
yanhe, ramkri, sdharia
On Tue, Jan 16, 2018 at 07:02:36PM +0000, srinivas.kandagatla@linaro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> When Linux is master of BAM, it can directly read registers to know number
> of supported execution enviroments, however when its remotely controlled
> reading these registers would trigger a crash if the BAM is not yet
> intialized/powered up on the remote side.
>
> This patch adds new binding num-ees to specify supported number of
> Execution Environments when BAM is remotely controlled.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> Documentation/devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++
> drivers/dma/qcom/bam_dma.c | 15 ++++++++++++---
> 2 files changed, 14 insertions(+), 3 deletions(-)
The correct split is the binding changes in 1 patch. Driver changes
separate.
>
> diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
> index aa6822cbb230..f0d10c2b393e 100644
> --- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
> +++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
> @@ -17,6 +17,8 @@ Required properties:
> remote proccessor i.e. execution environment.
> - num-channels : optional, indicates supported number of DMA channels in a
> remotely controlled bam.
> +- num-ees : optional, indicates supported number of Execution Environments in a
> + remotely controlled bam.
This one needs a vendor prefix as it is not a common property.
>
> Example:
>
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [4/4] dmaengine: qcom: bam_dma: Add num-ees dt binding for remotely controlled
@ 2018-01-30 9:18 Srinivas Kandagatla
0 siblings, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2018-01-30 9:18 UTC (permalink / raw)
To: Rob Herring
Cc: Vinod Koul, Andy Gross, dmaengine, Mark Rutland, David Brown,
Dan Williams, devicetree, linux-kernel, linux-arm-msm, linux-soc,
yanhe, ramkri, sdharia
Thanks for the review,
On 29/01/18 16:21, Rob Herring wrote:
> On Tue, Jan 16, 2018 at 07:02:36PM +0000, srinivas.kandagatla@linaro.org wrote:
>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>
>> When Linux is master of BAM, it can directly read registers to know number
>> of supported execution enviroments, however when its remotely controlled
>> reading these registers would trigger a crash if the BAM is not yet
>> intialized/powered up on the remote side.
>>
>> This patch adds new binding num-ees to specify supported number of
>> Execution Environments when BAM is remotely controlled.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>> Documentation/devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++
>> drivers/dma/qcom/bam_dma.c | 15 ++++++++++++---
>> 2 files changed, 14 insertions(+), 3 deletions(-)
>
> The correct split is the binding changes in 1 patch. Driver changes
> separate.
>
Sure, Will Split it in next version.
>>
>> diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
>> index aa6822cbb230..f0d10c2b393e 100644
>> --- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
>> +++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
>> @@ -17,6 +17,8 @@ Required properties:
>> remote proccessor i.e. execution environment.
>> - num-channels : optional, indicates supported number of DMA channels in a
>> remotely controlled bam.
>> +- num-ees : optional, indicates supported number of Execution Environments in a
>> + remotely controlled bam.
>
> This one needs a vendor prefix as it is not a common property.
>
Make sense, I will change it in next version.
Thanks,
Srini
>>
>> Example:
>>
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-30 9:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-16 19:02 [4/4] dmaengine: qcom: bam_dma: Add num-ees dt binding for remotely controlled Srinivas Kandagatla
-- strict thread matches above, loose matches on Subject: below --
2018-01-29 16:21 Rob Herring
2018-01-30 9:18 Srinivas Kandagatla
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).