From patchwork Sun Feb 19 21:22:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 729656 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vRKVd6RLJz9s7n for ; Mon, 20 Feb 2017 08:23:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="sQDzefZk"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751669AbdBSVXC (ORCPT ); Sun, 19 Feb 2017 16:23:02 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34871 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbdBSVXA (ORCPT ); Sun, 19 Feb 2017 16:23:00 -0500 Received: by mail-wm0-f66.google.com with SMTP id u63so11264592wmu.2; Sun, 19 Feb 2017 13:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=nIm/IAuAmhQI+54Sf6bCLDUEbG6avI4EbEWYbUu6hD8=; b=sQDzefZkSOmXbD3GHtb15+URJzT1k/Mx71QRnCgnJT9tClIJGpboOhja5VxAhqWwPI J1EbFsYDkqjiSRyvJp+rjoucFfsYPJvrwAbzn93FGW2nNTj3i+SJX4v84CO3giiwg7K7 IjjOtOFypY8hjy7Obp2rfkX9ahzbcGIrR7aDGkoAltFcS2q7d6bzMFlelpJEBGFq6uKj R2cjscvBDjCQepJfl9zg+4yZC6sTlzFAq7KbVg0vpYNevNEt8F7rLiffBg3ExSDyWOHU qcLII+YD/EtCEaQFRFIv9dplfjMRmgkErLDT2PSk8d8E5RpPlQ5OK/EDL3MgCeFXAxCA HIBQ== 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; bh=nIm/IAuAmhQI+54Sf6bCLDUEbG6avI4EbEWYbUu6hD8=; b=tEMVXzYkFsOVtrGZ4EuVpcLECzbZ+rAyQEwobz4hqmKGfgLmNqnEkM2Ia+vjaJRwAG gRGpRlkn395q55jhvzYqs8KeQ/Ozm3p0dgoNY6yyS0kpchL17eUSM/POZs5gYPxIrN3s b12F+3hT1jblE5TWy4a705zI9nzFxV/71MXmNMEun0KQvENlgLOi66S6dXEsPwH+ZHi9 VtVD+R3b5GDPtvXUtHV4jwi6gBkoXcIjC8l6bjFHV7hkZp6Pb2oR5wUOqEGygj8SfNuN B0eFB4/tmLY3N+esfmbmPXd9MrpQXyNTUHIoV+hPWuzFj2GP/8NJdUAZ1xsRmGxA1DcU 4vjA== X-Gm-Message-State: AMke39lvKO86dqIYZMn96Drn8vdmYyPrT2/RttLlHZJ7MnMlz+VtNvAd2UCb8WIgs64QFw== X-Received: by 10.28.203.75 with SMTP id b72mr9328824wmg.110.1487539378653; Sun, 19 Feb 2017 13:22:58 -0800 (PST) Received: from debian64.daheim (p5B0D7BCC.dip0.t-ipconnect.de. [91.13.123.204]) by smtp.gmail.com with ESMTPSA id 10sm10863875wmk.26.2017.02.19.13.22.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 19 Feb 2017 13:22:57 -0800 (PST) Received: from chuck by debian64.daheim with local (Exim 4.89_RC5) (envelope-from ) id 1cfYwa-0003Dm-NH; Sun, 19 Feb 2017 22:22:56 +0100 From: Christian Lamparter To: netdev@vger.kernel.org, devicetree@vger.kernel.org Cc: "David S . Miller" , Ivan Mikhaylov , Florian Fainelli , Andrew Lunn , Rob Herring Subject: [PATCH v1 1/2] dt: emac: document device-tree based phy discovery and setup Date: Sun, 19 Feb 2017 22:22:55 +0100 Message-Id: <8f94c394faf5665ae693f41832f2446dfc7c989e.1487539319.git.chunkeey@googlemail.com> X-Mailer: git-send-email 2.11.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds documentation for a new "phy-handle" property, "fixed-link" and "mdio" sub-node. These allows the enumeration of PHYs which are supported by the phy library under drivers/net/phy. The EMAC ethernet controller in IBM and AMCC 4xx chips is currently stuck with a few privately defined phy implementations. It has no support for PHYs which are supported by the generic phylib. Acked-by: Rob Herring Signed-off-by: Christian Lamparter --- I rewrote the "phy-handle" property in order to make the links to net/ethernet.txt consistent with the ones in the mdio subnode. I've also added the "fixed-link" subnode, which I copied from net/dsa.txt. I hope this doesn't invalidate Rob's ACK from the RFC (If it does, please tell me, otherwise I assume everything is still OK). --- .../devicetree/bindings/powerpc/4xx/emac.txt | 64 +++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/powerpc/4xx/emac.txt b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt index 712baf6c3e24..1893b4c4d93b 100644 --- a/Documentation/devicetree/bindings/powerpc/4xx/emac.txt +++ b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt @@ -71,6 +71,9 @@ For Axon it can be absent, though my current driver doesn't handle phy-address yet so for now, keep 0x00ffffff in it. + - phy-handle : Used to describe configurations where a external PHY + is used. Please refer to: + Documentation/devicetree/bindings/net/ethernet.txt - rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec operations (if absent the value is the same as rx-fifo-size). For Axon, either absent or 2048. @@ -81,8 +84,22 @@ offload, phandle of the TAH device node. - tah-channel : 1 cell, optional. If appropriate, channel used on the TAH engine. + - fixed-link : Fixed-link subnode describing a link to a non-MDIO + managed entity. See + Documentation/devicetree/bindings/net/fixed-link.txt + for details. + - mdio subnode : When the EMAC has a phy connected to its local + mdio, which us supported by the kernel's network + PHY library in drivers/net/phy, there must be device + tree subnode with the following required properties: + - #address-cells: Must be <1>. + - #size-cells: Must be <0>. - Example: + For PHY definitions: Please refer to + Documentation/devicetree/bindings/net/phy.txt and + Documentation/devicetree/bindings/net/ethernet.txt + + Examples: EMAC0: ethernet@40000800 { device_type = "network"; @@ -104,6 +121,50 @@ zmii-channel = <0>; }; + EMAC1: ethernet@ef600c00 { + device_type = "network"; + compatible = "ibm,emac-apm821xx", "ibm,emac4sync"; + interrupt-parent = <&EMAC1>; + interrupts = <0 1>; + #interrupt-cells = <1>; + #address-cells = <0>; + #size-cells = <0>; + interrupt-map = <0 &UIC2 0x10 IRQ_TYPE_LEVEL_HIGH /* Status */ + 1 &UIC2 0x14 IRQ_TYPE_LEVEL_HIGH /* Wake */>; + reg = <0xef600c00 0x000000c4>; + local-mac-address = [000000000000]; /* Filled in by U-Boot */ + mal-device = <&MAL0>; + mal-tx-channel = <0>; + mal-rx-channel = <0>; + cell-index = <0>; + max-frame-size = <9000>; + rx-fifo-size = <16384>; + tx-fifo-size = <2048>; + fifo-entry-size = <10>; + phy-mode = "rgmii"; + phy-handle = <&phy0>; + phy-map = <0x00000000>; + rgmii-device = <&RGMII0>; + rgmii-channel = <0>; + tah-device = <&TAH0>; + tah-channel = <0>; + has-inverted-stacr-oc; + has-new-stacr-staopc; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + phy0: ethernet-phy@0 { + device_type = "ethernet-phy"; + reg = <0>; + + qca,ar8327-initvals = < + 0x0010 0x40000000>; + }; + }; + + ii) McMAL node Required properties: @@ -145,4 +206,3 @@ - revision : as provided by the RGMII new version register if available. For Axon: 0x0000012a -