From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>,
Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Paul Burton <paulburton@kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
Lee Jones <lee.jones@linaro.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Arnd Bergmann <arnd@arndb.de>, Rob Herring <robh+dt@kernel.org>,
<linux-mips@vger.kernel.org>,
devicetree <devicetree@vger.kernel.org>,
John Garry <john.garry@huawei.com>,
Chuanhong Guo <gch981213@gmail.com>,
Eddie James <eajames@linux.ibm.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Chris Packham <chris.packham@alliedtelesis.co.nz>,
Tomer Maimon <tmaimon77@gmail.com>,
Masahisa Kojima <masahisa.kojima@linaro.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Jassi Brar <jaswinder.singh@linaro.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-spi <linux-spi@vger.kernel.org>
Subject: Re: [PATCH 2/2] spi: Add Baikal-T1 System Boot SPI Controller driver
Date: Fri, 8 May 2020 19:24:55 +0300 [thread overview]
Message-ID: <20200508162455.3cgfquqmbx7ep2zf@mobilestation> (raw)
In-Reply-To: <CAHp75VcaVGHfYN1hjD5eKgpKJkpKEif8NxBGO1YF61_apv82Kg@mail.gmail.com>
On Fri, May 08, 2020 at 01:26:52PM +0300, Andy Shevchenko wrote:
> On Fri, May 8, 2020 at 1:15 PM Serge Semin
> <Sergey.Semin@baikalelectronics.ru> wrote:
> >
> > On Fri, May 08, 2020 at 01:03:11PM +0300, Andy Shevchenko wrote:
> > > On Fri, May 8, 2020 at 12:37 PM Serge Semin
> > > <Sergey.Semin@baikalelectronics.ru> wrote:
> > > >
> > > > This SPI-controller is a part of the Baikal-T1 System Controller and
> > > > is based on the DW APB SSI IP-core, but with very limited resources:
> > > > no IRQ, no DMA, only a single native chip-select and just 8 bytes Tx/Rx
> > > > FIFO available. In order to provide a transparent initial boot code
> > > > execution this controller is also utilized by an vendor-specific block,
> > > > which provides an CS0 SPI flash direct mapping interface. Since both
> > > > direct mapping and SPI controller normal utilization are mutual exclusive
> > > > only a one of these interfaces can be used to access an external SPI
> > > > slave device. Taking into account the peculiarities of the controller
> > > > registers and physically mapped SPI flash access, very limited resources
> > > > and seeing the normal usecase of the controller is to access an external
> > > > SPI-nor flash, we decided to create a dedicated SPI driver for it.
> > >
> > > It seems a lot of code.
> > > Why can't you use spi-dw-mmio.c et al.?
> >
> > I said above why. Even though the registers set is similar It's too specific
> > to be integrated into the generic DW SSI driver.
>
> At least you may do at the beginning is to reuse header spi-dw.h and
> put your stuff under
> spi-dw-baikal.c or so. Then, look at the spi-dw.c and check what can
> be reused (I think a lot).
Nah, It's not a lot, barely a few things. What is useful is the registers map
(though it has to be shifted and most of the registers are unused), IO operations
(two small read-write methods with questionable design) and possibly a few lines
of config setting procedure.
You think I didn't had in mind to integrate this controller support into
the generic driver or resuse something from there? If it was worth a try I would
have done it.
-Sergey
>
> --
> With Best Regards,
> Andy Shevchenko
next prev parent reply other threads:[~2020-05-08 16:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 9:36 [PATCH 0/2] spi: Add Baikal-T1 System Boot SPI Controller driver Serge Semin
2020-05-08 9:36 ` [PATCH 1/2] dt-bindings: spi: Add Baikal-T1 System Boot SPI Controller binding Serge Semin
2020-05-18 15:26 ` Rob Herring
2020-05-18 21:27 ` Serge Semin
2020-05-21 14:57 ` Rob Herring
2020-05-21 15:11 ` Serge Semin
2020-05-21 21:35 ` Rob Herring
2020-05-18 21:55 ` Serge Semin
2020-05-08 9:36 ` [PATCH 2/2] spi: Add Baikal-T1 System Boot SPI Controller driver Serge Semin
2020-05-08 10:03 ` Andy Shevchenko
2020-05-08 10:15 ` Serge Semin
2020-05-08 10:22 ` Mark Brown
2020-05-08 15:42 ` Serge Semin
2020-05-08 17:07 ` Mark Brown
2020-05-08 10:26 ` Andy Shevchenko
2020-05-08 16:24 ` Serge Semin [this message]
2020-05-08 11:37 ` Mark Brown
2020-05-10 0:20 ` Serge Semin
2020-05-10 22:17 ` Chris Packham
2020-05-11 21:25 ` Mark Brown
2020-05-18 0:05 ` Serge Semin
2020-05-18 15:19 ` Mark Brown
2020-05-18 21:17 ` Serge Semin
2020-05-19 10:32 ` Mark Brown
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=20200508162455.3cgfquqmbx7ep2zf@mobilestation \
--to=sergey.semin@baikalelectronics.ru \
--cc=Alexey.Malahov@baikalelectronics.ru \
--cc=Ramil.Zaripov@baikalelectronics.ru \
--cc=andy.shevchenko@gmail.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=devicetree@vger.kernel.org \
--cc=eajames@linux.ibm.com \
--cc=f.fainelli@gmail.com \
--cc=gch981213@gmail.com \
--cc=geert@linux-m68k.org \
--cc=jaswinder.singh@linaro.org \
--cc=john.garry@huawei.com \
--cc=krzk@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=masahisa.kojima@linaro.org \
--cc=miquel.raynal@bootlin.com \
--cc=paulburton@kernel.org \
--cc=ralf@linux-mips.org \
--cc=robh+dt@kernel.org \
--cc=tmaimon77@gmail.com \
--cc=tsbogend@alpha.franken.de \
/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).