1. 17 Aug, 2015 1 commit
  2. 15 Jul, 2015 1 commit
  3. 29 Jun, 2015 3 commits
    • Heiko Schocher's avatar
      mtd, spi: Check if flash pointer is used · 8ee81b7f
      Heiko Schocher authored
      If flash pointer is used free it, before probing a new
      flash and storing it in flash.
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Tested-by: default avatarJagannadh Teki <jteki@openedev.com>
      Reviewed-by: default avatarJagannadh Teki <jteki@openedev.com>
      8ee81b7f
    • Heiko Schocher's avatar
      spi, sf: Use offset and size in sf cmd from mtdpartition · 2ec1a405
      Heiko Schocher authored
      With this patch, it is possible to get the offset and size information
      from the mtdpartiton setting in "mtdparts", similiar to the
      "nand" commandos.
      
      => 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
      
      zynq-uboot> mtdparts add nor0 0x10000@0x0 env
      zynq-uboot> sf erase env 0x10000
      SF: 65536 bytes @ 0x0 Erased: OK
      
      zynq-uboot> sf write 0x100 env
      device 0 offset 0x0, size 0x10000
      SF: 65536 bytes @ 0x0 Written: OK
      
      zynq-uboot> sf read 0x40000 env
      device 0 offset 0x0, size 0x10000
      SF: 65536 bytes @ 0x0 Read: OK
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Tested-by: default avatarJagannadh Teki <jteki@openedev.com>
      Reviewed-by: default avatarJagannadh Teki <jteki@openedev.com>
      2ec1a405
    • Daniel Schwierzeck's avatar
      mtd, spi: Add MTD layer driver · 9fe6d871
      Daniel Schwierzeck authored
      Add MTD layer driver for spi, original patch from:
      http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=bb246819cdc90493dd7089eaa51b9e639765cced
      
      Changes from Heiko Schocher against this patch:
      - Remove compile error if not defining CONFIG_SPI_FLASH_MTD:
      
        LD      drivers/mtd/spi/built-in.o
      drivers/mtd/spi/sf_probe.o: In function `spi_flash_mtd_unregister':
      /home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple definition of `spi_flash_mtd_unregister'
      drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: first defined here
      drivers/mtd/spi/sf_ops.o: In function `spi_flash_mtd_unregister':
      /home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple definition of `spi_flash_mtd_unregister'
      drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: first defined here
      make[1]: *** [drivers/mtd/spi/built-in.o] Fehler 1
      make: *** [drivers/mtd/spi] Fehler 2
      
      - Add a README entry.
      - Add correct writebufsize, to fit with Linux v3.14
        MTD, UBI/UBIFS sync.
      
      Note (From Jagan): For testing raw mtd parition erase/read/write operations
      using cmd_sf, sf_mtd should be required to register the spi flash device to
      MTD layer but the sf_mtd_info ops were not required until and unless if we
      use any flash filesystem layer say for example UBI. Due to this the foot-print
      got increased ~290bytes in non-UBI case here that should be acceptible.
      Signed-off-by: default avatarDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Tested-by: default avatarJagannadh Teki <jteki@openedev.com>
      Reviewed-by: default avatarJagannadh Teki <jteki@openedev.com>
      9fe6d871
  4. 22 Apr, 2015 1 commit
    • Stefan Roese's avatar
      cmd_sf: Fix problem with "sf update" and unaligned length · ed62756d
      Stefan Roese authored
      On SoCFPGA, using "sf update" with an non-4byte aligned length leads
      to a hangup (and reboot via watchdog). This is because of the unaligned
      access in the cadence QSPI driver which is hard to prevent since the
      data is written into a 4-byte wide FIFO. This patch fixes this problem
      by changing the behavior of the last sector write (not sector aligned).
      
      The new code is even simpler and copies the source data into the temp
      buffer and now uses the temp buffer to write the complete sector. So
      only one SPI sector write is used now instead of 2 in the old version.
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Cc: Gerlando Falauto <gerlando.falauto@keymile.com>
      Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
      Cc: Holger Brunck <holger.brunck@keymile.com>
      Acked-by: default avatarGerlando Falauto <gerlando.falauto@keymile.com>
      Reviewed-by: default avatarJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
      ed62756d
  5. 18 Apr, 2015 1 commit
  6. 17 Apr, 2015 1 commit
  7. 23 Nov, 2014 1 commit
  8. 22 Oct, 2014 2 commits
  9. 24 Sep, 2014 1 commit
    • Nikita Kiryanov's avatar
      spl: replace CONFIG_SPL_SPI_* with CONFIG_SF_DEFAULT_* · 88e34e5f
      Nikita Kiryanov authored
      Currently, CONFIG_SPL_SPI_* #defines are used for controlling SPI boot in
      SPL. These #defines do not allow the user to select SPI mode for the SPI flash
      (there's no CONFIG_SPL_SPI_MODE, so the SPI mode is hardcoded in
      spi_spl_load.c), and duplicate information already provided by
      CONFIG_SF_DEFAULT_* #defines.
      
      Kill CONFIG_SPL_SPI_*, and use CONFIG_SF_DEFAULT_* instead.
      
      Cc: Tom Rini <trini@ti.com>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
      Cc: Lokesh Vutla <lokeshvutla@ti.com>
      Cc: Vitaly Andrianov <vitalya@ti.com>
      Cc: Lars Poeschel <poeschel@lemonage.de>
      Cc: Bo Shen <voice.shen@atmel.com>
      Cc: Hannes Petermaier <hannes.petermaier@br-automation.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Acked-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarNikita Kiryanov <nikita@compulab.co.il>
      Reviewed-by: default avatarJagannadha Sutradharudu Teki <jaganna@xilinx.com>
      88e34e5f
  10. 11 Jan, 2014 1 commit
  11. 15 Oct, 2013 1 commit
  12. 27 Aug, 2013 1 commit
  13. 06 Aug, 2013 2 commits
  14. 02 Jun, 2013 2 commits
  15. 08 Apr, 2013 1 commit
    • Mingkai Hu's avatar
      cmd_sf: include header file common.h before div64.h · 381c6e2c
      Mingkai Hu authored
      The header file div64.h includes <asm/types.h> which defines
      the phys_addr_t according to the macro CONFIG_PHYS_64BIT, while
      the macro CONFIG_PHYS_64BIT is included in common.h which comes
      after div64.h, so in order to get consistent type definition for
      phys_addr_t, common.h should be included before div64.h, Or else,
      the parameters of phys_addr_t type will be passed wrongly when
      CONFIG_PHYS_64BIT is defined.
      Signed-off-by: default avatarMingkai Hu <Mingkai.Hu@freescale.com>
      381c6e2c
  16. 19 Mar, 2013 1 commit
  17. 19 Dec, 2012 2 commits
  18. 03 Apr, 2012 1 commit
  19. 06 Mar, 2012 1 commit
  20. 12 Feb, 2012 1 commit
  21. 17 Dec, 2011 1 commit
    • Andreas Bießmann's avatar
      cmd_sf.c: fix printf() length modifier · a97f6efd
      Andreas Bießmann authored
      size_t is not always 'unsigned int', use corret length modifer.
      
      This patch fixes following warning:
      
      ---8<---
      cmd_sf.c: In function 'spi_flash_update_block':
      cmd_sf.c:130: warning: format '%#x' expects type 'unsigend int', but argument 4 has type 'size_t'
      cmd_sf.c:135: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'size_t'
      --->8---
      Signed-off-by: default avatarAndreas Bießmann <biessmann@corscience.de>
      cc: Mike Frysinger <vapier@gentoo.org>
      cc: Thomas Chou <thomas@wytron.com.tw>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      a97f6efd
  22. 05 Oct, 2011 1 commit
  23. 29 Sep, 2011 1 commit
  24. 07 Sep, 2011 1 commit
    • Anton Staaf's avatar
      common: fix behavior of ROUND macro when input is already rounded · 155cfb5e
      Anton Staaf authored
      Currently when you call ROUND with a value that is already a
      multiple of the second parameter it will return a value that is
      one multiple larger, instead of returning the value passed in.
      
      There are only two types of usage of ROUND currently, one in
      various config files to round CONFIG_SYS_MALLOC_LEN to a multiple
      of 4096 bytes.  The other in cmd_sf.c where the incorrect behavior
      of ROUND is worked around be subtracting one from the length argument
      before passing it to ROUND.
      
      This patch fixes ROUND and removes the workaround from cmd_sf.  It
      also results in all of the malloc pools that use ROUND to compute
      their size shrinking by 4KB.
      
      Cc: Lukasz Majewski <l.majewski@samsung.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      155cfb5e
  25. 12 Apr, 2011 3 commits
  26. 24 Jul, 2010 1 commit
  27. 04 Jul, 2010 1 commit
    • Wolfgang Denk's avatar
      Make sure that argv[] argument pointers are not modified. · 54841ab5
      Wolfgang Denk authored
      The hush shell dynamically allocates (and re-allocates) memory for the
      argument strings in the "char *argv[]" argument vector passed to
      commands.  Any code that modifies these pointers will cause serious
      corruption of the malloc data structures and crash U-Boot, so make
      sure the compiler can check that no such modifications are being done
      by changing the code into "char * const argv[]".
      
      This modification is the result of debugging a strange crash caused
      after adding a new command, which used the following argument
      processing code which has been working perfectly fine in all Unix
      systems since version 6 - but not so in U-Boot:
      
      int main (int argc, char **argv)
      {
      	while (--argc > 0 && **++argv == '-') {
      /* ====> */	while (*++*argv) {
      			switch (**argv) {
      			case 'd':
      				debug++;
      				break;
      			...
      			default:
      				usage ();
      			}
      		}
      	}
      	...
      }
      
      The line marked "====>" will corrupt the malloc data structures and
      usually cause U-Boot to crash when the next command gets executed by
      the shell.  With the modification, the compiler will prevent this with
      an
      	error: increment of read-only location '*argv'
      
      N.B.: The code above can be trivially rewritten like this:
      
      	while (--argc > 0 && **++argv == '-') {
      		char *arg = *argv;
      		while (*++arg) {
      			switch (*arg) {
      			...
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      54841ab5
  28. 24 Oct, 2009 1 commit
  29. 14 Jul, 2009 1 commit
  30. 12 Jun, 2009 1 commit
    • Wolfgang Denk's avatar
      General help message cleanup · a89c33db
      Wolfgang Denk authored
      Many of the help messages were not really helpful; for example, many
      commands that take no arguments would not print a correct synopsis
      line, but "No additional help available." which is not exactly wrong,
      but not helpful either.
      
      Commit ``Make "usage" messages more helpful.'' changed this
      partially. But it also became clear that lots of "Usage" and "Help"
      messages (fields "usage" and "help" in struct cmd_tbl_s respective)
      were actually redundant.
      
      This patch cleans this up - for example:
      
      Before:
      	=> help dtt
      	dtt - Digital Thermometer and Thermostat
      
      	Usage:
      	dtt         - Read temperature from digital thermometer and thermostat.
      
      After:
      	=> help dtt
      	dtt - Read temperature from Digital Thermometer and Thermostat
      
      	Usage:
      	dtt
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      a89c33db
  31. 28 Jan, 2009 2 commits