From patchwork Mon Feb 27 20:54:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 733161 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 3vXDWy0SMzz9s9x for ; Tue, 28 Feb 2017 07:56:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="cJGTsbDD"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752011AbdB0U4J (ORCPT ); Mon, 27 Feb 2017 15:56:09 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35259 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751552AbdB0UzK (ORCPT ); Mon, 27 Feb 2017 15:55:10 -0500 Received: by mail-wm0-f65.google.com with SMTP id u63so15247055wmu.2; Mon, 27 Feb 2017 12:54:52 -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=M6t7VUbJA36nffgiW5w6DsnOPHwINkkCiCWupqnFhn0=; b=cJGTsbDDZpTiPEIf0zyXWdF4JJBfSEVIm0EU/YbIEk+3xaNTpPtNyQ0jn9MoXvELqH iJqOFWuZzF32hsF0TJXvMJ3Cas2bzXo2WXBaZz3FCnOkdKKQSGCyMGuAIlDz3WXjoVkR Ol0QVJjrfF3ylkVcbqibrwGKN0pBOgD01jK1PYERsFe4ueoEqmFoHRclwAAY9uewTrTE nGFt3sUsaoM+Ry8wJfF9Q//d2onIo/tDOfdj6+Zq7mWQ6nVbMNkc+h5c+X0re7c3q1q5 /RVQ7NiaBXgLOiaD5VM4eYGXaPFq6kpmNtxPDUQ9U0i/jEf8pSYtn4CtYBg1Fdyodm2G aydg== 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=M6t7VUbJA36nffgiW5w6DsnOPHwINkkCiCWupqnFhn0=; b=boc0AzjbOoa2RaNvK7uXor0BBMyopFQ6ob0l+SyqgWABY4RLiWsOmxzjHExRZyVCLg YzmTaqktPpn33AE8C7vrWwW+LKYEUsXEF6bpq9PQhaPhQ9NJZK0xHlJTIr//v9aI0LHC qORjGaX/WRm2v8GKj7CMZzU9qZDGdwoxEt0LuDchFFcXxUpDHWRSQxs/M577kqJrwNh7 l/FMeZNPGh2Llx1lKdkjAhuGg4yT1jZDrU+iAygQFSJASn1MJR7dqLLSeNIb+tq6lQsU /cZZmcyi01QNNgCtrr8AaIlSuvM7T/2i2qCNkY2LqQBgpUKr0H6QqcXSHQB14O24va3D NlKQ== X-Gm-Message-State: AMke39ns9kKdVa5PWTmoLN1XZsBJrtM3DbAPrX9EZx9Z871+Q/zwXhbYgbH9Cse19C0V2w== X-Received: by 10.28.146.12 with SMTP id u12mr15616814wmd.113.1488228891770; Mon, 27 Feb 2017 12:54:51 -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 z198sm15749311wmz.24.2017.02.27.12.54.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2017 12:54:50 -0800 (PST) Received: from chuck by debian64.daheim with local (Exim 4.89_RC6) (envelope-from ) id 1ciSJm-00086L-0l; Mon, 27 Feb 2017 21:54:50 +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 v2] dt: emac: document device-tree based phy discovery and setup Date: Mon, 27 Feb 2017 21:54:50 +0100 Message-Id: <0149985a262cfc2feacd604a581cd5ae9134a525.1488228734.git.chunkeey@googlemail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: 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-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 Reviewed-by: Florian Fainelli Signed-off-by: Christian Lamparter --- --- .../devicetree/bindings/powerpc/4xx/emac.txt | 62 +++++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/powerpc/4xx/emac.txt b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt index 712baf6c3e24..44b842b6ca15 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,48 @@ 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 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + }; + }; + + ii) McMAL node Required properties: @@ -145,4 +204,3 @@ - revision : as provided by the RGMII new version register if available. For Axon: 0x0000012a -