[PATCH v2 0/2] CAAM Driver: re-factor and dynamic JR availability check

From: Andrey Zhizhikin
Date: Thu Nov 11 2021 - 11:46:31 EST


This patchset is a follow-up work, which was originated with patch [1].

During the review of originally proposed solution, it has been
discovered that a certain level of clean-up and re-factoring would be
needed for CAAM Driver to remove static variables in JR probing
functions, and some bits of CAAM driver code that is used for debug
output purposes only.

New solution is proposed in this series, and provides following
enhancements to the CAAM Driver infrastructure:
- CAAM Driver uses new bitmap to indicate capabilities, which has been
previously accomplished by various assorted variables in
caam_ctrl_priv structure
- JR node parsing is made independent from the order of appearance in
the DTB, indexing is now based on the address provided by the "reg"
property
- CAAM Driver checks the presence on JR nodes in DTB, and matches the
access to JR HW units in its internal registers. If the JR HW unit is
marked to be used by TrustZone - it would be marked appropriate and
further probing of JR device would be stopped at the very early stage.

Changelog with respect to original patch [1] is recorded in the updated
version of the patch, which is included in this series.

Link: [1]: https://lore.kernel.org/lkml/20211104162114.2019509-1-andrey.zhizhikin@xxxxxxxxxxxxxxxxxxxx/

Andrey Zhizhikin (2):
crypto: caam - convert to use capabilities
crypto: caam - check jr permissions before probing

drivers/crypto/caam/caamalg_qi.c | 2 +-
drivers/crypto/caam/ctrl.c | 110 ++++++++++++++++++++++---------
drivers/crypto/caam/intern.h | 18 ++---
drivers/crypto/caam/jr.c | 33 ++++++++--
drivers/crypto/caam/regs.h | 9 ++-
5 files changed, 122 insertions(+), 50 deletions(-)


base-commit: ad8be4fa6e8149ba6ea21fdf0089e8254437b3c8
--
2.25.1