From patchwork Mon Apr 19 15:46:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Lipnitskiy X-Patchwork-Id: 12212161 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 2BA95C43461 for ; Mon, 19 Apr 2021 15:49:20 +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 A78A561246 for ; Mon, 19 Apr 2021 15:49:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A78A561246 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=qYI0Cw+G8CoxZ5JTnEUG/+MdJ oqGIOZfBsSDSg7YuZCti+0nrguNJ20uFuaDtj709l2qHFKCa//4hdKguNbFVh/YCTuhtR5qPFBnzB RfZrfvJ2Yy1cH61oBi7McWahlLQVx9CaFPQzoOnASR1adhmkw9PY4B02vATxKoy8nYGd4MuRHzquZ T9S3BH/i5anLb9U+XG+iGJhbnWNwOJP7FD4H3Wt9I2VTWbKc7HA98E4/qlesKat6Y1avRO4fQxjuH ObvH1n9EWivZE0wsiKmF0VDWoTOrco/AnX26tSS4Zz3H5l6s/wS4wy0QA3TXsSe5j8polanx+qjHR s14VGiGlQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYW7E-00ADE8-I6; Mon, 19 Apr 2021 15:47:12 +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 1lYW7C-00ADDt-1N; Mon, 19 Apr 2021 15:47:10 +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=kWF7fGk/GHa2HthowEb2nWOuyT nwA8+aZeFQDMB/bcnZXOXztNPiEgu7rAolhqF9/9yU8KKtMLNY+yoBr0pCCB8CVCMcTDSJuXpSnHz x3/tbY6inxEtW5zPKlPuErdQWk2muP8aMnZFOha38cqc5ly7NSr7rwVtadEmyHqLUPImYPfBZCXmq h2dlivGH9nFdfR1cklcGMGfgRji0FC7RUTWJQ5PNWmT80lR/oiR9OU0dndO/ZAXjVO7grLNMm86nV qrHpTu33I464ejPgIaW3mc807KIM78kHNgK1gmou9wJqBESm4ZBlLnjYDubBopQ1PaeU2x0GnA6fK Yz8RDeRg==; Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYW79-00BUwa-BF; Mon, 19 Apr 2021 15:47:08 +0000 Received: by mail-pj1-x1030.google.com with SMTP id cu16so16181249pjb.4; Mon, 19 Apr 2021 08:47:07 -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=d+KMjGdwLqY1RKsIEwvO2O/+nJyhETXl0eZQN9OgrfAQFOdo0cPkMwuPXUvA849dKX Z0OA/iV0oQNKVvgQASsytNZ+0D/qE25JJIWkIfJ7kVlTwQHmjbP3jXKCfm3fDShGUuzH BwMbic2WtsJxI/z4kZTSglL1GG9kr7BRGT1EajjilM5bSWuFXYYGMZmlUPP/vZlo/cQa LbiBcQ/44cAnK82wqwyA8jH54x8x4Sk2g/n3vIUevFzHqrJN7yWkX1bCPOfG+Nsn3fM2 HSEiRieW7yA7bsKjTbnXiMySGxv8aiWYuhmg6xuTDNhQ3QoIOEVkQfWoDug3V6YnIGzO YVvA== 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=N4lbXEu32wFu5g1rngBBz2Uqt9tun4F4dtio8RcIq5CxWGjwzQx9RoZdlLwqq4EzjX 5ktMh9aU9mrl2qDc45Sm08qOWT3nzDUlLV7EUsL6AHHEFZQ0zIOKULpSLZhpel8I1/7L UDC1tAFpK3JkND4cmCR6NvIUxu/Zj0UxzhMzTAgZfeYsujjw8crmhWrzOcdOme191Mc6 hIbq1y6SJysvyTF/mrqMYlEQDQjB0elFpl5pwD4ZzK02GWEGQNekRbRHiz8NSzVwbhra oP2RivQaLT6qJWb0bM7+yBhjEuAJkRu0Ji4f/bCYTgtaZCmjUJx0ao+wsLYvOZYSBWmW ukqg== X-Gm-Message-State: AOAM530x3jI6V41uWfEIRuldEzS1aqfNM79liLGXo/L98j2L0uQSq8Yi t9tmuPn0HIW7pYzcIJjwKS4= X-Google-Smtp-Source: ABdhPJyQOLYsHUKaECSVkjdiOan+lnRWKTgrZi8x0QQ9DX5p0KE3pkRZKrm4yz1se7ftVYlH6bGPag== X-Received: by 2002:a17:90b:4504:: with SMTP id iu4mr25401047pjb.76.1618847226695; Mon, 19 Apr 2021 08:47:06 -0700 (PDT) Received: from z640-arch.lan ([2602:61:7344:f100::678]) by smtp.gmail.com with ESMTPSA id u1sm15314139pjj.19.2021.04.19.08.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 08:47:06 -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 v2 1/2] dt-bindings: net: mediatek: add optional GMAC labels Date: Mon, 19 Apr 2021 08:46:58 -0700 Message-Id: <20210419154659.44096-2-ilya.lipnitskiy@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419154659.44096-1-ilya.lipnitskiy@gmail.com> References: <20210419154659.44096-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-20210419_084707_404488_6B80BD67 X-CRM114-Status: GOOD ( 12.24 ) 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 15:46:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ilya Lipnitskiy X-Patchwork-Id: 12212163 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 0C067C433B4 for ; Mon, 19 Apr 2021 15:49:25 +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 76E1D61246 for ; Mon, 19 Apr 2021 15:49:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76E1D61246 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=5nyL3iUnXvDxENhIdEc/m1tWXkKxWyrALFNrtbZJk+A=; b=MCmeYCnVqP0k8kAJCeHFttFMK tic0ItOybwBWe1RawHVPUHf2JSZRDeicJlDWq3FyXAtwN+wfHhl+Hvxx85Hg5P7MboJ2QIGjO3P4C Ukz+DBb7kF7/tkKQwJbp44OkvUL+kQ6Sgg+RDLzYAQEzebtu/zFB0LQsJhv6UUCHkFCOcoFbCmHZJ pNb7sVC2KZfsgZjv8nm/U+NiEK+ev3TyjQUp5QzFr7Zik22kmB157qfL6xuyMgIfx9ysDaivcr7tT E0uAtJ7xexOpxz3zTpRZrnxJQM3EQuPXxxWqdvCbZODsu8HBtuTZ3nIxgYL+h8i9elwmspkT7YZIE ebxr6CBWA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYW7Y-00ADGH-MG; Mon, 19 Apr 2021 15:47:32 +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 1lYW7F-00ADED-Av; Mon, 19 Apr 2021 15:47:13 +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=5bzjff+su6HXIaTpyjBroSwlupbpwpZmI0kJmdwR1sA=; b=vCTN+zPWwZMuRi7PMuGN10Thxx yBUcQPqyPzjEJJfkNlTU+mb5rLhb6xwHz5VQ4x6LJxbA0XIzGMOR7w50QRsykmFnF7C8nlyEci2cN wTYFN0q6pomfYq8JUTdtd4NWanLFidK+2Zo7KPsdC1DAixX1ZDX2Lso23kVBV5+17TAki4ggtXoUx oENiFJlvO2x/Ga3KtnTLq9PKQF6XtO2i/e8TlulJBg7lpx/U4m0YS2usYBtfjzEeGWrA8q18HEmrb 1cM5U2gTg+OaRcXeX+b64nrFOlJ/5Bk5pDZrBY4q8hNkLtW9JxSXudIr1pQwx+g9cI7YLgJmqzyui amwuNxnQ==; Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYW7A-00BUwo-2B; Mon, 19 Apr 2021 15:47:12 +0000 Received: by mail-pf1-x435.google.com with SMTP id c3so4653207pfo.3; Mon, 19 Apr 2021 08:47:07 -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=5bzjff+su6HXIaTpyjBroSwlupbpwpZmI0kJmdwR1sA=; b=B9MXwRU5X1n4ceTorijsBBZblGJ8kcjMP43LSuW2efFbARNz7+Zvc5/SDoJ5hYkUKk aruI5gIM/i/+tKcnmSNUbHsG2g78SBSuBs6lKM21q/r0eHxTL9ZjaGzWVDfiT5h+ipAF QJnDmdyQ6htpSA3O8f0eSD7iYufopn+KFNDIg2gvLQPDh4TMQP7rJUSaLJO5JoQFloEm Q0fh76kPDqV6Ad31pVKMMI5PpqI8e4JnyjcWPS7dBdJJD+b2GaohejF+/HJqlPS+M2wA 7aozd+lOFtMVviIWSSiPGlxXG/qsD6rKkGyz77O5HOk03CFUhcxKjmspZZpfa0B3VcbX 8Wbg== 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=5bzjff+su6HXIaTpyjBroSwlupbpwpZmI0kJmdwR1sA=; b=QpKslXOfxwp0IsIDOKmzFfctL9beCLKX2c2nBgygiAStxes2MAQLFHfZR++FYjOZIa jfV/DXj/6m6EKPN6pB6LqWsEgm+pq1dKQ6UPSPorvC2k+PhtU2u3tmfG6Y5affgNp6on LUQPBeG4uUdTpL2PpOCdl9oW/R3Y8FaWv3xntRmSAXJ0ePTXjpC1a1CkZ0fcEwgM7NoK CXKPbeE7EHYW32B8VdMIooHPEQ7L8T+0MYiUFIvSTwjxCUs4vzIvaUrVjrxRzekIEFqf LH2sd+eODkwhfH4QRAbqk6OOD+1a8IzEPVbQ/rn0UJZBhwqh+hC2i3O4/jgN74Br4fWx f6nw== X-Gm-Message-State: AOAM530q/RKaHsvU2zS09GEMiRa0fd1ZFS2iP+lEXkV0yzn9RMhC+o62 fTlV7tRZCA6lDxnt7ehlZ2Y= X-Google-Smtp-Source: ABdhPJy9R/pUClK4i2RW8B6XQkBUuBDnjzRtHvwyP++1eSHFoDzj6/4ku6ALOfkrnznbdlMghY4OKQ== X-Received: by 2002:a63:e405:: with SMTP id a5mr8785503pgi.89.1618847227364; Mon, 19 Apr 2021 08:47:07 -0700 (PDT) Received: from z640-arch.lan ([2602:61:7344:f100::678]) by smtp.gmail.com with ESMTPSA id u1sm15314139pjj.19.2021.04.19.08.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 08:47: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 , =?utf-8?q?Ren=C3=A9_van_Dor?= =?utf-8?q?st?= Subject: [PATCH net-next v2 2/2] net: ethernet: mediatek: support custom GMAC label Date: Mon, 19 Apr 2021 08:46:59 -0700 Message-Id: <20210419154659.44096-3-ilya.lipnitskiy@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419154659.44096-1-ilya.lipnitskiy@gmail.com> References: <20210419154659.44096-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-20210419_084708_125375_3609B5F0 X-CRM114-Status: GOOD ( 15.06 ) 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 Reviewed-by: Andrew Lunn --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 6b00c12c6c43..df3cda63a8c5 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; @@ -2867,9 +2868,10 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) return -EINVAL; } - eth->netdev[id] = alloc_etherdev(sizeof(*mac)); + eth->netdev[id] = alloc_netdev(sizeof(*mac), label ? label : "eth%d", + NET_NAME_UNKNOWN, ether_setup); if (!eth->netdev[id]) { - dev_err(eth->dev, "alloc_etherdev failed\n"); + dev_err(eth->dev, "alloc_netdev failed\n"); return -ENOMEM; } mac = netdev_priv(eth->netdev[id]);