mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Gross <agross@codeaurora.org>
To: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	dmaengine@vger.kernel.org, Vinod Koul <vinod.koul@intel.com>,
	Rob Herring <robh+dt@kernel.org>, Rob Herring <robh@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Archit Taneja <architt@codeaurora.org>
Subject: Re: [PATCH 4/4] dmaengine: qcom_bam_dma: add controlled remotely dt property
Date: Tue, 1 Dec 2015 11:30:26 -0600	[thread overview]
Message-ID: <20151201173026.GD26687@Agamemnon.attlocal.net> (raw)
In-Reply-To: <1448961299-15161-5-git-send-email-stanimir.varbanov@linaro.org>

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>

  reply	other threads:[~2015-12-01 17:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  9:14 [PATCH 0/4] bam dma fixes and one dt extension Stanimir Varbanov
2015-12-01  9:14 ` [PATCH 1/4] dmaengine: qcom_bam_dma: fix dma free memory on remove Stanimir Varbanov
2015-12-01  9:14 ` [PATCH 2/4] dmaengine: qcom_bam_dma: clear BAM interrupt only if it is rised Stanimir Varbanov
2015-12-01 10:29   ` Arnd Bergmann
2015-12-02 12:56     ` Stanimir Varbanov
2015-12-02 13:05       ` Arnd Bergmann
2015-12-02 16:47         ` Stanimir Varbanov
2015-12-01 17:28   ` Andy Gross
2015-12-01  9:14 ` [PATCH 3/4] dmaengine: qcom_bam_dma: use correct pipe FIFO size Stanimir Varbanov
2015-12-01 10:28   ` Arnd Bergmann
2015-12-01 17:25     ` Andy Gross
2015-12-01 20:22       ` Arnd Bergmann
2015-12-01 17:23   ` Andy Gross
2015-12-02 16:44     ` Stanimir Varbanov
2015-12-02 17:22       ` Andy Gross
2015-12-10 13:18         ` Stanimir Varbanov
2016-01-29  4:38           ` Andy Gross
2015-12-01  9:14 ` [PATCH 4/4] dmaengine: qcom_bam_dma: add controlled remotely dt property Stanimir Varbanov
2015-12-01 17:30   ` Andy Gross [this message]
2016-04-05 21:33 ` [PATCH 0/4] bam dma fixes and one dt extension Andy Gross
2016-04-05 23:06   ` Stanimir Varbanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151201173026.GD26687@Agamemnon.attlocal.net \
    --to=agross@codeaurora.org \
    --cc=architt@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®