Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1280681 > unrolled thread
| Started by | Stanimir Varbanov <stanimir.varbanov@linaro.org> |
|---|---|
| First post | 2015-12-01 10:20 +0100 |
| Last post | 2015-12-01 18:40 +0100 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/4] bam dma fixes and one dt extension Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2015-12-01 10:20 +0100
[PATCH 4/4] dmaengine: qcom_bam_dma: add controlled remotely dt property Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2015-12-01 10:20 +0100
Re: [PATCH 4/4] dmaengine: qcom_bam_dma: add controlled remotely dt property Andy Gross <agross@codeaurora.org> - 2015-12-01 18:40 +0100
| From | Stanimir Varbanov <stanimir.varbanov@linaro.org> |
|---|---|
| Date | 2015-12-01 10:20 +0100 |
| Subject | [PATCH 0/4] bam dma fixes and one dt extension |
| Message-ID | <qAPgm-7I5-11@gated-at.bofh.it> |
Here are three bam dma fixes, which I made during testing qcrypto driver. The first one is a real fix, the second one is related to peripherals on which the BAM IP is initialized by remote execution environment, and the third one is a sleeping bug IMO. The last patch is a extension again for peripherals which BAM is remotely controlled by other execution environment. All patches has been tested on db410c board with apq8016. Comments are welcome! regards, Stan Stanimir Varbanov (4): dmaengine: qcom_bam_dma: fix dma free memory on remove dmaengine: qcom_bam_dma: clear BAM interrupt only if it is rised dmaengine: qcom_bam_dma: use correct pipe FIFO size dmaengine: qcom_bam_dma: add controlled remotely dt property .../devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++ drivers/dma/qcom_bam_dma.c | 24 ++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Stanimir Varbanov <stanimir.varbanov@linaro.org> |
|---|---|
| Date | 2015-12-01 10:20 +0100 |
| Subject | [PATCH 4/4] dmaengine: qcom_bam_dma: add controlled remotely dt property |
| Message-ID | <qAPgn-7I5-39@gated-at.bofh.it> |
| In reply to | #1280681 |
Some of the peripherals has bam which is controlled by remote
processor, thus the bam dma driver must avoid register writes
which initialise bam hw block. Those registers are protected
from xPU block and any writes to them will lead to secure
violation and system reboot.
Adding the contolled_remotely flag in bam driver to avoid
not permitted register writes in bam_init function.
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
.../devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++
drivers/dma/qcom_bam_dma.c | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
index 1c9d48ea4914..87b6b2bf5e1e 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,controlled-remotely : optional, indicates that the bam is controled by
+ remote proccessor i.e. execution enviroment.
Example:
diff --git a/drivers/dma/qcom_bam_dma.c b/drivers/dma/qcom_bam_dma.c
index 6d290de9ab2b..5dedab77180a 100644
--- a/drivers/dma/qcom_bam_dma.c
+++ b/drivers/dma/qcom_bam_dma.c
@@ -387,6 +387,7 @@ struct bam_device {
/* execution environment ID, from DT */
u32 ee;
+ bool controlled_remotely;
const struct reg_offset_data *layout;
@@ -1039,6 +1040,9 @@ static int bam_init(struct bam_device *bdev)
val = readl_relaxed(bam_addr(bdev, 0, BAM_NUM_PIPES));
bdev->num_channels = val & BAM_NUM_PIPES_MASK;
+ if (bdev->controlled_remotely)
+ return 0;
+
/* s/w reset bam */
/* after reset all pipes are disabled and idle */
val = readl_relaxed(bam_addr(bdev, 0, BAM_CTRL));
@@ -1126,6 +1130,9 @@ static int bam_dma_probe(struct platform_device *pdev)
return ret;
}
+ bdev->controlled_remotely = of_property_read_bool(pdev->dev.of_node,
+ "qcom,controlled-remotely");
+
bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");
if (IS_ERR(bdev->bamclk))
return PTR_ERR(bdev->bamclk);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andy Gross <agross@codeaurora.org> |
|---|---|
| Date | 2015-12-01 18:40 +0100 |
| Subject | Re: [PATCH 4/4] dmaengine: qcom_bam_dma: add controlled remotely dt property |
| Message-ID | <qAX4e-4do-9@gated-at.bofh.it> |
| In reply to | #1280683 |
On Tue, Dec 01, 2015 at 11:14:59AM +0200, Stanimir Varbanov wrote:
> Some of the peripherals has bam which is controlled by remote
> processor, thus the bam dma driver must avoid register writes
> which initialise bam hw block. Those registers are protected
> from xPU block and any writes to them will lead to secure
> violation and system reboot.
>
> Adding the contolled_remotely flag in bam driver to avoid
> not permitted register writes in bam_init function.
>
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
> .../devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++
> drivers/dma/qcom_bam_dma.c | 7 +++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
> index 1c9d48ea4914..87b6b2bf5e1e 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,controlled-remotely : optional, indicates that the bam is controled by
> + remote proccessor i.e. execution enviroment.
Please fix the spelling. controlled, environment. Otherwise looks ok.
>
> Example:
>
> diff --git a/drivers/dma/qcom_bam_dma.c b/drivers/dma/qcom_bam_dma.c
> index 6d290de9ab2b..5dedab77180a 100644
> --- a/drivers/dma/qcom_bam_dma.c
> +++ b/drivers/dma/qcom_bam_dma.c
> @@ -387,6 +387,7 @@ struct bam_device {
>
> /* execution environment ID, from DT */
> u32 ee;
> + bool controlled_remotely;
>
> const struct reg_offset_data *layout;
>
> @@ -1039,6 +1040,9 @@ static int bam_init(struct bam_device *bdev)
> val = readl_relaxed(bam_addr(bdev, 0, BAM_NUM_PIPES));
> bdev->num_channels = val & BAM_NUM_PIPES_MASK;
>
> + if (bdev->controlled_remotely)
> + return 0;
> +
> /* s/w reset bam */
> /* after reset all pipes are disabled and idle */
> val = readl_relaxed(bam_addr(bdev, 0, BAM_CTRL));
> @@ -1126,6 +1130,9 @@ static int bam_dma_probe(struct platform_device *pdev)
> return ret;
> }
>
> + bdev->controlled_remotely = of_property_read_bool(pdev->dev.of_node,
> + "qcom,controlled-remotely");
> +
> bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");
> if (IS_ERR(bdev->bamclk))
> return PTR_ERR(bdev->bamclk);
Reviewed-by: Andy Gross <agross@codeaurora.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web