From patchwork Thu Dec 3 09:25:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 1410233 X-Patchwork-Delegate: eugen.hristev@microchip.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=VWm3yu7l; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cmr831qvBz9s1l for ; Thu, 3 Dec 2020 20:26:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 216DB82829; Thu, 3 Dec 2020 10:26:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="VWm3yu7l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0BE48282B; Thu, 3 Dec 2020 10:26:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from esa3.microchip.iphmx.com (esa3.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6D6C68280B for ; Thu, 3 Dec 2020 10:26:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Claudiu.Beznea@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1606987571; x=1638523571; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=iKwKX7WsadrkZxDA8IvDNXV8wQvTtZkS2bDw3D96KaE=; b=VWm3yu7lD69D29futhT60hIERGU0mvSucUuo7eQF/o7xY6zNOYc1pzyC kt3ENuau/cZunf0e2swDDFwU7UuvtBn37k4Od+wVT5M8y6tM2fQkPvg2K Jxr9meg4tI+NzmyMDmt/f6Ye+b/uyTPhMMdQTeKxJliOJEamj+V6ZFm9g u+QIERO4YKuoQbV1CIXHDHdSgNRkXdjYgufW74D6gY5wbR4mmMz8RK2E8 IADXkpuLgtbDvZD3USkxCWeFW6KCDvLUgnK5iQ93c8PcjNdBV54lpkq23 NXAeoCgW9yK0yNUBALnK2QoaaoMJ6lRfPjJe6laoknqe76bToVvPS01/b Q==; IronPort-SDR: EhFdUoyu/6D78HYYQ61IQMeUhswMDI9rXB8InRKrkRoM5a9xaj2AnyFSMsSn02uiqxwtqcM9+V yeXqSXuo8emJ6S3EUqsxA3SxlpFhiqaIADAe0SOVUAYezgAsWGjiu5An/vVWKIDIhTxiOhT2zO 7wagm7InXl+h58/hw6hCfGtQqZ7rYfMxDT0ZXYkM/NxU49MkmkroUlW7WBaaePiiuFm8dvMFGo C5c7xObIrmiOwSOT9SCwjlYtDx5g6oHltbEZr/2LJnH0gzbzrIdoVflt35uc/xx4M3OrkP8kET Z2k= X-IronPort-AV: E=Sophos;i="5.78,389,1599548400"; d="scan'208";a="101254001" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Dec 2020 02:26:10 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 3 Dec 2020 02:26:10 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 3 Dec 2020 02:26:09 -0700 From: Claudiu Beznea To: CC: , Claudiu Beznea Subject: [PATCH 6/6] net: macb: take into account all RGMII interface types Date: Thu, 3 Dec 2020 11:25:56 +0200 Message-ID: <1606987556-20217-7-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1606987556-20217-1-git-send-email-claudiu.beznea@microchip.com> References: <1606987556-20217-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Take into account all RGMII interface types. Depending on it the RGMII PHY's timings are setup. Signed-off-by: Claudiu Beznea --- drivers/net/macb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index e3003cb4a619..127d6e899bad 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -630,7 +630,7 @@ static int macb_phy_init(struct macb_device *macb, const char *name) #else /* need to consider other phy interface mode */ macb->phydev = phy_connect(macb->bus, macb->phy_addr, &macb->netdev, - PHY_INTERFACE_MODE_RGMII); + macb->phy_interface); #endif if (!macb->phydev) { printf("phy_connect failed\n"); @@ -857,7 +857,10 @@ static int _macb_init(struct macb_device *macb, const char *name) * to select interface between RMII and MII. */ #ifdef CONFIG_DM_ETH - if (macb->phy_interface == PHY_INTERFACE_MODE_RGMII) + if (macb->phy_interface == PHY_INTERFACE_MODE_RGMII || + macb->phy_interface == PHY_INTERFACE_MODE_RGMII_ID || + macb->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID || + macb->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) val = macb->config->usrio->rgmii; else if (macb->phy_interface == PHY_INTERFACE_MODE_RMII) val = macb->config->usrio->rmii;