From patchwork Sat Jun 17 14:07:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 9794103 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 580C9600C5 for ; Sat, 17 Jun 2017 14:19:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49BBD20564 for ; Sat, 17 Jun 2017 14:19:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E7A72843F; Sat, 17 Jun 2017 14:19:28 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F2B9F20564 for ; Sat, 17 Jun 2017 14:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZM/0vHaCWV7/PAq6Xo5sXdKKtviZK3oUVFZrRRYaAg8=; b=BC1YsY4hQndRtd3P8jg45lstmB bJ46JjCtgmnjEv4lTvW3Low42dRPZO1381sjAMPjp57qjLqVsu9DO23JMYK2Y+O+GRcGHt2oa86HE zep511UF2+CiXlpzBNri7XAz6qj7VgaPCmkzRztjrr4iaY2Y++ejHvmpKuI/tTx+LQDDq6SA3B3yL X7LxcivMtAKv4dvYVFCo/wi1Z1NplU1IdViMZPe3sPJo74hAnK8Rp0lZCSo0T7iI9tya25mN7BdnU WojVBpD4tS+RVYhQ4TfQ6zlRXVW/v8a9LYMGozpwyZjxgEbnMx4YRk9/1MT9mP7CySlZkfZz/xDU4 X93CqHxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dMEZT-0006Yu-5T; Sat, 17 Jun 2017 14:19:27 +0000 Received: from nov-007-i457.relay.mailchannels.net ([46.232.183.11]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dMEQL-00020Q-Ib for linux-arm-kernel@lists.infradead.org; Sat, 17 Jun 2017 14:10:06 +0000 X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E4DC3126A6A; Sat, 17 Jun 2017 14:09:36 +0000 (UTC) Received: from hermes.aosc.io (unknown [100.96.126.254]) (Authenticated sender: lmn-TZDUIOWCRQMW) by relay.mailchannels.net (Postfix) with ESMTPA id E616D126C03; Sat, 17 Jun 2017 14:09:34 +0000 (UTC) X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from hermes.aosc.io (hermes.aosc.io [172.20.63.30]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.9.4); Sat, 17 Jun 2017 14:09:36 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io X-MailChannels-Auth-Id: lmn-TZDUIOWCRQMW X-Glossy-Battle: 1570ff0907441043_1497708576098_948406069 X-MC-Loop-Signature: 1497708576098:1347333215 X-MC-Ingress-Time: 1497708576095 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id B87A5522F5; Sat, 17 Jun 2017 14:09:28 +0000 (UTC) From: Icenowy Zheng To: Rob Herring , LABBE Corentin , "David S . Miller" , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 4/4] net-next: stmmac: dwmac-sun8i: add support for V3s EMAC Date: Sat, 17 Jun 2017 22:07:37 +0800 Message-Id: <20170617140737.41951-5-icenowy@aosc.io> In-Reply-To: <20170617140737.41951-1-icenowy@aosc.io> References: <20170617140737.41951-1-icenowy@aosc.io> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170617_071003_275185_36F16775 X-CRM114-Status: UNSURE ( 8.01 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, Icenowy Zheng MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Allwinner V3s SoC has an Ethernet MAC and an internal PHY like the ones in H3 SoC, however the MAC has no external *MII interfaces available at GPIOs, thus only MII connection to internal PHY is supported. Add this variant of EMAC to dwmac-sun8i driver. The default value of the syscon EMAC-related register seems to have changed from H3, but it seems to be a harmless change. Signed-off-by: Icenowy Zheng --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 8 ++++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 61ce3b54f0c6..fffd6d5fc907 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -81,6 +81,12 @@ static const struct emac_variant emac_variant_h3 = { .support_rgmii = true }; +static const struct emac_variant emac_variant_v3s = { + .default_syscon_value = 0x38000, + .internal_phy = PHY_INTERFACE_MODE_MII, + .support_mii = true +}; + static const struct emac_variant emac_variant_a83t = { .default_syscon_value = 0, .internal_phy = 0, @@ -975,6 +981,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) static const struct of_device_id sun8i_dwmac_match[] = { { .compatible = "allwinner,sun8i-h3-emac", .data = &emac_variant_h3 }, + { .compatible = "allwinner,sun8i-v3s-emac", + .data = &emac_variant_v3s }, { .compatible = "allwinner,sun8i-a83t-emac", .data = &emac_variant_a83t }, { .compatible = "allwinner,sun50i-a64-emac", diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 3840529344ed..a366b3747eeb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -313,6 +313,7 @@ static int stmmac_dt_phy(struct plat_stmmacenet_data *plat, { .compatible = "snps,dwc-qos-ethernet-4.10" }, { .compatible = "allwinner,sun8i-a83t-emac" }, { .compatible = "allwinner,sun8i-h3-emac" }, + { .compatible = "allwinner,sun8i-v3s-emac" }, { .compatible = "allwinner,sun50i-a64-emac" }, };