From patchwork Wed Feb 24 01:56:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 8398021 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 015CD9FC33 for ; Wed, 24 Feb 2016 01:56:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4DFC0202EB for ; Wed, 24 Feb 2016 01:56:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86CA52034C for ; Wed, 24 Feb 2016 01:56:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751751AbcBXB4r (ORCPT ); Tue, 23 Feb 2016 20:56:47 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:43174 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849AbcBXB4o (ORCPT ); Tue, 23 Feb 2016 20:56:44 -0500 Received: from reginn.isobedori.kobe.vergenet.net (p5023-ipbfp803kobeminato.hyogo.ocn.ne.jp [123.221.39.23]) by kirsty.vergenet.net (Postfix) with ESMTPA id B40C625BE42; Wed, 24 Feb 2016 12:56:39 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1456278999; bh=cDKsAuRB9/S/I/rjPTPGrm2btim2k79kgj0gGy9tM90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oTPPpBYM0niRKQsSC4hwqk+r2w7sh2/WocqrpbGOnAnjvguofun9RTvNRZE8t+U3O JsDQi+5GqfCKb8k8h3yqlH/NQXE1lXX6D1R3cwOprxVnV+DdPohWNOZZtbJ37M86nA 2+Nzs2AqPHRDJPrb/sS5kDhwXIVfWTetUi/+V/Lo= Received: by reginn.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id 216C69401E0; Wed, 24 Feb 2016 10:56:38 +0900 (JST) From: Simon Horman To: Wolfgang Grandegger , Marc Kleine-Budde Cc: Magnus Damm , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Simon Horman Subject: [PATCH can-next v2 1/2] CAN: rcar: add gen[12] fallback compatibility strings Date: Wed, 24 Feb 2016 10:56:32 +0900 Message-Id: <1456278993-9899-2-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456278993-9899-1-git-send-email-horms+renesas@verge.net.au> References: <1456278993-9899-1-git-send-email-horms+renesas@verge.net.au> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add fallback compatibility string for R-Car Gen 1 and Gen2. In the case of Renesas R-Car hardware we know that there are generations of SoCs, e.g. Gen 1 and Gen 2. But beyond that its not clear what the relationship between IP blocks might be. For example, I believe that r8a7779 is older than r8a7778 but that doesn't imply that the latter is a descendant of the former or vice versa. We can, however, by examining the documentation and behaviour of the hardware at run-time observe that the current driver implementation appears to be compatible with the IP blocks on SoCs within a given generation. For the above reasons and convenience when enabling new SoCs a per-generation fallback compatibility string scheme being adopted for drivers for Renesas SoCs. Signed-off-by: Simon Horman Acked-by: Rob Herring Acked-by: Geert Uytterhoeven --- v2 * Added Ack from Rob Herring * Place 'can' at the end of new compatibility strings, this is in keeping with current guidelines for compatibility string names. * Describe use of fallback compatibility strings in conjunction with per-SoC compatibility strings * Enhanced changelog text --- Documentation/devicetree/bindings/net/can/rcar_can.txt | 8 +++++++- drivers/net/can/rcar_can.c | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/can/rcar_can.txt b/Documentation/devicetree/bindings/net/can/rcar_can.txt index 002d8440bf66..f2172fb42cd8 100644 --- a/Documentation/devicetree/bindings/net/can/rcar_can.txt +++ b/Documentation/devicetree/bindings/net/can/rcar_can.txt @@ -6,6 +6,12 @@ Required properties: "renesas,can-r8a7779" if CAN controller is a part of R8A7779 SoC. "renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC. "renesas,can-r8a7791" if CAN controller is a part of R8A7791 SoC. + "renesas,rcar-gen1-can" for a generic R-Car Gen1 compatible device. + "renesas,rcar-gen2-can" for a generic R-Car Gen2 compatible device. + When compatible with the generic version, nodes must list the + SoC-specific version corresponding to the platform first + followed by the generic version. + - reg: physical base address and size of the R-Car CAN register map. - interrupts: interrupt specifier for the sole interrupt. - clocks: phandles and clock specifiers for 3 CAN clock inputs. @@ -25,7 +31,7 @@ Example SoC common .dtsi file: can0: can@e6e80000 { - compatible = "renesas,can-r8a7791"; + compatible = "renesas,can-r8a7791", "renesas,rcar-gen2-can"; reg = <0 0xe6e80000 0 0x1000>; interrupts = <0 186 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp9_clks R8A7791_CLK_RCAN0>, diff --git a/drivers/net/can/rcar_can.c b/drivers/net/can/rcar_can.c index bc46be39549d..ad3d2e0cb191 100644 --- a/drivers/net/can/rcar_can.c +++ b/drivers/net/can/rcar_can.c @@ -904,6 +904,8 @@ static const struct of_device_id rcar_can_of_table[] __maybe_unused = { { .compatible = "renesas,can-r8a7779" }, { .compatible = "renesas,can-r8a7790" }, { .compatible = "renesas,can-r8a7791" }, + { .compatible = "renesas,rcar-gen1-can" }, + { .compatible = "renesas,rcar-gen2-can" }, { } }; MODULE_DEVICE_TABLE(of, rcar_can_of_table);