public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/20] Improvements to memory, hashing functions for sandbox
@ 2012-12-26 18:56 Simon Glass
  2012-12-26 18:56 ` [U-Boot] [PATCH 01/20] Tidy up error checking and fix bug in hash command Simon Glass
                   ` (20 more replies)
  0 siblings, 21 replies; 62+ messages in thread
From: Simon Glass @ 2012-12-26 18:56 UTC (permalink / raw)
  To: u-boot

This series aims to get all the memory functions running correctly
on sandbox.

There was some discussion about this a while ago, and a commit was
added to show a possible approach:

355a8357 sandbox: Change md command to use map_physmem

This commit was subsequently reverted because it used map_physmem()
instead of the NOP that most architectures need for the memory functions.

This series introduces map_sysmem(), a NOP on all architectures
except sandbox. It allows us to use a ram buffer to which all U-Boot
addresses are relative. The memory commands (including hashing) are
updated to use this so that sandbox can now use those commands.

Half of the mtest code is behind #ifdefs and there is duplication of
some functions in both versions of the memory test. Several patches
here clean this up a bit and get it working on sandbox.

The numeric setenv_ulong() function is a useful way of avoiding a
'char buf[17]; sprintf(buf, "%ld", ...); setenv("...", buf)' sequence.
There is also setenv_addr(). What is missing is setenv_hex() which sets
a ulong in hex format. Add this function and then make use of it in the
main places: common/ drivers/ and net/.

The recently added and very basic hash instructure can help reduce
code duplication in some cases. Redo the crc32 command to use this, and
make it available through the 'hash' command. Also a few bugs were
found in hashing with verify disabled - the arg count was not checked and
a variable declaration was missing.

To permit the memory tester to run on sandbox, we need ctrl-C to work.
To achieve this, add a proper implementation of sandbox's tstc(), with a
simple FIFO for character input. An os_usleep() is added to ensure that
U-Boot does not consume infinite CPU when setting at the command prompt.

With all of this it is possible to use the memory commands in sandbox, as
well as crc32 and the other hashing commands.


Simon Glass (19):
  Tidy up error checking and fix bug in hash command
  Update print_buffer() to use const
  sandbox: Add un/map_sysmen() to deal with sandbox's ram_buf
  sandbox: Change memory commands to use map_physmem
  Split out the memory tests into separate functions
  Use common mtest iteration counting
  Fix mtest indenting
  Bring mtest putc() into common code
  Reduce casting in mtest
  Update set_working_fdt_addr() to use setenv_addr()
  common: Use new numeric setenv functions
  drivers: Use new numeric setenv functions
  net: Use new numeric setenv functions
  image: Use crc header file instead of C prototypes
  Roll crc32 into hash infrastructure
  sandbox: config: Enable hash functions and mtest
  Move CONFIG_SYS_MEMTEST_SCRATCH #ifdef to top of file
  sandbox: Update mtest to fix crashes
  sandbox: Allow hash functions to work correctly

Taylor Hutt (1):
  sandbox: Improve sandbox serial port keyboard interface

 README                        |    9 +
 arch/sandbox/config.mk        |    1 +
 arch/sandbox/cpu/os.c         |    8 +
 arch/sandbox/include/asm/io.h |   10 +
 common/cmd_bootm.c            |   11 +-
 common/cmd_cbfs.c             |    4 +-
 common/cmd_cramfs.c           |    4 +-
 common/cmd_fdos.c             |    4 +-
 common/cmd_fdt.c              |   11 +-
 common/cmd_hash.c             |    4 +
 common/cmd_jffs2.c            |    4 +-
 common/cmd_load.c             |   12 +-
 common/cmd_mem.c              |  798 ++++++++++++++++++++---------------------
 common/cmd_mtdparts.c         |    4 +-
 common/cmd_nand.c             |   12 +-
 common/cmd_nvedit.c           |   11 +-
 common/cmd_reiser.c           |    4 +-
 common/cmd_setexpr.c          |   39 ++-
 common/cmd_unzip.c            |    4 +-
 common/cmd_ximg.c             |    7 +-
 common/cmd_zfs.c              |    3 +-
 common/cmd_zip.c              |    4 +-
 common/hash.c                 |   31 ++-
 common/image.c                |    4 +-
 drivers/net/fm/fm.c           |    4 +-
 drivers/serial/sandbox.c      |   44 ++-
 fs/fs.c                       |    4 +-
 fs/ubifs/ubifs.c              |    4 +-
 include/common.h              |   29 ++-
 include/configs/sandbox.h     |    9 +-
 include/hash.h                |    2 +-
 include/os.h                  |   10 +
 include/u-boot/crc.h          |   11 +
 lib/crc32.c                   |    9 +
 lib/display_options.c         |    3 +-
 net/net.c                     |    8 +-
 36 files changed, 612 insertions(+), 528 deletions(-)

-- 
1.7.7.3

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

end of thread, other threads:[~2013-02-27 18:48 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-26 18:56 [U-Boot] [PATCH 0/20] Improvements to memory, hashing functions for sandbox Simon Glass
2012-12-26 18:56 ` [U-Boot] [PATCH 01/20] Tidy up error checking and fix bug in hash command Simon Glass
2013-02-15 23:48   ` Simon Glass
2012-12-26 18:56 ` [U-Boot] [PATCH 02/20] Update print_buffer() to use const Simon Glass
2013-02-15 23:49   ` Simon Glass
2012-12-26 18:56 ` [U-Boot] [PATCH 03/20] sandbox: Improve sandbox serial port keyboard interface Simon Glass
2013-02-15 23:49   ` Simon Glass
2012-12-26 18:56 ` [U-Boot] [PATCH 04/20] sandbox: Add un/map_sysmen() to deal with sandbox's ram_buf Simon Glass
2013-02-15 23:51   ` Simon Glass
2012-12-26 18:56 ` [U-Boot] [PATCH 05/20] sandbox: Change memory commands to use map_physmem Simon Glass
2013-02-15 23:51   ` Simon Glass
2012-12-26 18:56 ` [U-Boot] [PATCH 06/20] Split out the memory tests into separate functions Simon Glass
2013-02-15 23:52   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 07/20] Use common mtest iteration counting Simon Glass
2013-02-15 23:52   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 08/20] Fix mtest indenting Simon Glass
2013-02-15 23:53   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 09/20] Bring mtest putc() into common code Simon Glass
2013-02-15 23:53   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 10/20] Reduce casting in mtest Simon Glass
2013-02-15 23:54   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 11/20] Update set_working_fdt_addr() to use setenv_addr() Simon Glass
2013-02-14 20:00   ` [U-Boot] [PATCH] common/main: move set_working_fdt_addr to enable usage of $fdtaddr Barak Wasserstrom
2013-02-15 23:54   ` [U-Boot] [PATCH 11/20] Update set_working_fdt_addr() to use setenv_addr() Simon Glass
2013-02-25 10:52   ` [U-Boot] [PATCH] common/main: move set_working_fdt_addr to enable usage of $fdtaddr Barak Wasserstrom
2013-02-27 18:48   ` Barak Wasserstrom
2012-12-26 18:57 ` [U-Boot] [PATCH 12/20] common: Use new numeric setenv functions Simon Glass
2013-02-15 23:55   ` Simon Glass
2013-02-18 22:08   ` Tom Rini
2013-02-24 17:45     ` Simon Glass
2013-02-24 20:53       ` Tom Rini
2013-02-25  3:42         ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 13/20] drivers: " Simon Glass
2013-02-15 23:55   ` Simon Glass
2013-02-18 22:37   ` Tom Rini
2012-12-26 18:57 ` [U-Boot] [PATCH 14/20] net: " Simon Glass
2013-02-15 23:56   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 15/20] image: Use crc header file instead of C prototypes Simon Glass
2012-12-26 22:02   ` Marek Vasut
2013-02-15 23:56     ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 16/20] Roll crc32 into hash infrastructure Simon Glass
2013-02-15 23:57   ` Simon Glass
2013-02-17 20:53     ` Wolfgang Denk
2013-02-17 21:34       ` Simon Glass
2013-02-17 23:26       ` Tom Rini
2013-02-18 11:35         ` Wolfgang Denk
2013-02-18 16:36           ` Simon Glass
2013-02-18 17:05             ` Tom Rini
2013-02-18 17:06           ` Simon Glass
2013-02-18 22:45             ` Tom Rini
2013-02-19  5:24               ` Simon Glass
2013-02-20 17:04               ` Simon Glass
2013-02-18 23:14             ` Wolfgang Denk
2012-12-26 18:57 ` [U-Boot] [PATCH 17/20] sandbox: config: Enable hash functions and mtest Simon Glass
2013-02-15 23:57   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 18/20] Move CONFIG_SYS_MEMTEST_SCRATCH #ifdef to top of file Simon Glass
2013-02-15 23:58   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 19/20] sandbox: Update mtest to fix crashes Simon Glass
2013-02-15 23:58   ` Simon Glass
2012-12-26 18:57 ` [U-Boot] [PATCH 20/20] sandbox: Allow hash functions to work correctly Simon Glass
2013-02-15 23:58   ` Simon Glass
2013-02-18 22:49 ` [U-Boot] [PATCH 0/20] Improvements to memory, hashing functions for sandbox Tom Rini

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