From patchwork Fri May 14 21:00:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 439759 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.8 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 7E446C433B4 for ; Fri, 14 May 2021 21:02:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6191861440 for ; Fri, 14 May 2021 21:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234117AbhENVDQ (ORCPT ); Fri, 14 May 2021 17:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbhENVB4 (ORCPT ); Fri, 14 May 2021 17:01:56 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE7C5C061350; Fri, 14 May 2021 14:00:38 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id i13so42571edb.9; Fri, 14 May 2021 14:00:38 -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=cMbbIPoz/E9mCPWCX+knh4B7/pIPz9y1MYvr/nHZTTg=; b=P95rgzTerBSmqkuABXDs9YFSAYACNqf2Uf+wqkKs0N0Q803OHsY0VNVlvQAGfRVgGE H13xJ4Vu+JJo0BmtQNdYAzidxq3cM5aQ//XWONsffAT+RRXY2uUWqNkwUumIpX8xHGuD beCmRCQZZD7az0QLqtbUTkvrPqPlLCeAT7IL/Mm7YwfGT3Wt2Vpi2tNS6l1axJB0BIGw qtM18+PwWnM9xg5FAuhWUnxo+SwL6wNfAChsGMFrjfiWtgX/G8GzWvvAG1kgPxsL9v2T 0wzrHWiMlqV4l9J3xpN5buPEqLyutFpitcTkAkP1o4Jm/8rXbhYhCCYIb+ycKFHu87fT dtAw== 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=cMbbIPoz/E9mCPWCX+knh4B7/pIPz9y1MYvr/nHZTTg=; b=PalyVj9+TOXv1YiuJ2ERuE0fNPO5NY358kKIyUMMpQ0NM3aL11js/qEgHLeFJOya5g TLjqPQ5tJ3v/8sLcwhFfhophtV9BtOIpUO+at4GUkjAfeZk0wNYDT3xN43YYreOYL4Gw auZP7LZQmwJHLbLB50rJDI5L5sQ+ToxupU3Z+IrDeyS04EutxyerCmEL+gnSgXOhK3ME WfXamXs7pV8SKwtij9f270vepSfrkWuwbcQi2deRj0TOUkJjf0fHuQwT1GsO504A8IMs /NIKuvdtEkiljvqg4dLVp1biETdclNLFLymJHb4qFrGy2yvz0RfD5yAjivgw6Z41zpl+ pb7Q== X-Gm-Message-State: AOAM530u6r3RzR/VVrrZfOJj7VoavCLK2kMlGA/B6Z7oIb/2yQPcT/5s p24Ya9B5qqiFfSrUXl1ME7k= X-Google-Smtp-Source: ABdhPJx5Xh9CHKQWvazJa1WAhYY7WQ3M27VUb7UTya/v5a/zQzItG+OCXJ6Lgk2v+HwemwU+JEZBAg== X-Received: by 2002:aa7:cc98:: with SMTP id p24mr33565381edt.353.1621026037540; Fri, 14 May 2021 14:00:37 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id c3sm5455237edn.16.2021.05.14.14.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:00:37 -0700 (PDT) From: Ansuel Smith To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ansuel Smith , Rob Herring Subject: [PATCH net-next v6 21/25] devicetree: bindings: dsa: qca8k: Document internal mdio definition Date: Fri, 14 May 2021 23:00:11 +0200 Message-Id: <20210514210015.18142-22-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210514210015.18142-1-ansuelsmth@gmail.com> References: <20210514210015.18142-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Document new way of declare mapping of internal PHY to port. The new implementation directly declare the PHY connected to the port by adding a node in the switch node. The driver detect this and register an internal mdiobus using the mapping defined in the mdio node. Signed-off-by: Ansuel Smith Reviewed-by: Rob Herring --- .../devicetree/bindings/net/dsa/qca8k.txt | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.txt b/Documentation/devicetree/bindings/net/dsa/qca8k.txt index 1daf68e7ae19..8c73f67c43ca 100644 --- a/Documentation/devicetree/bindings/net/dsa/qca8k.txt +++ b/Documentation/devicetree/bindings/net/dsa/qca8k.txt @@ -21,6 +21,10 @@ described in dsa/dsa.txt. If the QCA8K switch is connect to a SoC's external mdio-bus each subnode describing a port needs to have a valid phandle referencing the internal PHY it is connected to. This is because there's no N:N mapping of port and PHY id. +To declare the internal mdio-bus configuration, declare a mdio node in the +switch node and declare the phandle for the port referencing the internal +PHY is connected to. In this config a internal mdio-bus is registered and +the mdio MASTER is used as communication. Don't use mixed external and internal mdio-bus configurations, as this is not supported by the hardware. @@ -150,26 +154,61 @@ for the internal master mdio-bus configuration: port@1 { reg = <1>; label = "lan1"; + phy-mode = "internal"; + phy-handle = <&phy_port1>; }; port@2 { reg = <2>; label = "lan2"; + phy-mode = "internal"; + phy-handle = <&phy_port2>; }; port@3 { reg = <3>; label = "lan3"; + phy-mode = "internal"; + phy-handle = <&phy_port3>; }; port@4 { reg = <4>; label = "lan4"; + phy-mode = "internal"; + phy-handle = <&phy_port4>; }; port@5 { reg = <5>; label = "wan"; + phy-mode = "internal"; + phy-handle = <&phy_port5>; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + phy_port1: phy@0 { + reg = <0>; + }; + + phy_port2: phy@1 { + reg = <1>; + }; + + phy_port3: phy@2 { + reg = <2>; + }; + + phy_port4: phy@3 { + reg = <3>; + }; + + phy_port5: phy@4 { + reg = <4>; }; }; };