diff options
author | Ruchika Gupta <ruchika.gupta@freescale.com> | 2013-04-22 06:20:04 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-23 20:40:16 (GMT) |
commit | e858dff4b9adc41dcf4b2f2a6f4066da8bfe45b4 (patch) | |
tree | abce75b5c68c64241aa48aa78300b988a0f9f750 /drivers/crypto/caam/ctrl.c | |
parent | 731a7ed2c09fd37e7928bbdd219f5a73005d3207 (diff) | |
download | linux-fsl-qoriq-e858dff4b9adc41dcf4b2f2a6f4066da8bfe45b4.tar.xz |
crypto: caam - Packed RNG vid function
Packed RNG vid function into caam_probe function
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Change-Id: I3fb28ee0ae4daec89725868900445d36fe7e8795
Reviewed-on: http://git.am.freescale.net:8181/1675
Reviewed-by: Garg Vakul-B16394 <vakul@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/crypto/caam/ctrl.c')
-rw-r--r-- | drivers/crypto/caam/ctrl.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 3aa3e43..b1334cc 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -189,17 +189,6 @@ int caam_get_era(u64 caam_id) } EXPORT_SYMBOL(caam_get_era); -/** - * get_rng_vid() - Return the version of the (T)RNG block of the SEC. - * @topregs - pointer to SEC register space - **/ -static inline u8 get_rng_vid(struct caam_full __iomem *topregs) -{ - u64 cha_vid = rd_reg64(&topregs->ctrl.perfmon.cha_id); - - return (cha_vid & CHA_ID_RNG_MASK) >> CHA_ID_RNG_SHIFT; -} - /* Probe routine for CAAM top (controller) level */ static int caam_probe(struct platform_device *pdev) { @@ -213,6 +202,7 @@ static int caam_probe(struct platform_device *pdev) #ifdef CONFIG_DEBUG_FS struct caam_perfmon *perfmon; #endif + u64 cha_vid; ctrlpriv = kzalloc(sizeof(struct caam_drv_private), GFP_KERNEL); if (!ctrlpriv) @@ -308,7 +298,9 @@ static int caam_probe(struct platform_device *pdev) * RNG4 based SECs need special initialization prior * to executing any descriptors */ - if (get_rng_vid(topregs) >= 4) { + cha_vid = rd_reg64(&topregs->ctrl.perfmon.cha_id); + + if ((cha_vid & CHA_ID_RNG_MASK) >> CHA_ID_RNG_SHIFT >= 4) { kick_trng(pdev); ret = instantiate_rng(ctrlpriv->jrdev[0]); if (ret) { |