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>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
This commit is contained in:
Franck LENORMAND 2018-02-05 10:54:19 +01:00 committed by Leonard Crestez
parent ba233fce69
commit bb87424812

View File

@ -1112,11 +1112,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,