From patchwork Mon Feb 4 17:30:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 1036089 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ettus.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ettus-com.20150623.gappssmtp.com header.i=@ettus-com.20150623.gappssmtp.com header.b="ae5GGyXI"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43tZWG4xXvz9sMx for ; Tue, 5 Feb 2019 04:31:22 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728342AbfBDRa7 (ORCPT ); Mon, 4 Feb 2019 12:30:59 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43804 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728125AbfBDRa5 (ORCPT ); Mon, 4 Feb 2019 12:30:57 -0500 Received: by mail-pl1-f193.google.com with SMTP id gn14so224492plb.10 for ; Mon, 04 Feb 2019 09:30:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ettus-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jdnN8oMz57K6JwphabgMQst68MVpMqZb8th3jd5zgk0=; b=ae5GGyXIQcAiz0To0gPgxCoEA5CoyUjQHcHQLnz18JbBAxVnSCm/ewyi31CJ9Xh2Tw JvtnrPiX0kkk8yyCS1DoYqdMHwghzZOc6DNk8auC7AzdCiSghNTehB4jpmxoWiVZIiY0 9k60W63tBUfWwAT880b3iR6Wag/LQubOiMmVAlxetwQt8igmqUfdkYkzf80LFeAJY3YU tk8Gc1mC4jEHcA38KNw622uvK7J3f17HPZVFRcmzX6wcZMJcGUjtoMHrY2PK6BHpoNn8 KTGSjAy7/rZDcq27tsQUhbVCe7FMyBCL8ykdJboOUWFSzgTUxZRxFcNWAefg+eahVr3t eC4w== 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=jdnN8oMz57K6JwphabgMQst68MVpMqZb8th3jd5zgk0=; b=AZO54N9IHC7RRBD3CFfDLC4jaJk+s5qY6+cZVRs6FKcLIJOJSdhrYgyTh+df+MSC+r bAY89NanC7XepdDKsqswafevI23P3KoMLBc2TKQiFNJAD157ncTFP9BMOknKvekkdpUG hGAGqa1oPHOrHhLG6itVPav6XDrANSk/dBYsYk0o6xoWSuveBNaw1sZqLEUmeVBMF4Rs eMASoW/PKXPDdL6CtkaV+/3FpWpFwiJsrqrGdsKTK1+MZoCbpZ93KF0q6k9g+AwWs12z GjuPAWBP7KFDrDGZkYBaUIKIce99yXOoT5f4ezorujWWI7R6Dc2EoJ4cJdSNJ6QX7zHu 90Lg== X-Gm-Message-State: AHQUAuYBpL3w4CdUK/SgJNrOhNfBNQpeVLr2VmYm+RTmu2zaWX+BvbMy LW2f8nTB8ac1wFJ1sisT+den14HDZW4= X-Google-Smtp-Source: AHgI3IYuFSSOIc8vrBYatt9NQ9ULxlrErKbd0AiboQmzEyIPNy9pM2F2rdd1Qkc1T7ClkAopcBR7Sw== X-Received: by 2002:a17:902:850c:: with SMTP id bj12mr528760plb.46.1549301455688; Mon, 04 Feb 2019 09:30:55 -0800 (PST) Received: from localhost ([207.114.172.147]) by smtp.gmail.com with ESMTPSA id k15sm794363pfb.147.2019.02.04.09.30.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Feb 2019 09:30:55 -0800 (PST) From: Moritz Fischer To: netdev@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alex.williams@ni.com, andrew@lunn.ch, robh+dt@kernel.org, davem@davemloft.net, moritz.fischer@ettus.com, Moritz Fischer Subject: [PATCH net-next 1/3] net: nixge: Make mdio child node optional Date: Mon, 4 Feb 2019 09:30:38 -0800 Message-Id: <20190204173040.5538-2-moritz.fischer@ettus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204173040.5538-1-moritz.fischer@ettus.com> References: <20190204173040.5538-1-moritz.fischer@ettus.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Moritz Fischer Make MDIO child optional and only instantiate the MDIO bus if the child is actually present. There are currently no (in-tree) users of this binding; all (out-of-tree) users use overlays that get shipped together with the FPGA images that contain the IP. This will significantly increase maintainabilty of future revisions of this IP. Reviewed-by: Andrew Lunn Signed-off-by: Moritz Fischer --- Changes from RFC: - Add Andrew's Reviewed-by tag - Rebased on top of net-next --- .../devicetree/bindings/net/nixge.txt | 27 ++++++++++++++++--- drivers/net/ethernet/ni/nixge.c | 19 ++++++++----- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/net/nixge.txt b/Documentation/devicetree/bindings/net/nixge.txt index 44a7358b4399..bb2929f9c64f 100644 --- a/Documentation/devicetree/bindings/net/nixge.txt +++ b/Documentation/devicetree/bindings/net/nixge.txt @@ -16,6 +16,9 @@ Required properties: - nvmem-cells: Phandle of nvmem cell containing the MAC address - nvmem-cell-names: Should be "address" +Optional properties: +- mdio subnode to indicate presence of MDIO controller + Examples (10G generic PHY): nixge0: ethernet@40000000 { compatible = "ni,xge-enet-3.00"; @@ -33,8 +36,26 @@ Examples (10G generic PHY): phy-mode = "xgmii"; phy-handle = <ðernet_phy1>; - ethernet_phy1: ethernet-phy@4 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <4>; + mdio { + ethernet_phy1: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <4>; + }; }; }; + +Examples (10G generic PHY, no MDIO): + nixge0: ethernet@40000000 { + compatible = "ni,xge-enet-2.00"; + reg = <0x40000000 0x6000>; + + nvmem-cells = <ð1_addr>; + nvmem-cell-names = "address"; + + interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>, <0 30 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "rx", "tx"; + interrupt-parent = <&intc>; + + phy-mode = "xgmii"; + phy-handle = <ðernet_phy1>; + }; diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c index 73a98bd2fcd2..c8dd1e4c759d 100644 --- a/drivers/net/ethernet/ni/nixge.c +++ b/drivers/net/ethernet/ni/nixge.c @@ -1284,6 +1284,7 @@ static int nixge_probe(struct platform_device *pdev) { struct nixge_priv *priv; struct net_device *ndev; + struct device_node *mn; const u8 *mac_addr; int err; @@ -1335,10 +1336,14 @@ static int nixge_probe(struct platform_device *pdev) priv->coalesce_count_rx = XAXIDMA_DFT_RX_THRESHOLD; priv->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD; - err = nixge_mdio_setup(priv, pdev->dev.of_node); - if (err) { - netdev_err(ndev, "error registering mdio bus"); - goto free_netdev; + mn = of_get_child_by_name(pdev->dev.of_node, "mdio"); + if (mn) { + err = nixge_mdio_setup(priv, mn); + of_node_put(mn); + if (err) { + netdev_err(ndev, "error registering mdio bus"); + goto free_netdev; + } } priv->phy_mode = of_get_phy_mode(pdev->dev.of_node); @@ -1364,7 +1369,8 @@ static int nixge_probe(struct platform_device *pdev) return 0; unregister_mdio: - mdiobus_unregister(priv->mii_bus); + if (priv->mii_bus) + mdiobus_unregister(priv->mii_bus); free_netdev: free_netdev(ndev); @@ -1379,7 +1385,8 @@ static int nixge_remove(struct platform_device *pdev) unregister_netdev(ndev); - mdiobus_unregister(priv->mii_bus); + if (priv->mii_bus) + mdiobus_unregister(priv->mii_bus); free_netdev(ndev); From patchwork Mon Feb 4 17:30:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 1036087 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ettus.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ettus-com.20150623.gappssmtp.com header.i=@ettus-com.20150623.gappssmtp.com header.b="BrIUteSI"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43tZW313vzz9sDr for ; Tue, 5 Feb 2019 04:31:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728433AbfBDRa7 (ORCPT ); Mon, 4 Feb 2019 12:30:59 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33054 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728206AbfBDRa6 (ORCPT ); Mon, 4 Feb 2019 12:30:58 -0500 Received: by mail-pg1-f194.google.com with SMTP id z11so230556pgu.0 for ; Mon, 04 Feb 2019 09:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ettus-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pyNN/cBC8H0d9mt1rt0a7Z0pTJTwhk8gYyIq7n/7xJo=; b=BrIUteSIrwvJg/2uc01Tg+9ntfxpfujvtMk1TYiYj2gBafmE5tw2ZGBpqxm93b1lOA ybO2qSM2YJWvMjssHtrnLwAZndx1Cm494wud+eZpeejHDueirnp5MFLSqA3/Pz1zVbHu NLvRjdaxfyYVHV59ghBlZdi2iHXmbshKcw4CZPH+xhhc9zN3mvd8ri+RpJlxvfVmAR9T oebcvlylamWQyKepfycWxbmRgRQru+XoNXpKd5G7Lr0AxC26fluvf2x4IcXyRVAHxCNY tbJGXf+tNhFX2d3D0tJ1KuIPOD0KIgNKiRGses4Xn/aLP/zbxJRNA3MQAKzM9GpbWLXb 8Oig== 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=pyNN/cBC8H0d9mt1rt0a7Z0pTJTwhk8gYyIq7n/7xJo=; b=jDlE+iEIjxBZNsTm6KQqvaFGP3/JfKPQHWo7IO/gZmiQtwDqmZSRhrZkiY1TdHH4CO MnHvdI4VOl9tQEeiviw0H1RXFdKn/ezn5GtZNKLwk/SPV/ZUjN1xjFHFdvW9YT2geRXN cPEa4Qkl+qZvRUHhjz6xU0sOAaFHfuGgKJ5NqdOWv1tMSsfkzAfsmIJXM6ObhGTw/wDU ixb1Xq7kz0EqnfdnwuBgxtCuFnx2DMf0L2fsmyvidYBfcDx8o6EhrsBVWYKP9PhVBQq8 UOd3/yXKVyyKbzfcyZY3NZn49BmuMpLb1j40KZb3Zfn1nbRccrcoTEcdh3sMZFlXIQNh 0zDQ== X-Gm-Message-State: AHQUAuZ1i5+l5ZazF5vjpa4IT5pRb4ysaMSocdRrx+MgQCuSKLflCFji awa0n0+V6GyNsmmbXN6dI4UWudJbM0w= X-Google-Smtp-Source: AHgI3IaIzyOCAqTzDveM2kV3aUqjgrqlZBHRTWm/rAVePpIAU97U8n3ZEnfHOJPGd2g1kb6RWnSxaA== X-Received: by 2002:a63:ea4f:: with SMTP id l15mr455812pgk.102.1549301457148; Mon, 04 Feb 2019 09:30:57 -0800 (PST) Received: from localhost ([207.114.172.147]) by smtp.gmail.com with ESMTPSA id g11sm730212pfo.139.2019.02.04.09.30.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Feb 2019 09:30:56 -0800 (PST) From: Moritz Fischer To: netdev@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alex.williams@ni.com, andrew@lunn.ch, robh+dt@kernel.org, davem@davemloft.net, moritz.fischer@ettus.com, Moritz Fischer Subject: [PATCH net-next 2/3] net: nixge: Add support for fixed-link configurations Date: Mon, 4 Feb 2019 09:30:39 -0800 Message-Id: <20190204173040.5538-3-moritz.fischer@ettus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204173040.5538-1-moritz.fischer@ettus.com> References: <20190204173040.5538-1-moritz.fischer@ettus.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Moritz Fischer Add support for fixed-link configurations to nixge driver. Signed-off-by: Moritz Fischer --- drivers/net/ethernet/ni/nixge.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c index c8dd1e4c759d..96f7a9818294 100644 --- a/drivers/net/ethernet/ni/nixge.c +++ b/drivers/net/ethernet/ni/nixge.c @@ -1282,9 +1282,9 @@ static int nixge_of_get_resources(struct platform_device *pdev) static int nixge_probe(struct platform_device *pdev) { + struct device_node *mn, *phy_node; struct nixge_priv *priv; struct net_device *ndev; - struct device_node *mn; const u8 *mac_addr; int err; @@ -1353,21 +1353,30 @@ static int nixge_probe(struct platform_device *pdev) goto unregister_mdio; } - priv->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); - if (!priv->phy_node) { - netdev_err(ndev, "not find \"phy-handle\" property\n"); - err = -EINVAL; - goto unregister_mdio; + phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); + if (!phy_node && of_phy_is_fixed_link(pdev->dev.of_node)) { + err = of_phy_register_fixed_link(pdev->dev.of_node); + if (err < 0) { + netdev_err(ndev, "broken fixed-link specification\n"); + goto unregister_mdio; + } + phy_node = of_node_get(pdev->dev.of_node); } + priv->phy_node = phy_node; err = register_netdev(priv->ndev); if (err) { netdev_err(ndev, "register_netdev() error (%i)\n", err); - goto unregister_mdio; + goto free_phy; } return 0; +free_phy: + if (of_phy_is_fixed_link(pdev->dev.of_node)) + of_phy_deregister_fixed_link(pdev->dev.of_node); + of_node_put(phy_node); + unregister_mdio: if (priv->mii_bus) mdiobus_unregister(priv->mii_bus); @@ -1385,6 +1394,10 @@ static int nixge_remove(struct platform_device *pdev) unregister_netdev(ndev); + if (of_phy_is_fixed_link(pdev->dev.of_node)) + of_phy_deregister_fixed_link(pdev->dev.of_node); + of_node_put(priv->phy_node); + if (priv->mii_bus) mdiobus_unregister(priv->mii_bus); From patchwork Mon Feb 4 17:30:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 1036086 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ettus.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ettus-com.20150623.gappssmtp.com header.i=@ettus-com.20150623.gappssmtp.com header.b="hUUUihBr"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43tZW04Q8Wz9sMl for ; Tue, 5 Feb 2019 04:31:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728546AbfBDRbG (ORCPT ); Mon, 4 Feb 2019 12:31:06 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46807 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727656AbfBDRa7 (ORCPT ); Mon, 4 Feb 2019 12:30:59 -0500 Received: by mail-pg1-f194.google.com with SMTP id w7so199516pgp.13 for ; Mon, 04 Feb 2019 09:30:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ettus-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CQIR+vQkRw03k7f92bCCQ4fkFdpX2pG/UQ43gReR3v4=; b=hUUUihBrOU63Ld/TuDFBawn3XJYBlwYLusn++lYN0EMoyw1EFSJGqb+1U6OPJruy+k X3JdQf/ELBjAk9D39XW9kV42mu4CRMpqoetJXG0UhnFQEjGSJ+FocV8cIgMljAdSJYM/ i+vCQ6a9t0LtPGM5FAp3qb/fDc7XSpjlnhkoknv2G6GgOudoDvMC1nO3SCtt6q73jGi4 thvTc04fwlK0KlYjIXj3YTmjfcRY6ODLyB40NXJ336Q5bBbysLOfHFU8/4un8u0e7oPG rndbNBH0VfTEXk9BERN5hzCaHrC60DqSW2GakD06Rp84qhhxtyGSZlvQ/8RvBHp6KxcF B+jQ== 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=CQIR+vQkRw03k7f92bCCQ4fkFdpX2pG/UQ43gReR3v4=; b=dyxkw982aLVBv/q7Zsp9rrB4gVeTGkNh0toc/lf1rh+km7yjiVqvj3NRBANF8wbccL jLeoo6mOdJy/yrtKtfC4uaus7sn7G93SDYDhBkimw7LQWw5HuhQBJcqtGBcO+nVbDKD9 L9ibfx4SxH9t/gQdyZzPnThd+m0qdRkfi3yVQxfaGtB7EXgIBzIDr+t/xndRCNRik8Qb vvDOsUejoiVik5mP1oldH0L7S+JzXs4DnLfoZP8yu7HcXnzsw6xcAP8jWxNPydmpuS3j Vpywdhxasz1exmvYnD1D9CVllqxMwpM30Hy78KCgPuLmKNN/dgaF+ApvFh4JilDpz8Z2 xVYA== X-Gm-Message-State: AHQUAua+PLx+EXZ0Xj9/APRJxrksf0daKJrhq0mKK1WDchFYgT6gWJdC wm1/IlWw18S8iPGYI6/6chXJP8nVQlE= X-Google-Smtp-Source: AHgI3Ib4WCSRBf+WFdSunDIaUdDJOwXjIkqwp+XXCV49C6XfgX5YUHWr5DdBrMDGcvrDfqXikQ6ROw== X-Received: by 2002:a62:53c5:: with SMTP id h188mr478199pfb.190.1549301458476; Mon, 04 Feb 2019 09:30:58 -0800 (PST) Received: from localhost ([207.114.172.147]) by smtp.gmail.com with ESMTPSA id d18sm815373pfj.47.2019.02.04.09.30.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Feb 2019 09:30:58 -0800 (PST) From: Moritz Fischer To: netdev@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alex.williams@ni.com, andrew@lunn.ch, robh+dt@kernel.org, davem@davemloft.net, moritz.fischer@ettus.com, Moritz Fischer Subject: [PATCH net-next 3/3] dt-bindings: net: Add fixed-link support Date: Mon, 4 Feb 2019 09:30:40 -0800 Message-Id: <20190204173040.5538-4-moritz.fischer@ettus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204173040.5538-1-moritz.fischer@ettus.com> References: <20190204173040.5538-1-moritz.fischer@ettus.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Moritz Fischer Update device-tree binding with fixed-link support. With fixed-link support the formerly required property 'phy-handle' is now optional if 'fixed-link' child is present. Signed-off-by: Moritz Fischer --- .../devicetree/bindings/net/nixge.txt | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/nixge.txt b/Documentation/devicetree/bindings/net/nixge.txt index bb2929f9c64f..85d7240a9b20 100644 --- a/Documentation/devicetree/bindings/net/nixge.txt +++ b/Documentation/devicetree/bindings/net/nixge.txt @@ -12,12 +12,14 @@ Required properties: - interrupts: Should contain tx and rx interrupt - interrupt-names: Should be "rx" and "tx" - phy-mode: See ethernet.txt file in the same directory. -- phy-handle: See ethernet.txt file in the same directory. - nvmem-cells: Phandle of nvmem cell containing the MAC address - nvmem-cell-names: Should be "address" Optional properties: - mdio subnode to indicate presence of MDIO controller +- fixed-link : Assume a fixed link. See fixed-link.txt in the same directory. + Use instead of phy-handle. +- phy-handle: See ethernet.txt file in the same directory. Examples (10G generic PHY): nixge0: ethernet@40000000 { @@ -59,3 +61,32 @@ Examples (10G generic PHY, no MDIO): phy-mode = "xgmii"; phy-handle = <ðernet_phy1>; }; + +Examples (1G generic fixed-link + MDIO): + nixge0: ethernet@40000000 { + compatible = "ni,xge-enet-2.00"; + reg = <0x40000000 0x6000>; + + nvmem-cells = <ð1_addr>; + nvmem-cell-names = "address"; + + interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>, <0 30 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "rx", "tx"; + interrupt-parent = <&intc>; + + phy-mode = "xgmii"; + + fixed-link { + speed = <1000>; + pause; + link-gpios = <&gpio0 63 GPIO_ACTIVE_HIGH>; + }; + + mdio { + ethernet_phy1: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <4>; + }; + }; + + };