From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 14 Sep 2015 19:35:53 +0100 From: Mark Brown To: Jagan Teki Cc: Vignesh R , Benoit Cousson , Tony Lindgren , Russell King , David Woodhouse , Brian Norris , hramrach@gmail.com, devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , linux-spi@vger.kernel.org, "linux-mtd@lists.infradead.org" , linux-omap@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" Message-ID: <20150914183553.GE12027@sirena.org.uk> References: <1441355402-6837-1-git-send-email-vigneshr@ti.com> <1441355402-6837-2-git-send-email-vigneshr@ti.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TbSr5s+wTV5WAS2d" Content-Disposition: inline In-Reply-To: Subject: Re: [PATCH 1/5] spi: introduce mmap read support for spi flash devices List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --TbSr5s+wTV5WAS2d Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 04, 2015 at 04:55:33PM +0530, Jagan Teki wrote: > On 4 September 2015 at 13:59, Vignesh R wrote: > > + * @spi_mtd_mmap_read: some spi-controller hardwares provide memory > > + * mapped interface to communicate with mtd flashes. > > + * For this, spi controller needs to know flash > > + * memory settings like read command to use, dummy > > + * bytes and address width. Once these settings are > > + * populated in hardware registers, any read > > + * accesses to flash's memory map region(as defined > > + * by SoC) through memcpy or mem-to-mem DMA copy > > + * will be handled by controller hardware. The > > + * hardware will automatically generate spi signals > > + * required to read data from flash and present it > > + * to CPU or DMA. SPI master drivers can use this > > + * callback to implement memory mapped read > > + * interface. Flash driver (like m25p80) requests > > + * memory mapped read via this method. The interface > > + * should only be used mtd flashes and cannot be > > + * used with other spi devices. This comment is *way* too verbose - probably you just need up to the "Once" here. > > + int (*spi_mtd_mmap_read)(struct spi_device *spi, > > + loff_t from, size_t len, size_t *retlen, > > + u_char *buf, u8 read_opcode, > > + u8 addr_width, u8 dummy_bytes); > This looks un-manageable to know spi core or master knows what are the > command or opcode used by spi-nor flash and also I think mmap support > seems to be flash related or any justification this is spi bus > master/controller feature? There seem to be a reasonable number of SPI controllers out there which have as an extension the ability to do memory mapped reads but are otherwise perfectly normal SPI controllers and which rely on that for everything except reads. --TbSr5s+wTV5WAS2d Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJV9xOIAAoJECTWi3JdVIfQqgcH/3Ekg6pdRGJdZXUWeq96lbf2 RqMNZrClp0GhaW2FGFFNKqNIFMMLB37lSaZHsONuauahceTqeVeFRnsXzv4xn3vB x9ou9s5XFCJ33J4U2cSD60lG3+DFerOYTyX455Tak0hD7nm88uPw7BRqkF35+wIN 2Rxp1IRMrIYSJ590yes2gCYbzsiTSAZ2PBFHJCmNNtRstGZkKmQEgjFNtBOnzu+7 rLxdsovxNA4LP1Xk8838RQqcfwCZcC+NS5SV6P1rCcGaV3G0UKI3OwYApvY6nJBI o99K7Mg9++onPyoZYQPy+S9d/quYmDk8Go6pYD3zAg23DIhXVge863oAl6bOkUI= =EWog -----END PGP SIGNATURE----- --TbSr5s+wTV5WAS2d--