linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vakul Garg <vakul@freescale.com>
To: <linux-crypto@vger.kernel.org>
Cc: Herbert Xu <herbert@gondor.hengli.com.au>,
	"David S. Miller" <davem@davemloft.net>,
	Kim Phillips <kim.phillips@freescale.com>,
	Shengzhou Liu <Shengzhou.Liu@freescale.com>,
	Alex Porosanu <alexandru.porosanu@freescale.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH] crypto: caam - set RDB bit in security configuration register
Date: Wed, 6 Feb 2013 17:17:46 +0530	[thread overview]
Message-ID: <1360151266-28428-1-git-send-email-vakul@freescale.com> (raw)

This change is required for post SEC-5.0 devices which have RNG4. Setting RDB
in security configuration register allows CAAM to use the "Random Data Buffer"
to be filled by a single request. The Random Data Buffer is large enough for
ten packets to get their IVs from a single request. If the Random Data Buffer
is not enabled, then each IV causes a separate request, and RNG4 hardware
cannot keep up resulting in lower IPSEC throughput.

Signed-off-by: Vakul Garg <vakul@freescale.com>
---

 drivers/crypto/caam/ctrl.c |    3 +++
 drivers/crypto/caam/regs.h |    4 +++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index b3fecfa..53dd54e 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -234,6 +234,9 @@ static int caam_probe(struct platform_device *pdev)
 	setbits32(&topregs->ctrl.mcr, MCFGR_WDENABLE |
 		  (sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0));
 
+	if (of_device_is_compatible(nprop, "fsl,sec-v5.0"))
+		setbits32(&topregs->ctrl.scfgr, SCFGR_RDBENABLE);
+
 	if (sizeof(dma_addr_t) == sizeof(u64))
 		if (of_device_is_compatible(nprop, "fsl,sec-v5.0"))
 			dma_set_mask(dev, DMA_BIT_MASK(40));
diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h
index 3223fc6..cd6feda 100644
--- a/drivers/crypto/caam/regs.h
+++ b/drivers/crypto/caam/regs.h
@@ -252,7 +252,8 @@ struct caam_ctrl {
 	/* Read/Writable					        */
 	u32 rsvd1;
 	u32 mcr;		/* MCFG      Master Config Register  */
-	u32 rsvd2[2];
+	u32 rsvd2;
+	u32 scfgr;		/* SCFGR, Security Config Register */
 
 	/* Bus Access Configuration Section			010-11f */
 	/* Read/Writable                                                */
@@ -299,6 +300,7 @@ struct caam_ctrl {
 #define MCFGR_WDFAIL		0x20000000 /* DECO watchdog force-fail */
 #define MCFGR_DMA_RESET		0x10000000
 #define MCFGR_LONG_PTR		0x00010000 /* Use >32-bit desc addressing */
+#define SCFGR_RDBENABLE		0x00000400
 
 /* AXI read cache control */
 #define MCFGR_ARCACHE_SHIFT	12
-- 
1.7.7.6



             reply	other threads:[~2013-02-06 11:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 11:47 Vakul Garg [this message]
2013-02-07  1:33 ` [PATCH] crypto: caam - set RDB bit in security configuration register Kim Phillips
2013-02-07  4:38   ` Garg Vakul-B16394

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360151266-28428-1-git-send-email-vakul@freescale.com \
    --to=vakul@freescale.com \
    --cc=Shengzhou.Liu@freescale.com \
    --cc=alexandru.porosanu@freescale.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=kim.phillips@freescale.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).