* [PATCH 0/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver
@ 2024-10-30 21:33 Markus Mayer
2024-10-30 21:33 ` [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG Markus Mayer
2024-10-30 21:33 ` [PATCH 2/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver Markus Mayer
0 siblings, 2 replies; 10+ messages in thread
From: Markus Mayer @ 2024-10-30 21:33 UTC (permalink / raw)
To: Olivia Mackall, Herbert Xu, Aurelien Jarno, Conor Dooley,
Daniel Golle, Florian Fainelli, Francesco Dolcini,
Krzysztof Kozlowski, Krzysztof Kozlowski, Rob Herring
Cc: Markus Mayer, Device Tree Mailing List, Linux Crypto Mailing List,
Linux Kernel Mailing List
This series adds a driver for the random number generator found on the
BCM74110 SoC.
Markus Mayer (2):
dt-bindings: rng: add binding for BCM74110 RNG
hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver
.../bindings/rng/brcm,bcm74110.yaml | 35 +++++
drivers/char/hw_random/Kconfig | 14 ++
drivers/char/hw_random/Makefile | 1 +
drivers/char/hw_random/bcm74110-rng.c | 125 ++++++++++++++++++
4 files changed, 175 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
create mode 100644 drivers/char/hw_random/bcm74110-rng.c
--
2.46.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG
2024-10-30 21:33 [PATCH 0/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver Markus Mayer
@ 2024-10-30 21:33 ` Markus Mayer
2024-10-30 21:42 ` Florian Fainelli
` (2 more replies)
2024-10-30 21:33 ` [PATCH 2/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver Markus Mayer
1 sibling, 3 replies; 10+ messages in thread
From: Markus Mayer @ 2024-10-30 21:33 UTC (permalink / raw)
To: Olivia Mackall, Herbert Xu, Aurelien Jarno, Conor Dooley,
Daniel Golle, Florian Fainelli, Francesco Dolcini,
Krzysztof Kozlowski, Krzysztof Kozlowski, Rob Herring
Cc: Markus Mayer, Device Tree Mailing List, Linux Crypto Mailing List,
Linux Kernel Mailing List
Add a binding for the random number generator used on the BCM74110.
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
.../bindings/rng/brcm,bcm74110.yaml | 35 +++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
new file mode 100644
index 000000000000..acd0856cee72
--- /dev/null
+++ b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rng/brcm,bcm74110.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: BCM74110 Random number generator
+
+description: |
+ Random number generator used on the BCM74110.
+
+maintainers:
+ - Markus Mayer <mmayer@broadcom.com>
+ - Florian Fainelli <florian.fainelli@broadcom.com>
+
+properties:
+ compatible:
+ enum:
+ - brcm,bcm74110-rng
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ rng: rng@83ba000 {
+ compatible = "brcm,bcm74110-trng";
+ reg = <0x83ba000 0x14>;
+ };
--
2.46.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver
2024-10-30 21:33 [PATCH 0/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver Markus Mayer
2024-10-30 21:33 ` [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG Markus Mayer
@ 2024-10-30 21:33 ` Markus Mayer
2024-10-30 21:41 ` Florian Fainelli
1 sibling, 1 reply; 10+ messages in thread
From: Markus Mayer @ 2024-10-30 21:33 UTC (permalink / raw)
To: Olivia Mackall, Herbert Xu, Aurelien Jarno, Conor Dooley,
Daniel Golle, Florian Fainelli, Francesco Dolcini,
Krzysztof Kozlowski, Krzysztof Kozlowski, Rob Herring
Cc: Markus Mayer, Device Tree Mailing List, Linux Crypto Mailing List,
Linux Kernel Mailing List
Add a driver for the random number generator present on the Broadcom
BCM74110 SoC.
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
drivers/char/hw_random/Kconfig | 14 +++
drivers/char/hw_random/Makefile | 1 +
drivers/char/hw_random/bcm74110-rng.c | 125 ++++++++++++++++++++++++++
3 files changed, 140 insertions(+)
create mode 100644 drivers/char/hw_random/bcm74110-rng.c
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index b51d9e243f35..90ae35aeb23a 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -99,6 +99,20 @@ config HW_RANDOM_BCM2835
If unsure, say Y.
+config HW_RANDOM_BCM74110
+ tristate "Broadcom BCM74110 Random Number Generator support"
+ depends on ARCH_BCM2835 || ARCH_BCM_NSP || ARCH_BCM_5301X || \
+ ARCH_BCMBCA || BCM63XX || ARCH_BRCMSTB || COMPILE_TEST
+ default HW_RANDOM
+ help
+ This driver provides kernel-side support for the Random Number
+ Generator hardware found on the Broadcom BCM74110 SoCs.
+
+ To compile this driver as a module, choose M here: the
+ module will be called bcm74110-rng
+
+ If unsure, say Y.
+
config HW_RANDOM_IPROC_RNG200
tristate "Broadcom iProc/STB RNG200 support"
depends on ARCH_BCM_IPROC || ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST
diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile
index 01f012eab440..283791f5462d 100644
--- a/drivers/char/hw_random/Makefile
+++ b/drivers/char/hw_random/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_HW_RANDOM_POWERNV) += powernv-rng.o
obj-$(CONFIG_HW_RANDOM_HISI) += hisi-rng.o
obj-$(CONFIG_HW_RANDOM_HISTB) += histb-rng.o
obj-$(CONFIG_HW_RANDOM_BCM2835) += bcm2835-rng.o
+obj-$(CONFIG_HW_RANDOM_BCM74110) += bcm74110-rng.o
obj-$(CONFIG_HW_RANDOM_IPROC_RNG200) += iproc-rng200.o
obj-$(CONFIG_HW_RANDOM_ST) += st-rng.o
obj-$(CONFIG_HW_RANDOM_XGENE) += xgene-rng.o
diff --git a/drivers/char/hw_random/bcm74110-rng.c b/drivers/char/hw_random/bcm74110-rng.c
new file mode 100644
index 000000000000..5c64148e91f1
--- /dev/null
+++ b/drivers/char/hw_random/bcm74110-rng.c
@@ -0,0 +1,125 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2024 Broadcom
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/module.h>
+#include <linux/mod_devicetable.h>
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/random.h>
+#include <linux/hw_random.h>
+
+#define HOST_REV_ID 0x00
+#define HOST_FIFO_DEPTH 0x04
+#define HOST_FIFO_COUNT 0x08
+#define HOST_FIFO_THRESHOLD 0x0c
+#define HOST_FIFO_DATA 0x10
+
+#define HOST_FIFO_COUNT_MASK 0xffff
+
+/* Delay range in microseconds */
+#define FIFO_DELAY_MIN_US 3
+#define FIFO_DELAY_MAX_US 7
+#define FIFO_DELAY_MAX_COUNT 10
+
+struct bcm74110_priv {
+ void __iomem *base;
+};
+
+static inline int bcm74110_rng_fifo_count(void __iomem *mem)
+{
+ return readl_relaxed(mem) & HOST_FIFO_COUNT_MASK;
+}
+
+static int bcm74110_rng_read(struct hwrng *rng, void *buf, size_t max,
+ bool wait)
+{
+ struct bcm74110_priv *priv = (struct bcm74110_priv *)rng->priv;
+ void __iomem *fc_addr = priv->base + HOST_FIFO_COUNT;
+ void __iomem *fd_addr = priv->base + HOST_FIFO_DATA;
+ unsigned underrun_count = 0;
+ u32 max_words = max / sizeof(u32);
+ u32 num_words;
+ unsigned i;
+
+ /*
+ * We need to check how many words are available in the RNG FIFO. If
+ * there aren't any, we need to wait for some to become available.
+ */
+ while ((num_words = bcm74110_rng_fifo_count(fc_addr)) == 0) {
+ if (!wait)
+ return 0;
+ /*
+ * As a precaution, limit how long we wait. If the FIFO doesn't
+ * refill within the allotted time, return 0 (=no data) to the
+ * caller.
+ */
+ if (likely(underrun_count < FIFO_DELAY_MAX_COUNT))
+ usleep_range(FIFO_DELAY_MIN_US, FIFO_DELAY_MAX_US);
+ else
+ return 0;
+ underrun_count++;
+ }
+ if (num_words > max_words)
+ num_words = max_words;
+
+ /* Bail early if we run out of random numbers unexpectedly */
+ for (i = 0; i < num_words && bcm74110_rng_fifo_count(fc_addr) > 0; i++)
+ ((u32 *)buf)[i] = readl_relaxed(fd_addr);
+
+ return i * sizeof(u32);
+}
+
+static struct hwrng bcm74110_hwrng = {
+ .read = bcm74110_rng_read,
+};
+
+static int bcm74110_rng_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct bcm74110_priv *priv;
+ int rc;
+
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ bcm74110_hwrng.name = pdev->name;
+ bcm74110_hwrng.priv = (unsigned long)priv;
+
+ priv->base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(priv->base))
+ return PTR_ERR(priv->base);
+
+ rc = devm_hwrng_register(dev, &bcm74110_hwrng);
+ if (rc)
+ dev_err(dev, "hwrng registration failed (%d)\n", rc);
+ else
+ dev_info(dev, "hwrng registered\n");
+
+ return rc;
+}
+
+static const struct of_device_id bcm74110_rng_match[] = {
+ { .compatible = "brcm,bcm74110-rng", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, bcm74110_rng_match);
+
+static struct platform_driver bcm74110_rng_driver = {
+ .driver = {
+ .name = KBUILD_MODNAME,
+ .of_match_table = bcm74110_rng_match,
+ },
+ .probe = bcm74110_rng_probe,
+};
+module_platform_driver(bcm74110_rng_driver);
+
+MODULE_AUTHOR("Markus Mayer <mmayer@broadcom.com>");
+MODULE_DESCRIPTION("BCM 74110 Random Number Generator (RNG) driver");
+MODULE_LICENSE("GPL v2");
--
2.46.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver
2024-10-30 21:33 ` [PATCH 2/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver Markus Mayer
@ 2024-10-30 21:41 ` Florian Fainelli
2024-10-31 18:35 ` Markus Mayer
0 siblings, 1 reply; 10+ messages in thread
From: Florian Fainelli @ 2024-10-30 21:41 UTC (permalink / raw)
To: Markus Mayer, Olivia Mackall, Herbert Xu, Aurelien Jarno,
Conor Dooley, Daniel Golle, Francesco Dolcini,
Krzysztof Kozlowski, Krzysztof Kozlowski, Rob Herring
Cc: Device Tree Mailing List, Linux Crypto Mailing List,
Linux Kernel Mailing List
On 10/30/24 14:33, Markus Mayer wrote:
> Add a driver for the random number generator present on the Broadcom
> BCM74110 SoC.
>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
> drivers/char/hw_random/Kconfig | 14 +++
> drivers/char/hw_random/Makefile | 1 +
> drivers/char/hw_random/bcm74110-rng.c | 125 ++++++++++++++++++++++++++
> 3 files changed, 140 insertions(+)
> create mode 100644 drivers/char/hw_random/bcm74110-rng.c
>
> diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
> index b51d9e243f35..90ae35aeb23a 100644
> --- a/drivers/char/hw_random/Kconfig
> +++ b/drivers/char/hw_random/Kconfig
> @@ -99,6 +99,20 @@ config HW_RANDOM_BCM2835
>
> If unsure, say Y.
>
> +config HW_RANDOM_BCM74110
> + tristate "Broadcom BCM74110 Random Number Generator support"
> + depends on ARCH_BCM2835 || ARCH_BCM_NSP || ARCH_BCM_5301X || \
> + ARCH_BCMBCA || BCM63XX || ARCH_BRCMSTB || COMPILE_TEST
AFAICT this driver is only present on STB chips so limiting to
ARCH_BRCMSTB || COMPILE_TEST should suffice for now.
--
Florian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG
2024-10-30 21:33 ` [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG Markus Mayer
@ 2024-10-30 21:42 ` Florian Fainelli
2024-10-30 22:36 ` Rob Herring (Arm)
2024-10-31 7:29 ` Krzysztof Kozlowski
2 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2024-10-30 21:42 UTC (permalink / raw)
To: Markus Mayer, Olivia Mackall, Herbert Xu, Aurelien Jarno,
Conor Dooley, Daniel Golle, Francesco Dolcini,
Krzysztof Kozlowski, Krzysztof Kozlowski, Rob Herring
Cc: Device Tree Mailing List, Linux Crypto Mailing List,
Linux Kernel Mailing List
On 10/30/24 14:33, Markus Mayer wrote:
> Add a binding for the random number generator used on the BCM74110.
>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
> .../bindings/rng/brcm,bcm74110.yaml | 35 +++++++++++++++++++
> 1 file changed, 35 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
This file should be named, brcm,bcm74110-rng.yaml, I believe.
--
Florian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG
2024-10-30 21:33 ` [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG Markus Mayer
2024-10-30 21:42 ` Florian Fainelli
@ 2024-10-30 22:36 ` Rob Herring (Arm)
2024-10-31 7:29 ` Krzysztof Kozlowski
2 siblings, 0 replies; 10+ messages in thread
From: Rob Herring (Arm) @ 2024-10-30 22:36 UTC (permalink / raw)
To: Markus Mayer
Cc: Florian Fainelli, Conor Dooley, Aurelien Jarno, Olivia Mackall,
Krzysztof Kozlowski, Device Tree Mailing List,
Linux Crypto Mailing List, Krzysztof Kozlowski, Francesco Dolcini,
Herbert Xu, Daniel Golle, Linux Kernel Mailing List
On Wed, 30 Oct 2024 14:33:54 -0700, Markus Mayer wrote:
> Add a binding for the random number generator used on the BCM74110.
>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
> .../bindings/rng/brcm,bcm74110.yaml | 35 +++++++++++++++++++
> 1 file changed, 35 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/rng/brcm,bcm74110.example.dtb: /example-0/rng@83ba000: failed to match any schema with compatible: ['brcm,bcm74110-trng']
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241030213400.802264-2-mmayer@broadcom.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG
2024-10-30 21:33 ` [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG Markus Mayer
2024-10-30 21:42 ` Florian Fainelli
2024-10-30 22:36 ` Rob Herring (Arm)
@ 2024-10-31 7:29 ` Krzysztof Kozlowski
2024-10-31 18:55 ` Markus Mayer
2 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-31 7:29 UTC (permalink / raw)
To: Markus Mayer, Olivia Mackall, Herbert Xu, Aurelien Jarno,
Conor Dooley, Daniel Golle, Florian Fainelli, Francesco Dolcini,
Krzysztof Kozlowski, Rob Herring
Cc: Device Tree Mailing List, Linux Crypto Mailing List,
Linux Kernel Mailing List
On 30/10/2024 22:33, Markus Mayer wrote:
> Add a binding for the random number generator used on the BCM74110.
>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
> .../bindings/rng/brcm,bcm74110.yaml | 35 +++++++++++++++++++
> 1 file changed, 35 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>
> diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
> new file mode 100644
> index 000000000000..acd0856cee72
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
Filename as compatible.
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rng/brcm,bcm74110.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: BCM74110 Random number generator
> +
> +description: |
Do not need '|' unless you need to preserve formatting.
> + Random number generator used on the BCM74110.
> +
> +maintainers:
> + - Markus Mayer <mmayer@broadcom.com>
> + - Florian Fainelli <florian.fainelli@broadcom.com>
> +
> +properties:
> + compatible:
> + enum:
> + - brcm,bcm74110-rng
That's not what you have in DTS.
> +
> + reg:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + rng: rng@83ba000 {
Drop unused label.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver
2024-10-30 21:41 ` Florian Fainelli
@ 2024-10-31 18:35 ` Markus Mayer
0 siblings, 0 replies; 10+ messages in thread
From: Markus Mayer @ 2024-10-31 18:35 UTC (permalink / raw)
To: Florian Fainelli
Cc: Olivia Mackall, Herbert Xu, Aurelien Jarno, Conor Dooley,
Daniel Golle, Francesco Dolcini, Krzysztof Kozlowski, Rob Herring,
Device Tree Mailing List, Linux Crypto Mailing List,
Linux Kernel Mailing List
On Wed, 30 Oct 2024 at 14:41, Florian Fainelli
<florian.fainelli@broadcom.com> wrote:
>
> On 10/30/24 14:33, Markus Mayer wrote:
> > Add a driver for the random number generator present on the Broadcom
> > BCM74110 SoC.
> >
> > Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> > ---
> > drivers/char/hw_random/Kconfig | 14 +++
> > drivers/char/hw_random/Makefile | 1 +
> > drivers/char/hw_random/bcm74110-rng.c | 125 ++++++++++++++++++++++++++
> > 3 files changed, 140 insertions(+)
> > create mode 100644 drivers/char/hw_random/bcm74110-rng.c
> >
> > diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
> > index b51d9e243f35..90ae35aeb23a 100644
> > --- a/drivers/char/hw_random/Kconfig
> > +++ b/drivers/char/hw_random/Kconfig
> > @@ -99,6 +99,20 @@ config HW_RANDOM_BCM2835
> >
> > If unsure, say Y.
> >
> > +config HW_RANDOM_BCM74110
> > + tristate "Broadcom BCM74110 Random Number Generator support"
> > + depends on ARCH_BCM2835 || ARCH_BCM_NSP || ARCH_BCM_5301X || \
> > + ARCH_BCMBCA || BCM63XX || ARCH_BRCMSTB || COMPILE_TEST
>
> AFAICT this driver is only present on STB chips so limiting to
> ARCH_BRCMSTB || COMPILE_TEST should suffice for now.
This is now fixed in my tree. I will resend in a few days.
Regards,
-Markus
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG
2024-10-31 7:29 ` Krzysztof Kozlowski
@ 2024-10-31 18:55 ` Markus Mayer
2024-11-01 6:50 ` Krzysztof Kozlowski
0 siblings, 1 reply; 10+ messages in thread
From: Markus Mayer @ 2024-10-31 18:55 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Olivia Mackall, Herbert Xu, Aurelien Jarno, Conor Dooley,
Daniel Golle, Florian Fainelli, Francesco Dolcini,
Krzysztof Kozlowski, Rob Herring, Device Tree Mailing List,
Linux Crypto Mailing List, Linux Kernel Mailing List
On Thu, 31 Oct 2024 at 00:29, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 30/10/2024 22:33, Markus Mayer wrote:
> > Add a binding for the random number generator used on the BCM74110.
> >
> > Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> > ---
> > .../bindings/rng/brcm,bcm74110.yaml | 35 +++++++++++++++++++
> > 1 file changed, 35 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
> > new file mode 100644
> > index 000000000000..acd0856cee72
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>
> Filename as compatible.
I am not sure what you mean by this. That the filename should match
the compatible string? I did change the filename to
brcm,bcm74110-rng.yaml the ID to
http://devicetree.org/schemas/rng/brcm,bcm74110-rng.yaml# in response
to Florian's comment from yesterday.
> > @@ -0,0 +1,35 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/rng/brcm,bcm74110.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: BCM74110 Random number generator
> > +
> > +description: |
>
> Do not need '|' unless you need to preserve formatting.
Removed.
> > + Random number generator used on the BCM74110.
> > +
> > +maintainers:
> > + - Markus Mayer <mmayer@broadcom.com>
> > + - Florian Fainelli <florian.fainelli@broadcom.com>
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - brcm,bcm74110-rng
>
> That's not what you have in DTS.
Fixed in the DTS to be "brcm,bcm74110-rng" everywhere.
> > +
> > + reg:
> > + maxItems: 1
> > +
> > +required:
> > + - compatible
> > + - reg
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + rng: rng@83ba000 {
>
> Drop unused label.
Done.
I am giving it a bit more time for additional feedback (on the driver
and the binding) and will send v2 in a few days. Meanwhile, the
generated DTS (with the changes incorporated) is now looking like
this:
$ cat ./Documentation/devicetree/bindings/rng/brcm,bcm74110-rng.example.dts
/dts-v1/;
/plugin/; // silence any missing phandle references
/{
compatible = "foo";
model = "foo";
#address-cells = <1>;
#size-cells = <1>;
example-0 {
#address-cells = <1>;
#size-cells = <1>;
rng@83ba000 {
compatible = "brcm,bcm74110-rng";
reg = <0x83ba000 0x14>;
};
};
};
Thanks,
-Markus
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG
2024-10-31 18:55 ` Markus Mayer
@ 2024-11-01 6:50 ` Krzysztof Kozlowski
0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-01 6:50 UTC (permalink / raw)
To: Markus Mayer
Cc: Olivia Mackall, Herbert Xu, Aurelien Jarno, Conor Dooley,
Daniel Golle, Florian Fainelli, Francesco Dolcini,
Krzysztof Kozlowski, Rob Herring, Device Tree Mailing List,
Linux Crypto Mailing List, Linux Kernel Mailing List
On 31/10/2024 19:55, Markus Mayer wrote:
> On Thu, 31 Oct 2024 at 00:29, Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 30/10/2024 22:33, Markus Mayer wrote:
>>> Add a binding for the random number generator used on the BCM74110.
>>>
>>> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
>>> ---
>>> .../bindings/rng/brcm,bcm74110.yaml | 35 +++++++++++++++++++
>>> 1 file changed, 35 insertions(+)
>>> create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>>> new file mode 100644
>>> index 000000000000..acd0856cee72
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>>
>> Filename as compatible.
>
> I am not sure what you mean by this. That the filename should match
> the compatible string? I did change the filename to
Yes.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-11-01 6:50 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30 21:33 [PATCH 0/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver Markus Mayer
2024-10-30 21:33 ` [PATCH 1/2] dt-bindings: rng: add binding for BCM74110 RNG Markus Mayer
2024-10-30 21:42 ` Florian Fainelli
2024-10-30 22:36 ` Rob Herring (Arm)
2024-10-31 7:29 ` Krzysztof Kozlowski
2024-10-31 18:55 ` Markus Mayer
2024-11-01 6:50 ` Krzysztof Kozlowski
2024-10-30 21:33 ` [PATCH 2/2] hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver Markus Mayer
2024-10-30 21:41 ` Florian Fainelli
2024-10-31 18:35 ` Markus Mayer
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).