public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v10 00/27] dm: Generic MTD Subsystem, with SPI-NOR interface
Date: Wed, 3 Jan 2018 11:59:42 +0100	[thread overview]
Message-ID: <20180103115942.2c6c1ec4@jawa> (raw)
In-Reply-To: <CAD6G_RR2mO_bd2sQ4k+ANj+V1_HnXPv_6iduVY1Y=TtKxN3sMw@mail.gmail.com>

Hi Jagan,

> On Wed, Jan 3, 2018 at 2:18 PM, Vignesh R <vigneshr@ti.com> wrote:
> >
> >
> > On Tuesday 02 January 2018 03:39 PM, Jagan Teki wrote:  
> >> On Thu, Dec 28, 2017 at 8:14 PM, Lukasz Majewski <lukma@denx.de>
> >> wrote:  
> >>> Hi Jagan,
> >>>  
> >>>> Compared to previous series’s [1], [2], [3] and [4] this patch
> >>>> set redefined most of the implementation suitable to fit into
> >>>> existing driver-model.
> >>>>
> >>>> MTD is generic subsystem for underlying flash devices like nand,
> >>>> parallel nor, spinor, dataflash etc. So to drive this theory with
> >>>> driver model(with an example of block layer) mtd is common device
> >>>> interaction for most of  memory technology flashes like nand,
> >>>> parallel nor, spinor, dataflash etc, these are treated as
> >>>> interface types wrt u-boot driver model.
> >>>>
> >>>> Once the respective interface driver bind happen, the uclass
> >>>> driver will pass an 'interface type' to mtd layer to create
> >>>> device for it, for example once spinor ULASS_SPI_NOR driver bind
> >>>> happen, the uclass driver of spinor will pass MTD_IF_TYPE_SPI_NOR
> >>>> interface type to create mtd device for spinor devices.
> >>>>
> >>>> SPI-NOR:
> >>>> =======
> >>>> Some of the SPI device drivers at drivers/spi not a real
> >>>> spi controllers, Unlike normal/generic SPI controllers they
> >>>> operates only with SPI-NOR flash devices. these were technically
> >>>> termed as SPI-NOR controllers, Ex: drivers/spi/fsl_qspi.c
> >>>>
> >>>> The problem with these were resides at drivers/spi is entire
> >>>> SPI layer becomes SPI-NOR flash oriented which is absolutely
> >>>> a wrong indication where SPI layer getting effected more with
> >>>> flash operations - So this SPI-NOR core will resolve this issue
> >>>> by separating all SPI-NOR flash operations from spi layer and
> >>>> creats a generic layer called SPI-NOR core which can be used to
> >>>> interact SPI-NOR to SPI driver interface layer and the SPI-NOR
> >>>> controller driver.  
> >>>
> >>> I must admit that I'm a bit confused....
> >>>
> >>> If you don't mind I would like to ask for clarification of a few
> >>> things:
> >>>
> >>>
> >>>  
> >>>>
> >>>> =======================================
> >>>>              cmd/spinor.c  
> >>>
> >>>                 ^^^^^ - this would be a new set of commands to
> >>> comply with DM?  
> >>
> >> with this series yes, and we're working on supporting the same
> >> with non-dm. 
> >>>
> >>>                 What about "sf" command which we use now to get
> >>> access to SPI-NOR memory? A lot of boards already use "sf"
> >>>                 command... which may be tricky to replace.  
> >>
> >> end-goal will be replace sf with spinor command and removal of 'sf'
> >> will be done when the new spi-nor framework stable enough to handle
> >> all scenarios which are spi-flash supporting as of now.  
> >
> > I don't agree on adding new cmd and removing sf. It would be
> > impractical to change all boot cmds to replace sf with spinor cmd
> > all over U-Boot. Not to forget the envs already stored on non
> > volatile media need updation to work with new cmd.
> > If SPI NOR framework is to abstract all accesses to nor flash
> > devices in U-Boot, then why cannot it replace the logic
> > implementing cmd sf? All that is changing is that mtd/spi/* is
> > replaced by spi-nor.c + m25p80.c. sf probe  can be modified achieve
> > what spinor dev does sf read for spinor read and so on. Board
> > configs would just need to enable MTD related configs.  
> 
> I know how hard it is adding new command in u-boot, 

Yes, it is. Especially command which duplicates already present
functionality.

> you can understood
> the reason for adding new command if you follow the previous versions
> on this series and I hope you does. 

I must admit that this is the first version, which I reviewed.

The only feasible way would be to have new Kconfig option for this
framework, force spinor for new boards and ..... wait.

After some long time (how long do we struggle with DM
conversion/Kconfig?) we could think about removing "sf" command.

I do want to emphasis that I do agree with Vignesh - there are many
boards out there, which do use sf command, with even more dangerous
situation when company X only plan to update u-boot, but has envs in a
separate partition. Breaking "sf" equals to brick of on-field
devices....

IMHO - we shall have sf command as an alias to new "spinor" command
(even by calling run_command("spinor....");).

> we have been adding mtd, spi-nor
> changes to existing mtd/spi and sf.c since from first series and
> observed many issue with respective to framework design(where we move
> spi-nor controller drivers on to mtd side) along with driver model. In
> v9 we worked on designing MTD UCLASS where mtd command can be commonly
> interfaced to all underlying flash devices. and from continuous
> evaluation on driver model this series we designed MTD uclass can be a
> generic and make run-time creation of underlying flash devices with
> interface type, spi-nor is one of the interface. So to make the
> framework suitable to command interface the new command named as
> spinor. adding/supporting all these new design on top of mtd/spi or sf
> doesn’t smooth easy which is proved on previous version. technically
> sf termed as spi-flash comprise of spinor and spinand, spinand can be
> another interface type with spinand command and adding new features on
> legacy code doesn't make sense to me it will eventually breaking
> legacy dependencies.
> 
> Will all these new framework design, driver model, feasibility to sync
> Linux spi-nor.c we adding relevant command, and env.
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180103/bd12ca0b/attachment.sig>

  reply	other threads:[~2018-01-03 10:59 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28  6:12 [U-Boot] [PATCH v10 00/27] dm: Generic MTD Subsystem, with SPI-NOR interface Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 01/27] mtd: Add mtd core ops Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 02/27] mtd: add mtd device create operations Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 03/27] mtd: add SPI-NOR core support Jagan Teki
2017-12-29  9:25   ` Andy Yan
2018-01-02 10:18   ` Prabhakar Kushwaha
2018-01-02 10:31     ` Jagan Teki
2018-01-03  8:49   ` Vignesh R
2018-01-03  9:32     ` Jagan Teki
2018-01-03  9:56       ` Vignesh R
2018-01-03 10:07         ` Jagan Teki
2018-01-04  2:33   ` Andy Yan
2018-02-28  9:42   ` Prabhakar Kushwaha
2018-02-28 12:10     ` Boris Brezillon
2018-03-06  5:59       ` Prabhakar Kushwaha
2018-03-06  6:38     ` Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 04/27] mtd: spi-nor: sync/modify sst write operations Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 05/27] mtd: spi-nor: sync/modify lock operations Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 06/27] mtd: spi-nor: Kconfig: Add MTD_SPI_NOR entry Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 07/27] mtd: spi-nor: Kconfig: Add MTD_SPI_NOR_USE_4K_SECTORS Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 08/27] mtd: spi-nor: Kconfig: Add SPI_NOR_MISC entry Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 09/27] mtd: spi-nor: Kconfig: Add SPI_NOR_MACRONIX entry Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 10/27] mtd: spi-nor: Kconfig: Add SPI_NOR_SPANSION entry Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 11/27] mtd: spi-nor: Kconfig: Add SPI_NOR_STMICRO entry Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 12/27] mtd: spi-nor: Kconfig: Add SPI_NOR_SST entry Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 13/27] mtd: spi-nor: Kconfig: Add SPI_NOR_WINBOND entry Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 14/27] mtd-uclass: use platdata_auto_alloc Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 15/27] spi: Add spi_write_then_read Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 16/27] mtd: spi-nor: Add m25p80 driver Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 17/27] mtd: spi-nor: Kconfig: Add MTD_M25P80 entry Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 18/27] mtd: spi-nor: Add zynq qspinor driver Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 19/27] mtd: spi-nor: zynq_qspi: Kconfig: Add MTD_ZYNQ Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 20/27] mtd: spi-nor: Add 4-byte addresswidth support Jagan Teki
2017-12-28  8:06   ` Cyrille Pitchen
2017-12-28  8:08     ` Cyrille Pitchen
2017-12-28  6:12 ` [U-Boot] [PATCH v10 21/27] cmd: add spinor cmd support Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 22/27] cmd: spinor: sync/update protect command Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 23/27] board_r: initialize spi_nor Jagan Teki
2018-01-08  3:52   ` Simon Glass
2017-12-28  6:12 ` [U-Boot] [PATCH v10 24/27] env: add spi-nor environment Jagan Teki
2018-01-04  7:06   ` Prabhakar Kushwaha
2017-12-28  6:12 ` [U-Boot] [PATCH v10 25/27] arm: dts: zynq: Add zynq-qspinor node Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 26/27] dm: zynq: microzed: enable MTD/SPI-NOR framework Jagan Teki
2017-12-28  6:12 ` [U-Boot] [PATCH v10 27/27] test: dm: add tests for mtd devices Jagan Teki
2017-12-28 14:44 ` [U-Boot] [PATCH v10 00/27] dm: Generic MTD Subsystem, with SPI-NOR interface Lukasz Majewski
2018-01-02 10:09   ` Jagan Teki
2018-01-03  8:48     ` Vignesh R
2018-01-03  9:24       ` Jagan Teki
2018-01-03 10:59         ` Lukasz Majewski [this message]
2018-01-31  8:07           ` Andy Yan
2018-01-04 11:52         ` Vignesh R
2018-01-23  9:50     ` Siva Durga Prasad Paladugu
2018-01-23  9:59       ` Jagan Teki
2018-01-23 11:50         ` Siva Durga Prasad Paladugu
2018-01-23  9:00 ` Siva Durga Prasad Paladugu
  -- strict thread matches above, loose matches on Subject: below --
2018-02-28  9:32 Prabhakar Kushwaha

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=20180103115942.2c6c1ec4@jawa \
    --to=lukma@denx.de \
    --cc=u-boot@lists.denx.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