All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v6 0/4] spi, sf: add mtdparts feature to spi and sf commands
@ 2015-04-27  5:42 Heiko Schocher
  2015-04-27  5:42 ` [U-Boot] [PATCH v6 1/4] mtd, spi: add MTD layer driver Heiko Schocher
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Heiko Schocher @ 2015-04-27  5:42 UTC (permalink / raw)
  To: u-boot

This patchserie add the popssibility to define mtd partitions on
spi nor flash, and use this settings with the sf commands.

steps:

- add MTD layer driver for spi, original patch from:
http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=bb246819cdc90493dd7089eaa51b9e639765cced

  and addapted it to current mainline.

- move common functions to get offset and size from
  cmdline nand command to extract offset and size from
  a mtd partition to common place "drivers/mtd/mtd_uboot.c"
  maybe another place is better?

- add to the sf command the possibility to use offset and size from
  the settings in mtdparts

With this patchset, the sf command looks now:

=> sf
sf - SPI flash sub-system

Usage:
sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus
                                  and chip select
sf read addr offset|partition len       - read `len' bytes starting at
                                          `offset' to memory at `addr'
sf write addr offset|partition len      - write `len' bytes from memory
                                          at `addr' to flash at `offset'
sf erase offset|partition [+]len        - erase `len' bytes from `offset'
                                          `+len' round up `len' to block size
sf update addr offset|partition len     - erase and write `len' bytes from memory
                                          at `addr' to flash at `offset'
=>
for example "env" is defined in mtdparts:

=> sf read 13000000 env
device 0 offset 0xd0000, size 0x10000
SF: 65536 bytes @ 0xd0000 Read: OK
=>

There are the followings checkpatch warnings:

CHECK: Alignment should match open parenthesis
+               if (arg_off(argv[2], &idx, &addr, &maxsize, &maxsize,
+                   MTD_DEV_TYPE_NAND, nand_info[idx].size)) {

CHECK: Alignment should match open parenthesis
+                       if (arg_off(argv[3], &dev, &off, &size, &maxsize,
+                           MTD_DEV_TYPE_NAND, nand_info[dev].size))

CHECK: Alignment should match open parenthesis
+                       if (arg_off_size(argc - 3, argv + 3, &dev, &off, &size,
+                           &maxsize, MTD_DEV_TYPE_NAND,

total: 0 errors, 0 warnings, 3 checks, 361 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE USLEEP_RANGE

20140714_ml_mtdparts/0002-mtd-nand-move-common-functions-from-cmd_nand.c-to-co.patch has style problems, please review.

I see not, why this warning pops up ...

resend rebased version of this series, as v3 is pending since
September 2014...

Changes in v6:
- add comments from Jagan Teki:
  new patch in this patchserie, extract this piece
  of code into a new patch.

Changes in v2:
- add comment from Daniel Schwierzeck:
  fix compile error from original patch with
  "static inline" rather than "static __maybe_unused"
Changes in v3:
- rebase with d6c1ffc7d23f4fe4ae8c91101861055b8e1501b6
- add comments from scott wood:
  - align MTD_DEV_TYPE_NAND correct
  - remove unnecessary inline
  - rework "jffs2 header" problem later
Changes in v4:
- rebased against 385a08a60f042061b004642d6b9bb6cfb794ad5a
Changes in v5:
- add comment from Scott Wood:
  keep the continuation line aligned with the arguments

Changes in v6:
- add comments from Jagan Teki:
  move code, which checks if flash pointer is used
  into a new patch.
  - use #ifdef in Code
  - call mtd register before the spi_release_bus
- add Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
- fix Tom Rinis mail addr
- add comment from Scott Wood:
  - fix indentation level
  - add mtd_ prefix
  - move str2off and str2long into common place, as they are no
    mtd specific functions and change return value from int to bool
- add comment from Jagan Teki:
  - append help text
  - add Reviewed-by from Jagannadha Sutradharudu Teki

Daniel Schwierzeck (1):
  mtd, spi: add MTD layer driver

Heiko Schocher (3):
  mtd, nand: move common functions from cmd_nand.c to common place
  spi, sf: use offset and size in sf cmd from mtdpartition
  mtd, spi: check if flash pointer is used

 README                        |   3 +
 common/cmd_nand.c             | 148 +++++++++---------------------------------
 common/cmd_onenand.c          |  19 ++----
 common/cmd_sf.c               |  61 +++++++++--------
 common/cmd_test.c             |  12 +---
 drivers/mtd/Makefile          |   4 +-
 drivers/mtd/mtd_uboot.c       |  99 ++++++++++++++++++++++++++++
 drivers/mtd/spi/Makefile      |   1 +
 drivers/mtd/spi/sf_internal.h |   5 ++
 drivers/mtd/spi/sf_mtd.c      | 104 +++++++++++++++++++++++++++++
 drivers/mtd/spi/sf_probe.c    |  10 +--
 include/linux/mtd/mtd.h       |   5 ++
 include/vsprintf.h            |   2 +
 lib/vsprintf.c                |  16 +++++
 14 files changed, 317 insertions(+), 172 deletions(-)
 create mode 100644 drivers/mtd/mtd_uboot.c
 create mode 100644 drivers/mtd/spi/sf_mtd.c

-- 
2.1.0

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

end of thread, other threads:[~2015-06-22 19:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-27  5:42 [U-Boot] [PATCH v6 0/4] spi, sf: add mtdparts feature to spi and sf commands Heiko Schocher
2015-04-27  5:42 ` [U-Boot] [PATCH v6 1/4] mtd, spi: add MTD layer driver Heiko Schocher
2015-05-19 20:09   ` Jagan Teki
2015-05-20  6:46     ` Heiko Schocher
2015-06-16  8:04       ` Jagan Teki
2015-06-16  8:43         ` Heiko Schocher denx
2015-06-16  8:52           ` Jagan Teki
2015-06-16  9:18             ` Heiko Schocher denx
2015-06-16  9:36               ` Jagan Teki
2015-06-16 10:06                 ` Daniel Schwierzeck
2015-06-22  6:43                   ` Jagan Teki
2015-06-22 11:53                     ` Daniel Schwierzeck
2015-06-22 19:59                       ` Jagan Teki
2015-04-27  5:42 ` [U-Boot] [PATCH v6 2/4] mtd, nand: move common functions from cmd_nand.c to common place Heiko Schocher
2015-04-27 23:49   ` Scott Wood
2015-04-27  5:42 ` [U-Boot] [PATCH v6 3/4] spi, sf: use offset and size in sf cmd from mtdpartition Heiko Schocher
2015-04-27  5:42 ` [U-Boot] [PATCH v6 4/4] mtd, spi: check if flash pointer is used Heiko Schocher
2015-05-11  5:49 ` [U-Boot] [PATCH v6 0/4] spi, sf: add mtdparts feature to spi and sf commands Heiko Schocher
2015-05-11  6:01   ` Jagan Teki
2015-05-11  6:10     ` Heiko Schocher
2015-06-16  4:30     ` Heiko Schocher

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.