aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2013-07-26 02:59:15 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2013-07-31 20:54:00 -0400
commit7d7c704d0dc9858e6bbb515842e32acb70cf0222 (patch)
tree4eb945ec797d684e1975b3fb6bded3bae473c73d /drivers/crypto
parenteaef7e3f3f82923ea175ce4859908bb0d70072f3 (diff)
crypto: omap-sham - Add OMAP5/AM43XX SHAM Support
Add support for the OMAP5 version of the SHAM module that is present on OMAP5 and AM43xx SoCs. This module is very simialar to OMAP4 version of SHAM module, and adds SHA384 SHA512 hardware-accelerated hash functions to it. To handle the higher digest size of SHA512, few SHA512_DIGEST_i (i=1-16, and first 8 registers are duplicated from SHA_DIGEST_i registers) registers are added at the end of register set. So adding the above register offsets and module info in pdata. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/omap-sham.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index f73b1e0fa5e8..a6eb6a8bbb61 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1718,6 +1718,46 @@ static const struct omap_sham_pdata omap_sham_pdata_omap4 = {
1718 .minor_shift = 0, 1718 .minor_shift = 0,
1719}; 1719};
1720 1720
1721static struct omap_sham_algs_info omap_sham_algs_info_omap5[] = {
1722 {
1723 .algs_list = algs_sha1_md5,
1724 .size = ARRAY_SIZE(algs_sha1_md5),
1725 },
1726 {
1727 .algs_list = algs_sha224_sha256,
1728 .size = ARRAY_SIZE(algs_sha224_sha256),
1729 },
1730 {
1731 .algs_list = algs_sha384_sha512,
1732 .size = ARRAY_SIZE(algs_sha384_sha512),
1733 },
1734};
1735
1736static const struct omap_sham_pdata omap_sham_pdata_omap5 = {
1737 .algs_info = omap_sham_algs_info_omap5,
1738 .algs_info_size = ARRAY_SIZE(omap_sham_algs_info_omap5),
1739 .flags = BIT(FLAGS_AUTO_XOR),
1740 .digest_size = SHA512_DIGEST_SIZE,
1741 .copy_hash = omap_sham_copy_hash_omap4,
1742 .write_ctrl = omap_sham_write_ctrl_omap4,
1743 .trigger = omap_sham_trigger_omap4,
1744 .poll_irq = omap_sham_poll_irq_omap4,
1745 .intr_hdlr = omap_sham_irq_omap4,
1746 .idigest_ofs = 0x240,
1747 .odigest_ofs = 0x200,
1748 .din_ofs = 0x080,
1749 .digcnt_ofs = 0x280,
1750 .rev_ofs = 0x100,
1751 .mask_ofs = 0x110,
1752 .sysstatus_ofs = 0x114,
1753 .mode_ofs = 0x284,
1754 .length_ofs = 0x288,
1755 .major_mask = 0x0700,
1756 .major_shift = 8,
1757 .minor_mask = 0x003f,
1758 .minor_shift = 0,
1759};
1760
1721static const struct of_device_id omap_sham_of_match[] = { 1761static const struct of_device_id omap_sham_of_match[] = {
1722 { 1762 {
1723 .compatible = "ti,omap2-sham", 1763 .compatible = "ti,omap2-sham",
@@ -1727,6 +1767,10 @@ static const struct of_device_id omap_sham_of_match[] = {
1727 .compatible = "ti,omap4-sham", 1767 .compatible = "ti,omap4-sham",
1728 .data = &omap_sham_pdata_omap4, 1768 .data = &omap_sham_pdata_omap4,
1729 }, 1769 },
1770 {
1771 .compatible = "ti,omap5-sham",
1772 .data = &omap_sham_pdata_omap5,
1773 },
1730 {}, 1774 {},
1731}; 1775};
1732MODULE_DEVICE_TABLE(of, omap_sham_of_match); 1776MODULE_DEVICE_TABLE(of, omap_sham_of_match);