diff mbox

[2/3] soc: renesas: Identify R-Car M3-W ES1.1

Message ID 1509384599-28953-3-git-send-email-geert+renesas@glider.be (mailing list archive)
State Accepted
Commit 90f0d2b344313a8a4c366ef60d0df33008d2be84
Delegated to: Simon Horman
Headers show

Commit Message

Geert Uytterhoeven Oct. 30, 2017, 5:29 p.m. UTC
The Product Register of R-Car M3-W ES1.1 incorrectly identifies the SoC
revision as ES2.0.  Add a workaround to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Is it already known how future revisions will be identified?
---
 drivers/soc/renesas/renesas-soc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Simon Horman Nov. 1, 2017, 8:42 a.m. UTC | #1
On Mon, Oct 30, 2017 at 06:29:58PM +0100, Geert Uytterhoeven wrote:
> The Product Register of R-Car M3-W ES1.1 incorrectly identifies the SoC
> revision as ES2.0.  Add a workaround to fix this.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Is it already known how future revisions will be identified?

I'd like there to be some sort of conclusion to that discussion before
applying that patch (I seem to recall we discussed it some time ago
but I don't recall the outcome). The reason that I am being cautious here
is that it potentially has implications for old-kernel/new-SoC compatibility
which may be hard to fix later.

I am happy to apply the other patches in the series if you think that is
worthwhile.
Simon Horman Nov. 10, 2017, 9:26 a.m. UTC | #2
On Wed, Nov 01, 2017 at 09:42:38AM +0100, Simon Horman wrote:
> On Mon, Oct 30, 2017 at 06:29:58PM +0100, Geert Uytterhoeven wrote:
> > The Product Register of R-Car M3-W ES1.1 incorrectly identifies the SoC
> > revision as ES2.0.  Add a workaround to fix this.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > Is it already known how future revisions will be identified?
> 
> I'd like there to be some sort of conclusion to that discussion before
> applying that patch (I seem to recall we discussed it some time ago
> but I don't recall the outcome). The reason that I am being cautious here
> is that it potentially has implications for old-kernel/new-SoC compatibility
> which may be hard to fix later.
> 
> I am happy to apply the other patches in the series if you think that is
> worthwhile.

After some discussion off-list I am now satisfied that the approach you
have taken - to special case as identifying ES1.1 as what would otherwise
be identified ES2.0 - is not likely to cause problems with future SoC
releases.

I have applied this patch for v4.16.
diff mbox

Patch

diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c
index f8389ed2249f9816..5c7f920ff060957a 100644
--- a/drivers/soc/renesas/renesas-soc.c
+++ b/drivers/soc/renesas/renesas-soc.c
@@ -293,6 +293,9 @@  static int __init renesas_soc_init(void)
 	if (chipid) {
 		product = readl(chipid);
 		iounmap(chipid);
+		/* R-Car M3-W ES1.1 incorrectly identifies as ES2.0 */
+		if ((product & 0x7fff) == 0x5210)
+			product ^= 0x11;
 		if (soc->id && ((product >> 8) & 0xff) != soc->id) {
 			pr_warn("SoC mismatch (product = 0x%x)\n", product);
 			return -ENODEV;