Skip to content

Improvements to memory, hashing functions for sandbox

Tom Rini u-boot 1 version New

Get series with b4
b4 am 20130218224937.GC3722@bill-the-cat

Versions newest first

  1. v1 Latest6 of 20 patches 0 repliesNew

6 of 20 patches are in this archive. The cover letter announces 20.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
12/20common: Use new numeric setenv functions+0 -01 reply
12/20common: Use new numeric setenv functions+0 -01 reply
13/20drivers: Use new numeric setenv functions+0 -00 replies
16/20Roll crc32 into hash infrastructure+0 -04 replies
16/20Roll crc32 into hash infrastructure+0 -00 replies
16/20Roll crc32 into hash infrastructure+0 -02 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchTom Rini
SeriesR-b
12/20
12/20
13/20
16/20
16/20
16/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/20] Improvements to memory, hashing functions for sandbox
Quoted 32 lines · Simon Glass

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.

Quoted 7 lines

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.

So, aside from a few posted comments:

And pending the answer to if you plan to v2 the hash command part (and since everyone sets CONFIG_CMD_CRC32, we do want to be careful), I'm OK with applying this bundle.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130218/ebf94f74/attachment.pgp>