From patchwork Mon Feb 27 20:11:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 733111 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 3vXCns5wLYz9s8D for ; Tue, 28 Feb 2017 07:23:13 +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="NECJg+LC"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751341AbdB0UXH (ORCPT ); Mon, 27 Feb 2017 15:23:07 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35979 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468AbdB0UXG (ORCPT ); Mon, 27 Feb 2017 15:23:06 -0500 Received: by mail-wm0-f66.google.com with SMTP id r18so15163636wmd.3; Mon, 27 Feb 2017 12:21:00 -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:in-reply-to:references; bh=4wMCdssyOcmXmhZ7F3zBwuOrGxEcCTZvFsd4+uDPg94=; b=NECJg+LCXpCkf+4+vF6yegPAQzkl3xrI5CK647Ac0mizdWzQVm7Pc471OSnOE2dN0z AxUzB7TMjdGuG/sW/E5NWGs3YIrlj8eK+4Om/TP2/Td9tBPdbzwqWhEfR6cWbFEBarSP KtukFrJ4n40M0Z6Sh/9EcyRgp5E/4xRJoZVeUmAwrFvMd6jAu5A1Q7OgMkPjFntg4iU4 OT6JEfEI4mJK1sZWYXJWp7zsodZQ302iXe+7NutnMFM5G9BmpyPqGL7N2Gp3O0S2BX5h Fc0zR2+ulI/WNuiuN88UHbi6gUbCwMr1auoyU6GBTx+yf4vkrJMctFdIzvV8wvg0LnHx o2kg== 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; bh=4wMCdssyOcmXmhZ7F3zBwuOrGxEcCTZvFsd4+uDPg94=; b=eRwatFaEmktqBVenZ4QMpG1kttkwATMR6Zwmz06tKm+j+G34ZRTyulkDbt5aIBe9NR MkCW/WGDP8WPoQ5O3af/9ykXpTgj5C85C0ijMlDxO3FhU+zo3Qpv0S+8uZQAzHyDPU4C ULOqdgcdpHa1TqTew01Yr/4u+1zGVyC9ePyhwIjqufRorfDwTG0bORVg37UJC2pyC2Tg fM47Kq6G8xec3ORf7ZXPIiw7NZnREkmmu5X9GAxkj2mLKtm5PHQ0RgecHLwHPUA9O2pQ 3n15OiL2cmke3dPSNBBq7ANgx65Q3Apkn7VIWLptuJsNCt6/c0mhHvZhjXzYrYP3JeUP QkMA== X-Gm-Message-State: AMke39nmhkRCPtj19JubwBmfh6s6YxPZgXm/Ac5xzuhweGal1pFg9Xq81jyEFhWiuUkW3w== X-Received: by 10.28.234.19 with SMTP id i19mr14900307wmh.129.1488226307896; Mon, 27 Feb 2017 12:11:47 -0800 (PST) Received: from debian64.daheim (p200300D5FBC047FCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc0:47fc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id 63sm23652054wrh.68.2017.02.27.12.11.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2017 12:11:47 -0800 (PST) Received: from chuck by debian64.daheim with local (Exim 4.89_RC6) (envelope-from ) id 1ciRe6-00073x-EB; Mon, 27 Feb 2017 21:11:46 +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] dt: emac: document device-tree based phy discovery and setup Date: Mon, 27 Feb 2017 21:11:46 +0100 Message-Id: <8f94c394faf5665ae693f41832f2446dfc7c989e.1488226061.git.chunkeey@googlemail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170227.145447.1005420963599745103.davem@davemloft.net> References: <20170227.145447.1005420963599745103.davem@davemloft.net> 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 --- Resent - no changes. --- .../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 -