From: Miquel Raynal <miquel.raynal@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 03/16] spi: Add non DM version of SPI_MEM
Date: Thu, 13 Dec 2018 10:41:28 +0100 [thread overview]
Message-ID: <20181213104128.2a4e0414@xps13> (raw)
In-Reply-To: <e17c26a4-a49d-df3b-050e-579524cc91d9@ti.com>
Hi Vignesh,
Vignesh R <vigneshr@ti.com> wrote on Thu, 13 Dec 2018 15:08:32 +0530:
> On 13/12/18 2:55 AM, Boris Brezillon wrote:
> > On Wed, 12 Dec 2018 22:07:44 +0100
> > Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> >> On Wed 12 Dec, 2018, 10:02 PM Boris Brezillon <boris.brezillon@bootlin.com
> >> wrote:
> >>
> >>> On Thu, 13 Dec 2018 02:15:16 +0530
> >>> Jagan Teki <jagan@amarulasolutions.com> wrote:
> >>>
> >>>> On Thu, Dec 13, 2018 at 2:10 AM Boris Brezillon
> >>>> <boris.brezillon@bootlin.com> wrote:
> >>>>>
> >>>>> Hi Jagan,
> >>>>>
> >>>>> On Thu, 13 Dec 2018 01:55:08 +0530
> >>>>> Jagan Teki <jagan@amarulasolutions.com> wrote:
> >>>>>
> >>>>>> On Wed, Dec 12, 2018 at 11:08 PM Vignesh R <vigneshr@ti.com>
> >>> wrote:
> >>>>>>>
> >>>>>>> Add non DM version of SPI_MEM to support easy migration to new SPI
> >>> NOR
> >>>>>>> framework. This can be removed once DM_SPI conversion is
> >>> complete.
> >>>>>>
> >>>>>> Our intention to use new driver to follow dm, why we need to support
> >>>>>> non-dm? any usecases?
> >>>>>
> >>>>> Looks like we're having the same discussion over and over. Vignesh is
> >>>>> dropping spi_flash.c which AFAICT was not depending on DM_SPI, so, if
> >>>>> we want to keep everyone happy while getting rid of some legacy code,
> >>>>> that's the only solution. DM conversion is a nice goal, but it's kind
> >>>>> of orthogonal to what Vignesh is working on. If DM_SPI conversion
> >>>>> happens before the spi-nor stuff is merged (which I doubt) then this
> >>>>> patch can simply be dropped.
> >>>>
> >>>> spi_flash.c is a core code not a specific driver it belongs. spi-mem
> >>>> is new feature driver how come new driver will support legacy non-dm
> >>>> do we have legacy use for that(ie what I'm asking about usecase)
> >>>
> >>> I recommend that you read the spi-mem code carefully. spi-mem is not
> >>> driver specific, it's a thin layer on top of spi and driver *can* (but
> >>> are not forced to) provide optimized methods to execute spi-mem
> >>> operations. When that's not the case, the implementation falls back to
> >>> regular spi transfers. AFAIK, both DM and non-DM drivers support
> >>> regular spi transfers, right? So why should we depend on DM_SPI? And
> >>> more importantly, if we do that, that means we can't get rid of
> >>> spi_flash.c since some users might still have non-DM SPI drivers, which
> >>> in turn means we keep more legacy code for no good reasons.
> >>>
> >>
> >> I understand spi-mem is core file, but new code too.
> >
> > Sorry, I don't get it.
> >
> >>
> >>
> >>> You want non-DM SPI controller drivers to go away, then remove them,
> >>> instead of blocking other changes using this excuse.
> >>>
> >>
> >> Please understand uboot development flow, legacy driver can be removed if
> >> possible once migration expire and NEW drivers or code must be dm driven.
> >
> > Sorry, but I think you're the one misunderstanding what we are trying
> > to do here. Vignesh changes have simply no impact on the DM SPI
> > conversion you're aiming at. All Vignesh does is provide a dummy
> > wrapper for non-DM drivers, which would probably have been implemented
> > by Miquel if you had not been so insistent on your precious DM_SPI
> > conversion. That was not really a problem for spi-nand, as we were
> > adding support for a new feature. This is not the case here. SPI NORs
> > are already partially supported by the u-boot spi flash layer, and we
> > need to keep things in a working state for those that were using it and
> > didn't have their SPI controller drivers converted to the DM. This
> > leaves us 2 options:
> >
> > 1/ keep the sf_flash code as is and add a new spi-nor code base
> > 2/ replace spi_flash code by the spi-nor layer imported from Linux
> >
> > Vignesh chose option #2 which has the benefit of avoiding code
> > duplication. Given the discussion we're having right now, I'm wondering
> > if it wouldn't be easier to go for option #1 in order to avoid those
> > endless discussions...
> >
>
> Boris, thanks for chiming in! This is exactly what I had in mind.
>
> To add, I did start with #1 by simply adding support for 4 byte
> addressing. But, then released I need spi-mem to communicate this
> protocol info to SPI drivers, then found Quad Enable detection logic to
> be incomplete and so on.. Finally released I would end up with code
> exactly similar to Linux SPI-NOR(with addition of SFDP logic). Therefore
> switched to #2 ;)
>
>
I also share (strongly) the same point of view: #2 is the best way
IMHO.
Thanks,
Miquèl
next prev parent reply other threads:[~2018-12-13 9:41 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-12 17:32 [U-Boot] [PATCH 00/16] SF: Migrate to Linux SPI NOR framework Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 01/16] spi: spi-mem: Allow use of spi_mem_exec_op for all SPI modes Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 02/16] spi-mem: Claim SPI bus before spi mem access Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 03/16] spi: Add non DM version of SPI_MEM Vignesh R
2018-12-12 20:25 ` Jagan Teki
2018-12-12 20:40 ` Boris Brezillon
2018-12-12 20:45 ` Jagan Teki
2018-12-12 21:02 ` Boris Brezillon
2018-12-12 21:07 ` Jagan Teki
2018-12-12 21:25 ` Boris Brezillon
2018-12-12 23:10 ` Jagan Teki
2018-12-12 23:20 ` Tom Rini
2018-12-12 23:55 ` Boris Brezillon
2018-12-14 9:59 ` Jagan Teki
2019-01-04 21:28 ` Simon Glass
2018-12-13 9:38 ` Vignesh R
2018-12-13 9:41 ` Miquel Raynal [this message]
2018-12-13 8:50 ` Vignesh R
2018-12-14 10:02 ` Jagan Teki
2018-12-14 10:57 ` Vignesh R
2018-12-14 13:59 ` Jagan Teki
2019-01-28 6:57 ` Jagan Teki
2019-01-28 9:45 ` Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 04/16] sh: bitops: add hweight*() macros Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 05/16] mtd: spi: Port SPI NOR framework from Linux Vignesh R
2018-12-12 20:31 ` Jagan Teki
2018-12-12 22:56 ` Tom Rini
2018-12-12 23:21 ` Jagan Teki
2018-12-13 3:01 ` Tom Rini
2018-12-13 7:47 ` Stefan Roese
2018-12-13 11:44 ` Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 06/16] mtd: spi: Switch to new SPI NOR framework Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 07/16] mtd: spi: Remove unused files Vignesh R
2018-12-12 20:38 ` Jagan Teki
2018-12-13 9:07 ` Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 08/16] mtd: spi: Add lightweight SPI flash stack for SPL Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 09/16] sf_mtd: Simply mtd operations Vignesh R
2018-12-12 20:31 ` Boris Brezillon
2018-12-13 2:11 ` Daniel Schwierzeck
2018-12-13 7:46 ` Stefan Roese
2018-12-13 8:24 ` Vignesh R
2018-12-13 9:40 ` Stefan Roese
2018-12-12 17:32 ` [U-Boot] [PATCH 10/16] configs: Get rid of SPI_FLASH_BAR Vignesh R
2018-12-12 20:41 ` Jagan Teki
2018-12-12 20:51 ` Boris Brezillon
2018-12-12 20:54 ` Simon Goldschmidt
2018-12-13 10:41 ` Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 11/16] configs: Remove SF_DUAL_FLASH Vignesh R
2018-12-12 20:50 ` Jagan Teki
2018-12-12 17:32 ` [U-Boot] [PATCH 12/16] axm_defconfig: Enable simple malloc in SPL Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 13/16] taurus_defconfig: " Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 14/16] da850_am18xxevm: Enable tiny printf Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 15/16] turris_omnia_defconfig: " Vignesh R
2018-12-12 17:32 ` [U-Boot] [PATCH 16/16] MAINTAINERS: Add an entry for SPI NOR Vignesh R
2018-12-12 21:01 ` Jagan Teki
2018-12-14 8:03 ` Vignesh R
2018-12-14 10:13 ` [U-Boot] [PATCH 00/16] SF: Migrate to Linux SPI NOR framework Jagan Teki
2018-12-14 15:54 ` Vignesh R
2018-12-14 16:14 ` Simon Goldschmidt
2018-12-14 16:27 ` Vignesh R
2018-12-14 16:38 ` Simon Goldschmidt
2018-12-14 16:42 ` Vignesh R
2018-12-15 13:59 ` Jagan Teki
2018-12-15 14:42 ` Jagan Teki
2018-12-15 6:31 ` Stefan Roese
2018-12-15 13:54 ` Jagan Teki
2018-12-15 15:43 ` Vignesh R
2018-12-18 12:32 ` Jagan Teki
2018-12-18 17:19 ` Vignesh R
2018-12-21 8:55 ` Ashish Kumar
2018-12-15 15:43 ` Vignesh R
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=20181213104128.2a4e0414@xps13 \
--to=miquel.raynal@bootlin.com \
--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