From patchwork Thu Sep 15 20:33:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Pearson X-Patchwork-Id: 670589 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sZr4l4drPz9sD5 for ; Fri, 16 Sep 2016 06:44:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=raptorengineering.com header.i=@raptorengineering.com header.b=uJCvzrfS; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3sZr4l3PdXzDsZJ for ; Fri, 16 Sep 2016 06:44:39 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=raptorengineering.com header.i=@raptorengineering.com header.b=uJCvzrfS; dkim-atps=neutral X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Received: from mail.rptsys.com (mail.rptsys.com [192.119.205.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sZr3f547jzDsYf for ; Fri, 16 Sep 2016 06:43:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=raptorengineering.com header.i=@raptorengineering.com header.b=uJCvzrfS; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 5FE14641135 for ; Thu, 15 Sep 2016 15:33:50 -0500 (CDT) Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id aW6kQOYwtbad for ; Thu, 15 Sep 2016 15:33:50 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id E3C1E641136 for ; Thu, 15 Sep 2016 15:33:49 -0500 (CDT) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.rptsys.com E3C1E641136 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD; t=1473971629; bh=0N1YIf/ROoKNaTc9ETWP1C3Sqel30s0DxrZPRilmX6w=; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding; b=uJCvzrfSidD9L5uxRCMkrF38G+ga0AMZDRNqC+QOsky65zePImuA5n5Kplq26XhKn l92lcwRMDC8x0TZW6aRRAJjWVs6kSLteAJyUHWfZyu95otVEb+qstK0uGzAFFLT2xc r4GJB0sgUBGol8IXAObT6AH8RAGbPtCKblMwlvn0= X-Virus-Scanned: amavisd-new at rptsys.com Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qL2pmMWCux9d for ; Thu, 15 Sep 2016 15:33:49 -0500 (CDT) Received: from vali.starlink.edu (vali.starlink.edu [192.168.3.21]) by mail.rptsys.com (Postfix) with ESMTP id B7BBA641135 for ; Thu, 15 Sep 2016 15:33:49 -0500 (CDT) Date: Thu, 15 Sep 2016 15:33:49 -0500 (CDT) From: Timothy Pearson To: openbmc@lists.ozlabs.org Message-ID: <1076636982.194621.1473971629669.JavaMail.zimbra@raptorengineeringinc.com> Subject: [PATCH 03/16] Ensure that the old style MDIO interface is active MIME-Version: 1.0 X-Mailer: Zimbra 8.5.0_GA_3042 (ZimbraWebClient - FF3.6 (Linux)/8.5.0_GA_3042) Thread-Topic: Ensure that the old style MDIO interface is active Thread-Index: XWLR4y6PiMPjn5pyIiEdEDVNVhBT5A== X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" before registering the MDIO bus on Faraday style MACs. Without this patch the hardware may continue to expect new style commands, yielding MDIO timeouts and general lack of communication with the MII. Signed-off-by: Timothy Pearson --- drivers/net/ethernet/faraday/ftgmac100.c | 6 ++++++ drivers/net/ethernet/faraday/ftgmac100.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index c20f767..778c625 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1250,6 +1250,7 @@ static int ftgmac100_setup_mdio(struct net_device *netdev) { struct ftgmac100 *priv = netdev_priv(netdev); struct platform_device *pdev = to_platform_device(priv->dev); + uint32_t revcr; int i, err = 0; /* initialize mdio bus */ @@ -1257,6 +1258,11 @@ static int ftgmac100_setup_mdio(struct net_device *netdev) if (!priv->mii_bus) return -EIO; + /* This driver only supports the old MDIO interface -- enable it */ + revcr = ioread32(priv->base + FTGMAC100_OFFSET_REVR); + revcr &= ~FTGMAC100_OFFSET_REVR_NEW_INTERFACE; + iowrite32(revcr, priv->base + FTGMAC100_OFFSET_REVR); + priv->mii_bus->name = "ftgmac100_mdio"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%d", pdev->name, pdev->id); diff --git a/drivers/net/ethernet/faraday/ftgmac100.h b/drivers/net/ethernet/faraday/ftgmac100.h index d07b6ea..ee5f758 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.h +++ b/drivers/net/ethernet/faraday/ftgmac100.h @@ -133,6 +133,8 @@ #define FTGMAC100_DMAFIFOS_RXDMA_REQ (1 << 30) #define FTGMAC100_DMAFIFOS_TXDMA_REQ (1 << 31) +#define FTGMAC100_OFFSET_REVR_NEW_INTERFACE (1 << 31) + /* * Receive buffer size register */