From patchwork Wed Feb 1 13:58:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 649168 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp303219pva; Wed, 1 Feb 2023 06:05:01 -0800 (PST) X-Google-Smtp-Source: AK7set+jFAR3x9yKCTiR1mWNmwj1V6bGAFef75KdBMLOBRMbrxxMZLdTaJIIWIL6FizpAJ+Rl1Nk X-Received: by 2002:a9d:1b66:0:b0:68b:b534:c8e4 with SMTP id l93-20020a9d1b66000000b0068bb534c8e4mr1422373otl.7.1675260301480; Wed, 01 Feb 2023 06:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675260301; cv=none; d=google.com; s=arc-20160816; b=q9ETyfk+5WUJkgxcen3F8MQsCz1yVZFziaD2xbcImVwbPOFShVg1tlhm5dL8yh8VSO cQdWESE9eL48ZM4PBHZ4DazyYPjswE47Zt+77LV6ykCk3C46m5A1sulhLtSzhuG2u/tW RvJPglFvPGY0DTaHzGskKp78LcqIbdNjKBBjRJGZI6OHog4L0gKTFUYbvYLdWhJ7T/tu w/+w21zPlvKDQgCrLMXgseBTW2SFPUs7tjv3V2acUw9Yt4vGD1ls5eetrm+vwTVp/HSX 6N2j1JUttqYXwwgebDBdaUQ3iFb5z3m2pbt694iQjF0vbDbGVe5mJ8OLJTMoXXF/WWO8 bAgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nQ4N2iEXD19K17SmVs7Q6jYkWQq8B8obtRDPStpvTrA=; b=UfBJPfAnp9zvA6ajsrbq4SVIpNl9sWemzjIT4KEFX2GZBPJZ9SJRlgQEXCqwy8sxro 2zFCkZqHbaV90XZaWwhTyBipNiNXr7rxa7ppeaH2ea3Niyvi2k7wzVLw6XMkGEEMD+d1 C3ZtyGF7JdV6QivhlzDDWpG1ld1IWQR+SidJXN4wN1gVHFP4PbEk0kRDRk4PubS35gd8 oNOk5i1CEJj4L5dDjaTdLv/2ArvbfO+cZTYu83RIiQqmb5J9yjN3PSuhr04Q7vf/KPqR f7yPZrj8kP5QlkcPrNmufOzIa1cnhO9WfDs+y98zDrtB/wUZcEGNGcuiqWLptmE982mp qGjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rAaetirJ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id y1-20020a0568302a0100b0068be5783976si3826787otu.51.2023.02.01.06.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 06:05:01 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rAaetirJ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D3F8C85C9D; Wed, 1 Feb 2023 15:03:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="rAaetirJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12DA485C52; Wed, 1 Feb 2023 15:00:48 +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=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BL_SPAMCOP_NET, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4AFE485C75 for ; Wed, 1 Feb 2023 14:59:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x632.google.com with SMTP id be8so18514824plb.7 for ; Wed, 01 Feb 2023 05:59:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nQ4N2iEXD19K17SmVs7Q6jYkWQq8B8obtRDPStpvTrA=; b=rAaetirJqBvIr/p8cDYKwoyrtahbriwVUL0Bf6emPuqapbCDGMMelpK4hJp8p/0VCa BaXG9GWy0J/RZA6eCQzSJd/mv4Wdir5eizX0N9ef2PE7pA774jKHb2bsXg2WJtH+Gapv 0XGOXFlY+8eN4Q7W6aF104z9BmMNGKLiACNhB0RwzNSAALe7jDqQqKzrdnHJKujARPQ2 g6xsqwy2dxvMmcFsuACfy3YNssuZiuOrvVZOXkdylJt7wR/TgKbpYN3Tvnm46ZKjULHt wQBSguT+XP9HL9t8u6OpthA9YRQcSG7jW4txIgxp7uxSJBlXb4pPncjCHa3n90aiK7px SU5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nQ4N2iEXD19K17SmVs7Q6jYkWQq8B8obtRDPStpvTrA=; b=w4dtpbtO1Shvx3t3FmyS+NIdEcjlBlUcxxHwOoUNmMrCvY65Vb/tnxb8Yh2dMpu8rJ PO5h2xhddf2Cf2sYxSCTxxamZp1ljz99inoBVPcZ0IGywAZJdDdOO5jtwDxv/qSgjbPW KvaPrkfDtz7JKeOxdLr6rOhlABqmslMB1HVUFBIeayvSQ+fDZUDGOIyqgY5l+bRwxGnP bvmQCyRu2Su3smWjrdw53jZI67+1sZwp5z0ZHhDG+SQbMt0sE63ocFzgnlpGwt1fDMr0 GRVjjUN+bq/uSwPpPohMzRWMTQIjKdnF4bteuWXAEP/YA/Z24CFLIwpfMDhyw6ualPAU mL6w== X-Gm-Message-State: AO0yUKUkHjdy5m11W3fBnBT+hvvuREj5x7icTAC0CpGsLVu/bNOe6EC4 9Vil2UiJXqCl2VAhz/Qzef96UMttjaG7Ph0F X-Received: by 2002:a17:902:c652:b0:196:35cf:3b11 with SMTP id s18-20020a170902c65200b0019635cf3b11mr2394519pls.55.1675259979708; Wed, 01 Feb 2023 05:59:39 -0800 (PST) Received: from sumit-X1.. ([223.178.209.222]) by smtp.gmail.com with ESMTPSA id i8-20020a17090332c800b001899c2a0ae0sm3636759plr.40.2023.02.01.05.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 05:59:39 -0800 (PST) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, hs@denx.de, joe.hershberger@ni.com, stephan@gerhold.net, mworsfold@impinj.com, lgillham@impinj.com, jbrennan@impinj.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, daniel.thompson@linaro.org, Sumit Garg Subject: [PATCH v2 06/14] net: dwc_eth_qos: Make eqos_get_tick_clk_rate callback optional Date: Wed, 1 Feb 2023 19:28:53 +0530 Message-Id: <20230201135901.482671-7-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201135901.482671-1-sumit.garg@linaro.org> References: <20230201135901.482671-1-sumit.garg@linaro.org> MIME-Version: 1.0 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 Signed-off-by: Sumit Garg Reviewed-by: Ramon Fried --- drivers/net/dwc_eth_qos.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index afc47b56ff..753a912607 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -774,10 +774,13 @@ static int eqos_start(struct udevice *dev) pr_err("eqos_calibrate_pads() failed: %d", ret); goto err_stop_resets; } - rate = eqos->config->ops->eqos_get_tick_clk_rate(dev); - val = (rate / 1000000) - 1; - writel(val, &eqos->mac_regs->us_tic_counter); + if (eqos->config->ops->eqos_get_tick_clk_rate) { + rate = eqos->config->ops->eqos_get_tick_clk_rate(dev); + + val = (rate / 1000000) - 1; + writel(val, &eqos->mac_regs->us_tic_counter); + } /* * if PHY was already connected and configured,