linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/4] crypto: caam - Add i.MX8MQ support
@ 2019-02-22 10:06 spencercw
  2019-02-22 10:06 ` [RFC 1/4] crypto: caam - fix detection of i.MX8 SoC spencercw
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: spencercw @ 2019-02-22 10:06 UTC (permalink / raw)
  To: Horia Geantă, Aymen Sghaier; +Cc: linux-crypto, Chris Spencer

From: Chris Spencer <christopher.spencer@sea.co.uk>

This patch series adds support for the i.MX8MQ to the CAAM driver. This
is mostly adapted from corresponding changes in the NXP repo. The
patches are based on v5.0-rc7.

RFC for now because I do not have any other boards to test it on.
Hopefully people can verify this change on other boards. The only thing
that I think is potentially problematic is that the RNG is now
initialised via the job ring instead of interfacing directly with the
DECO.

In principle, support for the i.MX8MM can be added by just checking for
fsl,imx8mm everywhere we are checking for fsl,imx8mq. I left this out
because there is currently no upstream support for the i.MX8MM, and I
wouldn't be able to test it anyway.

The i.MX8QM and i.MX8QXP will take more work to support because the
driver needs to be updated to handle the SECO.

I have copied the DT nodes for imx8mq.dtsi below. I will submit these
separately to the imx tree if/when these changes are accepted.

crypto: caam@30900000 {
	compatible = "fsl,sec-v4.0";
	#address-cells = <0x1>;
	#size-cells = <0x1>;
	reg = <0x30900000 0x40000>;
	ranges = <0 0x30900000 0x40000>;
	interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;

	sec_jr0: jr0@1000 {
		 compatible = "fsl,sec-v4.0-job-ring";
		 reg = <0x1000 0x1000>;
		 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
	};

	sec_jr1: jr1@2000 {
		 compatible = "fsl,sec-v4.0-job-ring";
		 reg = <0x2000 0x1000>;
		 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
	};

	sec_jr2: jr2@3000 {
		 compatible = "fsl,sec-v4.0-job-ring";
		 reg = <0x3000 0x1000>;
		 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
	};
};

Sample boot log:
[    2.691119] caam 30900000.caam: device ID = 0x0a16040100000000 (Era 9)
[    2.697950] caam 30900000.caam: job rings = 3, qi = 0
[    2.703645] caam_jr 30901000.jr0: Entropy delay = 3200
[    2.709126] caam_jr 30901000.jr0: Entropy delay = 3600
[    2.784991] caam_jr 30901000.jr0: Instantiated RNG4 SH0.
[    2.855464] caam_jr 30901000.jr0: Instantiated RNG4 SH1.
[    2.881181] alg: No test for authenc(hmac(sha224),ecb(cipher_null)) (authenc-hmac-sha224-ecb-cipher_null-caam)
[    2.891777] alg: No test for authenc(hmac(sha256),ecb(cipher_null)) (authenc-hmac-sha256-ecb-cipher_null-caam)
[    2.902371] alg: No test for authenc(hmac(md5),cbc(aes)) (authenc-hmac-md5-cbc-aes-caam)
[    2.910989] alg: No test for echainiv(authenc(hmac(md5),cbc(aes))) (echainiv-authenc-hmac-md5-cbc-aes-caam)
[    2.933251] alg: No test for echainiv(authenc(hmac(sha1),cbc(aes))) (echainiv-authenc-hmac-sha1-cbc-aes-caam)
[    2.946711] alg: No test for authenc(hmac(sha224),cbc(aes)) (authenc-hmac-sha224-cbc-aes-caam)
[    2.956107] alg: No test for echainiv(authenc(hmac(sha224),cbc(aes))) (echainiv-authenc-hmac-sha224-cbc-aes-caam)
[    2.967791] alg: No test for echainiv(authenc(hmac(sha256),cbc(aes))) (echainiv-authenc-hmac-sha256-cbc-aes-caam)
[    2.978680] alg: No test for authenc(hmac(md5),cbc(des3_ede)) (authenc-hmac-md5-cbc-des3_ede-caam)
[    2.988204] alg: No test for echainiv(authenc(hmac(md5),cbc(des3_ede))) (echainiv-authenc-hmac-md5-cbc-des3_ede-caam)
[    2.999764] alg: No test for echainiv(authenc(hmac(sha1),cbc(des3_ede))) (echainiv-authenc-hmac-sha1-cbc-des3_ede-caam)
[    3.011477] alg: No test for echainiv(authenc(hmac(sha224),cbc(des3_ede))) (echainiv-authenc-hmac-sha224-cbc-des3_ede-caam)
[    3.023583] alg: No test for echainiv(authenc(hmac(sha256),cbc(des3_ede))) (echainiv-authenc-hmac-sha256-cbc-des3_ede-caam)
[    3.035376] alg: No test for authenc(hmac(md5),cbc(des)) (authenc-hmac-md5-cbc-des-caam)
[    3.044013] alg: No test for echainiv(authenc(hmac(md5),cbc(des))) (echainiv-authenc-hmac-md5-cbc-des-caam)
[    3.054668] alg: No test for echainiv(authenc(hmac(sha1),cbc(des))) (echainiv-authenc-hmac-sha1-cbc-des-caam)
[    3.065489] alg: No test for echainiv(authenc(hmac(sha224),cbc(des))) (echainiv-authenc-hmac-sha224-cbc-des-caam)
[    3.076658] alg: No test for echainiv(authenc(hmac(sha256),cbc(des))) (echainiv-authenc-hmac-sha256-cbc-des-caam)
[    3.087528] alg: No test for authenc(hmac(md5),rfc3686(ctr(aes))) (authenc-hmac-md5-rfc3686-ctr-aes-caam)
[    3.097680] alg: No test for seqiv(authenc(hmac(md5),rfc3686(ctr(aes)))) (seqiv-authenc-hmac-md5-rfc3686-ctr-aes-caam)
[    3.109169] alg: No test for seqiv(authenc(hmac(sha1),rfc3686(ctr(aes)))) (seqiv-authenc-hmac-sha1-rfc3686-ctr-aes-caam)
[    3.120670] alg: No test for authenc(hmac(sha224),rfc3686(ctr(aes))) (authenc-hmac-sha224-rfc3686-ctr-aes-caam)
[    3.131358] alg: No test for seqiv(authenc(hmac(sha224),rfc3686(ctr(aes)))) (seqiv-authenc-hmac-sha224-rfc3686-ctr-aes-caam)
[    3.143393] alg: No test for seqiv(authenc(hmac(sha256),rfc3686(ctr(aes)))) (seqiv-authenc-hmac-sha256-rfc3686-ctr-aes-caam)
[    3.155198] caam algorithms registered in /proc/crypto
[    3.171662] caam_jr 30901000.jr0: registering rng-caam
[    3.616749] caam 30900000.caam: caam pkc algorithms registered in /proc/crypto

Chris Spencer (4):
  crypto: caam - fix detection of i.MX8 SoC
  crypto: caam - do not initialise clocks on the i.MX8
  crypto: caam - correct DMA address size for the i.MX8
  crypto: caam - use job ring for RNG instantiation instead of DECO

 drivers/crypto/caam/Makefile      |   2 +-
 drivers/crypto/caam/ctrl.c        | 587 ++++++------------------------
 drivers/crypto/caam/desc_constr.h |  27 +-
 drivers/crypto/caam/inst_rng.c    | 374 +++++++++++++++++++
 drivers/crypto/caam/inst_rng.h    |  18 +
 drivers/crypto/caam/intern.h      |   5 +-
 drivers/crypto/caam/jr.c          |  19 +-
 drivers/crypto/caam/pdb.h         |  49 +--
 drivers/crypto/caam/regs.h        |  21 +-
 9 files changed, 575 insertions(+), 527 deletions(-)
 create mode 100644 drivers/crypto/caam/inst_rng.c
 create mode 100644 drivers/crypto/caam/inst_rng.h

-- 
2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-03-05  8:54 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 10:06 [RFC 0/4] crypto: caam - Add i.MX8MQ support spencercw
2019-02-22 10:06 ` [RFC 1/4] crypto: caam - fix detection of i.MX8 SoC spencercw
2019-02-25  7:50   ` Chris Spencer
2019-02-22 10:06 ` [RFC 2/4] crypto: caam - do not initialise clocks on the i.MX8 spencercw
2019-02-22 10:06 ` [RFC 3/4] crypto: caam - correct DMA address size for " spencercw
2019-02-22 10:06 ` [RFC 4/4] crypto: caam - use job ring for RNG instantiation instead of DECO spencercw
2019-02-25 14:22   ` Horia Geanta
2019-02-25 14:36     ` Chris Spencer
2019-02-26 14:53       ` Horia Geanta
2019-02-26 16:24         ` Chris Spencer
2019-02-28 11:33           ` Chris Spencer
2019-03-04 18:13             ` Horia Geanta
2019-03-05  8:54               ` Chris Spencer
2019-02-25 14:03 ` [RFC 0/4] crypto: caam - Add i.MX8MQ support Horia Geanta
2019-02-25 14:17   ` Chris Spencer
2019-02-25 19:28     ` Chris Spencer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).