From: Ian Dannapel <iansdannapel@gmail.com>
To: Conor Dooley <conor@kernel.org>
Cc: Xu Yilun <yilun.xu@linux.intel.com>,
mdf@kernel.org, hao.wu@intel.com, yilun.xu@intel.com,
trix@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, neil.armstrong@linaro.org,
heiko.stuebner@cherry.de, rafal@milecki.pl,
linus.walleij@linaro.org, linux-fpga@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] fpga: Add Efinix Trion & Titanium serial SPI programming driver
Date: Mon, 21 Oct 2024 15:23:10 +0200 [thread overview]
Message-ID: <CAKrir7gB+cdnHJu6ZgpEOA-rYLpVK0wJOG=9zChmA6fMCyZRQw@mail.gmail.com> (raw)
In-Reply-To: <20241021-depravity-scale-6123da541538@spud>
Am Mo., 21. Okt. 2024 um 14:18 Uhr schrieb Conor Dooley <conor@kernel.org>:
>
> On Mon, Oct 21, 2024 at 10:10:20AM +0800, Xu Yilun wrote:
> > On Fri, Oct 18, 2024 at 05:58:44PM +0100, Conor Dooley wrote:
> > > On Fri, Oct 18, 2024 at 09:37:22AM +0800, Xu Yilun wrote:
> > > > On Fri, Sep 27, 2024 at 04:14:42PM +0200, iansdannapel@gmail.com wrote:
> > > > > From: Ian Dannapel <iansdannapel@gmail.com>
> > > > >
> > > > > Add a new driver for loading binary firmware to volatile
> > > > > configuration RAM using "SPI passive programming" on Efinix FPGAs.
> > > > >
> > > > > Signed-off-by: Ian Dannapel <iansdannapel@gmail.com>
> > > > > ---
> > > > > drivers/fpga/Kconfig | 10 ++
> > > > > drivers/fpga/Makefile | 1 +
> > > > > drivers/fpga/efinix-trion-spi-passive.c | 211 ++++++++++++++++++++++++
> > > > > 3 files changed, 222 insertions(+)
> > > > > create mode 100644 drivers/fpga/efinix-trion-spi-passive.c
> > > > >
> > > > > diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
> > > > > index 37b35f58f0df..eb1e44c4e3e0 100644
> > > > > --- a/drivers/fpga/Kconfig
> > > > > +++ b/drivers/fpga/Kconfig
> > > > > @@ -83,6 +83,16 @@ config FPGA_MGR_XILINX_SPI
> > > > > FPGA manager driver support for Xilinx FPGA configuration
> > > > > over slave serial interface.
> > > > >
> > > > > +config FPGA_MGR_EFINIX_SPI
> > > > > + tristate "Efinix FPGA configuration over SPI passive"
> > > > > + depends on SPI
> > > > > + help
> > > > > + This option enables support for the FPGA manager driver to
> > > > > + configure Efinix Trion and Titanium Series FPGAs over SPI
> > > > > + using passive serial mode.
> > > > > + Warning: Do not activate this if there are other SPI devices
> > > > > + on the same bus as it might interfere with the transmission.
> > > >
> > > > Sorry, this won't work. As you can see, the conflict usage of CS causes
> > > > several concerns. Just a text here is far from enough.
> > > >
> > > > You need to actively work with SPI core/controller drivers to find a
> > > > solution that coordinate the usage of this pin.
> > >
> > > Why does it even impact other SPI devices on the bus? It's not /their/
> > > CS line that is being modified here, it is the line for the FPGA's
> > > programming interface, right?
> > > What am I missing here that makes it any different to any other SPI
> > > device that may need it's CS toggled?
> >
> > IIUC, now spi core or controller driver should fully responsible for
> > HW operations of CS. And every good behaved spi device driver should
> > declare their logical CS index defined by SPI controller and let SPI
> > core/controller driver to proxy the CS change.
> >
> > But if this spi device driver directly aquires CS, it conflicts with
> > the controller and just fails.
>
> Right, I don't think you answered my question here at all, but just
> reading over the kconfig text again I think I understand what it means.
> I'd interpreted this as other devices being impacted by what this driver
> is doing, but actually it is talking about other devices on the bus
> interfering with this one because of how it handles the chip select.
Correct, the problem lies when other devices initiate a transfer in
between the device programming:
If the CS goes inactive in between, the fpga won't be programmed
correctly since it requires that all bytes are transferred within the
same CS active.
If the CS remains active, the fpga will be programmed with random payloads.
But I might have found a solution to coordinate the CS with the
controller (set_cs in struct spi_controller), since the cs state must
be set before any transfer to enter the programming mode.
Regards,
Ian
next prev parent reply other threads:[~2024-10-21 13:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 14:14 [PATCH 1/3] fpga: Add Efinix Trion & Titanium serial SPI programming driver iansdannapel
2024-09-27 14:14 ` [PATCH 2/3] dt-bindings: fpga: Add Efinix serial SPI programming bindings iansdannapel
2024-09-27 14:26 ` Krzysztof Kozlowski
2024-09-27 15:34 ` Ian Dannapel
2024-09-28 7:31 ` Krzysztof Kozlowski
2024-09-28 12:33 ` Ian Dannapel
2024-09-28 12:53 ` Krzysztof Kozlowski
2024-09-28 14:26 ` Ian Dannapel
2024-09-29 19:49 ` Krzysztof Kozlowski
2024-09-27 14:14 ` [PATCH 3/3] dt-bindings: vendor-prefix: Add prefix for Efinix, Inc iansdannapel
2024-09-27 14:26 ` Krzysztof Kozlowski
2024-09-30 6:23 ` Alexander Dahl
2024-09-27 14:14 ` [PATCH v3 0/3] Summary of changes iansdannapel
2024-09-27 14:27 ` Krzysztof Kozlowski
2024-09-27 14:22 ` [PATCH 1/3] fpga: Add Efinix Trion & Titanium serial SPI programming driver Krzysztof Kozlowski
2024-10-18 1:22 ` Xu Yilun
2024-10-18 1:37 ` Xu Yilun
2024-10-18 16:58 ` Conor Dooley
2024-10-21 2:10 ` Xu Yilun
2024-10-21 12:18 ` Conor Dooley
2024-10-21 13:23 ` Ian Dannapel [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-20 14:42 iansdannapel
2024-06-20 18:05 ` Marco Pagani
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='CAKrir7gB+cdnHJu6ZgpEOA-rYLpVK0wJOG=9zChmA6fMCyZRQw@mail.gmail.com' \
--to=iansdannapel@gmail.com \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hao.wu@intel.com \
--cc=heiko.stuebner@cherry.de \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rafal@milecki.pl \
--cc=robh@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
--cc=yilun.xu@linux.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;
as well as URLs for NNTP newsgroup(s).