lkml.org 
[lkml]   [2021]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/16] soc: renesas: Add support to read LSI DEVID register
Date
Add support for reading the LSI DEVID register which is present on
RZ/G2{L,LC,UL} SoC's.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/soc/renesas/renesas-soc.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c
index 0f8eff4a641a..d73389670eef 100644
--- a/drivers/soc/renesas/renesas-soc.c
+++ b/drivers/soc/renesas/renesas-soc.c
@@ -64,7 +64,7 @@ static const struct renesas_family fam_shmobile __initconst __maybe_unused = {

struct renesas_soc {
const struct renesas_family *family;
- u8 id;
+ u32 id;
};

static const struct renesas_soc soc_rz_a1h __initconst __maybe_unused = {
@@ -348,6 +348,25 @@ static int __init renesas_soc_init(void)
goto done;
}

+ np = of_find_compatible_node(NULL, NULL, "renesas,devid");
+ if (np) {
+ chipid = of_iomap(np, 0);
+ of_node_put(np);
+
+ if (chipid) {
+ product = readl(chipid);
+ iounmap(chipid);
+
+ if (soc->id && (product & 0xfffffff) != soc->id) {
+ pr_warn("SoC mismatch (product = 0x%x)\n",
+ product);
+ return -ENODEV;
+ }
+ }
+
+ goto done;
+ }
+
/* Try PRR first, then hardcoded fallback */
np = of_find_compatible_node(NULL, NULL, "renesas,prr");
if (np) {
--
2.17.1
\
 
 \ /
  Last update: 2021-05-14 21:29    [W:0.269 / U:1.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site