From: Dirk Behme <dirk.behme@de.bosch.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
Simon Horman <horms+renesas@verge.net.au>,
<linux-renesas-soc@vger.kernel.org>,
Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Cc: Dirk Behme <dirk.behme@de.bosch.com>
Subject: [PATCH 1/4] ARM: Renesas: R-Car3: Add product register support
Date: Wed, 25 May 2016 10:58:25 +0200 [thread overview]
Message-ID: <1464166708-18320-2-git-send-email-dirk.behme@de.bosch.com> (raw)
In-Reply-To: <1464166708-18320-1-git-send-email-dirk.behme@de.bosch.com>
The product register of the Renesas R-Car3 isn't part of any SoC
module, but "just" a register at address 0xFFF00044.
It provides some configuration information about the SoC itself, like
the number of the CA57, CA53 and CR7 cores, the product description
(R-Car H3, R-Car M3-W etc) and the sample revision.
This information is needed by some drivers to enable or disable
specific features which are present or not in the SoC.
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
---
drivers/soc/renesas/Makefile | 4 ++--
drivers/soc/renesas/rcar3-prr.c | 49 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 2 deletions(-)
create mode 100644 drivers/soc/renesas/rcar3-prr.c
diff --git a/drivers/soc/renesas/Makefile b/drivers/soc/renesas/Makefile
index cd85cd5..d39990a 100644
--- a/drivers/soc/renesas/Makefile
+++ b/drivers/soc/renesas/Makefile
@@ -4,5 +4,5 @@ obj-$(CONFIG_ARCH_R8A7791) += rcar-sysc.o r8a7791-sysc.o
# R-Car M2-N is identical to R-Car M2-W w.r.t. power domains.
obj-$(CONFIG_ARCH_R8A7793) += rcar-sysc.o r8a7791-sysc.o
obj-$(CONFIG_ARCH_R8A7794) += rcar-sysc.o r8a7794-sysc.o
-obj-$(CONFIG_ARCH_R8A7795) += rcar-sysc.o r8a7795-sysc.o
-obj-$(CONFIG_ARCH_R8A7796) += rcar-sysc.o r8a7796-sysc.o
+obj-$(CONFIG_ARCH_R8A7795) += rcar-sysc.o r8a7795-sysc.o rcar3-prr.o
+obj-$(CONFIG_ARCH_R8A7796) += rcar-sysc.o r8a7796-sysc.o rcar3-prr.o
diff --git a/drivers/soc/renesas/rcar3-prr.c b/drivers/soc/renesas/rcar3-prr.c
new file mode 100644
index 0000000..8fda1c2
--- /dev/null
+++ b/drivers/soc/renesas/rcar3-prr.c
@@ -0,0 +1,49 @@
+/*
+ * R-Car3 Product Register (PRR) support
+ *
+ * Copyright (C) 2016 Robert Bosch Car Multimedia GmbH
+ * Dirk Behme <dirk.behme@de.bosch.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+unsigned int __rcar3_prr;
+EXPORT_SYMBOL(__rcar3_prr);
+
+static const struct of_device_id rcar3_prr_ids[] __initconst = {
+ { .compatible = "renesas,rcar-gen3-prr" },
+ {}
+};
+
+static int __init rcar3_read_prr(void)
+{
+ struct device_node *np;
+ void __iomem *prr;
+
+ np = of_find_matching_node(NULL, rcar3_prr_ids);
+ if (!np) {
+ pr_err("can't find renesas,rcar-gen3-prr device node");
+ return -ENOENT;
+ }
+
+ prr = of_iomap(np, 0);
+ if (!prr) {
+ pr_err("failed to map product register");
+ of_node_put(np);
+ return -ENOMEM;
+ }
+
+ __rcar3_prr = ioread32(prr);
+
+ iounmap(prr);
+ of_node_put(np);
+
+ return 0;
+}
+early_initcall(rcar3_read_prr);
--
2.8.0
next prev parent reply other threads:[~2016-05-25 8:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 8:58 [PATCH 0/4] ARM: Renesas: R-Car3: Add product register support Dirk Behme
2016-05-25 8:58 ` Dirk Behme [this message]
2016-05-25 8:58 ` [PATCH 2/4] arm64: dts: Renesas: R-Car3: Add product register Dirk Behme
2016-05-25 8:58 ` [PATCH 3/4] ARM: Renesas: R-Car3: Add cpu and revision handlers Dirk Behme
2016-05-25 8:58 ` [PATCH 4/4] drm: rcar-du: Use product register framework Dirk Behme
2016-05-27 3:40 ` Magnus Damm
2016-05-27 8:16 ` Dirk Behme
2016-05-27 9:56 ` Magnus Damm
2016-05-27 10:18 ` Dirk Behme
2016-06-01 2:33 ` Magnus Damm
2016-05-26 7:14 ` [PATCH 0/4] ARM: Renesas: R-Car3: Add product register support Geert Uytterhoeven
2016-05-26 7:48 ` Dirk Behme
2016-05-27 3:13 ` Magnus Damm
2016-05-27 7:56 ` Dirk Behme
2016-05-27 8:39 ` Geert Uytterhoeven
2016-05-27 8:44 ` Dirk Behme
2016-05-27 9:00 ` Geert Uytterhoeven
2016-06-01 5:19 ` Magnus Damm
2016-06-01 7:19 ` Dirk Behme
2016-06-01 7:27 ` Geert Uytterhoeven
2016-06-01 7:38 ` Dirk Behme
2016-06-01 8:26 ` Geert Uytterhoeven
2016-06-01 8:36 ` Dirk Behme
2016-06-01 8:40 ` Geert Uytterhoeven
2016-06-01 8:43 ` Dirk Behme
2016-06-29 7:58 ` Dirk Behme
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464166708-18320-2-git-send-email-dirk.behme@de.bosch.com \
--to=dirk.behme@de.bosch.com \
--cc=geert+renesas@glider.be \
--cc=horms+renesas@verge.net.au \
--cc=koji.matsuoka.xm@renesas.com \
--cc=linux-renesas-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox