Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4012467ybi; Mon, 27 May 2019 09:25:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYbotQARnALf/CSMyIgV0AQTt6D0L80/2gCTybTvrgIRDcoxsSjEY+k1TYgMoI7ls0gj9S X-Received: by 2002:aa7:8c1a:: with SMTP id c26mr137435219pfd.25.1558974322455; Mon, 27 May 2019 09:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558974322; cv=none; d=google.com; s=arc-20160816; b=qAvIhMdQ+v6vFLvHkD1bmhAZfAbBAjm1mZKWHr9ecMUEn8B53JViKanpe8t98/tAq3 rQwSQWBLqdgO9HXsEGW/f+Ploa+w0GKraneOncIkJR7rK4eE9ZP7GZrWgNKJoLCfkLLW AOwdWLHJSvuOtQY+xtvu6xgSOExbbL6ta6gcqdAR/jS5QCu57wOj1938vl0QdXOeLcEy nA9zyW3B81KeWOMKWsonevDTUGAqyFyvt14be/yQuU0rezrEtTRkBz5g6dF/uqKDNPlK xOjm9Wxt+Hx7w82LfByucs8t58FFqn7Btj+mSwHO/obKLs4vrpujvfXGzBDIemGIEvF7 JpIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7QJ1vWAGwX/Z7KdigaaZuTZyv4CmmsWojo0kwH2ixLg=; b=JGqnuF3ma9Yu6uWHPNxx0bRGiQApykaoRwQ9tIfy3LuHBA0ZyP1QQzy8vCd7TxYoEI C0bzbXkb88o02+urTpnWNDEW6yPp3xcY4zTozAlYSLD8VzsMOiEoR7gAwLE4av2aN7NZ U2wMebktZ5oUmLfnxIaGlYHXc6tyAXQ3oFmvTsTGyLE3PFS0mPFA4tymJZEEf9qtY912 xDe+oqeRj0VvrKy2hY4PYp/LBukS6nJGQwFHU8ZFgpjges8PGkEBPCeGFQPwl1Xpuj9s iiTXthkJmoAheHAnBp1GeEOWEEDKrK+GNOQ1Y3aSQrGl7oVU/f4Xf5s2LYS9WRlmkqqG UJYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=jtRJyTN0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p23si17458194pgj.356.2019.05.27.09.25.07; Mon, 27 May 2019 09:25:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=jtRJyTN0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727160AbfE0QXT (ORCPT + 99 others); Mon, 27 May 2019 12:23:19 -0400 Received: from vps.xff.cz ([195.181.215.36]:52504 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726733AbfE0QWl (ORCPT ); Mon, 27 May 2019 12:22:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1558974159; bh=W1eysqnIHUZkksJlW6Nnyz1rUD5/k0fxV0/y2AwBQ70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jtRJyTN0mda0dMEzqcL/RsuQH3ecGfIJExMPybYmhP/91ewbQ8PMdd0t02M7thPNb GLx+i1A+NAnqwhvXQb8kcP73pcszhszejUdUlmzP1pa+CTgXFB7L4O3QLKLmKczsFa br6uJjWMkUjgR9ciFeZpdqhKN/3ii65yVduiLv/Y= From: megous@megous.com To: linux-sunxi@googlegroups.com, Maxime Ripard , Chen-Yu Tsai , Rob Herring Cc: Icenowy Zheng , David Airlie , Daniel Vetter , Mark Rutland , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Ondrej Jirman Subject: [PATCH v6 1/6] net: stmmac: sun8i: add support for Allwinner H6 EMAC Date: Mon, 27 May 2019 18:22:32 +0200 Message-Id: <20190527162237.18495-2-megous@megous.com> In-Reply-To: <20190527162237.18495-1-megous@megous.com> References: <20190527162237.18495-1-megous@megous.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Icenowy Zheng The EMAC on Allwinner H6 is just like the one on A64. The "internal PHY" on H6 is on a co-packaged AC200 chip, and it's not really internal (it's connected via RMII at PA GPIO bank). Add support for the Allwinner H6 EMAC in the dwmac-sun8i driver. Signed-off-by: Icenowy Zheng Signed-off-by: Ondrej Jirman --- .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index ba124a4da793..3258dec84d55 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -147,6 +147,20 @@ static const struct emac_variant emac_variant_a64 = { .tx_delay_max = 7, }; +static const struct emac_variant emac_variant_h6 = { + .default_syscon_value = 0x50000, + .syscon_field = &sun8i_syscon_reg_field, + /* The "Internal PHY" of H6 is not on the die. It's on the + * co-packaged AC200 chip instead. + */ + .soc_has_internal_phy = false, + .support_mii = true, + .support_rmii = true, + .support_rgmii = true, + .rx_delay_max = 31, + .tx_delay_max = 7, +}; + #define EMAC_BASIC_CTL0 0x00 #define EMAC_BASIC_CTL1 0x04 #define EMAC_INT_STA 0x08 @@ -1212,6 +1226,8 @@ static const struct of_device_id sun8i_dwmac_match[] = { .data = &emac_variant_r40 }, { .compatible = "allwinner,sun50i-a64-emac", .data = &emac_variant_a64 }, + { .compatible = "allwinner,sun50i-h6-emac", + .data = &emac_variant_h6 }, { } }; MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); -- 2.21.0