Skip to content

Commit

Permalink
crypto: caam - fix pointer size for AArch64 boot loader, AArch32 kernel
Browse files Browse the repository at this point in the history
Start with a clean slate before dealing with bit 16 (pointer size)
of Master Configuration Register.
This fixes the case of AArch64 boot loader + AArch32 kernel, when
the boot loader might set MCFGR[PS] and kernel would fail to clear it.

Cc: <[email protected]>
Reported-by: Alison Wang <[email protected]>
Signed-off-by: Horia Geantă <[email protected]>
Reviewed-By: Alison Wang <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
horiag authored and herbertx committed Dec 7, 2016
1 parent 9e5f7a1 commit 39eaf75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/crypto/caam/ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,9 @@ static int caam_probe(struct platform_device *pdev)
* Enable DECO watchdogs and, if this is a PHYS_ADDR_T_64BIT kernel,
* long pointers in master configuration register
*/
clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK, MCFGR_AWCACHE_CACH |
MCFGR_AWCACHE_BUFF | MCFGR_WDENABLE | MCFGR_LARGE_BURST |
clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK | MCFGR_LONG_PTR,
MCFGR_AWCACHE_CACH | MCFGR_AWCACHE_BUFF |
MCFGR_WDENABLE | MCFGR_LARGE_BURST |
(sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0));

/*
Expand Down

0 comments on commit 39eaf75

Please sign in to comment.