All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Looijmans <mike.looijmans@topic.nl>
To: Moritz Fischer <mdf@kernel.org>
Cc: "linux-fpga@vger.kernel.org" <linux-fpga@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"michal.simek@xilinx.com" <michal.simek@xilinx.com>,
	"atull@kernel.org" <atull@kernel.org>
Subject: Re: [PATCH] zynq-fpga: Only route PR via PCAP when required
Date: Tue, 23 Oct 2018 10:53:50 +0000	[thread overview]
Message-ID: <1781ed23-e03c-f70a-ea8c-3e9fa6eec9d4@topic.nl> (raw)
In-Reply-To: <20181023090119.GA2205@archbook>

On 23-10-18 11:01, Moritz Fischer wrote:
> Hi Mike,
> 
> seems like a good usecase (though uncommon), question below

Usecases for ICAP:
- It's considerably faster than PCAP
- Self-repairing logic (e.g. single-event upsets)
- Being programmed from a remote FPGA
- Programming through another bus (e.g. PCIe)


> 
> On Tue, Oct 23, 2018 at 08:31:19AM +0200, Mike Looijmans wrote:
>> The Xilinx Zynq FPGA driver takes ownership of the PR interface, making
>> it impossible to use the ICAP interface for partial reconfiguration.
>>
>> This patch changes the driver to only activate PR over PCAP while the
>> device is actively being accessed by the driver for programming.
>>
>> This allows both PCAP and ICAP interfaces to be used for PR.
>>
>> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
>> ---
>>   drivers/fpga/zynq-fpga.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c
>> index 3110e00..f6c205a 100644
>> --- a/drivers/fpga/zynq-fpga.c
>> +++ b/drivers/fpga/zynq-fpga.c
>> @@ -497,6 +497,10 @@ static int zynq_fpga_ops_write_complete(struct fpga_manager *mgr,
>>   	int err;
>>   	u32 intr_status;
>>   
>> +	/* Release 'PR' control back to the ICAP */
>> +	zynq_fpga_write(priv, CTRL_OFFSET,
>> +		zynq_fpga_read(priv, CTRL_OFFSET) & ~CTRL_PCAP_PR_MASK);
>> +
> 
> Shouldn't that be after the below stanza that enables the clock?

I'm actually not sure, and I did not encounter any problems while testing 
this, but it's easier to just move it than to find out, so I'll go for "yes, 
let's enable the clock first".
I'll await a bit more feedback and post a v2 for that.

> 
>>   	err = clk_enable(priv->clk);
>>   	if (err)
>>   		return err;
>> -- 
>> 1.9.1
>>
> 
> Cheers,
> 
> Moritz
> 


WARNING: multiple messages have this Message-ID (diff)
From: mike.looijmans@topic.nl (Mike Looijmans)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] zynq-fpga: Only route PR via PCAP when required
Date: Tue, 23 Oct 2018 10:53:50 +0000	[thread overview]
Message-ID: <1781ed23-e03c-f70a-ea8c-3e9fa6eec9d4@topic.nl> (raw)
In-Reply-To: <20181023090119.GA2205@archbook>

On 23-10-18 11:01, Moritz Fischer wrote:
> Hi Mike,
> 
> seems like a good usecase (though uncommon), question below

Usecases for ICAP:
- It's considerably faster than PCAP
- Self-repairing logic (e.g. single-event upsets)
- Being programmed from a remote FPGA
- Programming through another bus (e.g. PCIe)


> 
> On Tue, Oct 23, 2018 at 08:31:19AM +0200, Mike Looijmans wrote:
>> The Xilinx Zynq FPGA driver takes ownership of the PR interface, making
>> it impossible to use the ICAP interface for partial reconfiguration.
>>
>> This patch changes the driver to only activate PR over PCAP while the
>> device is actively being accessed by the driver for programming.
>>
>> This allows both PCAP and ICAP interfaces to be used for PR.
>>
>> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
>> ---
>>   drivers/fpga/zynq-fpga.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c
>> index 3110e00..f6c205a 100644
>> --- a/drivers/fpga/zynq-fpga.c
>> +++ b/drivers/fpga/zynq-fpga.c
>> @@ -497,6 +497,10 @@ static int zynq_fpga_ops_write_complete(struct fpga_manager *mgr,
>>   	int err;
>>   	u32 intr_status;
>>   
>> +	/* Release 'PR' control back to the ICAP */
>> +	zynq_fpga_write(priv, CTRL_OFFSET,
>> +		zynq_fpga_read(priv, CTRL_OFFSET) & ~CTRL_PCAP_PR_MASK);
>> +
> 
> Shouldn't that be after the below stanza that enables the clock?

I'm actually not sure, and I did not encounter any problems while testing 
this, but it's easier to just move it than to find out, so I'll go for "yes, 
let's enable the clock first".
I'll await a bit more feedback and post a v2 for that.

> 
>>   	err = clk_enable(priv->clk);
>>   	if (err)
>>   		return err;
>> -- 
>> 1.9.1
>>
> 
> Cheers,
> 
> Moritz
> 

  reply	other threads:[~2018-10-23 10:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  6:31 [PATCH] zynq-fpga: Only route PR via PCAP when required Mike Looijmans
2018-10-23  6:31 ` Mike Looijmans
2018-10-23  9:01 ` Moritz Fischer
2018-10-23  9:01   ` Moritz Fischer
2018-10-23 10:53   ` Mike Looijmans [this message]
2018-10-23 10:53     ` Mike Looijmans
2018-10-23 10:53     ` Mike Looijmans
2018-10-23 11:04     ` Moritz Fischer
2018-10-23 11:04       ` Moritz Fischer
2018-10-23 11:04       ` Moritz Fischer
2018-10-26  7:54       ` Michal Simek
2018-10-26  7:54         ` Michal Simek
2018-10-26  7:54         ` Michal Simek
2018-10-26 17:04         ` Moritz Fischer
2018-10-26 17:04           ` Moritz Fischer
2018-10-24  7:53 ` [PATCH v2] " Mike Looijmans
2018-10-24  7:53   ` Mike Looijmans
2018-11-01 18:33   ` Alan Tull
2018-11-01 18:33     ` Alan Tull
2018-11-01 18:33     ` Alan Tull

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=1781ed23-e03c-f70a-ea8c-3e9fa6eec9d4@topic.nl \
    --to=mike.looijmans@topic.nl \
    --cc=atull@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=michal.simek@xilinx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.