From patchwork Tue Jan 11 16:05:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Boger X-Patchwork-Id: 12709992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A50D6C433EF for ; Tue, 11 Jan 2022 16:07:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=eDTlzQ8y5PYQLy29Imu98hLJiM3/SjphTsgfdvGodYs=; b=IaXIfIG446yz4M IZFO1NzKDHsLwUweiKhq8r7JjKkHzDJyAsBk2W/VdypQqOWEDzQoi5mf+B2r1/fZh7NpfCiZ4avOK JC92UN2qjey+z83ymsDGSdrGvJPWReOOVErXBU9yq4CiwZDLIiwrLbou/DNBr7fxLfzZTs5jI5YYq e8Y9iKMSERMTkzcTv44Xzb1HFHkHkluthvRvd7vND0/5ijNwj9qVS7H9gGjV68xZY+sRUiKVyCUlB uxWKg9gO+n+fKaoAjw0gXOkeIzPh+DFBbjxqXC/BR4ZEZvODXYtdtdguuFxhlKUzKU68dKK6NqLiD 4Rb+hB1xZ2r1A7nluS3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Jf5-00Gr3T-Gl; Tue, 11 Jan 2022 16:06:15 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Jf0-00Gr1v-Rx for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 16:06:12 +0000 Received: by mail-lf1-x131.google.com with SMTP id x22so5402162lfd.10 for ; Tue, 11 Jan 2022 08:06:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirenboard-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ghCDsraBhx6Ux8rsiyXEwiYUcJ8M/xjPGCENEP2UbME=; b=e0kJjUgUxHp/VPD89/E1WMXF0/g+/axHS12C152VR7HHMXYXnmg9mdWzS3JjjlnGno oNzQOeqUATKXCSy1TzedjcJ0fJPPV2EyUTIF/OT37Y4w4cDHWhIfB5xAuHHn1Q4xe/4i Vnfs5fhVEVQN83KNpVhZnWijNbGnK1TmrhSZxN4nzpbsMkKUyCq9ObgEy59iWS48kP5L mDuo24jgz/i+1mUazwGg94H2cdZlV2vk+fnuTJL296V4Yys0ZTb8t1Zc8Fh2Mkufepm4 p/qCcRX/lwP0VOF0YnBPmrfSdpucXZPT739Bwjc+76G2sPG8wfqUlWnIUePZY7mszdVc k+/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ghCDsraBhx6Ux8rsiyXEwiYUcJ8M/xjPGCENEP2UbME=; b=WCWLp/c3bRcqaJfjY15gzXaMUcxOzZ4tOw0Th3mOeHSQFwwU/ExPhGpg619F3Y2NKL UUe9dFMVWU4Y6RdxoYSRjj1D78j43WYtdxuYp1eWCvWyouWz3Kk0ioYAu/rWMpQWB9O3 dvJbDXKmeHfAd6mSzOJyNnGZBP4Pt3/bpwkC9YYONLx8xhHPknGtnbUgx4BPFkaGCbef mTnyHSuIyotd4yJIJXHXK/c0cqF8j6SqyVLgtuCtBOQXWC5cRwkROAp+wEpY07QVUI1z RPabzVHY+k5vi1dsHE09tGukpG5QH14SFDQJKCdrAX0iByH0ztxt54xBCB3FBTdKXjFE R9aA== X-Gm-Message-State: AOAM533xbVRe/TJBXigIDCsg8qlVGtpkA49hROJDWuW3mSFu7kXd+IBd gcrZ7SNxIATUTLxOZS+jcGabig== X-Google-Smtp-Source: ABdhPJyUJJFMl6VSkQTIjNLaY78aGkxmsDaJn7BrSOtOKpX4kY3z83dn8nHRT59jVfk6K6f9LH3vWw== X-Received: by 2002:ac2:5624:: with SMTP id b4mr2932527lff.308.1641917169464; Tue, 11 Jan 2022 08:06:09 -0800 (PST) Received: from boger-laptop.lan (81.5.110.253.dhcp.mipt-telecom.ru. [81.5.110.253]) by smtp.gmail.com with ESMTPSA id k39sm564803lfv.150.2022.01.11.08.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 08:06:08 -0800 (PST) From: Evgeny Boger To: Maxime Ripard , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org Cc: Evgeny Boger , devicetree@vger.kernel.org, Rob Herring , linux-sunxi@lists.linux.dev Subject: [PATCH v4 0/3] sun8i: r40: second ethernet support Date: Tue, 11 Jan 2022 19:05:57 +0300 Message-Id: <20220111160600.58384-1-boger@wirenboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_080610_938614_93B20BA3 X-CRM114-Status: GOOD ( 14.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch series adds support for two Ethernet ports on Allwinner R40. R40 (aka V40,A40i,T3) has two different Ethernet IPs called EMAC and GMAC. EMAC only support 10/100 Mbit in MII mode, while GMAC support both 10/100 (MII) and 10/100/1000 (RGMII). In contrast to A10/A20 where GMAC and EMAC share the same pins making EMAC somewhat pointless, on R40 EMAC can be routed to port H. Both EMAC (on port H) and GMAC (on port A) can be then enabled at the same time, allowing for two ethernet ports. Tested on custom A40i board with two IP101GRI PHYs in MII mode. Changes in v4: - Rename sun4i-r40-emac to sun8i-r40-emac to match R40 family. - remove redundant status = "okay" in dts - less obscure commit messages Changes in v3: Minor fixes in bindings. Rebased on top of linux-next/master. dt_bindings_check and dtbs_check passed. - bindings: separate commit for DT bindings - bindings: simplify handling of compatible strings - bindings: make resets property required on R40 - dts: get rid of duplicate node Changes in v2: - EMAC reset is no longer optional on R40 - Add a new DT compatible string for R40 EMAC - Deassert reset line before enabling the clock - minor fixes: formatting, DT node order, leftover pinctrl props Evgeny Boger (3): net: allwinner: reset control support dt-bindings: net: support for Allwinner R40 EMAC controller ARM: dts: sun8i: r40: add second ethernet support .../net/allwinner,sun4i-a10-emac.yaml | 20 +++++- arch/arm/boot/dts/sun8i-r40.dtsi | 49 ++++++++++++++ drivers/net/ethernet/allwinner/sun4i-emac.c | 64 +++++++++++++++++-- 3 files changed, 127 insertions(+), 6 deletions(-)