From patchwork Thu Jun 28 19:47:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 936380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="UCJBJ8UL"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41Gr174KD6z9ryk for ; Fri, 29 Jun 2018 05:48:11 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 37B52C21C50; Thu, 28 Jun 2018 19:48:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 834DDC21C4A; Thu, 28 Jun 2018 19:48:00 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 017AEC21C50; Thu, 28 Jun 2018 19:47:58 +0000 (UTC) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lists.denx.de (Postfix) with ESMTPS id 76058C21C29 for ; Thu, 28 Jun 2018 19:47:58 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id w5SJltvj122280; Thu, 28 Jun 2018 14:47:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1530215275; bh=xDOYtTwxJFNvpZMmL10qbE1vv3iofO+AJmTvSrm/fEg=; h=From:To:CC:Subject:Date; b=UCJBJ8UL/WYOc09MV5qX197GY92Q8D44rhVVFDl9u4M8L5lpmOGy+KfbwkVuHzmqZ m5t1FEWLWmnoth33SNO8kKT2x+srSovy0TYcf3fnYR1DTn8ssGjcss7ESkJhDvZ4Xx PHAk9xL5wkHqyyQgXKwtir6hZL/eFivmCi7U0kcE= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w5SJltOB003453; Thu, 28 Jun 2018 14:47:55 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 28 Jun 2018 14:47:55 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 28 Jun 2018 14:47:55 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w5SJltKl005425; Thu, 28 Jun 2018 14:47:55 -0500 Received: from localhost (uda0226610.dhcp.ti.com [128.247.59.147]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w5SJltx15529; Thu, 28 Jun 2018 14:47:55 -0500 (CDT) From: Grygorii Strashko To: Joe Hershberger , Lokesh Vutla Date: Thu, 28 Jun 2018 14:47:50 -0500 Message-ID: <20180628194755.28504-1-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.10.5 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: Tom Rini , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/5] net: phy: prevent uclass_eth device "node" field overwriting X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This series prevents the UCLASS_ETH device "node" field overwriting by some network drivers when Ethernet PHYs are linked to UCLASS_ETH device using "phy-handle" DT property and when Ethernet PHY driver needs to read some additional information from DT (like dp83867). It fixes following cases: - network drivers priv->phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface); <-- phydev is connected to dev which is UCLASS_ETH device if (priv->phy_of_handle > 0) dev_set_of_offset(priv->phydev->dev, priv->phy_of_handle); <-- phydev->dev->node is overwritten by phy-handle DT node - PHY driver in .config() callback int node = dev_of_offset(dev); <-- PHY driver uses overwritten dev->node const void *fdt = gd->fdt_blob; if (fdtdec_get_bool(fdt, node, "property")) ... As result, UCLASS_ETH device can't be used any more for DT accessing. It adds new field ofnode node to struct phy_device and updates TI CPSW and zynq_gem drivers to use it. zynq_gem.c, xilinx_phy.c changes only build tested. Dependency: This series has dependency from https://patchwork.ozlabs.org/cover/936370/ due to possible merge conflicts PS: Not sure if any other Net drivers need to be updated, at least I've not found any. Grygorii Strashko (5): net: phy: add ofnode node to struct phy_device net: phy: dp83867: switch to use phy_get_ofnode() net: phy: xilinx: switch to use phy_get_ofnode() drivers: net: cpsw: fix phy dt node setting drivers: net: zynq_gem: fix phy dt node setting drivers/net/cpsw.c | 2 +- drivers/net/phy/ti.c | 7 +++++-- drivers/net/phy/xilinx_phy.c | 10 ++++++---- drivers/net/zynq_gem.c | 2 +- include/phy.h | 13 +++++++++++++ 5 files changed, 26 insertions(+), 8 deletions(-)