diff options
author | Alex Porosanu <alexandru.porosanu@freescale.com> | 2013-01-29 16:45:50 (GMT) |
---|---|---|
committer | Emil Medve <Emilian.Medve@Freescale.com> | 2013-04-02 09:48:03 (GMT) |
commit | c0968ee93056fcbaec2235642ab0de9b221df916 (patch) | |
tree | 9c4302e65da30c26ccc4d631fa200b6426dd768b /drivers/crypto/caam/ctrl.c | |
parent | 62e653aa1e47b47033604d36755971ae17a773f8 (diff) | |
download | linux-fsl-qoriq-c0968ee93056fcbaec2235642ab0de9b221df916.tar.xz |
crypto: caam - support for RNG version retrieval
This patch adds support for retrieving the version of the RNG
block inside the SEC. This is done by retrieving the corresponding
value from the the CHAVID register.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
(cherry picked from commit b7319875be0ec106708aade88a9578c75bdfe8b3)
Change-Id: I4847b0f32bab6397551a2a1b01bd4edcedcaf9a3
Reviewed-on: http://git.am.freescale.net:8181/522
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 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 19faea2..c7565a1 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -189,6 +189,17 @@ 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) { |