Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A442EC5479D for ; Wed, 11 Jan 2023 07:31:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B29780EB7; Wed, 11 Jan 2023 08:30:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1673422258; bh=OLrF8tZLWoQeBnjxIF+8ybnY/htLriucAm0OA3B9OII=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=PK0MQXFY4WLwHrIxkXtqLHGk2zAhbPGgt2XwMhsoE9BnCRmmawoyrvaexSAVX73Uy QLdAeZDs5kx/OJRS2J2H5GFESdfwoIGT3Cf/UXppY87CLuhxZ8DPPl+tcEOIoj9xwM ejjFzgXEt52h88HkohcqcTYp1eaGyWtR/9OwuutaVYoeDf0VZ0C+97ewuHwJZJmbIX Jrv5pt1tZ4CbMReN+QZiIfEdafsV1MdV8ugnRy/BfmVv6uxxJSpzTVSTC7Tx+ayJe4 tC0ktYazPyy7OwHs2yzSoPeSwktjPW9EhoOkE2HZCzGE+obetgA/QE6rCWiSdCTDGu h5AtevggM7t2A== Received: by phobos.denx.de (Postfix, from userid 109) id 9318B85676; Wed, 11 Jan 2023 08:30:56 +0100 (CET) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [IPv6:2001:67c:2050:101:465::107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 720F680EB7 for ; Wed, 11 Jan 2023 08:30:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4NsK982Tvsz9sVL; Wed, 11 Jan 2023 08:30:52 +0100 (CET) From: Stefan Roese To: u-boot@lists.denx.de Cc: Michal Simek , Ramon Fried , Sean Anderson Subject: [PATCH] net: zynq_gem: Add a 10ms delay in zynq_gem_init() Date: Wed, 11 Jan 2023 08:30:51 +0100 Message-Id: <20230111073051.1248341-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean In our system using ZynqMP with an external SGMII PHY it's necessary to wait a short while after the configuration in zynq_gem_init() before the xfer starts. Otherwise the first packet(s) might get dropped, resulting in a delay at the start of the ethernet transfers. This patch adds a minimal delay of 10ms which fixes problems of dropped first packages. Signed-off-by: Stefan Roese Cc: Michal Simek Cc: Ramon Fried Cc: Sean Anderson --- drivers/net/zynq_gem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 507b19b75975..26e468766871 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -522,6 +522,13 @@ static int zynq_gem_init(struct udevice *dev) return ret; } } + + /* + * Some additional minimal delay seems to be needed so that + * the first packet will be sent correctly + */ + mdelay(10); + setbits_le32(®s->nwctrl, ZYNQ_GEM_NWCTRL_RXEN_MASK | ZYNQ_GEM_NWCTRL_TXEN_MASK); -- 2.39.0