
On Fri, 1 Mar 2013 11:16:22 -0500 Akshay Saraswat akshay.s@samsung.com wrote:
SHA-256 and SHA-1 accelerated using ACE hardware.
curious about the rationale: how much faster is this than software?
Changes since v2:
- Added falling back to software sha256 in case length exceeds buffer limit.
- Reduced one tab at lines 533, 559 and 571 in this patch.
- Removed space after a cast at line 506 in this patch.
- Removed blank line at line 561 in this patch.
- Removed space before semicolon at line 576 in this patch.
you should retain the list of changes since v1 here. Read:
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
+/* Hash status */ +#define ACE_HASH_BUFRDY_MASK (1 << 0) +#define ACE_HASH_BUFRDY_OFF (0 << 0) +#define ACE_HASH_BUFRDY_ON (1 << 0) +#define ACE_HASH_SEEDSETTING_MASK (1 << 1) +#define ACE_HASH_SEEDSETTING_OFF (0 << 1) +#define ACE_HASH_SEEDSETTING_ON (1 << 1) +#define ACE_HASH_PRNGBUSY_MASK (1 << 2) +#define ACE_HASH_PRNGBUSY_OFF (0 << 2) +#define ACE_HASH_PRNGBUSY_ON (1 << 2) +#define ACE_HASH_PARTIALDONE_MASK (1 << 4) +#define ACE_HASH_PARTIALDONE_OFF (0 << 4) +#define ACE_HASH_PARTIALDONE_ON (1 << 4)
based on the nomenclature of the above definitions, this hardware obviously has support for breaking up hash requests into multiple buffer submissions, so do that, and not this:
- } else if (buf_len > BUF_LIMIT) {
/*
* ACE H/W cannot compute hash value for buffer > 8 MB.
* Falling back to software.
*/
if (hash_type == ACE_SHA_TYPE_SHA1)
sha1_csum_wd(pbuf, buf_len, pout, CHUNKSZ_SHA1);
else
sha256_csum_wd(pbuf, buf_len, pout, CHUNKSZ_SHA256);
return 0;
- }
Kim