From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 18 Feb 2013 17:49:37 -0500 Subject: [U-Boot] [PATCH 0/20] Improvements to memory, hashing functions for sandbox In-Reply-To: <1356548233-5570-1-git-send-email-sjg@chromium.org> References: <1356548233-5570-1-git-send-email-sjg@chromium.org> Message-ID: <20130218224937.GC3722@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Dec 26, 2012 at 10:56:53AM -0800, Simon Glass wrote: > 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. So, aside from a few posted comments: Reviewed-by: Tom Rini 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. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: