Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2129725lqt; Mon, 22 Apr 2024 02:12:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQU5OuRon5VSbvMjzZ97+rYutN6IqFnt6NgvCcy+QG9XAIGMfXqGHn6I4mdKHe6oAznVShaRuaZuaPe5FIOCl6guqEw79WzdxKw77LDg== X-Google-Smtp-Source: AGHT+IG/6eejpdy/zbq/+yBzx0oRJlXbgJUg5lEPA2++kHhelM3VCKrqnMwvJL+uarNWVvvj2YK/ X-Received: by 2002:a05:620a:1908:b0:78d:6182:fa35 with SMTP id bj8-20020a05620a190800b0078d6182fa35mr12319181qkb.53.1713777173994; Mon, 22 Apr 2024 02:12:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713777173; cv=pass; d=google.com; s=arc-20160816; b=LChImJ2lg4WVD4B65oEwluiOzUsGrFwrmYMeykdqnKHINxi2ajo2x1GckeeH4jdUT0 lm5WUMmKT6MZg7tYhF0SkOHGNKHGV7PWfn2/iC3BFnXe4OJL3p57hYnTBc2fuFnRiQ2v ROaUV99jiNzsUSYGHfGO7ztoEOWEHRSic9fQlNXryt8Af7QnCLitLXZIs3luMDW4kfW7 ch1gt+3A2gr2XNUKL7w1jV2B0lZf6gnsF2Fu5d16kie05Hk+yvnfNDHxy50oDhgjnYz+ knaQSXMeaVc/uxxLrtTlX6bOGzSHMw3mVHmcYQeNRf0ivzk4sIlFVrZhrgKjvwnB4KPg rq3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=LUXy42KiwkMsfzFd8SftlWu2Tv7A1Nv/ePpZqOKpeVo=; fh=yl3dsFJNsTk+vupE8wVDpuQ3cyMK0OlYCGufpLMyQ84=; b=kv787nS/HDWWE2xKzdP6bM+AmroLQ+bbP/XFIvZZGVGPf3/aQkUt7/OgQxoXa6sDFu CiC2VndWRWc+ZMR6G7t5CC062prm5Uuc6qVNNBpEI313+dHxbLUZbm9GMkqBVNsRH8A/ FlnyWRqPwvYPimaRB2lrcV9VbtpqHPzNR2WdvprxhZonq5F9732lQkMlApByqzj0C/wv hVn0UEitnDMl/MI7dlMmg8Zad2EzuqB8SHt/tpJ+Tfl8w987KpfSB+KZXT44QJvaIF2+ THLjJdRlKYs1ntdt7pqfqAkWyUp9+hsfqFcX5tde5LhKb/xEvC9v4YQUZr80UX06gwHo QkIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ghUDNnpX; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-153068-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153068-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m23-20020a05620a215700b0078d3e84647fsi9645679qkm.674.2024.04.22.02.12.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 02:12:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153068-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ghUDNnpX; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-153068-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153068-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A91481C20B58 for ; Mon, 22 Apr 2024 09:12:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94FCA53E1B; Mon, 22 Apr 2024 09:12:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ghUDNnpX" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB03C4C602 for ; Mon, 22 Apr 2024 09:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713777164; cv=none; b=jNQ3lRSvQmIymCDIV85QY2xlVjK6N0zdM49en7tEfOy2Legsyx29emmwUCi9FbS2a0MkyE9iVeVJoXPqzxCGAoXtdkZsvEf0bU5goSy7mPFB50HS45sqfRZLrkPaUu5IaJbU0QdgXYC9y9JTCbobL06Bz+grVzee7IFF/fl6h7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713777164; c=relaxed/simple; bh=WE0KzX3VJKaep+Dhdb0z/FehMwSsCc8bQKgh8J8SkqQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cdcuDOFbYfLfYpMTFeM4HYRwqB98tHoT5XRUVhahBmCFn22dP9GOWgaVXBHXN1jmxPlwuabhLGI4VV9DhzZ5hOpm4+5h9gaH/wFNu7cJf22T2l/CCia4hCPTh16YBem9wnK/FdDGvwSP7E63Uvu/QYpKPl1gux81FddNFXtiAqo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ghUDNnpX; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a44ad785a44so380938766b.3 for ; Mon, 22 Apr 2024 02:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713777161; x=1714381961; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=LUXy42KiwkMsfzFd8SftlWu2Tv7A1Nv/ePpZqOKpeVo=; b=ghUDNnpXjTYtlVIEFNwFXkp85uBLPy2XgJMncBJ1CX2Q8EkBBKQSdDduznY4DcjGtK RG5egitNrwDKeUHFhodNwagGQngHW2j4KarIA37Xhukt+bmrownXb8CYKLtveQ0fjb3A 9JgE4RmGNZMdPYyeQfDIQk1iAt9bOaC6D3jswM6rt+FQQpU1UCJ9QADFvTGZK5puWm/Z tr6Pv/1d26kyIIVsprNHpY5BB7gZz17dYe+RTKUUTDIxC++Zi+BNNPcIBaCpPJl9kfuB 7QBrB4bxP2XZIzykoTVmN4nL6s3DmVW9WzXaFP7bcOjxX3Bnd8fWIOq8wLzMiVfw5lLF sCuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713777161; x=1714381961; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LUXy42KiwkMsfzFd8SftlWu2Tv7A1Nv/ePpZqOKpeVo=; b=QTg5/Qp3tszy98cO3x8xJgjdFDy0r0vm8/Ys3QQo9y5OLA/Jl5RJBuoGX5iICjiaKj 6ruQM6QhzC3zWfmyL8oqTtacohz1ClvrJ/ZHupnoOLXMOieeDbAobLWyqoXdDfe9D7nY sf8bm6dKVmtxPbMHlmcMW2T9aGLEXPYwGOkemt/iQD0aV/NZLFU6OMA74oZs0OVlr8mH ADC/juh+vr396Dy9+01lWfCl9PieqObw786/1FeXlATX05Eeoe7B1skdL9p1XP+lYwD5 Xrq2pQCkpBB82TxAGjkZuDfqaJXzsO8XyiCFIlpCyTXvdkqABXUWgRTzXRsyLw56jc0q LaRw== X-Forwarded-Encrypted: i=1; AJvYcCVRbEFo5j1UmnQNY0a1E2US/Se+qEWx/vJRlbb4HKbJRUrk9Kjy3u17GJuFx3QT1YfvRhzozNg9yAz7hIpUa8NpU9y78ZGtZl2mM0+k X-Gm-Message-State: AOJu0Yxfde+30cb/f5pZv7cu4ok6/RL0aOpLdcrjb/upYIMxMdYmzvXW G2RrWzWKw1XO9+1T3cPenaej32ggtnW6OsHUaWT2lpP10/K6+R1TOgpAWb26P3c= X-Received: by 2002:a17:907:7e81:b0:a55:b485:fee1 with SMTP id qb1-20020a1709077e8100b00a55b485fee1mr1935856ejc.36.1713777161195; Mon, 22 Apr 2024 02:12:41 -0700 (PDT) Received: from [192.168.1.20] ([178.197.223.16]) by smtp.gmail.com with ESMTPSA id t8-20020a170906a10800b00a4e253c8735sm5525254ejy.52.2024.04.22.02.12.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Apr 2024 02:12:40 -0700 (PDT) Message-ID: <015d5f6c-9209-40fc-9d2c-c642070df99e@linaro.org> Date: Mon, 22 Apr 2024 11:12:38 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] net: stmicro: imx: set TX_CLK direction in RMII mode To: Steffen Trumtrar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Clark Wang , Linux Team , Alexandre Torgue , Jose Abreu , Maxime Coquelin Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com References: <20240422-v6-9-topic-imx93-eqos-rmii-v1-0-30151fca43d2@pengutronix.de> <20240422-v6-9-topic-imx93-eqos-rmii-v1-3-30151fca43d2@pengutronix.de> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLU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VKiJzlvLd9tSe4jRx6Z6LMXhB21fa5DGs/tHAcUF35hSJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240422-v6-9-topic-imx93-eqos-rmii-v1-3-30151fca43d2@pengutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22/04/2024 10:46, Steffen Trumtrar wrote: > In case of RMII connection, the TX_CLK must be set to output direction. > Parse the register and offset from the devicetree and set the direction > of the TX_CLK when the property was provided. > > Signed-off-by: Steffen Trumtrar > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 27 +++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c > index 6b65420e11b5c..0fc81a626a664 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c > @@ -37,6 +37,9 @@ > #define MX93_GPR_ENET_QOS_INTF_SEL_RGMII (0x1 << 1) > #define MX93_GPR_ENET_QOS_CLK_GEN_EN (0x1 << 0) > > +#define MX93_GPR_ENET_QOS_TX_CLK_SEL_MASK GENMASK(1, 1) > +#define MX93_GPR_ENET_QOS_TX_CLK_SEL (0x1 << 1) > + > #define DMA_BUS_MODE 0x00001000 > #define DMA_BUS_MODE_SFT_RESET (0x1 << 0) > #define RMII_RESET_SPEED (0x3 << 14) > @@ -57,7 +60,9 @@ struct imx_priv_data { > struct clk *clk_tx; > struct clk *clk_mem; > struct regmap *intf_regmap; > + struct regmap *enet_clk_regmap; > u32 intf_reg_off; > + u32 enet_clk_reg_off; > bool rmii_refclk_ext; > void __iomem *base_addr; > > @@ -116,6 +121,18 @@ static int imx93_set_intf_mode(struct plat_stmmacenet_data *plat_dat) > break; > case PHY_INTERFACE_MODE_RMII: > val = MX93_GPR_ENET_QOS_INTF_SEL_RMII; > + > + /* According to NXP AN14149, the direction of the > + * TX_CLK must be set to output in RMII mode. > + */ > + if (dwmac->enet_clk_regmap) > + regmap_update_bits(dwmac->enet_clk_regmap, > + dwmac->enet_clk_reg_off, > + MX93_GPR_ENET_QOS_TX_CLK_SEL_MASK, > + MX93_GPR_ENET_QOS_TX_CLK_SEL); > + else > + dev_warn(dwmac->dev, "TX_CLK can't be set to output mode.\n"); > + > break; > case PHY_INTERFACE_MODE_RGMII: > case PHY_INTERFACE_MODE_RGMII_ID: > @@ -310,6 +327,16 @@ imx_dwmac_parse_dt(struct imx_priv_data *dwmac, struct device *dev) > dev_err(dev, "Can't get intf mode reg offset (%d)\n", err); > return err; > } > + > + dwmac->enet_clk_regmap = syscon_regmap_lookup_by_phandle(np, "enet_clk_sel"); > + if (IS_ERR(dwmac->enet_clk_regmap)) > + return PTR_ERR(dwmac->enet_clk_regmap); This looks like breaking ABI. Please test your changes without the DTS. Does the DTS pass dtbs_check? Does the driver probe correctly with such DTS? Best regards, Krzysztof