From patchwork Mon Apr 19 04:03:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Lipnitskiy X-Patchwork-Id: 12210681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 393C5C433B4 for ; Mon, 19 Apr 2021 04:06:33 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B242660241 for ; Mon, 19 Apr 2021 04:06:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B242660241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=N7yLLJt+hVk+P8mxPkwL0+ylR+HfIbA065b0H/sjnZg=; b=eeMSLl6NGcKXbo00UIFaQyCD+ Id+xhAX6ttjl18oVcE1H2PlPXqv6MdLE6drz5nT2rPQqwUBNJJf6cbg73VolDPML7skjYdlmI6JN5 Upm65p82vOydCQqGydjmtzjOTJInvTr677bhs2FSRX6QuaovysC6RDNSQyBU5xTtY/TY+DHu3l0hi g+vpVNorSjJ4fuSv2bPtM5AtJn7FK0KPTgtq8FeS2yQ2WuRK/SszqFKMhU8thjfRMLyNkeOHwrcVD /B6CTHFwjHjLnq//KCQZwrLjgRCWrzBg2DDjWSVcYqgbiqnk5OYy6O7/nEyRGCBzSJzMOhCvrmq3o 5Qx/pOrMA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYL97-00921z-RD; Mon, 19 Apr 2021 04:04:26 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYL8u-00920p-Kr; Mon, 19 Apr 2021 04:04:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=d6IeN222L2AvMC3BWodguJL4uvfgEGERLTNiOfhrG14=; b=ANOIjEGVw2z3BGEkb6Z6HVRAiH Tp3OR11j5b99QUPCk4xLTQaoTIUF0FaTRJUuMBlZn4ZFiThjcf8ACKRTNw0AKTSL9mXIE5EBbefBT LX+zcgQFyIFSSQpH8ZnYVBFupWitsqOVLgzrFaxEzfCrH02y/h5DWWMI+0YssH8l9FIOUjjvyd1Og KCHYMJBXlwMKx/qQUmqblWbYm65ZAxmjQ+4uxL7ZwHthbXRH38xpWL67TbyAOmNbwx/oJdkpn09KO qYTqzcRewyZDvH66XTotaCblIgQuEsXtojxmlb3Zrn0YC2cEwgmplwUiZwtUy1GDRAuVdVxGjJ4s6 G2BFbsUA==; Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYL8r-00Awy7-2a; Mon, 19 Apr 2021 04:04:10 +0000 Received: by mail-pg1-x52d.google.com with SMTP id y32so23317563pga.11; Sun, 18 Apr 2021 21:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d6IeN222L2AvMC3BWodguJL4uvfgEGERLTNiOfhrG14=; b=hp1kcgZxFWT8L4BFkOKZifS1WtozMEz2JHpzcAYKcXyohrFfbFPqyKBqsn6UVaaE92 ujAG3bWmhL7fMQVAsynqU56t4V8rqWcZM2VbZgtgwennO/CJhtf1sTkk6FGc3altf0Ke 1UwCM7LXFIO9ZJSvQcL2W0XjXxaG3YIjDYXnPO1G4BE4HKn4BKET0yY9EiWLcBlntNmS 1S6AyBdFKVYPoAwXDqWVaD5gSI8grL8VtmgZ3YMIEgEFDklO0tDT8J4YWoy+/VZ/ExRZ XtHqAm4SXDdMYLHfBTTo4Axxo02/L/eko/10X4PPiPJsffZ4902yw7hixvGgfRFgB1H5 i9XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d6IeN222L2AvMC3BWodguJL4uvfgEGERLTNiOfhrG14=; b=CvMhuqm3Rowo5rc///MrrnPd3nz6eVqkHHFk2Yavxm6qTdfVLvdedvchKtjr8oijj4 E0XJxBXgKyIYdRlrYX5LOXDif1ACBfR6q5siTDEQGKbDIP7wZuFmugHrUQoOL21jbdZc AbjoAMQ8Oj+j7NMka3xbZmq2/zX/T5os73Q0uzd4B0QBg6b6IStG/fkC2sY7azJiHTpT MkmKw9BPdApIhklIcoxMQO5xaAgQ7mKR2RtH3qwSwkyrHUe7qVeeHNtQRGgl9G4dvLZd /pkMLpyeR9YcD0RWPFyKrbwmDXXvmMIasmeYZtfRsIgYgTuy4oAdeCi+aqcWmBz3KVMM sKug== X-Gm-Message-State: AOAM5328VJ73GqFmY8+MK5nJjai/PAAe5y7P8xuCyGXaQLB2RavWKbVN f0LtG6NsJTLCdLDInnTBUcc= X-Google-Smtp-Source: ABdhPJySGEplzNOMXbX8mZJ9ih1HgpaLsQcB9orNv5Od5eujgBSB/bPGQSA2iseT8Vp27TAWSqWWcQ== X-Received: by 2002:a65:42c3:: with SMTP id l3mr8072387pgp.258.1618805047563; Sun, 18 Apr 2021 21:04:07 -0700 (PDT) Received: from z640-arch.lan ([2602:61:7344:f100::678]) by smtp.gmail.com with ESMTPSA id 25sm12169423pgx.72.2021.04.18.21.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 21:04:07 -0700 (PDT) From: Ilya Lipnitskiy To: "David S. Miller" , Jakub Kicinski , Rob Herring , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Matthias Brugger , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Ilya Lipnitskiy Subject: [PATCH net-next 1/2] dt-bindings: net: mediatek: add optional GMAC labels Date: Sun, 18 Apr 2021 21:03:51 -0700 Message-Id: <20210419040352.2452-2-ilya.lipnitskiy@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419040352.2452-1-ilya.lipnitskiy@gmail.com> References: <20210419040352.2452-1-ilya.lipnitskiy@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210418_210409_142988_9BAC1BF1 X-CRM114-Status: GOOD ( 11.83 ) 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 Document the mediatek ethernet driver change that adds support for custom labels and provide an example. Signed-off-by: Ilya Lipnitskiy --- Documentation/devicetree/bindings/net/mediatek-net.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt index 72d03e07cf7c..500bf9351010 100644 --- a/Documentation/devicetree/bindings/net/mediatek-net.txt +++ b/Documentation/devicetree/bindings/net/mediatek-net.txt @@ -51,6 +51,10 @@ Required properties: is equal to 0 and the MAC uses fixed-link to connect with internal switch such as MT7530. +Optional properties: +- label: overrides the default netdevice name. Useful when a custom name for the + DSA master interface is desired. + Example: eth: ethernet@1b100000 { @@ -74,12 +78,14 @@ eth: ethernet@1b100000 { gmac1: mac@0 { compatible = "mediatek,eth-mac"; + label = "gmac1"; reg = <0>; phy-handle = <&phy0>; }; gmac2: mac@1 { compatible = "mediatek,eth-mac"; + label = "gmac2"; reg = <1>; phy-handle = <&phy1>; }; From patchwork Mon Apr 19 04:03:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ilya Lipnitskiy X-Patchwork-Id: 12210683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1AFBC433B4 for ; Mon, 19 Apr 2021 04:06:40 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 249D0610A1 for ; Mon, 19 Apr 2021 04:06:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 249D0610A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=dm3aCXwlsVjIL7gI05SFAaQmuba+CxvEdFZpGW7K2jE=; b=YbaNlcPXl0bjMYDyenbZhrfFU iji5hW2G2K+/J2aKOtSTlIvkcoOYPyNSp+Y19L8AdUROYqaku+8IuhY3lmb0611kODLn4dJzdTqYS fs7qD4I8tJpmGZ5DSOI3Gh8yc4mjhnxuJ02Bj5UkAKk67Y2PFSlosqhR4atjJlxffHuUG8fGqho/o 8UNNWrPuuzy1jIAv52GqT8trd3TnDN01EEfWmhS1daQLK4IkmL3RD9FcqXFZ4ED9drPVKtjqPZL+J f7U+JDGGiAmGIjDhVxPqjF81/97rbqCgASCUqivfcQevxaK/U85fr4naMhWVRgSClOZWJaqQMXKrG m648mpkdg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYL9K-00923M-3f; Mon, 19 Apr 2021 04:04:38 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYL8x-00921D-Tb; Mon, 19 Apr 2021 04:04:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=nooF0bh3uQe/ilf/ttra6OUts5vU91KPBygIK+rN8CU=; b=Rs07f4amdW34dT8Zxmhebb87w/ ZfOLpVeSDcy2wib2S/kCHkCleqcWAHg1K+XN/qcfsoZrox7b/QqdD2HblNUBPxrnPWD92dfWhNnPh 4pc27XzLAkHrAWKa0wE+1Eeq9qurDs1npE8p6/6m8LiFA2lq8zUYB46C+kHXir/06jFEPiw2F4tJo Kpq2b7eXSgLS3yyRQLPkDY5PYQNICh6rhuTUjhfIj3djGoMqZEn7oJx8RU538CXM8TehRXlo+qpiW puq5KnTqpJSrIV8iJP0cXv6/MzLsxP9dEXDB9fmFniup/iDytZ9pV2VSJI611arNsrSpJ/cvMEhob nhjGr4Bw==; Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYL8s-00AwyY-CH; Mon, 19 Apr 2021 04:04:14 +0000 Received: by mail-pf1-x434.google.com with SMTP id w6so7760990pfc.8; Sun, 18 Apr 2021 21:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nooF0bh3uQe/ilf/ttra6OUts5vU91KPBygIK+rN8CU=; b=lAE1M2kH8mYGvH4QI2ZOpm39wWa82gcbp2UhP0pd8YfHtS/cOHPn9k/+8vBbmYjPJQ B7YLOHcKKQodQni2ID6ZRG2C0cTCaYNx0r8PsACXLeUGRwGlqUl6sFPiguWqasIDKqv7 9sQbY2hmfpnYLHWq9rpDcQ8NcaTO9VZfmP6dzOiwAOykn5lV7XDx4ktxT1rTQzVPy/K8 EoGHHeIwtJ2vkaSTMK03l0Ffalq/2ItfJ/UjGYt33pY8UzUOtJc4ki8GM+TECddbVxH9 gZBsQUe370IvM+hutvbSC+uZlHx4BTSlVKqXbdZ4kLdJaD68OVyJoBhG9DWErIBZWrLm Ucbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nooF0bh3uQe/ilf/ttra6OUts5vU91KPBygIK+rN8CU=; b=Xd77az0tUDVP5af6Sw9Z6QHzyoV3+YXxbWhaATJFUSYomnFvMa8aDGVcImOehQ1ern yjxCijdzH7pSlnNcsLJapkAJfE2VsiQx7MotQGunMEzZQiQ5r/sOlLjJiSZvzDlCBDgw rGf5kV+nSGRDD+mrKmuDmUa7UITky1B0jPCDf5LqLDl6F02szEvGOtn1hqsuk3WTRg5z otuCVtrnR0QNzQFF83GhyBtHiJUzb1Uw6L4oykHsyVuRRMSPtge2QbTUdtMwq6+n70P0 5OWQW/Ubb/dqx7YbVlGMqSP/4gP1xNxunPI8QZjJCt1agiasuvQFhDU4Yvx2ivZefzL3 Q9Mg== X-Gm-Message-State: AOAM533nspRjlFVI+zaH2baKQUoYmGDYk3KC7LZiIsKf/nVo60O0Ogw5 hIA1kgRlmjZjEqptT4Bra44= X-Google-Smtp-Source: ABdhPJz2bKhFE3qPTDDPaQXc8tpwKJvnnZWr0+4qR2uTa5yoJE0Y33ONufXaKA1nPG7HARQ8c5C9Tw== X-Received: by 2002:a63:5f54:: with SMTP id t81mr3727918pgb.286.1618805048816; Sun, 18 Apr 2021 21:04:08 -0700 (PDT) Received: from z640-arch.lan ([2602:61:7344:f100::678]) by smtp.gmail.com with ESMTPSA id 25sm12169423pgx.72.2021.04.18.21.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 21:04:08 -0700 (PDT) From: Ilya Lipnitskiy To: "David S. Miller" , Jakub Kicinski , Rob Herring , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Matthias Brugger , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Ilya Lipnitskiy , =?utf-8?q?Ren=C3=A9_van_Dor?= =?utf-8?q?st?= Subject: [PATCH net-next 2/2] net: ethernet: mediatek: support custom GMAC label Date: Sun, 18 Apr 2021 21:03:52 -0700 Message-Id: <20210419040352.2452-3-ilya.lipnitskiy@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419040352.2452-1-ilya.lipnitskiy@gmail.com> References: <20210419040352.2452-1-ilya.lipnitskiy@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210418_210410_458588_4F2E440C X-CRM114-Status: GOOD ( 14.26 ) 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 The MAC device name can now be set within DTS file instead of always being "ethX". This is helpful for DSA to clearly label the DSA master device and distinguish it from DSA slave ports. For example, some devices, such as the Ubiquiti EdgeRouter X, may have ports labeled ethX. Labeling the master GMAC with a different prefix than DSA ports helps with clarity. Suggested-by: René van Dorst Signed-off-by: Ilya Lipnitskiy --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 6b00c12c6c43..4c0ce4fb7735 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2845,6 +2845,7 @@ static const struct net_device_ops mtk_netdev_ops = { static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { + const char *label = of_get_property(np, "label", NULL); const __be32 *_id = of_get_property(np, "reg", NULL); phy_interface_t phy_mode; struct phylink *phylink; @@ -2940,6 +2941,9 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) else eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN; + if (label) + strscpy(eth->netdev[id]->name, label, IFNAMSIZ); + return 0; free_netdev: