[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200518151946.GH8699@sirena.org.uk>
Date: Mon, 18 May 2020 16:19:47 +0100
From: Mark Brown <broonie@...nel.org>
To: Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc: Serge Semin <fancer.lancer@...il.com>,
Ramil Zaripov <Ramil.Zaripov@...kalelectronics.ru>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Paul Burton <paulburton@...nel.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Lee Jones <lee.jones@...aro.org>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Arnd Bergmann <arnd@...db.de>,
Rob Herring <robh+dt@...nel.org>, linux-mips@...r.kernel.org,
devicetree@...r.kernel.org, John Garry <john.garry@...wei.com>,
Chuanhong Guo <gch981213@...il.com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Eddie James <eajames@...ux.ibm.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Chris Packham <chris.packham@...iedtelesis.co.nz>,
Tomer Maimon <tmaimon77@...il.com>,
Masahisa Kojima <masahisa.kojima@...aro.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Jassi Brar <jaswinder.singh@...aro.org>,
linux-kernel@...r.kernel.org, linux-spi@...r.kernel.org
Subject: Re: [PATCH 2/2] spi: Add Baikal-T1 System Boot SPI Controller driver
On Mon, May 18, 2020 at 03:05:42AM +0300, Serge Semin wrote:
> On Mon, May 11, 2020 at 10:25:06PM +0100, Mark Brown wrote:
> > Yes, some flags should work here - the issue was that at least some
> > controllers may end up trying to do multiple SPI operations for one
> > spi-mem thing which will break if the chip select doesn't get changed to
> > correspond with what's going on.
> Ok. New SPI flag it is then. It will be something like this:
> + #define SPI_CONTROLLER_FLASH_SS BIT(6)
I'd rather use CS than SS (it's more common in the code).
> So, what do you think?
Should be fine, controllers that have an issue implementing just
shouldn't set the flag.
> > > > It's not clear to me that this hardware actually supports spi_mem in
> > > > hardware?
> > > SPI-mem operations are implemented by means of the EEPROM-read and Tx-only
> > > modes of the controller.
> > Sure, but those seem like normal SPI-level things rather than cases
> > where the hardware understands that it has a flash attached and is doing
> > flash specific things.
> No, hardware can't detect whether the flash is attached. This must be defined by
> the platform, like based on the DT sub-nodes.
This isn't about autodetection, it's about the abstraction level the
hardware is operating on - some hardware is able to generate flash
operations by itself (possibly with some help programming the opcodes
that are needed by a given flash), some hardware just works at the
bytestream level.
> > A very common case for this stuff is that
> > controllers have acceleration blocks for read and fall back on normal
> > SPI for writes and erases, that sounds like what's going on here.
>
> Well, yeah, they do provide some acceleration. EEPROM-read provides automatic
> write-cmd-dummy-data-then-read operations. But in this case the only thing we
> have to push into the SPI Tx FIFO is command and dummy bytes. The read operation
So it's a write then read but you have to program the write each time?
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists