linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Krzeminski, Marcin (Nokia - PL/Wroclaw)"  <marcin.krzeminski@nokia.com>
To: Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	"'computersforpeace@gmail.com'" <computersforpeace@gmail.com>,
	"'marek.vasut@gmail.com'" <marek.vasut@gmail.com>,
	"'boris.brezillon@free-electrons.com'" 
	<boris.brezillon@free-electrons.com>,
	"'richard@nod.at'" <richard@nod.at>,
	"'linux-mtd@lists.infradead.org'" <linux-mtd@lists.infradead.org>
Cc: "'nicolas.ferre@atmel.com'" <nicolas.ferre@atmel.com>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Odp.: [PATCH v4 4/8] mtd: spi-nor: add support of SPI protocols like SPI 1-2-2 and SPI 1-4-4
Date: Tue, 20 Dec 2016 19:41:45 +0000	[thread overview]
Message-ID: <AM4PR0701MB21309FCD4A3EBCC20B403D3BFE900@AM4PR0701MB2130.eurprd07.prod.outlook.com> (raw)
In-Reply-To: <8f70a04f-33f8-c703-0836-db1d3e07aca5@atmel.com>


>  
> Le 16/12/2016 à 14:47, Krzeminski, Marcin (Nokia - PL/Wroclaw) a écrit :
> >> -----Original Message-----
> >> From: Krzeminski, Marcin (Nokia - PL/Wroclaw)
> >> Sent: Tuesday, December 13, 2016 10:46 AM
> >> To: Cyrille Pitchen <cyrille.pitchen@atmel.com>;
> >> computersforpeace@gmail.com; marek.vasut@gmail.com;
> >> boris.brezillon@free-electrons.com; richard@nod.at; linux-
> >> mtd@lists.infradead.org
> >> Cc: nicolas.ferre@atmel.com; linux-kernel@vger.kernel.org
> >> Subject: RE: [PATCH v4 4/8] mtd: spi-nor: add support of SPI protocols like SPI
> >> 1-2-2 and SPI 1-4-4
> >>
> >> Cyrille,
> >>
> >>> -----Original Message-----
> >>> From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On
> >>> Behalf Of Cyrille Pitchen
> >>> Sent: Monday, November 21, 2016 3:16 PM
> >>> To: computersforpeace@gmail.com; marek.vasut@gmail.com;
> >>> boris.brezillon@free-electrons.com; richard@nod.at; linux-
> >>> mtd@lists.infradead.org
> >>> Cc: Cyrille Pitchen <cyrille.pitchen@atmel.com>;
> >>> nicolas.ferre@atmel.com; linux-kernel@vger.kernel.org
> >>> Subject: [PATCH v4 4/8] mtd: spi-nor: add support of SPI protocols
> >>> like SPI 1-
> >>> 2-2 and SPI 1-4-4
> >>>
> >>> This patch changes the prototype of spi_nor_scan(): its 3rd parameter
> >>> is replaced by a const struct spi_nor_modes pointer, which tells the
> >>> spi-nor framework about which SPI protocols are supported by the SPI
> >> controller.
> >>>
> >>> Besides, this patch also introduces a new
> >>> spi_nor_basic_flash_parameter structure telling the spi-nor framework
> >>> about the SPI protocols supported by the SPI memory and the needed op
> >> codes to use these SPI protocols.
> >>>
> >>> Currently the struct spi_nor_basic_flash_parameter is filled with
> >>> legacy values but a later patch will allow to fill it dynamically by
> >>> reading the
> >>> JESD216 Serial Flash Discoverable Parameter (SFDP) tables from the SPI
> >>> memory.
> >>>
> >>> With both structures, the spi-nor framework can now compute the best
> >>> match between SPI protocols supported by both the (Q)SPI memory and
> >>> controller hence selecting the relevant op codes for (Fast) Read, Page
> >>> Program and Sector Erase operations.
> >>>
> >>> The spi_nor_basic_flash_parameter structure also provides the spi-nor
> >>> framework with the number of dummy cycles to be used with each Fast
> >>> Read commands and the erase block size associated to the erase block
> >>> op codes.
> >>>
> >>> Finally the spi_nor_basic_flash_parameter structure, through the
> >>> optional
> >>> .enable_quad_io() hook, tells the spi-nor framework how to set the
> >>> Quad Enable (QE) bit of the QSPI memory to enable its Quad SPI features.
> >>>
> >>> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> >>> ---
> >>>  drivers/mtd/devices/m25p80.c          |  17 ++-
> >>>  drivers/mtd/spi-nor/atmel-quadspi.c   |  83 ++++++----
> >>>  drivers/mtd/spi-nor/cadence-quadspi.c |  18 ++-
> >>>  drivers/mtd/spi-nor/fsl-quadspi.c     |   8 +-
> >>>  drivers/mtd/spi-nor/hisi-sfc.c        |  32 +++-
> >>>  drivers/mtd/spi-nor/mtk-quadspi.c     |  16 +-
> >>>  drivers/mtd/spi-nor/nxp-spifi.c       |  21 +--
> >>>  drivers/mtd/spi-nor/spi-nor.c         | 280
> >> +++++++++++++++++++++++++++-
> >>> ------
> [...]
> >>> +static int spi_nor_setup(struct spi_nor *nor, const struct flash_info *info,
> >>> +                    const struct spi_nor_basic_flash_parameter
> >>> *params,
> >>> +                    const struct spi_nor_modes *modes)
> >>>  {
> >>> +   bool enable_quad_io;
> >>> +   u32 rd_modes, wr_modes, mask;
> >>> +   const struct spi_nor_erase_type *erase_type = NULL;
> >>> +   const struct spi_nor_read *read;
> >>> +   int rd_pindex, wr_pindex, i, err = 0;
> >>> +   u8 erase_size = SNOR_ERASE_64K;
> >>
> >> Erase size could be configurable, then user can chose best sector size that
> >> match his use case on multi-sized flash.
> >>
> >>> +
> >>> +   /* 2-2-2 or 4-4-4 modes are not supported yet. */
> >>> +   mask = (SNOR_MODE_2_2_2 | SNOR_MODE_4_4_4);
> > IMHO could be nice to put a warning here :)
> > 
>
> Then maybe only a dev_dbg() because many developers complain that there are
> already too many debug messages in the boot logs.

Sure, also if-ed printout when user request 222 o 444 mode will be fine.
Just imagine reaction of an impulsive programmer who requested Full Dual/Quad
mode and framework silently ignore it :)

Thanks,
Marcin
>
> > Thanks,
> > Marcin
> > 
>

  reply	other threads:[~2016-12-20 23:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 14:15 [PATCH v4 0/8] mtd: spi-nor: parse SFDP tables to setup (Q)SPI memories Cyrille Pitchen
2016-11-21 14:15 ` [PATCH v4 1/8] mtd: spi-nor: improve macronix_quad_enable() Cyrille Pitchen
2016-11-21 14:15 ` [PATCH v4 2/8] mtd: spi-nor: rename SPINOR_OP_* macros of the 4-byte address op codes Cyrille Pitchen
2016-11-21 14:15 ` [PATCH v4 3/8] mtd: spi-nor: add an alternative method to support memory >16MiB Cyrille Pitchen
2016-11-21 14:15 ` [PATCH v4 4/8] mtd: spi-nor: add support of SPI protocols like SPI 1-2-2 and SPI 1-4-4 Cyrille Pitchen
2016-12-13  9:46   ` Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-12-16 13:47     ` Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-12-19 17:00       ` Cyrille Pitchen
2016-12-20 19:41         ` Krzeminski, Marcin (Nokia - PL/Wroclaw) [this message]
2016-12-19 16:38     ` Cyrille Pitchen
2016-12-20 19:36       ` Odp.: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-11-21 14:15 ` [PATCH v4 5/8] mtd: spi-nor: remove unused set_quad_mode() function Cyrille Pitchen
2016-11-21 14:15 ` [PATCH v4 6/8] mtd: m25p80: add support of dual and quad spi protocols to all commands Cyrille Pitchen
2016-11-21 14:15 ` [PATCH v4 7/8] mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables Cyrille Pitchen
2016-11-21 14:15 ` [PATCH v4 8/8] mtd: spi-nor: parse SFDP 4-byte Address Instruction Table Cyrille Pitchen
2016-12-13  9:46 ` [PATCH v4 0/8] mtd: spi-nor: parse SFDP tables to setup (Q)SPI memories Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-12-20 16:42   ` Cyrille Pitchen
2016-12-20 19:51     ` Odp.: " Krzeminski, Marcin (Nokia - PL/Wroclaw)

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=AM4PR0701MB21309FCD4A3EBCC20B403D3BFE900@AM4PR0701MB2130.eurprd07.prod.outlook.com \
    --to=marcin.krzeminski@nokia.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=richard@nod.at \
    /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).