From patchwork Mon Sep 20 12:34:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12505217 X-Patchwork-Delegate: kuba@kernel.org 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 4672AC433FE for ; Mon, 20 Sep 2021 12:34:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 210B760F58 for ; Mon, 20 Sep 2021 12:34:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238461AbhITMgV (ORCPT ); Mon, 20 Sep 2021 08:36:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233550AbhITMgU (ORCPT ); Mon, 20 Sep 2021 08:36:20 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17757C061574; Mon, 20 Sep 2021 05:34:53 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id b20so8506203lfv.3; Mon, 20 Sep 2021 05:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HpQQkC1AOfzWHJl9ss8L2S0RA1Z9VdPx4YiHlvPnYPk=; b=jW9QUFzX611Lorga+kmJBdS+JIGjVmywVW5bBnJGaBpp3+Anh2WycRQICKHYmqpVBN U9FYZ1XWoTLI9CIjubM787kA6WYtphzt6V87poWVdLTvXbDTN/JRnFYuXYyt6gIcat3I 97ukMTN+9Ye/mhLgZQ3D4FcCIpAEJ/YSd8Y48HysBz5VKvMgC61FTfxHTG0nYg2mz1Y1 YuCgAXqLBLGBhYzz2pyT/PlDrt6qNHnJnPrCw4rYv0OA8bQ0bsmXxySabfg5j2WhLUk3 0eFius8QQdvVosYEjkrxqF6liOb6fOVjOS9zz6P45Feg0XKPcNoAS0iQnH1h5bvphZul 8vLA== 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=HpQQkC1AOfzWHJl9ss8L2S0RA1Z9VdPx4YiHlvPnYPk=; b=JO6x0t4/IBOFzKrdgNojR935QBHg8jD6xAAgbK0AHUFOJdXMYo42OfDf1GIF/RL+D6 OawEyqDUYqKXXo8y2NIDh+BHBvfXZAXhVq31aJZoS/u3pwhasHAPieL+eOP2DGMw8gKf Ef69pIhRhtQXTzXEE6T6E5IknxLSY3PO8Vf941cnv/uneikdgVAr+HZwzP3z6Fvc+NS/ 6TzQimhMDTXSy67EpY9u+ZmhZhPQb6pf8yxRWOyrk2eJ4YYbiLLLDPDHi5YK8Pc+DzCB 2j7IYXlybGiXYwFEDYIuKnIZ3lGQkUeGopEFejKHpjdEWLRZiOxz/7NhPrV/nRk7k5B/ py6Q== X-Gm-Message-State: AOAM532531DbYOfvOuQw60ffzvS89j/VHI36xtSdd52Sa7RvKVRceKTv x7Ef1K5s1SXi4znsu9oGvJ8= X-Google-Smtp-Source: ABdhPJxXbr1B932hVzp57IlvjUhWt3JLlpqlZgVyIKEKjcn7W0FHEUSKK3NsNtRsdaVL+hccgrvEiw== X-Received: by 2002:a05:6512:1049:: with SMTP id c9mr5237881lfb.283.1632141291208; Mon, 20 Sep 2021 05:34:51 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id b26sm1748454lji.128.2021.09.20.05.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 05:34:49 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Florian Fainelli , devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH net-next] net: bgmac: support MDIO described in DT Date: Mon, 20 Sep 2021 14:34:41 +0200 Message-Id: <20210920123441.9088-1-zajec5@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Rafał Miłecki Check ethernet controller DT node for "mdio" subnode and use it with of_mdiobus_register() when present. That allows specifying MDIO and its PHY devices in a standard DT based way. This is required for BCM53573 SoC support which has an MDIO attached switch. Signed-off-by: Rafał Miłecki --- drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c index 6ce80cbcb48e..086739e4f40a 100644 --- a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c +++ b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c @@ -10,6 +10,7 @@ #include #include +#include #include "bgmac.h" static bool bcma_mdio_wait_value(struct bcma_device *core, u16 reg, u32 mask, @@ -211,6 +212,7 @@ struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac) { struct bcma_device *core = bgmac->bcma.core; struct mii_bus *mii_bus; + struct device_node *np; int err; mii_bus = mdiobus_alloc(); @@ -229,7 +231,9 @@ struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac) mii_bus->parent = &core->dev; mii_bus->phy_mask = ~(1 << bgmac->phyaddr); - err = mdiobus_register(mii_bus); + np = of_get_child_by_name(core->dev.of_node, "mdio"); + + err = of_mdiobus_register(mii_bus, np); if (err) { dev_err(&core->dev, "Registration of mii bus failed\n"); goto err_free_bus;