From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vps0.lunn.ch ([185.16.172.187]:59460 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932302AbeBTC2z (ORCPT ); Mon, 19 Feb 2018 21:28:55 -0500 From: Andrew Lunn To: paul.burton@mips.com Cc: netdev , Andrew Lunn Subject: [PATCH net-next RFC 0/2] Convert OKI PCH GBE to mdiobus and phylib Date: Tue, 20 Feb 2018 03:28:17 +0100 Message-Id: <1519093699-26437-1-git-send-email-andrew@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: Hi Paul Here is my stab at converting the OKI PCH GBE to use the common MDIO bus and phylib drivers. This is compile tested only, and pretty much guaranteed to be broken. But hopefully it will help you. Feel free to pick it up and make it work. Without hardware, there is not much more i can do, other than answer questions. The handling of the GPIO for reset is possibly wrong. 1) It is probably active high, when active low is wanted. Your patch would sort this out. 2) It is possible the reset happens too late. Since there is no device tree binding for the minnow board, it is not possible to register the gpio with the core code until after it has been probed and attached to the MAC. If the PHY is being held in reset, it might not respond to the bus scan, and hence we fail to find it. If that is true, we need a different solution. Andrew Lunn (2): net: phy: at803x: Export at803x_debug_reg_mask() net: ethernet: pch_gbe: Convert to mdiobus and phylib drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | 1 + drivers/net/ethernet/oki-semi/pch_gbe/Makefile | 2 +- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h | 35 +- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_api.c | 118 ------- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_api.h | 8 +- .../ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c | 89 +---- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 373 ++++++++++---------- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c | 265 --------------- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c | 377 --------------------- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.h | 37 -- drivers/net/phy/at803x.c | 5 +- include/linux/at803x_phy.h | 16 + 12 files changed, 227 insertions(+), 1099 deletions(-) delete mode 100644 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c delete mode 100644 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.h create mode 100644 include/linux/at803x_phy.h -- 2.16.1