summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorFranck LENORMAND <franck.lenormand@nxp.com>2018-02-05 10:54:19 +0100
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:32:46 +0800
commit9199283d7177652c333546cc65f504c6cc96915f (patch)
treef73d87cf13cf8326be8f1e9ab4e373734c3e40c4 /drivers/crypto
parent1091a6fb0749b2fd1e8f663ecbd7f2d6aa861e72 (diff)
MLK-17253-1: crypto: caam: Fix computation of SM pages addresses
The computation of the base address of the physical and virtual need to be the same depending on the architecture. The addresses are computed using a pointer on u8 so the additions always works as expected. Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/caam/sm_store.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/crypto/caam/sm_store.c b/drivers/crypto/caam/sm_store.c
index 6e325e595b67..bc10e359559d 100644
--- a/drivers/crypto/caam/sm_store.c
+++ b/drivers/crypto/caam/sm_store.c
@@ -1108,11 +1108,11 @@ int caam_sm_startup(struct platform_device *pdev)
(pgstat & SMCS_PAGE_MASK) >> SMCS_PAGE_SHIFT;
lpagedesc[page].own_part =
(pgstat & SMCS_PART_SHIFT) >> SMCS_PART_MASK;
- lpagedesc[page].pg_base = ctrlpriv->sm_base +
- ((smpriv->page_size * page) / sizeof(u32));
+ lpagedesc[page].pg_base = (u8 *)ctrlpriv->sm_base +
+ (smpriv->page_size * page);
/* FIXME: get base address from platform property... */
- lpagedesc[page].pg_phys = (u32 *)0x00100000 +
- ((smpriv->page_size * page) / sizeof(u32));
+ lpagedesc[page].pg_phys = (u8 *)0x00100000 +
+ (smpriv->page_size * page);
lpagect++;
#ifdef SM_DEBUG
dev_info(smdev,