From patchwork Sun Feb 5 22:25:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 724295 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vGlbH2jg2z9s4q for ; Mon, 6 Feb 2017 09:27:22 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="BtUIw3oJ"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752066AbdBEW1V (ORCPT ); Sun, 5 Feb 2017 17:27:21 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34625 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbdBEW1T (ORCPT ); Sun, 5 Feb 2017 17:27:19 -0500 Received: by mail-wm0-f67.google.com with SMTP id c85so18437322wmi.1; Sun, 05 Feb 2017 14:27:19 -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=1Fe9bYYXzmjNBhrasVTheNAX3g3fYt5bA0bfVeu7DQE=; b=BtUIw3oJELQ7DVVjx4c1acMKVbQ1PRxdzjj9LPcAjXi/s4dVYkCDbG+Gt7K/0YOpX1 t1uhTkkTM4U1ZeiWTK+82sPjRdnjdXFHiTnHLifBdhqYhV93OM8rBd3kOMy1Zm7KRMPc HwPd7im1vaR23bpPxYvCnYlCNzpMZHI/naq1g0tFsEfjR2zDXTwcrclA+60f2dM6MTZ5 p5lx7f5HC6yREnTk8TbAcJryxhFuGJqV12OtqmYh3Q8eyP0YcgDl025vZ7FXl7PDFt5V hYDusAsi/CSO8pqKY+NUvhNp9nkq5lF00VIJ2RniInDOtB8CG1XCiDOl7DfKCrSY/Osg 6QyQ== 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=1Fe9bYYXzmjNBhrasVTheNAX3g3fYt5bA0bfVeu7DQE=; b=fUMZWMO66AmjSgkXbmUx4yS/ahD5aUqbpYDrpL7NyzXGTtu+bvkR71rXOcsrrqLvjQ d0Yn4n58wMw2hMaTnBQ6XsUpSZ/tL7tyGZIdz2ZooDeaPoxteMPOj3GD4xtWOGGe+Cer XN+lkfTP7h6+x+A7BbZbgIyPMQsOb0aMbPgbn1hTCB3aAIwQ5v/n2yaZRclF/G5TyMBh Iwt+Rqxcxc2atmGUxY+5+WpCekb+jvogciVIoixKeoxmVbkfPO54yOpIx2AZY56fyXzs fRnZ3Zp8i+rLN6IMBhTEaJzByCiXKmxXpgs5tHGnPpVRJ+5PJT7TFWzYxCu0IHBEvc0u RzYA== X-Gm-Message-State: AMke39k1Cd7/Ji966DZngrfvOaSWROL1lWhqvRx6BhUIsjOwDPQHdAZrl6sgQbspSRazdg== X-Received: by 10.28.37.195 with SMTP id l186mr5850668wml.73.1486333638042; Sun, 05 Feb 2017 14:27:18 -0800 (PST) Received: from debian64.daheim (p5B0D7CCE.dip0.t-ipconnect.de. [91.13.124.206]) by smtp.gmail.com with ESMTPSA id e74sm9444106wmd.2.2017.02.05.14.27.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Feb 2017 14:27:17 -0800 (PST) Received: from chuck by debian64.daheim with local (Exim 4.89) (envelope-from ) id 1caVF4-0003cM-RZ; Sun, 05 Feb 2017 23:25:06 +0100 From: Christian Lamparter To: netdev@vger.kernel.org, devicetree@vger.kernel.org Cc: "David S . Miller" , Ivan Mikhaylov , Mark Rutland , Rob Herring Subject: [RFC 1/2] dt: emac: document device-tree based phy discovery and setup Date: Sun, 5 Feb 2017 23:25:05 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch adds documentation for a new "phy-handler" property 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. Signed-off-by: Christian Lamparter Acked-by: Rob Herring --- .../devicetree/bindings/powerpc/4xx/emac.txt | 60 +++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/powerpc/4xx/emac.txt b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt index 712baf6c3e24..0572d053c35a 100644 --- a/Documentation/devicetree/bindings/powerpc/4xx/emac.txt +++ b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt @@ -71,6 +71,8 @@ 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 : See net/ethernet.txt file; used to describe + configurations where a external PHY is used. - 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. @@ -82,7 +84,18 @@ - tah-channel : 1 cell, optional. If appropriate, channel used on the TAH engine. - Example: + - 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>. + + For each phy on the mdio bus, there must be a node + with the following fields: + - reg: phy id used to communicate to phy. + - device_type: Must be "ethernet-phy". + Examples: EMAC0: ethernet@40000800 { device_type = "network"; @@ -104,6 +117,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-map = <0x00000000>; + phy-handle = <&phy0>; + 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 +202,3 @@ - revision : as provided by the RGMII new version register if available. For Axon: 0x0000012a -