From patchwork Thu Jan 13 05:37:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Boger X-Patchwork-Id: 12712305 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 04064C433F5 for ; Thu, 13 Jan 2022 05:39:17 +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=P+PQl2TQ251gqKR/JNcSt689ATiuvnZVTH7bw5EpA8E=; b=bzg6j50NolRGzP LfugpxagxKL0RTN8HO11q7B8DOLBjB26N97P91kcjMu0rJZX5mYnDD3ueiSsIILdOlKBlvhx7gCah xoOFvMUKC/nI+H25AaUd08PHlI9VlNTW8YKE/HgKi9RG8PY5yx+Ajv/lKyw+6/spuziQ5+QImTL2N ApCFreJei9mUj057fEf7BKYi9QaqLpqxsj+4Lkka+dSE8Z2/I6zdIVhoF4Oq3pPwKjbZOtFhEQUdZ Ntgawaj8fdBKVcgHXWN4sfDLlN0z2hM82ymVLWisCpzXdrx+gRShC5w3PMlsZQYXbvlKaOt80F7B/ lv5xgD8xxqaDrbowHNhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7so7-004i8f-54; Thu, 13 Jan 2022 05:37:55 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7so3-004i6v-1P for linux-arm-kernel@lists.infradead.org; Thu, 13 Jan 2022 05:37:52 +0000 Received: by mail-lf1-x12f.google.com with SMTP id m1so15762150lfq.4 for ; Wed, 12 Jan 2022 21:37:48 -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=fer7mUkd7brJ1mxdjvl5SPv5rmLRsQ3o5FR92yeQeCo=; b=mfzcu7ZvALRtO+M4LyO9ux3ZJNvxIXq+EuN5zKHltFJOVdTiSdvQgXAZ5QVJ64QMgP 5tKalUAC6iMi+Z8Sa9xO7RsvQwsBCJJIslkvfHyt86oaJ3ONSs2S6EZm1zJkXE4Po71e DmzbsLSPXl8VZcLp8hhOS5Jm8vVFktXkyscYenD/BL6fkSYAhqs8ybqakU07Ctghx5xP bzD6IMq+dFWIwN4pdtHPEqRDAPvUECzKjGMND/XIbfmQYEhdzcem7K/4XyurjNWrK21g pmoYGR+cKJlISCVoyuxAc3RfOG7DS+tKUT+vwrUv9iBLZuq1p1kzaCGHhe4bATpMb7Ve hOeQ== 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=fer7mUkd7brJ1mxdjvl5SPv5rmLRsQ3o5FR92yeQeCo=; b=HthZpksps90jwir5b2Ni4+CAkf5HCgkv4cyn46YbODKbfLEXVBtxZ3gw4Og3MyS6OA tct8oq6bScXb8cgFkhur50S5xueDOR93UkUozWYSFq2udV3EAppUcNzikY0zzbHz2bdj b/MO+fd8m+dkFH/IlUfLGbTicD99r+U2rVTg7oEcpmEZ+JPO2lKJmUW8i8EMvtanNzzs vEPuaxPH5a3c/Y7T+AkMxLyxoDqt2LPsGduKezKUiUiwELPnuSJQPweVSX+Sp2v1Am+1 OC16riK/bJZ9s90c7PW6bAMT4iCR8U7qnAjrE8JGY582awVVP6mCLY+QXgkJ7dKiKIUr XtrA== X-Gm-Message-State: AOAM533KkuoVhEjMtHMQu+gox/vEtbe8lRUOrK/qfptLtghGw1VZy3Bo ZouT+IulgIwACEABJmt6dm4DpQ== X-Google-Smtp-Source: ABdhPJwIZMKX//1tHJPBIbf2ecJ2fhAtfSrS1g129oAi1cqR243lLBMeSgWiQ2++JG2MVQXJ0gg8qg== X-Received: by 2002:a05:651c:a0e:: with SMTP id k14mr1952570ljq.514.1642052265598; Wed, 12 Jan 2022 21:37:45 -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 x21sm180212lfa.296.2022.01.12.21.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 21:37:45 -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 v5 0/3] sun8i: r40: second ethernet support Date: Thu, 13 Jan 2022 08:37:31 +0300 Message-Id: <20220113053734.105813-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-20220112_213751_107903_5B4B1590 X-CRM114-Status: GOOD ( 14.67 ) 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 Maxime, Corentin, thank you for the review of v4! 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 v5: - Rebase on fresh linux-next - Remove reset line from example bindings 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 | 17 ++++- arch/arm/boot/dts/sun8i-r40.dtsi | 49 ++++++++++++++ drivers/net/ethernet/allwinner/sun4i-emac.c | 64 +++++++++++++++++-- 3 files changed, 124 insertions(+), 6 deletions(-)