All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4 v3] Add ACE HW support for SHA 256
@ 2013-03-01 16:16 Akshay Saraswat
  2013-03-01 16:16 ` [U-Boot] [PATCH 1/4 v3] Exynos: Add hardware accelerated " Akshay Saraswat
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Akshay Saraswat @ 2013-03-01 16:16 UTC (permalink / raw)
  To: u-boot

This patch set adds hardware acceleration for SHA 256
with the help of ACE.

Changes since v2:
        - Patch-1: 
		- Added falling back to software sha256 in case length exceeds buffer limit.
		- Reduced one tab at lines 533, 559 and 571 in the patch.
		- Removed space after a cast at line 506 in the patch.
		- Removed blank line at line 561 in the patch.
		- Removed space before semicolon at line 576 in the patch.
        - Patch-2: 
		- Added "SHA1" in the comment for config.
        - Patch-3: 
		- Added new nodes for SHA1 and SHA256 in struct hash_algo for the case when ACE is enabled.
		- Added new declaration for function pointer hash_func_ws with different return type.
        - Patch-4: 
		- New patch to enable config for hash command.

Akshay Saraswat (4):
  Exynos: Add hardware accelerated SHA 256
  Exynos: config: Enable ACE HW for SHA 256 for Exynos
  gen: Add ACE acceleration to hash
  Exynos: config: Enable hash command

 Makefile                               |   1 +
 arch/arm/include/asm/arch-exynos/cpu.h |   4 +
 common/hash.c                          |  15 ++
 drivers/crypto/Makefile                |  47 +++++
 drivers/crypto/ace_sfr.h               | 310 +++++++++++++++++++++++++++++++++
 drivers/crypto/ace_sha.c               | 127 ++++++++++++++
 include/ace_sha.h                      |  42 +++++
 include/configs/exynos5250-dt.h        |   4 +
 include/hash.h                         |   5 +
 9 files changed, 555 insertions(+)
 create mode 100644 drivers/crypto/Makefile
 create mode 100644 drivers/crypto/ace_sfr.h
 create mode 100644 drivers/crypto/ace_sha.c
 create mode 100644 include/ace_sha.h

-- 
1.8.0

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 1/4 v3] Exynos: Add hardware accelerated SHA 256
@ 2013-03-06 15:00 Akshay Saraswat
  0 siblings, 0 replies; 12+ messages in thread
From: Akshay Saraswat @ 2013-03-06 15:00 UTC (permalink / raw)
  To: u-boot

Hi Kim,

>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?
>

Time taken by s/w and h/w sha256 are as given below:
Size: 0x1000
s/w - 11 ticks
h/w - 10 ticks

Size: 0x2000
s/w - 11 ticks
h/w - 10 ticks

Size: 0x4000
s/w - 13 ticks
h/w - 10 ticks

Size: 0x8000
s/w - 16 ticks
h/w - 10 ticks

Size: 0x800000
s/w - 1775 ticks
h/w - 45 ticks

Size: 0x400000
s/w - 893 ticks
h/w - 27 ticks

Size: 0x200000
s/w - 451 ticks
h/w - 18 ticks

Size: 0x8000000
s/w - 28270 ticks
h/w - 110 ticks

Size: 0x40000000
s/w - 225896 ticks
h/w - 110 ticks

>> ---
>> 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
>

Regards,
Akshay Saraswat

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

end of thread, other threads:[~2013-03-06 15:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-01 16:16 [U-Boot] [PATCH 0/4 v3] Add ACE HW support for SHA 256 Akshay Saraswat
2013-03-01 16:16 ` [U-Boot] [PATCH 1/4 v3] Exynos: Add hardware accelerated " Akshay Saraswat
2013-03-02  6:13   ` Simon Glass
2013-03-04 22:08   ` Kim Phillips
2013-03-01 16:16 ` [U-Boot] [PATCH 2/4 v3] Exynos: config: Enable ACE HW for SHA 256 for Exynos Akshay Saraswat
2013-03-02  6:05   ` Simon Glass
2013-03-01 16:16 ` [U-Boot] [PATCH 3/4 v3] gen: Add ACE acceleration to hash Akshay Saraswat
2013-03-02  6:05   ` Simon Glass
2013-03-04 22:16   ` Kim Phillips
2013-03-01 16:16 ` [U-Boot] [PATCH 4/4 v3] Exynos: config: Enable hash command Akshay Saraswat
2013-03-02  6:06   ` Simon Glass
2013-03-06 15:00 [U-Boot] [PATCH 1/4 v3] Exynos: Add hardware accelerated SHA 256 Akshay Saraswat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.