public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/12] cmd_sf: Add support for read and write instructions
@ 2012-12-31 11:13 Jagannadha Sutradharudu Teki
  2012-12-31 11:13 ` [U-Boot] [PATCH 01/12] cmd_sf: Add wr_inst argument to 'sf write' command Jagannadha Sutradharudu Teki
                   ` (10 more replies)
  0 siblings, 11 replies; 30+ messages in thread
From: Jagannadha Sutradharudu Teki @ 2012-12-31 11:13 UTC (permalink / raw)
  To: u-boot

All these patches are added a support for read and write instruction
for programming/reading SPI flash.

Read and Write instruction are implemented as a command line
arguments for 'sf write' , 'sf read' and 'sf update' commands.

Currently I have added below instructions those are commonly available
on all flash types.
pp - Page Program (existing one)
qpp - Quad-input Page Program
afr - Array Fast Read (existing one)
asr - Array Slow Read
dofr - Dual Output Fast Read
qofr - Quad Output Fast Read
diofr - Dual IO Fast Read
qiofr - Quad IO Fast Read

I have tested mostly of the instruction on real h/w.

This entire implementation will change the current sf framework little bit but
I thought these changes are worth to add.

Request for all your comment, so-that I can move forward.
Please let me know for any issue regarding this new implementation.

Thanks,
Jagan.

Jagannadha Sutradharudu Teki (12):
  cmd_sf: Add wr_inst argument to 'sf write' command
  cmd_sf: Add rd_inst argument to 'sf read' command
  cmd_sf: Add wr_inst argument to 'sf update' command
  cmd_sf: Add rd_inst argument to 'sf update' command
  cmd_sf: Define a functions for parsing read and write instructions
  cmd_sf: Add QPP(Quad-input Page Program) write instruction support
  cmd_sf: Add ASR(Array Slow Read) read instruction support
  cmd_sf: Add DOFR(Dual Output Fast Read) read instruction support
  cmd_sf: Add QOFR(Quad Output Fast Read) read instruction support
  cmd_sf: Add DIOFR(Dual IO Fast Read) read instruction support
  cmd_sf: Add QIOFR(Quad IO Fast Read) read instruction support
  sf: Pass rd_qeb_req variable as 0 for status and config reg reads

 common/cmd_sf.c                      |  198 +++++++++++++++++++++++++++++-----
 drivers/mtd/spi/spi_flash.c          |   40 +++++--
 drivers/mtd/spi/spi_flash_internal.h |   10 +-
 include/spi_flash.h                  |   22 ++--
 include/spi_flash_inst.h             |   39 +++++++
 5 files changed, 257 insertions(+), 52 deletions(-)
 create mode 100644 include/spi_flash_inst.h

^ permalink raw reply	[flat|nested] 30+ messages in thread
* [U-Boot] [PATCH 00/12] cmd_sf: Add support for read and write instructions
@ 2013-01-10 14:33 Langer Thomas
  2013-01-11  2:28 ` Simon Glass
  2013-01-16  7:47 ` Jagan Teki
  0 siblings, 2 replies; 30+ messages in thread
From: Langer Thomas @ 2013-01-10 14:33 UTC (permalink / raw)
  To: u-boot

Hello Jagan,

> All these patches are added a support for read and write instruction
> for programming/reading SPI flash.

I have written some weeks ago that I would really appreciate the support of 
dual and quad IO accesses for serial flashes. I just  think, this is not an acceptable
way to do this.

It is important to know for all, who do not know the details on the hardware
requirements of this feature, that these new transfers require a special SPI
controller! A standard SPI hardware, which is being used on most (maybe all) 
existing boards, cannot use the dual or quad IO features at all! 

And in addition, I still haven't seen any change, which indicates the required 
transfer mode to the SPI layer! How do you tell your SPI driver, which part
of the transfer should be done in dual or quad mode?

> 
> Read and Write instruction are implemented as a command line
> arguments for 'sf write' , 'sf read' and 'sf update' commands.
> 
> Currently I have added below instructions those are commonly available
> on all flash types.
> pp - Page Program (existing one)
> qpp - Quad-input Page Program
> afr - Array Fast Read (existing one)
> asr - Array Slow Read
> dofr - Dual Output Fast Read
> qofr - Quad Output Fast Read
> diofr - Dual IO Fast Read
> qiofr - Quad IO Fast Read
> 
> I have tested mostly of the instruction on real h/w.
> 
> This entire implementation will change the current sf framework little bit but
> I thought these changes are worth to add.

This means, all your patches adding new code, which has no benefit for existing 
boards, but changing the commands in an incompatible way, which forces all users
to adapt their definitions!
I don't think this will be accepted, as I would not.

The biggest question is: Do somebody really need the flexibility to select the
used instruction at this level?
If you have a platform, which contains an extended SPI controller and has also a 
supported flash, I expect it would be okay to always use the dual or quad instructions!
And this can be completely handled by the lower level functions, no need to expose
this to the command line!

I think, first of all, you should add some config options (e.g. CONFIG_SYS_SF_DUAL / 
CONFIG_SYS_SF_QUAD) to indicate, that the platform / board will support these.
Then, during "sf probe", there should be a detection, if the flash will support this
(depending on the type) and is enabled (checking the config bit for quad IO).
Depending on this, either specific functions for read/write could be assigned or
some other data, which indicate the usable instructions, can be set.

As it depends on the flash type and manufacturer, how the lower sequence must
look like (for the command/address/data phases, it might be 1-1-4, 1-4-4 or even 4-4-4),
this should be flexible to be assigned from the detection code.
For example, please check the differences between Spansion and Macronix!

> 
> Request for all your comment, so-that I can move forward.
> Please let me know for any issue regarding this new implementation.
> 
> Thanks,
> Jagan.
> 

Please think about my comments. I just want to avoid to bloat the code with something,
which is currently not usable for existing boards (as far as I know) and not flexible enough
to support different, manufacturer specific command sets.

Best Regards,
Thomas

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2013-03-08 23:55 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-31 11:13 [U-Boot] [PATCH 00/12] cmd_sf: Add support for read and write instructions Jagannadha Sutradharudu Teki
2012-12-31 11:13 ` [U-Boot] [PATCH 01/12] cmd_sf: Add wr_inst argument to 'sf write' command Jagannadha Sutradharudu Teki
2013-01-11  2:11   ` Simon Glass
     [not found]     ` <CAD6G_RSQXL3RsSuK=4QkRGRNfzuKvU-s7JPrsuB+o5O7GRxJuA@mail.gmail.com>
2013-02-14 14:35       ` Simon Glass
2012-12-31 11:13 ` [U-Boot] [PATCH 02/12] cmd_sf: Add rd_inst argument to 'sf read' command Jagannadha Sutradharudu Teki
2012-12-31 11:13 ` [U-Boot] [PATCH 03/12] cmd_sf: Add wr_inst argument to 'sf update' command Jagannadha Sutradharudu Teki
2012-12-31 11:13 ` [U-Boot] [PATCH 04/12] cmd_sf: Add rd_inst " Jagannadha Sutradharudu Teki
2012-12-31 11:13 ` [U-Boot] [PATCH 05/12] cmd_sf: Define a functions for parsing read and write instructions Jagannadha Sutradharudu Teki
2013-01-11  2:18   ` Simon Glass
2012-12-31 11:13 ` [U-Boot] [PATCH 06/12] cmd_sf: Add QPP(Quad-input Page Program) write instruction support Jagannadha Sutradharudu Teki
2012-12-31 11:13 ` [U-Boot] [PATCH 07/12] cmd_sf: Add ASR(Array Slow Read) read " Jagannadha Sutradharudu Teki
2012-12-31 11:13 ` [U-Boot] [PATCH 08/12] cmd_sf: Add DOFR(Dual Output Fast " Jagannadha Sutradharudu Teki
2012-12-31 11:13 ` [U-Boot] [PATCH 09/12] cmd_sf: Add QOFR(Quad " Jagannadha Sutradharudu Teki
2013-01-11  2:16 ` [U-Boot] [PATCH 00/12] cmd_sf: Add support for read and write instructions Simon Glass
2013-01-11  2:16 ` Simon Glass
2013-03-02  8:29   ` Jagan Teki
2013-03-04 21:02     ` Jagan Teki
2013-03-04 21:08     ` Tom Rini
2013-03-05 17:00       ` Jagan Teki
2013-03-05 17:08         ` Tom Rini
2013-03-05 17:21           ` Jagan Teki
2013-03-05 17:45             ` Tom Rini
2013-03-05 18:34               ` Jagan Teki
2013-03-05 19:59                 ` Tom Rini
2013-03-08 12:22                   ` Michal Simek
2013-03-08 23:55     ` Simon Glass
  -- strict thread matches above, loose matches on Subject: below --
2013-01-10 14:33 Langer Thomas
2013-01-11  2:28 ` Simon Glass
2013-01-16  7:47 ` Jagan Teki
2013-01-16 19:51   ` Langer Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox