From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Pull request: u-boot-spi/master
Date: Sat, 18 Jan 2014 21:26:30 +0100 [thread overview]
Message-ID: <201401182126.30489.marex@denx.de> (raw)
In-Reply-To: <CAD6G_RSt52tEent+U1EUKmYMNEVRyYPCOSbHwchiJ+XcTvgEqQ@mail.gmail.com>
On Thursday, January 16, 2014 at 08:44:55 PM, Jagan Teki wrote:
> Hi Marek,
[...]
> >>
> >> Let me explain the journey with (spi_flash)sf since last 8 months. [1]
> >> - We have a individual class of vendor drivers and removed all vendor
> >> specific stuff and added a common probe.
> >> - Added Bank addr reg stuff
> >> - Tunned sf almost seems like mtd/nand style where sf.c, sf_probe.c,
> >> sf_params.c and sf_ops.c
> >> - Added memory_mapped and quad commands supports
> >> - Done many of cleanups
> >> - maintained doc/SPI which we're trying to update.
> >>
> >> Keeping these enhancements on current sf we are in a good shape than
> >> before.
> >
> > This patchset does not do this cleanup you describe here. This patchset
> > adds (dead) code to support SPI-NOR controllers via regular SPI API .
>
> I don't know what you mean by dead code here
I mean all those new flags added to struct spi_slave {} for example. They have
no user in mainline U-Boot. CONFIG_SF_DUAL_FLASH is not used by anyone in u-
boot/master either.
> I agreed that the current sf code is
> touching spi api because we followed the same approach since so-far.
What does that mean ? The SF code must not ever touch the SPI API, the SPI
already provides everything the SPI flash can hope for (that is, means to
send/receive data on/from the bus AND position of the SPI devices (bus # and
chipselect # )). The approach to extend SPI API for one particular type of SPI
device is wrong.
> we're using this since so far and honestly if you compare this with newly
> added SPI-NOR framework in Linux - ends defiantly have a side effects.
What kind of side-effects ? The SPI API is different from SPI-NOR controller API
and we _must_ keep that in mind. The later is in no set relationship to the
former ; they're neither subset nor a superset, they barely even intersect.
> The reason why I am not agree with this not a dead-code is like even
> if we have a new
> SPI-NOR framework these should be part of spi-nor code i guess.
The actual device-model idea here is as such:
I) The 'sf' command talks to the SF layer and informs it about:
1) operation to be performed (read/write/erase)
2) device credentials (bus number and chipselect number)
II) The SF layer figures out the correct struct spi_slave {} based on the
information passed from the SF command above.
III) The SF layer talks using SPI API to make the SPI controller send/receive
data to/from device identified by struct spi_slave {}.
To incorporate the new SPI-NOR controllers, the SF layer would need to be
adjusted.
Step II) would need to be changed such, that an appropriate conversion to either
struct spi_slave {} or struct spi_nor_device {} would happen depending on which
kind of connection and API would the SPI flash device use -- whether it is
generic SPI or specific SPI-NOR.
Step III) would then need to be adjusted such that depending on the controller
type retrieved in step II), one of the APIs (generic SPI or SPI-NOR) would be
used.
The adjustment really isn't hard at all ;-)
> I totally agree that if we follow the new SPI-NOR will answer all
> these side effects.
> And also SPI-NOR is not yet ML'ed I am currently understanding this.
Ok, so that's why it's a lot of dead code ;-)
> My plan is to do this new framework addition for next release and wrap this
> code once all gets set.
I would suggest we start heading for the SPI NOR split. Seriously, hit the
brakes here, otherwise we're going for an unpleasant ride through a sh**storm
;-)
> >> > It seems this patchset aims to accomodate an SPI-NOR controllers
> >> > within the SPI API. The SPI-NOR controllers are a completely separate
> >> > class of hardware though, so I disagree with the attempt to integrate
> >> > them into the SPI framework. I cannot use most of the SPI-NOR
> >> > controllers to drive regular SPI bus (there are exceptions), but they
> >> > are now presented as regular SPI controllers indiscriminately.
> >> >
> >> > Instead of going down this path, there should be a completely separate
> >> > class of drivers for the SPI-NOR controllers, same as in Linux [1].
> >> > That way, there would still be an SF command talking to SF core, but
> >> > the SF core would be delegating the calls to either a layer talking
> >> > to a SPI flash via regular SPI interface or a layer talking the
> >> > SPI-NOR controller.
> >> >
> >> > I also see some flaws in these patches. For example the struct
> >> > spi_slave {} now contains all kinds of new entries used only by the
> >> > SPI flash driver. The slave can now export for example SPI_OPM_RX_QOF
> >> > and SPI_OPM_RX_QIOF (see include/spi.h) flags, which -- if you
> >> > inspect drivers/mtd/spi/sf_probe.c and include/spi_flash.h -- should
> >> > match up with enum spi_read_cmds . So we now have two sets of flags,
> >> > which needs to be kept in sync, which is wrong. Besides, these flags
> >> > define the capabilities of the SPI-NOR host controller, so why are
> >> > they even in struct spi_slave {} ?
> >>
> >> The spi_slave grown with flash stuff with spi driver terminologies,
> >> and the reason
> >> for taking one extra flag for reads in params is like we have couple
> >> of commands
> >> for 1, 2 and 4-lines I have given a spi driver has a provision to
> >> verify these one by one.
> >> The reason for going this implementation for improving sf performance.
> >
> > Sorry, I don't understand what you're telling me here.
> >
> > btw. the struct spi_slave {} has grown quite significantly , it contains:
> >
> > u8 op_mode_rx
> > u8 op_mode_tx
> >
> > -> SPI-NOR controllers' bus caps (like, can it do 4-bit transfer etc.),
> > but
> >
> > this is SPI-NOR _controller_ specific, what is this stuff doing in struct
> > spi_slave {} ? btw. /wrt placement of these new entries, you must read
> > [1], since you just generated 2-byte slop.
> >
> > void *memory_map
> >
> > -> this is clearly SPI-NOR controller specific stuff, which cannot be
> > used by
> >
> > any other generic SPI peripheral.
>
> This get added before - Yes will address all one by one soon.
>
> > u8 options
> >
> > -> Quite unclear what this is for.
> >
> > u8 flags
> >
> > -> DTTO.
> >
> > [1] http://www.catb.org/esr/structure-packing/
> >
> >> > I also observe a big lack of documentation for all those flags, so
> >> > it's really hard to make heads or tails of how it's supposed to work.
> >>
> >> Some how disagree this, because we have started doc/SPI [2] these days
> >> which don't have
> >> before and I'm stressing patch contributors to add as many as doc and
> >> test-cases logs.
> >>
> >> and Yes- for this quad I'm planning to add test-case logs once our
> >> zynq qspi is ML.
> >
> > I don't see any API documentation there, sorry. Can you point me to such
> > an API documentation or design document or something please ?
> >
> >> > Also, I don't see any of these new flags used yet, so we're still at a
> >> > good point to avoid going down the wrong path. I would love to see
> >> > this patchset postponed for next if possible, since my feeling of
> >> > this is it needs severe redesign.
> >> >
> >> > [1] http://www.spinics.net/lists/arm-kernel/msg291891.html
> >>
> >> And finally - I do understand your comments and agreed that we're
> >> tunning spi framework
> >> towards spi_flash, but the current implementation looks like that and
> >> there is no alternatives
> >> as of now.
> >
> > Oh, there is an alternative (see [1] above, the spi-nor approach) and we
> > should take the right direction instead of pushing in the wrong one.
> >
> >> It was almost 9 months to spent quad changes to fit into on current
> >> code, for this
> >> I tunned spi_flash as sf to more convient to add extra add-ons, i
> >> guess many of the customers
> >> wants this quad since last year.
> >
> > OK, but this doesn't justify pushing broken code which will bite us in
> > the future.
> >
> >> I agree that if we have a better framework which will divide spi and
> >> spi_flash separately
> >> like what you said with Linux SPI-NOR and it's good to have that. and
> >> also you're comparing
> >> the current sf stuff with this new approach, Yes - i agree that new
> >> approach will defiantly have a
> >> better view than the current.
> >>
> >> But, honestly as of now we're planning to move like this. and I am
> >> adding this new framework approach to my TODO list - Will post one more
> >> thread for this implementation and planning.
> >
> > OK, I would still prefer to get this release out _without_ the strange
> > additions to struct spi_slave {}. Is it possible to strip away all those
> > unused quad-spi additions for this release?
>
> as your point -
> spi_slave {} not only have quad additions and also have memory_map and etc
> stuff and will strip all these one by one with new SPI-NOR framework.
OK, but what about the mess in this release ?
> Summary: Will try to add SPI-NOR framework parallel and will strip the
> spi_flash stuff
> one by one from SPI API
Thanks. Please keep me in CC so I can keep nagging :)
next prev parent reply other threads:[~2014-01-18 20:26 UTC|newest]
Thread overview: 217+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-13 18:35 [U-Boot] Pull request: u-boot-spi/master Jagannadha Sutradharudu Teki
2014-01-13 19:42 ` Tom Rini
2014-01-15 19:38 ` Marek Vasut
2014-01-16 6:06 ` Jagan Teki
2014-01-16 19:04 ` Marek Vasut
2014-01-16 19:44 ` Jagan Teki
2014-01-18 20:26 ` Marek Vasut [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-10-25 8:38 Jagan Teki
2019-10-25 17:48 ` Tom Rini
2019-10-27 11:50 ` Jagan Teki
2019-10-28 0:46 ` Tom Rini
2019-10-31 7:53 ` Schrempf Frieder
2019-10-31 7:57 ` Jagan Teki
2019-10-31 8:01 ` Schrempf Frieder
2019-10-31 8:09 ` Jagan Teki
2019-09-16 2:45 Jagan Teki
2019-09-17 23:55 ` Tom Rini
2019-07-18 11:48 Jagan Teki
2019-06-17 7:45 Jagan Teki
2019-06-18 17:00 ` Tom Rini
2019-05-20 17:18 Jagan Teki
2019-05-21 11:12 ` Tom Rini
2019-05-24 19:34 ` Jagan Teki
2019-06-07 7:51 ` Mario Six
2019-06-07 8:56 ` Heiko Schocher
2019-06-07 9:10 ` Mario Six
2019-06-07 9:15 ` Heiko Schocher
2019-06-07 9:33 ` Mario Six
2019-05-05 16:42 Jagan Teki
2019-05-07 2:43 ` Tom Rini
2019-04-17 12:21 Jagan Teki
2019-04-17 12:45 ` Vignesh Raghavendra
2019-04-18 16:20 ` Tom Rini
2019-04-12 13:43 Jagan Teki
2019-04-14 12:57 ` Tom Rini
2019-03-06 17:02 Jagan Teki
2019-03-07 14:14 ` Tom Rini
2019-02-07 19:47 Jagan Teki
2019-02-08 3:13 ` Tom Rini
2019-01-02 19:19 Jagan Teki
2019-01-03 19:54 ` Jagan Teki
2019-01-03 20:34 ` Tom Rini
2018-12-23 21:19 Jagan Teki
2018-12-23 21:56 ` Jagan Teki
2018-12-24 1:01 ` Tom Rini
2018-12-05 19:23 Jagan Teki
2018-12-06 1:32 ` Tom Rini
2018-10-12 6:15 Jagan Teki
2018-10-15 12:41 ` Tom Rini
2018-10-04 13:16 Jagan Teki
2018-10-05 14:16 ` Tom Rini
2018-10-02 16:56 Jagan Teki
2018-10-03 0:54 ` Tom Rini
2018-10-03 6:42 ` Miquel Raynal
2018-08-04 16:13 Jagan Teki
2018-08-05 11:59 ` Tom Rini
2018-07-16 13:01 Jagan Teki
2018-07-17 1:11 ` Tom Rini
2018-07-02 17:35 Jagan Teki
2018-07-03 3:24 ` Tom Rini
2018-06-25 18:49 Jagan Teki
2018-06-25 21:35 ` Tom Rini
2018-06-27 6:47 ` Jagan Teki
2018-06-27 15:20 ` Tom Rini
2018-06-27 15:34 ` Jagan Teki
2018-06-28 18:17 ` Tom Rini
2018-06-05 18:28 Jagan Teki
2018-06-06 15:09 ` Tom Rini
2018-05-30 18:08 Jagan Teki
2018-05-31 2:10 ` Tom Rini
2018-04-25 5:29 Jagan Teki
2018-04-26 11:21 ` Tom Rini
2018-03-24 8:25 Jagan Teki
2018-03-26 19:09 ` Tom Rini
2018-03-14 14:02 Jagan Teki
2018-03-14 17:27 ` Tom Rini
2018-03-14 17:39 ` Jagan Teki
2018-03-14 18:38 ` Adam Ford
2018-03-14 18:47 ` Jagan Teki
2018-03-15 14:10 ` Jagan Teki
2018-01-22 5:50 Jagan Teki
2018-01-22 12:58 ` Tom Rini
2018-01-22 14:56 ` Daniel Schwierzeck
2018-01-22 14:59 ` Tom Rini
2018-01-22 15:28 ` Daniel Schwierzeck
2018-01-22 15:32 ` Tom Rini
2018-01-22 15:47 ` Daniel Schwierzeck
2018-01-22 16:49 ` Daniel Schwierzeck
2018-01-22 17:14 ` Tom Rini
2018-01-22 20:26 ` Daniel Schwierzeck
2018-01-22 20:55 ` Álvaro Fernández Rojas
2018-01-22 21:05 ` Tom Rini
2018-01-23 10:28 ` Daniel Schwierzeck
2018-01-24 6:57 ` Jagan Teki
2018-01-25 16:00 ` Álvaro Fernández Rojas
2017-12-19 12:24 Jagan Teki
2017-12-19 20:44 ` Tom Rini
2017-10-17 13:50 Jagan Teki
2017-10-18 19:47 ` Tom Rini
2017-09-25 7:51 Jagan Teki
2017-09-25 8:41 ` Łukasz Majewski
2017-09-25 8:57 ` Jagan Teki
2017-09-26 12:17 ` Tom Rini
2017-08-16 13:00 Jagan Teki
2017-08-17 1:17 ` Tom Rini
2017-05-03 12:13 Jagan Teki
2017-05-07 1:27 ` Tom Rini
2017-01-15 17:32 Jagan Teki
2017-01-16 4:02 ` Tom Rini
2017-01-04 16:33 Jagan Teki
2017-01-05 13:28 ` Tom Rini
2016-12-23 23:39 Jagan Teki
2016-12-23 23:43 ` Tom Rini
2016-12-14 15:36 Jagan Teki
2016-12-14 23:35 ` Tom Rini
2016-11-18 11:16 Jagan Teki
2016-11-19 0:57 ` Tom Rini
2016-11-20 11:59 ` Jagan Teki
2016-11-22 17:21 ` Tom Rini
2016-11-12 12:13 Jagan Teki
2016-11-13 20:55 ` Tom Rini
2016-09-22 15:02 Jagan Teki
2016-09-23 1:57 ` Tom Rini
2016-08-09 12:03 Jagan Teki
2016-08-09 13:27 ` Tom Rini
2016-07-29 18:48 Jagan Teki
2016-07-30 0:20 ` Tom Rini
2016-07-09 15:30 Jagan Teki
2016-07-09 16:06 ` Tom Rini
2016-07-12 17:59 ` Tom Rini
2016-03-15 7:11 Jagan Teki
2016-03-15 12:01 ` Tom Rini
2016-03-15 15:04 ` Tom Rini
2016-03-15 17:51 ` Jagan Teki
2016-03-12 14:44 Jagan Teki
2016-03-13 13:45 ` Tom Rini
2016-02-23 10:49 Jagan Teki
2016-02-23 20:35 ` Tom Rini
2016-02-25 17:13 ` Mugunthan V N
2016-03-01 5:46 ` Mugunthan V N
2016-01-13 14:46 Jagan Teki
2016-01-13 21:54 ` Tom Rini
2016-01-07 17:02 Jagan Teki
2016-01-07 17:42 ` Tom Rini
2015-12-11 16:53 Jagan Teki
2015-12-12 1:13 ` Tom Rini
2015-11-19 17:46 Jagan Teki
2015-11-19 22:07 ` Tom Rini
2015-10-28 18:22 Jagan Teki
2015-10-28 18:25 ` Otavio Salvador
2015-10-28 18:31 ` Jagan Teki
2015-10-29 1:42 ` Tom Rini
2015-10-25 8:04 Jagan Teki
2015-08-18 6:38 Jagan Teki
2015-08-18 14:47 ` Tom Rini
2015-07-04 8:41 Jagan Teki
2015-07-04 11:42 ` Tom Rini
2015-07-07 15:26 ` Jagan Teki
2015-07-14 22:12 ` Tom Rini
2015-07-01 17:33 Jagan Teki
2015-07-01 21:56 ` Tom Rini
2015-06-29 19:24 Jagan Teki
2015-06-29 21:51 ` Tom Rini
2015-06-23 15:17 Jagan Teki
2015-06-24 23:31 ` Tom Rini
2015-06-25 3:58 ` Heiko Schocher denx
2015-06-25 5:31 ` Jagan Teki
2015-06-25 11:36 ` Tom Rini
2015-06-25 13:26 ` Jagan Teki
2015-04-28 8:17 Jagannadha Sutradharudu Teki
2015-04-28 14:51 ` Tom Rini
2015-03-31 7:14 Jagannadha Sutradharudu Teki
2015-04-07 17:58 ` Tom Rini
2015-01-08 18:40 Jagannadha Sutradharudu Teki
2015-01-09 13:34 ` Tom Rini
2015-01-01 20:45 Jagannadha Sutradharudu Teki
2015-01-05 15:10 ` Tom Rini
2014-12-29 17:07 Jagannadha Sutradharudu Teki
2015-01-05 15:10 ` Tom Rini
2014-10-27 18:43 Jagannadha Sutradharudu Teki
2014-11-04 2:32 ` Tom Rini
2014-09-24 12:45 Jagannadha Sutradharudu Teki
2014-09-25 14:43 ` Tom Rini
2014-08-05 18:52 Jagannadha Sutradharudu Teki
2014-08-06 14:37 ` Tom Rini
2014-06-08 17:57 Jagannadha Sutradharudu Teki
2014-06-11 19:09 ` Tom Rini
2014-03-17 16:42 Jagannadha Sutradharudu Teki
2014-03-17 21:19 ` Tom Rini
2014-02-18 17:24 Jagannadha Sutradharudu Teki
2014-02-21 14:35 ` Tom Rini
2014-01-27 17:26 Jagannadha Sutradharudu Teki
2014-01-27 19:21 ` Marek Vasut
2014-01-22 16:26 Jagannadha Sutradharudu Teki
2014-01-24 20:10 ` Marek Vasut
2014-01-20 17:53 Jagannadha Sutradharudu Teki
2014-01-20 19:37 ` Marek Vasut
2014-01-20 19:47 ` Jagan Teki
2013-12-19 18:22 Jagannadha Sutradharudu Teki
2013-12-19 22:15 ` Tom Rini
2013-10-15 18:58 Jagannadha Sutradharudu Teki
2013-10-15 21:25 ` Tom Rini
2013-10-07 14:22 Jagannadha Sutradharudu Teki
2013-10-08 19:32 ` Tom Rini
2013-09-15 17:19 Jagannadha Sutradharudu Teki
2013-09-17 0:09 ` Tom Rini
2013-08-10 12:26 Jagannadha Sutradharudu Teki
2013-08-12 16:00 ` Tom Rini
2013-06-23 17:59 Jagannadha Sutradharudu Teki
2013-06-25 14:56 ` Tom Rini
2013-06-13 18:50 Jagannadha Sutradharudu Teki
2013-06-14 14:36 ` Tom Rini
2013-06-14 14:45 ` Jagan Teki
2013-06-14 14:51 ` Tom Rini
2013-06-14 14:53 ` Tom Rini
2013-06-14 15:00 ` Jagan Teki
2013-06-14 15:11 ` Tom Rini
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=201401182126.30489.marex@denx.de \
--to=marex@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.