From patchwork Mon Oct 31 17:13:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9406087 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D509E60721 for ; Mon, 31 Oct 2016 17:13:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1ADD28DB3 for ; Mon, 31 Oct 2016 17:13:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2C3D292E8; Mon, 31 Oct 2016 17:13:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C63428DB3 for ; Mon, 31 Oct 2016 17:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944922AbcJaRNk (ORCPT ); Mon, 31 Oct 2016 13:13:40 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:32920 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S944919AbcJaRNk (ORCPT ); Mon, 31 Oct 2016 13:13:40 -0400 Received: from ayla.of.borg ([84.193.137.253]) by michel.telenet-ops.be with bizsmtp id 2HDc1u0025UCtCs06HDcqv; Mon, 31 Oct 2016 18:13:36 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1c1G9P-0005Tj-P1; Mon, 31 Oct 2016 18:13:35 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1c1G9W-0003dv-2p; Mon, 31 Oct 2016 18:13:42 +0100 From: Geert Uytterhoeven To: "David S. Miller" , Sergei Shtylyov Cc: Simon Horman , Arnd Bergmann , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC] ravb: Support 1Gbps on R-Car H3 ES1.1+ and R-Car M3-W Date: Mon, 31 Oct 2016 18:13:38 +0100 Message-Id: <1477934018-13968-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The limitation to 10/100Mbit speeds on R-Car Gen3 is valid for R-Car H3 ES1.0 only. Check for the exact SoC model to allow 1Gbps on newer revisions of R-Car H3, and on R-Car M3-W. Signed-off-by: Geert Uytterhoeven Acked-by: David S. Miller --- Tested on: - r8a7795/salvator-x with R-Car H3 ES1.0 (limited to 100Mbps), - r8a7795/salvator-x with R-Car H3 ES1.1 (1Gbps), - r8a7796/salvator-x with R-Car M3-W ES1.0 (1Gbps). This is marked as an RFC because it depends on: A) the soc_device_match() infrastructure, B) Renesas SoC core ESx.y handling. Hence I think the best merge strategy is to let this patch go in through Simon's Renesas tree. David: If you agree, can you please provide your ack? Thanks! --- drivers/net/ethernet/renesas/ravb_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 27cfec3154c8e0f2..bf3109a413ac5721 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -977,6 +978,11 @@ static void ravb_adjust_link(struct net_device *ndev) phy_print_status(phydev); } +static const struct soc_device_attribute r8a7795es10[] = { + { .soc_id = "r8a7795", .revision = "ES1.0", }, + { /* sentinel */ } +}; + /* PHY init function */ static int ravb_phy_init(struct net_device *ndev) { @@ -1011,10 +1017,10 @@ static int ravb_phy_init(struct net_device *ndev) return -ENOENT; } - /* This driver only support 10/100Mbit speeds on Gen3 + /* This driver only support 10/100Mbit speeds on R-Car H3 ES1.0 * at this time. */ - if (priv->chip_id == RCAR_GEN3) { + if (soc_device_match(r8a7795es10)) { int err; err = phy_set_max_speed(phydev, SPEED_100);