aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.4/950-0419-hwrng-iproc-rng200-Correct-SoC-name.patch
blob: f4e93308b13e223c0b1c8c3e4fd7a00f8b088a90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From 5eafa5065b2ea2c8d1634f045b85b982393d808a Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Fri, 31 Jan 2020 09:36:57 +0000
Subject: [PATCH] hwrng: iproc-rng200: Correct SoC name

The Pi 4 SoC is called BCM2711, not BCM2838.

Fixes: "hwrng: iproc-rng200: Add BCM2838 support"

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 drivers/char/hw_random/Kconfig        |  2 +-
 drivers/char/hw_random/iproc-rng200.c | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -94,7 +94,7 @@ config HW_RANDOM_IPROC_RNG200
 	default HW_RANDOM
 	---help---
 	  This driver provides kernel-side support for the RNG200
-	  hardware found on the Broadcom iProc, BCM2838 and STB SoCs.
+	  hardware found on the Broadcom iProc, BCM2711 and STB SoCs.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called iproc-rng200
--- a/drivers/char/hw_random/iproc-rng200.c
+++ b/drivers/char/hw_random/iproc-rng200.c
@@ -174,7 +174,7 @@ static int iproc_rng200_init(struct hwrn
 	return 0;
 }
 
-static int bcm2838_rng200_read(struct hwrng *rng, void *buf, size_t max,
+static int bcm2711_rng200_read(struct hwrng *rng, void *buf, size_t max,
 			       bool wait)
 {
 	struct iproc_rng200_dev *priv = to_rng_priv(rng);
@@ -211,7 +211,7 @@ static int bcm2838_rng200_read(struct hw
 	return num_words * sizeof(u32);
 }
 
-static int bcm2838_rng200_init(struct hwrng *rng)
+static int bcm2711_rng200_init(struct hwrng *rng)
 {
 	struct iproc_rng200_dev *priv = to_rng_priv(rng);
 	uint32_t val;
@@ -271,9 +271,9 @@ static int iproc_rng200_probe(struct pla
 	priv->rng.name = pdev->name;
 	priv->rng.cleanup = iproc_rng200_cleanup;
 
-	if (of_device_is_compatible(dev->of_node, "brcm,bcm2838-rng200")) {
-		priv->rng.init = bcm2838_rng200_init;
-		priv->rng.read = bcm2838_rng200_read;
+	if (of_device_is_compatible(dev->of_node, "brcm,bcm2711-rng200")) {
+		priv->rng.init = bcm2711_rng200_init;
+		priv->rng.read = bcm2711_rng200_read;
 	} else {
 		priv->rng.init = iproc_rng200_init;
 		priv->rng.read = iproc_rng200_read;
@@ -296,7 +296,6 @@ static const struct of_device_id iproc_r
 	{ .compatible = "brcm,bcm7211-rng200", },
 	{ .compatible = "brcm,bcm7278-rng200", },
 	{ .compatible = "brcm,iproc-rng200", },
-	{ .compatible = "brcm,bcm2838-rng200"},
 	{},
 };
 MODULE_DEVICE_TABLE(of, iproc_rng200_of_match);