All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG
@ 2017-08-23  2:57 PrasannaKumar Muralidharan
  2017-08-23  2:57 ` [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation PrasannaKumar Muralidharan
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23  2:57 UTC (permalink / raw)
  To: herbert, davem, robh+dt, mark.rutland, ralf, paul, linux-crypto,
	devicetree, linux-mips, malat, noloader
  Cc: PrasannaKumar Muralidharan

This patch series adds support of pseudo random number generator found
in Ingenic's JZ4780 and X1000 SoC.

Based on Paul's review comments, add 'syscon' compatible in CGU node in
jz4780.dtsi. jz4780-rng driver uses regmap exposed via syscon interface
to access the RNG registers. CGU driver is not modified in this patch
set as registers used by CGU driver and this driver are different.

PrasannaKumar Muralidharan (4):
  crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation
  crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver
  crypto: jz4780-rng: Add RNG node to jz4780.dtsi
  crypto: jz4780-rng: Enable PRNG support in CI20 defconfig

 .../bindings/crypto/ingenic,jz4780-rng.txt         |  20 +++
 MAINTAINERS                                        |   5 +
 arch/mips/boot/dts/ingenic/jz4780.dtsi             |   6 +-
 arch/mips/configs/ci20_defconfig                   |   5 +
 drivers/crypto/Kconfig                             |  19 +++
 drivers/crypto/Makefile                            |   1 +
 drivers/crypto/jz4780-rng.c                        | 168 +++++++++++++++++++++
 7 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
 create mode 100644 drivers/crypto/jz4780-rng.c

-- 
2.10.0

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

* [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation
  2017-08-23  2:57 [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG PrasannaKumar Muralidharan
@ 2017-08-23  2:57 ` PrasannaKumar Muralidharan
  2017-08-25 21:57   ` Rob Herring
  2017-08-23  2:57 ` [PATCH v2 2/4] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver PrasannaKumar Muralidharan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23  2:57 UTC (permalink / raw)
  To: herbert, davem, robh+dt, mark.rutland, ralf, paul, linux-crypto,
	devicetree, linux-mips, malat, noloader
  Cc: PrasannaKumar Muralidharan

Add devicetree bindings for hardware pseudo random number generator
present in Ingenic JZ4780 SoC.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
---
Changes in v2:
* Add "syscon" in CGU node's compatible section
* Make RNG child node of CGU.

 .../bindings/crypto/ingenic,jz4780-rng.txt           | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt

diff --git a/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
new file mode 100644
index 0000000..a0c18e5
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
@@ -0,0 +1,20 @@
+Ingenic jz4780 RNG driver
+
+Required properties:
+- compatible : Should be "ingenic,jz4780-rng"
+
+Example:
+
+cgu: jz4780-cgu@10000000 {
+	compatible = "ingenic,jz4780-cgu", "syscon";
+	reg = <0x10000000 0x100>;
+
+	clocks = <&ext>, <&rtc>;
+	clock-names = "ext", "rtc";
+
+	#clock-cells = <1>;
+
+	rng: rng@d8 {
+		compatible = "ingenic,jz480-rng";
+	};
+};
-- 
2.10.0

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

* [PATCH v2 2/4] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver
  2017-08-23  2:57 [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG PrasannaKumar Muralidharan
  2017-08-23  2:57 ` [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation PrasannaKumar Muralidharan
@ 2017-08-23  2:57 ` PrasannaKumar Muralidharan
       [not found] ` <20170823025707.27888-1-prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-08-27  6:39 ` [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG PrasannaKumar Muralidharan
  3 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23  2:57 UTC (permalink / raw)
  To: herbert, davem, robh+dt, mark.rutland, ralf, paul, linux-crypto,
	devicetree, linux-mips, malat, noloader
  Cc: PrasannaKumar Muralidharan

JZ4780 SoC pseudo random number generator driver using crypto framework.

Adding a delay before reading RNG data and disabling RNG after reading
data was suggested by Jeffery Walton.

Tested-by: Mathieu Malaterre <malat@debian.org>
Suggested-by: Jeffrey Walton <noloader@gmail.com>
Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
---
Changes in v2:
* Fixed buffer overflow in generate function pointed out in Stephan's review
* Fold patch that had only MAINTAINERS file change with this patch
* Removed unnecessary comment in code

 MAINTAINERS                 |   5 ++
 drivers/crypto/Kconfig      |  19 +++++
 drivers/crypto/Makefile     |   1 +
 drivers/crypto/jz4780-rng.c | 168 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 193 insertions(+)
 create mode 100644 drivers/crypto/jz4780-rng.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 1c3feff..f662a70 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6672,6 +6672,11 @@ L:	linux-mtd@lists.infradead.org
 S:	Maintained
 F:	drivers/mtd/nand/jz4780_*
 
+INGENIC JZ4780 PRNG DRIVER
+M:	PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
+S:	Maintained
+F:	drivers/crypto/jz4780-rng.c
+
 INOTIFY
 M:	John McCutchan <john@johnmccutchan.com>
 M:	Robert Love <rlove@rlove.org>
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 4b75084..de2459f 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -599,6 +599,25 @@ config CRYPTO_DEV_IMGTEC_HASH
 	  hardware hash accelerator. Supporting MD5/SHA1/SHA224/SHA256
 	  hashing algorithms.
 
+config CRYPTO_DEV_JZ4780_RNG
+	tristate "JZ4780 HW pseudo random number generator support"
+	depends on MACH_JZ4780 || COMPILE_TEST
+	depends on HAS_IOMEM
+	select CRYPTO_RNG
+	select REGMAP
+	select SYSCON
+	select MFD_SYSCON
+	---help---
+	  This driver provides kernel-side support through the
+	  cryptographic API for the pseudo random number generator
+	  hardware found in ingenic JZ4780 and X1000 SoC. MIPS
+	  Creator CI20 uses JZ4780 SoC.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called jz4780-rng.
+
+	  If unsure, say Y.
+
 config CRYPTO_DEV_SUN4I_SS
 	tristate "Support for Allwinner Security System cryptographic accelerator"
 	depends on ARCH_SUNXI && !64BIT
diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
index 2c555a3..1df48f9 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o
 obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o
 obj-$(CONFIG_CRYPTO_DEV_IMGTEC_HASH) += img-hash.o
 obj-$(CONFIG_CRYPTO_DEV_IXP4XX) += ixp4xx_crypto.o
+obj-$(CONFIG_CRYPTO_DEV_JZ4780_RNG) += jz4780-rng.o
 obj-$(CONFIG_CRYPTO_DEV_MV_CESA) += mv_cesa.o
 obj-$(CONFIG_CRYPTO_DEV_MARVELL_CESA) += marvell/
 obj-$(CONFIG_CRYPTO_DEV_MEDIATEK) += mediatek/
diff --git a/drivers/crypto/jz4780-rng.c b/drivers/crypto/jz4780-rng.c
new file mode 100644
index 0000000..4444682
--- /dev/null
+++ b/drivers/crypto/jz4780-rng.c
@@ -0,0 +1,168 @@
+/*
+ * jz4780-rng.c - Random Number Generator driver for the jz4780
+ *
+ * Copyright (c) 2017 PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/crypto.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/mfd/syscon.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+
+#include <crypto/internal/rng.h>
+
+#define REG_RNG_CTRL	0xD8
+#define REG_RNG_DATA	0xDC
+
+/* Context for crypto */
+struct jz4780_rng_ctx {
+	struct jz4780_rng *rng;
+};
+
+/* Device associated memory */
+struct jz4780_rng {
+	struct device *dev;
+	struct regmap *regmap;
+};
+
+static struct jz4780_rng *jz4780_rng;
+
+static int jz4780_rng_readl(struct jz4780_rng *rng, u32 offset)
+{
+	u32 val = 0;
+	int ret;
+
+	ret = regmap_read(rng->regmap, offset, &val);
+	if (!ret)
+		return val;
+
+	return ret;
+}
+
+static int jz4780_rng_writel(struct jz4780_rng *rng, u32 val, u32 offset)
+{
+	return regmap_write(rng->regmap, offset, val);
+}
+
+static int jz4780_rng_generate(struct crypto_rng *tfm,
+			       const u8 *src, unsigned int slen,
+			       u8 *dst, unsigned int dlen)
+{
+	struct jz4780_rng_ctx *ctx = crypto_rng_ctx(tfm);
+	struct jz4780_rng *rng = ctx->rng;
+	u32 data;
+
+	/*
+	 * A delay is required so that the current RNG data is not bit shifted
+	 * version of previous RNG data which could happen if random data is
+	 * read continuously from this device.
+	 */
+	jz4780_rng_writel(rng, 1, REG_RNG_CTRL);
+	while (dlen >= 4) {
+		data = jz4780_rng_readl(rng, REG_RNG_DATA);
+		memcpy((void *)dst, (void *)&data, 4);
+		dlen -= 4;
+		dst += 4;
+		udelay(20);
+	};
+
+	if (dlen > 0) {
+		data = jz4780_rng_readl(rng, REG_RNG_DATA);
+		memcpy((void *)dst, (void *)&data, dlen);
+	}
+	jz4780_rng_writel(rng, 0, REG_RNG_CTRL);
+
+	return 0;
+}
+
+static int jz4780_rng_kcapi_init(struct crypto_tfm *tfm)
+{
+	struct jz4780_rng_ctx *ctx = crypto_tfm_ctx(tfm);
+
+	ctx->rng = jz4780_rng;
+
+	return 0;
+}
+
+static struct rng_alg jz4780_rng_alg = {
+	.generate		= jz4780_rng_generate,
+	.base			= {
+		.cra_name		= "stdrng",
+		.cra_driver_name	= "jz4780_rng",
+		.cra_priority		= 100,
+		.cra_ctxsize		= sizeof(struct jz4780_rng_ctx),
+		.cra_module		= THIS_MODULE,
+		.cra_init		= jz4780_rng_kcapi_init,
+	}
+};
+
+static int jz4780_rng_probe(struct platform_device *pdev)
+{
+	struct jz4780_rng *rng;
+	struct resource *res;
+	int ret;
+
+	rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL);
+	if (!rng)
+		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	rng->regmap = syscon_node_to_regmap(pdev->dev.parent->of_node);
+	if (IS_ERR(rng->regmap))
+		return PTR_ERR(rng->regmap);
+
+	jz4780_rng = rng;
+
+	ret = crypto_register_rng(&jz4780_rng_alg);
+	if (ret) {
+		dev_err(&pdev->dev,
+			"Couldn't register rng crypto alg: %d\n", ret);
+		jz4780_rng = NULL;
+	}
+
+	return ret;
+}
+
+static int jz4780_rng_remove(struct platform_device *pdev)
+{
+	crypto_unregister_rng(&jz4780_rng_alg);
+
+	jz4780_rng = NULL;
+
+	return 0;
+}
+
+static const struct of_device_id jz4780_rng_dt_match[] = {
+	{
+		.compatible = "ingenic,jz4780-rng",
+	},
+	{ },
+};
+MODULE_DEVICE_TABLE(of, jz4780_rng_dt_match);
+
+static struct platform_driver jz4780_rng_driver = {
+	.driver		= {
+		.name	= "jz4780-rng",
+		.of_match_table = jz4780_rng_dt_match,
+	},
+	.probe		= jz4780_rng_probe,
+	.remove		= jz4780_rng_remove,
+};
+
+module_platform_driver(jz4780_rng_driver);
+
+MODULE_DESCRIPTION("Ingenic JZ4780 H/W Pseudo Random Number Generator driver");
+MODULE_AUTHOR("PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>");
+MODULE_LICENSE("GPL");
-- 
2.10.0

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

* [PATCH v2 3/4] crypto: jz4780-rng: Add RNG node to jz4780.dtsi
  2017-08-23  2:57 [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG PrasannaKumar Muralidharan
@ 2017-08-23  2:57     ` PrasannaKumar Muralidharan
  2017-08-23  2:57 ` [PATCH v2 2/4] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver PrasannaKumar Muralidharan
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23  2:57 UTC (permalink / raw)
  To: herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	mark.rutland-5wv7dgnIgG8, ralf-6z/3iImG2C8G8FEW9MqTrA,
	paul-icTtO2rgO2OTuSrc4Mpeew, linux-crypto-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, malat-8fiUuRrzOP0dnm+yROfE0A,
	noloader-Re5JQEeQqe8AvxtiuMwx3w
  Cc: PrasannaKumar Muralidharan

Add RNG node to jz4780 dtsi. This driver uses registers that are part of
the register set used by Ingenic CGU driver. Make RNG node as child of
CGU node.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
Changes in v2:
* Add "syscon" in CGU node's compatible section
* Make RNG child node of CGU.

 arch/mips/boot/dts/ingenic/jz4780.dtsi | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi b/arch/mips/boot/dts/ingenic/jz4780.dtsi
index 4853ef6..411e16c 100644
--- a/arch/mips/boot/dts/ingenic/jz4780.dtsi
+++ b/arch/mips/boot/dts/ingenic/jz4780.dtsi
@@ -35,13 +35,17 @@
 	};
 
 	cgu: jz4780-cgu@10000000 {
-		compatible = "ingenic,jz4780-cgu";
+		compatible = "ingenic,jz4780-cgu", "syscon";
 		reg = <0x10000000 0x100>;
 
 		clocks = <&ext>, <&rtc>;
 		clock-names = "ext", "rtc";
 
 		#clock-cells = <1>;
+
+		rng: rng@d8 {
+			compatible = "ingenic,jz480-rng";
+		};
 	};
 
 	pinctrl: pin-controller@10010000 {
-- 
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 3/4] crypto: jz4780-rng: Add RNG node to jz4780.dtsi
@ 2017-08-23  2:57     ` PrasannaKumar Muralidharan
  0 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23  2:57 UTC (permalink / raw)
  To: herbert, davem, robh+dt, mark.rutland, ralf, paul, linux-crypto,
	devicetree, linux-mips, malat, noloader
  Cc: PrasannaKumar Muralidharan

Add RNG node to jz4780 dtsi. This driver uses registers that are part of
the register set used by Ingenic CGU driver. Make RNG node as child of
CGU node.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
---
Changes in v2:
* Add "syscon" in CGU node's compatible section
* Make RNG child node of CGU.

 arch/mips/boot/dts/ingenic/jz4780.dtsi | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi b/arch/mips/boot/dts/ingenic/jz4780.dtsi
index 4853ef6..411e16c 100644
--- a/arch/mips/boot/dts/ingenic/jz4780.dtsi
+++ b/arch/mips/boot/dts/ingenic/jz4780.dtsi
@@ -35,13 +35,17 @@
 	};
 
 	cgu: jz4780-cgu@10000000 {
-		compatible = "ingenic,jz4780-cgu";
+		compatible = "ingenic,jz4780-cgu", "syscon";
 		reg = <0x10000000 0x100>;
 
 		clocks = <&ext>, <&rtc>;
 		clock-names = "ext", "rtc";
 
 		#clock-cells = <1>;
+
+		rng: rng@d8 {
+			compatible = "ingenic,jz480-rng";
+		};
 	};
 
 	pinctrl: pin-controller@10010000 {
-- 
2.10.0

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

* [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
  2017-08-23  2:57 [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG PrasannaKumar Muralidharan
@ 2017-08-23  2:57     ` PrasannaKumar Muralidharan
  2017-08-23  2:57 ` [PATCH v2 2/4] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver PrasannaKumar Muralidharan
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23  2:57 UTC (permalink / raw)
  To: herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	mark.rutland-5wv7dgnIgG8, ralf-6z/3iImG2C8G8FEW9MqTrA,
	paul-icTtO2rgO2OTuSrc4Mpeew, linux-crypto-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, malat-8fiUuRrzOP0dnm+yROfE0A,
	noloader-Re5JQEeQqe8AvxtiuMwx3w
  Cc: PrasannaKumar Muralidharan

Enable PRNG driver support in MIPS Creator CI20 default config.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
No changes in v2

 arch/mips/configs/ci20_defconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
index b42cfa7..9f48f2c 100644
--- a/arch/mips/configs/ci20_defconfig
+++ b/arch/mips/configs/ci20_defconfig
@@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
 CONFIG_SERIAL_8250_INGENIC=y
 CONFIG_SERIAL_OF_PLATFORM=y
 # CONFIG_HW_RANDOM is not set
+CONFIG_CRYPTO_USER=y
+CONFIG_CRYPTO_USER_API=y
+CONFIG_CRYPTO_USER_API_RNG=y
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_DEV_JZ4780_RNG=y
 CONFIG_I2C=y
 CONFIG_I2C_JZ4780=y
 CONFIG_GPIO_SYSFS=y
-- 
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
@ 2017-08-23  2:57     ` PrasannaKumar Muralidharan
  0 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23  2:57 UTC (permalink / raw)
  To: herbert, davem, robh+dt, mark.rutland, ralf, paul, linux-crypto,
	devicetree, linux-mips, malat, noloader
  Cc: PrasannaKumar Muralidharan

Enable PRNG driver support in MIPS Creator CI20 default config.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
---
No changes in v2

 arch/mips/configs/ci20_defconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
index b42cfa7..9f48f2c 100644
--- a/arch/mips/configs/ci20_defconfig
+++ b/arch/mips/configs/ci20_defconfig
@@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
 CONFIG_SERIAL_8250_INGENIC=y
 CONFIG_SERIAL_OF_PLATFORM=y
 # CONFIG_HW_RANDOM is not set
+CONFIG_CRYPTO_USER=y
+CONFIG_CRYPTO_USER_API=y
+CONFIG_CRYPTO_USER_API_RNG=y
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_DEV_JZ4780_RNG=y
 CONFIG_I2C=y
 CONFIG_I2C_JZ4780=y
 CONFIG_GPIO_SYSFS=y
-- 
2.10.0

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
       [not found]     ` <20170823025707.27888-5-prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-08-23  9:09         ` Harvey Hunt
  (?)
@ 2017-08-23  9:09         ` Harvey Hunt
  0 siblings, 0 replies; 22+ messages in thread
From: Harvey Hunt @ 2017-08-23  9:09 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan,
	herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	mark.rutland-5wv7dgnIgG8, ralf-6z/3iImG2C8G8FEW9MqTrA,
	paul-icTtO2rgO2OTuSrc4Mpeew, linux-crypto-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, malat-8fiUuRrzOP0dnm+yROfE0A,
	noloader-Re5JQEeQqe8AvxtiuMwx3w

Hi PrasannaKumar,

On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
> Enable PRNG driver support in MIPS Creator CI20 default config.
> 
> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> No changes in v2
> 
>   arch/mips/configs/ci20_defconfig | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
> index b42cfa7..9f48f2c 100644
> --- a/arch/mips/configs/ci20_defconfig
> +++ b/arch/mips/configs/ci20_defconfig
> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>   CONFIG_SERIAL_8250_INGENIC=y
>   CONFIG_SERIAL_OF_PLATFORM=y
>   # CONFIG_HW_RANDOM is not set
> +CONFIG_CRYPTO_USER=y
> +CONFIG_CRYPTO_USER_API=y
> +CONFIG_CRYPTO_USER_API_RNG=y
> +CONFIG_CRYPTO_HW=y
> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>   CONFIG_I2C=y
>   CONFIG_I2C_JZ4780=y
>   CONFIG_GPIO_SYSFS=y
> 

You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.

Thanks,

Harvey
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
@ 2017-08-23  9:09         ` Harvey Hunt
  0 siblings, 0 replies; 22+ messages in thread
From: Harvey Hunt @ 2017-08-23  9:09 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan,
	herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	mark.rutland-5wv7dgnIgG8, ralf-6z/3iImG2C8G8FEW9MqTrA,
	paul-icTtO2rgO2OTuSrc4Mpeew, linux-crypto-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, malat-8fiUuRrzOP0dnm+yROfE0A,
	noloader-Re5JQEeQqe8AvxtiuMwx3w

Hi PrasannaKumar,

On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
> Enable PRNG driver support in MIPS Creator CI20 default config.
> 
> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> No changes in v2
> 
>   arch/mips/configs/ci20_defconfig | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
> index b42cfa7..9f48f2c 100644
> --- a/arch/mips/configs/ci20_defconfig
> +++ b/arch/mips/configs/ci20_defconfig
> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>   CONFIG_SERIAL_8250_INGENIC=y
>   CONFIG_SERIAL_OF_PLATFORM=y
>   # CONFIG_HW_RANDOM is not set
> +CONFIG_CRYPTO_USER=y
> +CONFIG_CRYPTO_USER_API=y
> +CONFIG_CRYPTO_USER_API_RNG=y
> +CONFIG_CRYPTO_HW=y
> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>   CONFIG_I2C=y
>   CONFIG_I2C_JZ4780=y
>   CONFIG_GPIO_SYSFS=y
> 

You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.

Thanks,

Harvey
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
@ 2017-08-23  9:09         ` Harvey Hunt
  0 siblings, 0 replies; 22+ messages in thread
From: Harvey Hunt @ 2017-08-23  9:09 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan, herbert, davem, robh+dt,
	mark.rutland, ralf, paul, linux-crypto, devicetree, linux-mips,
	malat, noloader

Hi PrasannaKumar,

On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
> Enable PRNG driver support in MIPS Creator CI20 default config.
> 
> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
> ---
> No changes in v2
> 
>   arch/mips/configs/ci20_defconfig | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
> index b42cfa7..9f48f2c 100644
> --- a/arch/mips/configs/ci20_defconfig
> +++ b/arch/mips/configs/ci20_defconfig
> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>   CONFIG_SERIAL_8250_INGENIC=y
>   CONFIG_SERIAL_OF_PLATFORM=y
>   # CONFIG_HW_RANDOM is not set
> +CONFIG_CRYPTO_USER=y
> +CONFIG_CRYPTO_USER_API=y
> +CONFIG_CRYPTO_USER_API_RNG=y
> +CONFIG_CRYPTO_HW=y
> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>   CONFIG_I2C=y
>   CONFIG_I2C_JZ4780=y
>   CONFIG_GPIO_SYSFS=y
> 

You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.

Thanks,

Harvey

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
@ 2017-08-23  9:09         ` Harvey Hunt
  0 siblings, 0 replies; 22+ messages in thread
From: Harvey Hunt @ 2017-08-23  9:09 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan, herbert, davem, robh+dt,
	mark.rutland, ralf, paul, linux-crypto, devicetree, linux-mips,
	malat, noloader

Hi PrasannaKumar,

On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
> Enable PRNG driver support in MIPS Creator CI20 default config.
> 
> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
> ---
> No changes in v2
> 
>   arch/mips/configs/ci20_defconfig | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
> index b42cfa7..9f48f2c 100644
> --- a/arch/mips/configs/ci20_defconfig
> +++ b/arch/mips/configs/ci20_defconfig
> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>   CONFIG_SERIAL_8250_INGENIC=y
>   CONFIG_SERIAL_OF_PLATFORM=y
>   # CONFIG_HW_RANDOM is not set
> +CONFIG_CRYPTO_USER=y
> +CONFIG_CRYPTO_USER_API=y
> +CONFIG_CRYPTO_USER_API_RNG=y
> +CONFIG_CRYPTO_HW=y
> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>   CONFIG_I2C=y
>   CONFIG_I2C_JZ4780=y
>   CONFIG_GPIO_SYSFS=y
> 

You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.

Thanks,

Harvey

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
  2017-08-23  9:09         ` Harvey Hunt
@ 2017-08-23 14:50             ` PrasannaKumar Muralidharan
  -1 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23 14:50 UTC (permalink / raw)
  To: Harvey Hunt
  Cc: Herbert Xu, David S . Miller, Rob Herring, Mark Rutland,
	Ralf Baechle, Paul Cercueil, linux-crypto-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, Mathieu Malaterre,
	noloader-Re5JQEeQqe8AvxtiuMwx3w

Hi Harvey,

On 23 August 2017 at 14:39, Harvey Hunt <Harvey.Hunt-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org> wrote:
> Hi PrasannaKumar,
>
> On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
>>
>> Enable PRNG driver support in MIPS Creator CI20 default config.
>>
>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> No changes in v2
>>
>>   arch/mips/configs/ci20_defconfig | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/mips/configs/ci20_defconfig
>> b/arch/mips/configs/ci20_defconfig
>> index b42cfa7..9f48f2c 100644
>> --- a/arch/mips/configs/ci20_defconfig
>> +++ b/arch/mips/configs/ci20_defconfig
>> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>>   CONFIG_SERIAL_8250_INGENIC=y
>>   CONFIG_SERIAL_OF_PLATFORM=y
>>   # CONFIG_HW_RANDOM is not set
>> +CONFIG_CRYPTO_USER=y
>> +CONFIG_CRYPTO_USER_API=y
>> +CONFIG_CRYPTO_USER_API_RNG=y
>> +CONFIG_CRYPTO_HW=y
>> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>>   CONFIG_I2C=y
>>   CONFIG_I2C_JZ4780=y
>>   CONFIG_GPIO_SYSFS=y
>>
>
> You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.
>
> Thanks,
>
> Harvey

CONFIG_MFD_SYSCON gets selected when CONFIG_CRYPTO_DEV_JZ4780_RNG is
selected. Please see the Kconfig changes. Given that should I add it
in ci20_defconfig? If it is required I will add and send a new
version.

Thanks,
PrasannaKumar
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
@ 2017-08-23 14:50             ` PrasannaKumar Muralidharan
  0 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23 14:50 UTC (permalink / raw)
  To: Harvey Hunt
  Cc: Herbert Xu, David S . Miller, Rob Herring, Mark Rutland,
	Ralf Baechle, Paul Cercueil, linux-crypto, devicetree,
	linux-mips, Mathieu Malaterre, noloader

Hi Harvey,

On 23 August 2017 at 14:39, Harvey Hunt <Harvey.Hunt@imgtec.com> wrote:
> Hi PrasannaKumar,
>
> On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
>>
>> Enable PRNG driver support in MIPS Creator CI20 default config.
>>
>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
>> ---
>> No changes in v2
>>
>>   arch/mips/configs/ci20_defconfig | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/mips/configs/ci20_defconfig
>> b/arch/mips/configs/ci20_defconfig
>> index b42cfa7..9f48f2c 100644
>> --- a/arch/mips/configs/ci20_defconfig
>> +++ b/arch/mips/configs/ci20_defconfig
>> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>>   CONFIG_SERIAL_8250_INGENIC=y
>>   CONFIG_SERIAL_OF_PLATFORM=y
>>   # CONFIG_HW_RANDOM is not set
>> +CONFIG_CRYPTO_USER=y
>> +CONFIG_CRYPTO_USER_API=y
>> +CONFIG_CRYPTO_USER_API_RNG=y
>> +CONFIG_CRYPTO_HW=y
>> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>>   CONFIG_I2C=y
>>   CONFIG_I2C_JZ4780=y
>>   CONFIG_GPIO_SYSFS=y
>>
>
> You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.
>
> Thanks,
>
> Harvey

CONFIG_MFD_SYSCON gets selected when CONFIG_CRYPTO_DEV_JZ4780_RNG is
selected. Please see the Kconfig changes. Given that should I add it
in ci20_defconfig? If it is required I will add and send a new
version.

Thanks,
PrasannaKumar

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

* Re: [PATCH v2 3/4] crypto: jz4780-rng: Add RNG node to jz4780.dtsi
  2017-08-23  2:57     ` PrasannaKumar Muralidharan
  (?)
@ 2017-08-23 14:51     ` Ralf Baechle
  -1 siblings, 0 replies; 22+ messages in thread
From: Ralf Baechle @ 2017-08-23 14:51 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan
  Cc: herbert, davem, robh+dt, mark.rutland, paul, linux-crypto,
	devicetree, linux-mips, malat, noloader

On Wed, Aug 23, 2017 at 08:27:06AM +0530, PrasannaKumar Muralidharan wrote:

> Add RNG node to jz4780 dtsi. This driver uses registers that are part of
> the register set used by Ingenic CGU driver. Make RNG node as child of
> CGU node.
> 
> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
> ---
> Changes in v2:
> * Add "syscon" in CGU node's compatible section
> * Make RNG child node of CGU.
> 
>  arch/mips/boot/dts/ingenic/jz4780.dtsi | 6 +++++-

This barely touched arch/mips so probably should be funnelled along with
the rest of the series:

Acked-by: Ralf Baechle <ralf@linux-mips.org>

Or I can take everything.

  Ralf

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
  2017-08-23 14:50             ` PrasannaKumar Muralidharan
@ 2017-08-23 14:51               ` Harvey Hunt
  -1 siblings, 0 replies; 22+ messages in thread
From: Harvey Hunt @ 2017-08-23 14:51 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan
  Cc: Herbert Xu, David S . Miller, Rob Herring, Mark Rutland,
	Ralf Baechle, Paul Cercueil, linux-crypto, devicetree,
	linux-mips, Mathieu Malaterre, noloader

Hi PrasannaKumar,

On 23/08/17 15:50, PrasannaKumar Muralidharan wrote:
> Hi Harvey,
> 
> On 23 August 2017 at 14:39, Harvey Hunt <Harvey.Hunt@imgtec.com> wrote:
>> Hi PrasannaKumar,
>>
>> On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
>>>
>>> Enable PRNG driver support in MIPS Creator CI20 default config.
>>>
>>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
>>> ---
>>> No changes in v2
>>>
>>>    arch/mips/configs/ci20_defconfig | 5 +++++
>>>    1 file changed, 5 insertions(+)
>>>
>>> diff --git a/arch/mips/configs/ci20_defconfig
>>> b/arch/mips/configs/ci20_defconfig
>>> index b42cfa7..9f48f2c 100644
>>> --- a/arch/mips/configs/ci20_defconfig
>>> +++ b/arch/mips/configs/ci20_defconfig
>>> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>>>    CONFIG_SERIAL_8250_INGENIC=y
>>>    CONFIG_SERIAL_OF_PLATFORM=y
>>>    # CONFIG_HW_RANDOM is not set
>>> +CONFIG_CRYPTO_USER=y
>>> +CONFIG_CRYPTO_USER_API=y
>>> +CONFIG_CRYPTO_USER_API_RNG=y
>>> +CONFIG_CRYPTO_HW=y
>>> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>>>    CONFIG_I2C=y
>>>    CONFIG_I2C_JZ4780=y
>>>    CONFIG_GPIO_SYSFS=y
>>>
>>
>> You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.
>>
>> Thanks,
>>
>> Harvey
> 
> CONFIG_MFD_SYSCON gets selected when CONFIG_CRYPTO_DEV_JZ4780_RNG is
> selected. Please see the Kconfig changes. Given that should I add it
> in ci20_defconfig? If it is required I will add and send a new
> version.

Oops, I hadn't noticed that - just skimmed the patches before my morning 
coffee. :-)

It's fine as is, excuse the noise.

> 
> Thanks,
> PrasannaKumar
> 

Thanks,

Harvey

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
@ 2017-08-23 14:51               ` Harvey Hunt
  0 siblings, 0 replies; 22+ messages in thread
From: Harvey Hunt @ 2017-08-23 14:51 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan
  Cc: Herbert Xu, David S . Miller, Rob Herring, Mark Rutland,
	Ralf Baechle, Paul Cercueil, linux-crypto, devicetree,
	linux-mips, Mathieu Malaterre, noloader

Hi PrasannaKumar,

On 23/08/17 15:50, PrasannaKumar Muralidharan wrote:
> Hi Harvey,
> 
> On 23 August 2017 at 14:39, Harvey Hunt <Harvey.Hunt@imgtec.com> wrote:
>> Hi PrasannaKumar,
>>
>> On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
>>>
>>> Enable PRNG driver support in MIPS Creator CI20 default config.
>>>
>>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
>>> ---
>>> No changes in v2
>>>
>>>    arch/mips/configs/ci20_defconfig | 5 +++++
>>>    1 file changed, 5 insertions(+)
>>>
>>> diff --git a/arch/mips/configs/ci20_defconfig
>>> b/arch/mips/configs/ci20_defconfig
>>> index b42cfa7..9f48f2c 100644
>>> --- a/arch/mips/configs/ci20_defconfig
>>> +++ b/arch/mips/configs/ci20_defconfig
>>> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>>>    CONFIG_SERIAL_8250_INGENIC=y
>>>    CONFIG_SERIAL_OF_PLATFORM=y
>>>    # CONFIG_HW_RANDOM is not set
>>> +CONFIG_CRYPTO_USER=y
>>> +CONFIG_CRYPTO_USER_API=y
>>> +CONFIG_CRYPTO_USER_API_RNG=y
>>> +CONFIG_CRYPTO_HW=y
>>> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>>>    CONFIG_I2C=y
>>>    CONFIG_I2C_JZ4780=y
>>>    CONFIG_GPIO_SYSFS=y
>>>
>>
>> You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.
>>
>> Thanks,
>>
>> Harvey
> 
> CONFIG_MFD_SYSCON gets selected when CONFIG_CRYPTO_DEV_JZ4780_RNG is
> selected. Please see the Kconfig changes. Given that should I add it
> in ci20_defconfig? If it is required I will add and send a new
> version.

Oops, I hadn't noticed that - just skimmed the patches before my morning 
coffee. :-)

It's fine as is, excuse the noise.

> 
> Thanks,
> PrasannaKumar
> 

Thanks,

Harvey

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

* Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
  2017-08-23 14:51               ` Harvey Hunt
  (?)
@ 2017-08-23 15:15               ` PrasannaKumar Muralidharan
  -1 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-23 15:15 UTC (permalink / raw)
  To: Harvey Hunt
  Cc: Herbert Xu, David S . Miller, Rob Herring, Mark Rutland,
	Ralf Baechle, Paul Cercueil, linux-crypto, devicetree,
	linux-mips, Mathieu Malaterre, noloader

Hi Harvey,

On 23 August 2017 at 20:21, Harvey Hunt <Harvey.Hunt@imgtec.com> wrote:
> Hi PrasannaKumar,
>
>
> On 23/08/17 15:50, PrasannaKumar Muralidharan wrote:
>>
>> Hi Harvey,
>>
>> On 23 August 2017 at 14:39, Harvey Hunt <Harvey.Hunt@imgtec.com> wrote:
>>>
>>> Hi PrasannaKumar,
>>>
>>> On 23/08/17 03:57, PrasannaKumar Muralidharan wrote:
>>>>
>>>>
>>>> Enable PRNG driver support in MIPS Creator CI20 default config.
>>>>
>>>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
>>>> ---
>>>> No changes in v2
>>>>
>>>>    arch/mips/configs/ci20_defconfig | 5 +++++
>>>>    1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/arch/mips/configs/ci20_defconfig
>>>> b/arch/mips/configs/ci20_defconfig
>>>> index b42cfa7..9f48f2c 100644
>>>> --- a/arch/mips/configs/ci20_defconfig
>>>> +++ b/arch/mips/configs/ci20_defconfig
>>>> @@ -88,6 +88,11 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=5
>>>>    CONFIG_SERIAL_8250_INGENIC=y
>>>>    CONFIG_SERIAL_OF_PLATFORM=y
>>>>    # CONFIG_HW_RANDOM is not set
>>>> +CONFIG_CRYPTO_USER=y
>>>> +CONFIG_CRYPTO_USER_API=y
>>>> +CONFIG_CRYPTO_USER_API_RNG=y
>>>> +CONFIG_CRYPTO_HW=y
>>>> +CONFIG_CRYPTO_DEV_JZ4780_RNG=y
>>>>    CONFIG_I2C=y
>>>>    CONFIG_I2C_JZ4780=y
>>>>    CONFIG_GPIO_SYSFS=y
>>>>
>>>
>>> You need to regenerate your defconfig as it is missing CONFIG_MFD_SYSCON.
>>>
>>> Thanks,
>>>
>>> Harvey
>>
>>
>> CONFIG_MFD_SYSCON gets selected when CONFIG_CRYPTO_DEV_JZ4780_RNG is
>> selected. Please see the Kconfig changes. Given that should I add it
>> in ci20_defconfig? If it is required I will add and send a new
>> version.
>
>
> Oops, I hadn't noticed that - just skimmed the patches before my morning
> coffee. :-)
>
> It's fine as is, excuse the noise.

No issues.

>
>>
>> Thanks,
>> PrasannaKumar
>>
>
> Thanks,
>
> Harvey
>

Regards,
PrasannaKumar

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

* Re: [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation
  2017-08-23  2:57 ` [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation PrasannaKumar Muralidharan
@ 2017-08-25 21:57   ` Rob Herring
  2017-08-26  3:20     ` PrasannaKumar Muralidharan
  0 siblings, 1 reply; 22+ messages in thread
From: Rob Herring @ 2017-08-25 21:57 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan
  Cc: herbert, davem, mark.rutland, ralf, paul, linux-crypto,
	devicetree, linux-mips, malat, noloader

On Wed, Aug 23, 2017 at 08:27:04AM +0530, PrasannaKumar Muralidharan wrote:
> Add devicetree bindings for hardware pseudo random number generator
> present in Ingenic JZ4780 SoC.
> 
> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
> ---
> Changes in v2:
> * Add "syscon" in CGU node's compatible section
> * Make RNG child node of CGU.
> 
>  .../bindings/crypto/ingenic,jz4780-rng.txt           | 20 ++++++++++++++++++++

bindings/rng/ for RNG h/w.

>  1 file changed, 20 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
> 
> diff --git a/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
> new file mode 100644
> index 0000000..a0c18e5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
> @@ -0,0 +1,20 @@
> +Ingenic jz4780 RNG driver
> +
> +Required properties:
> +- compatible : Should be "ingenic,jz4780-rng"
> +
> +Example:
> +
> +cgu: jz4780-cgu@10000000 {
> +	compatible = "ingenic,jz4780-cgu", "syscon";
> +	reg = <0x10000000 0x100>;
> +
> +	clocks = <&ext>, <&rtc>;
> +	clock-names = "ext", "rtc";
> +
> +	#clock-cells = <1>;
> +
> +	rng: rng@d8 {

unit-address requires reg property.

> +		compatible = "ingenic,jz480-rng";
> +	};
> +};
> -- 
> 2.10.0
> 

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

* Re: [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation
  2017-08-25 21:57   ` Rob Herring
@ 2017-08-26  3:20     ` PrasannaKumar Muralidharan
       [not found]       ` <CANc+2y7pD7EkSS-9ky4YDxGjk3wGW1PVZje2UXMRuOQJA=S+HA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-26  3:20 UTC (permalink / raw)
  To: Rob Herring
  Cc: Herbert Xu, David S . Miller, Mark Rutland, Ralf Baechle,
	Paul Cercueil, linux-crypto, devicetree, linux-mips,
	Mathieu Malaterre, noloader

Hi Rob,

On 26 August 2017 at 03:27, Rob Herring <robh@kernel.org> wrote:
> On Wed, Aug 23, 2017 at 08:27:04AM +0530, PrasannaKumar Muralidharan wrote:
>> Add devicetree bindings for hardware pseudo random number generator
>> present in Ingenic JZ4780 SoC.
>>
>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
>> ---
>> Changes in v2:
>> * Add "syscon" in CGU node's compatible section
>> * Make RNG child node of CGU.
>>
>>  .../bindings/crypto/ingenic,jz4780-rng.txt           | 20 ++++++++++++++++++++
>
> bindings/rng/ for RNG h/w.

There are two subsystem for dealing with RNG hw. Hw_random subsystem
for true RNG (driver/char/hw_random) and crypto framework for pseudo
RNG (crypto/ and drviers/crypto). This HW is pseudo RNG so I have
placed the dt bindings in bindings/crypto as the driver itself is in
drivers/crypto folder. I am wondering if there is any relation between
driver folder and bindings folder. Can you please explain the folder
relation? Should this be put in bindings/rng or bindings/crypto?

>
>>  1 file changed, 20 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>>
>> diff --git a/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>> new file mode 100644
>> index 0000000..a0c18e5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>> @@ -0,0 +1,20 @@
>> +Ingenic jz4780 RNG driver
>> +
>> +Required properties:
>> +- compatible : Should be "ingenic,jz4780-rng"
>> +
>> +Example:
>> +
>> +cgu: jz4780-cgu@10000000 {
>> +     compatible = "ingenic,jz4780-cgu", "syscon";
>> +     reg = <0x10000000 0x100>;
>> +
>> +     clocks = <&ext>, <&rtc>;
>> +     clock-names = "ext", "rtc";
>> +
>> +     #clock-cells = <1>;
>> +
>> +     rng: rng@d8 {
>
> unit-address requires reg property.

The driver uses regmap to access the registers. In this case reg
property is not useful. Is reg property still needed? If not, how
should the node be declared?

>
>> +             compatible = "ingenic,jz480-rng";
>> +     };
>> +};
>> --
>> 2.10.0
>>

Thanks,
PrasannaKumar

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

* Re: [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG
  2017-08-23  2:57 [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG PrasannaKumar Muralidharan
                   ` (2 preceding siblings ...)
       [not found] ` <20170823025707.27888-1-prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-08-27  6:39 ` PrasannaKumar Muralidharan
  3 siblings, 0 replies; 22+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-08-27  6:39 UTC (permalink / raw)
  To: Herbert Xu, David S . Miller, Rob Herring, Mark Rutland,
	Ralf Baechle, Paul Cercueil, linux-crypto, devicetree,
	linux-mips, Mathieu Malaterre, noloader
  Cc: PrasannaKumar Muralidharan

On 23 August 2017 at 08:27, PrasannaKumar Muralidharan
<prasannatsmkumar@gmail.com> wrote:
> This patch series adds support of pseudo random number generator found
> in Ingenic's JZ4780 and X1000 SoC.
>
> Based on Paul's review comments, add 'syscon' compatible in CGU node in
> jz4780.dtsi. jz4780-rng driver uses regmap exposed via syscon interface
> to access the RNG registers. CGU driver is not modified in this patch
> set as registers used by CGU driver and this driver are different.
>
> PrasannaKumar Muralidharan (4):
>   crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation
>   crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver
>   crypto: jz4780-rng: Add RNG node to jz4780.dtsi
>   crypto: jz4780-rng: Enable PRNG support in CI20 defconfig
>
>  .../bindings/crypto/ingenic,jz4780-rng.txt         |  20 +++
>  MAINTAINERS                                        |   5 +
>  arch/mips/boot/dts/ingenic/jz4780.dtsi             |   6 +-
>  arch/mips/configs/ci20_defconfig                   |   5 +
>  drivers/crypto/Kconfig                             |  19 +++
>  drivers/crypto/Makefile                            |   1 +
>  drivers/crypto/jz4780-rng.c                        | 168 +++++++++++++++++++++
>  7 files changed, 223 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>  create mode 100644 drivers/crypto/jz4780-rng.c
>
> --
> 2.10.0
>

The rng node which is the child node of CGU is ignored so the driver's
probe is not called at all. Realised that the tests were using crng
instead of this. Don't know how to get this working. Will submit a new
version once the issue is fixed.

Please do not take this patch series.

Thanks,
PrasannaKumar

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

* Re: [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation
  2017-08-26  3:20     ` PrasannaKumar Muralidharan
@ 2017-08-28 18:31           ` Rob Herring
  0 siblings, 0 replies; 22+ messages in thread
From: Rob Herring @ 2017-08-28 18:31 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan
  Cc: Herbert Xu, David S . Miller, Mark Rutland, Ralf Baechle,
	Paul Cercueil, linux-crypto-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Linux-MIPS, Mathieu Malaterre,
	noloader-Re5JQEeQqe8AvxtiuMwx3w

On Fri, Aug 25, 2017 at 10:20 PM, PrasannaKumar Muralidharan
<prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Rob,
>
> On 26 August 2017 at 03:27, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>> On Wed, Aug 23, 2017 at 08:27:04AM +0530, PrasannaKumar Muralidharan wrote:
>>> Add devicetree bindings for hardware pseudo random number generator
>>> present in Ingenic JZ4780 SoC.
>>>
>>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>> ---
>>> Changes in v2:
>>> * Add "syscon" in CGU node's compatible section
>>> * Make RNG child node of CGU.
>>>
>>>  .../bindings/crypto/ingenic,jz4780-rng.txt           | 20 ++++++++++++++++++++
>>
>> bindings/rng/ for RNG h/w.
>
> There are two subsystem for dealing with RNG hw. Hw_random subsystem
> for true RNG (driver/char/hw_random) and crypto framework for pseudo
> RNG (crypto/ and drviers/crypto). This HW is pseudo RNG so I have
> placed the dt bindings in bindings/crypto as the driver itself is in
> drivers/crypto folder. I am wondering if there is any relation between
> driver folder and bindings folder. Can you please explain the folder
> relation? Should this be put in bindings/rng or bindings/crypto?

There's not a 1-1 relationship though obviously there's a lot of
overlap. I'd still say this should go in bindings/rng.

>>>  1 file changed, 20 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>>> new file mode 100644
>>> index 0000000..a0c18e5
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>>> @@ -0,0 +1,20 @@
>>> +Ingenic jz4780 RNG driver
>>> +
>>> +Required properties:
>>> +- compatible : Should be "ingenic,jz4780-rng"
>>> +
>>> +Example:
>>> +
>>> +cgu: jz4780-cgu@10000000 {
>>> +     compatible = "ingenic,jz4780-cgu", "syscon";
>>> +     reg = <0x10000000 0x100>;
>>> +
>>> +     clocks = <&ext>, <&rtc>;
>>> +     clock-names = "ext", "rtc";
>>> +
>>> +     #clock-cells = <1>;
>>> +
>>> +     rng: rng@d8 {
>>
>> unit-address requires reg property.
>
> The driver uses regmap to access the registers. In this case reg
> property is not useful. Is reg property still needed? If not, how
> should the node be declared?

What the driver (currently) does is irrelevant to the binding. Your
choice is either add the reg property or name the node just "rng".
Either is fine, but better to have more information than less IMO.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation
@ 2017-08-28 18:31           ` Rob Herring
  0 siblings, 0 replies; 22+ messages in thread
From: Rob Herring @ 2017-08-28 18:31 UTC (permalink / raw)
  To: PrasannaKumar Muralidharan
  Cc: Herbert Xu, David S . Miller, Mark Rutland, Ralf Baechle,
	Paul Cercueil, linux-crypto, devicetree, Linux-MIPS,
	Mathieu Malaterre, noloader

On Fri, Aug 25, 2017 at 10:20 PM, PrasannaKumar Muralidharan
<prasannatsmkumar@gmail.com> wrote:
> Hi Rob,
>
> On 26 August 2017 at 03:27, Rob Herring <robh@kernel.org> wrote:
>> On Wed, Aug 23, 2017 at 08:27:04AM +0530, PrasannaKumar Muralidharan wrote:
>>> Add devicetree bindings for hardware pseudo random number generator
>>> present in Ingenic JZ4780 SoC.
>>>
>>> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
>>> ---
>>> Changes in v2:
>>> * Add "syscon" in CGU node's compatible section
>>> * Make RNG child node of CGU.
>>>
>>>  .../bindings/crypto/ingenic,jz4780-rng.txt           | 20 ++++++++++++++++++++
>>
>> bindings/rng/ for RNG h/w.
>
> There are two subsystem for dealing with RNG hw. Hw_random subsystem
> for true RNG (driver/char/hw_random) and crypto framework for pseudo
> RNG (crypto/ and drviers/crypto). This HW is pseudo RNG so I have
> placed the dt bindings in bindings/crypto as the driver itself is in
> drivers/crypto folder. I am wondering if there is any relation between
> driver folder and bindings folder. Can you please explain the folder
> relation? Should this be put in bindings/rng or bindings/crypto?

There's not a 1-1 relationship though obviously there's a lot of
overlap. I'd still say this should go in bindings/rng.

>>>  1 file changed, 20 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>>> new file mode 100644
>>> index 0000000..a0c18e5
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/crypto/ingenic,jz4780-rng.txt
>>> @@ -0,0 +1,20 @@
>>> +Ingenic jz4780 RNG driver
>>> +
>>> +Required properties:
>>> +- compatible : Should be "ingenic,jz4780-rng"
>>> +
>>> +Example:
>>> +
>>> +cgu: jz4780-cgu@10000000 {
>>> +     compatible = "ingenic,jz4780-cgu", "syscon";
>>> +     reg = <0x10000000 0x100>;
>>> +
>>> +     clocks = <&ext>, <&rtc>;
>>> +     clock-names = "ext", "rtc";
>>> +
>>> +     #clock-cells = <1>;
>>> +
>>> +     rng: rng@d8 {
>>
>> unit-address requires reg property.
>
> The driver uses regmap to access the registers. In this case reg
> property is not useful. Is reg property still needed? If not, how
> should the node be declared?

What the driver (currently) does is irrelevant to the binding. Your
choice is either add the reg property or name the node just "rng".
Either is fine, but better to have more information than less IMO.

Rob

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

end of thread, other threads:[~2017-08-28 18:31 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23  2:57 [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG PrasannaKumar Muralidharan
2017-08-23  2:57 ` [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation PrasannaKumar Muralidharan
2017-08-25 21:57   ` Rob Herring
2017-08-26  3:20     ` PrasannaKumar Muralidharan
     [not found]       ` <CANc+2y7pD7EkSS-9ky4YDxGjk3wGW1PVZje2UXMRuOQJA=S+HA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-28 18:31         ` Rob Herring
2017-08-28 18:31           ` Rob Herring
2017-08-23  2:57 ` [PATCH v2 2/4] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver PrasannaKumar Muralidharan
     [not found] ` <20170823025707.27888-1-prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-23  2:57   ` [PATCH v2 3/4] crypto: jz4780-rng: Add RNG node to jz4780.dtsi PrasannaKumar Muralidharan
2017-08-23  2:57     ` PrasannaKumar Muralidharan
2017-08-23 14:51     ` Ralf Baechle
2017-08-23  2:57   ` [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig PrasannaKumar Muralidharan
2017-08-23  2:57     ` PrasannaKumar Muralidharan
     [not found]     ` <20170823025707.27888-5-prasannatsmkumar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-23  9:09       ` Harvey Hunt
2017-08-23  9:09         ` Harvey Hunt
2017-08-23  9:09         ` Harvey Hunt
2017-08-23  9:09         ` Harvey Hunt
     [not found]         ` <9da7ab8b-aa81-e012-596c-54355758da83-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2017-08-23 14:50           ` PrasannaKumar Muralidharan
2017-08-23 14:50             ` PrasannaKumar Muralidharan
2017-08-23 14:51             ` Harvey Hunt
2017-08-23 14:51               ` Harvey Hunt
2017-08-23 15:15               ` PrasannaKumar Muralidharan
2017-08-27  6:39 ` [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG PrasannaKumar Muralidharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.