Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp872331rdh; Thu, 26 Oct 2023 19:57:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFp8guOJIn1wEJr456d2E+xryCljaZSn66sX7dH2lYgpe6pLK1GzfMH5hvI6rvLgGhT8o4y X-Received: by 2002:a25:c750:0:b0:d9c:f4ce:28c with SMTP id w77-20020a25c750000000b00d9cf4ce028cmr1264129ybe.12.1698375430951; Thu, 26 Oct 2023 19:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698375430; cv=none; d=google.com; s=arc-20160816; b=NUCjX/QpJXZWcRK5fTvXNza26MmTNmDJ1K+iz3vi7BCD9pMDPTMOFsmC87PL3CP7nW SwoFfFsP4sNjwzgNVkeJ074OtMLxs5/BEMq0cTaYXdWGB9oz/5ymF04ivUJ81SvGT7/D qmituqa1Xix7QcfIjMkKqhUauIOsPUC9FbNpui3GxQz7Nqd+xQX3i+v8CmCP/JqcSSu2 yRAZSUGwdcrddO4t4NtGNSeLL77WS7Uyk2hfpZEDEh+mNsPObov+S4/uoXAusiBp7NWy BO3LFfdwk6IFCxonP9bm+J7ZIE1A+G1knE2k+qnsjUSaBiW7BubyT9QUXPguPjpCgNX9 UVig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LDZeSNoT/F6uceX8xPaWwPCrqzVzl/F9opDYqP7fPJg=; fh=fQUSHtvtXnlA2TWsE6ApI99mIWtCUlG6e9KAZsNxWx4=; b=CFGnEJZZSv5IQINeyCOsEyqyEDw3dksm53ObVBaNlmAtxrK14Q5rJEMDgelocbedjj uggGL+uG2fvSrgIbbdpqePuloGlPuYUdIWZi8xUT9VJS8kV6YMwZ7wTdiDZ77qkewxAI Ccq/8wwoCo9h6Lu5yoz4G7gQuIvvcoaVtmwYr/35NnNiATzpwS5l9zIaadAir3th5Jpt 9BKGGXzlQaKbwlzykfTXd+B4k0JegZKLtae1rCZwo+HVSsAJB13SzykOs9nr+T4xr92Y Sm1ZPimrW5ex06moDNRxlfzpY6gZlomY7Wy2GtL9omNdEr39u8wETmeMJP+yljtlEoNx RaMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lv46pZwI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id r3-20020a258283000000b00da0c49a5fdesi1068488ybk.688.2023.10.26.19.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 19:57:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lv46pZwI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4CA798266305; Thu, 26 Oct 2023 19:57:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345183AbjJ0C5A (ORCPT + 99 others); Thu, 26 Oct 2023 22:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjJ0C46 (ORCPT ); Thu, 26 Oct 2023 22:56:58 -0400 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A130129; Thu, 26 Oct 2023 19:56:56 -0700 (PDT) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1e9d3cc6e7aso997529fac.2; Thu, 26 Oct 2023 19:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698375415; x=1698980215; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LDZeSNoT/F6uceX8xPaWwPCrqzVzl/F9opDYqP7fPJg=; b=lv46pZwIs5MU/Tq1hR90liS7lPOwKAK2cOWtOdt82RlyRayp7exQ/o/lc/+5WfPbdb CJ0LOQkWYn6MuFUFL+NkchQ11aNU+M7fatURhkqV/cKArQqI08I7FcKvceJplnu6Ow6H bK7RaGk/iJG34AadzYHSkNeCKUxLaVV/0uoZvFHCKGaH+ch8f+J+WmWCaKW7jo1O6z9y hlGzIxb8560vsmnakGF/G/0L14/1Eu4E+UY1HEFuyDW3z/pOsO3gt0+v7La7aN9iOnL4 5FxI5GjRLYJM9DsgSb7LWzQOr0cSMNPjJakeKdgfNAh7W2MtI8oOgsc0KKXClTRPDhKo zQNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698375415; x=1698980215; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LDZeSNoT/F6uceX8xPaWwPCrqzVzl/F9opDYqP7fPJg=; b=Bk+x7hGLMkyVNg6yv7lG3CCBF4ddIGpGEiRF5ehprOBXtRToCIoTuV02WVw0N8iQPt Tpx28dWcjr20DelOmi92Ub3G70UkkMywgi7IGv7ZRL6ZQodF2cqzSXdtQmIg1hIrUWLf Oq/DhtY7yNuj990yPyfVrFBH5IYtAq23Jrgap+2foVwGPuh10xXbkkkQlXohwACfR3Hw ZUtttWEAQ26lNLLvvlg9gUcZ6TZF0q88j2eFgng92fmdip9DvVSzhl3eeP4azdHbVzh+ MISuZGbvlqBrygZivPpm4G/TomJGuvMFIyfTg285M1r+cwKRJXlBHqyZP+30XflR35KI E3Aw== X-Gm-Message-State: AOJu0YyhjPS0Ji5NdZeUl+B0osVDyu24VvyRcyX3Ptqr3jqdSXO3N7n9 UefFOYM3rM2kS4M91fK+UKSLkQR8cw0= X-Received: by 2002:a05:6871:4188:b0:1e9:e063:ca6b with SMTP id lc8-20020a056871418800b001e9e063ca6bmr2108233oab.32.1698375414687; Thu, 26 Oct 2023 19:56:54 -0700 (PDT) Received: from localhost.localdomain ([74.48.130.204]) by smtp.googlemail.com with ESMTPSA id z127-20020a633385000000b005b82611378bsm275339pgz.52.2023.10.26.19.56.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 19:56:54 -0700 (PDT) From: Furong Xu <0x1207@gmail.com> To: "David S. Miller" , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joao Pinto , Simon Horman , Jacob Keller Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, xfr@outlook.com, rock.xu@nio.com, Furong Xu <0x1207@gmail.com> Subject: [PATCH net] net: stmmac: xgmac: Fix support for multiple Flexible PPS outputs Date: Fri, 27 Oct 2023 10:56:03 +0800 Message-Id: <20231027025603.1035668-1-0x1207@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 26 Oct 2023 19:57:08 -0700 (PDT) From XGMAC Core 3.20 and later, each Flexible PPS has individual PPSEN bit to select Fixed mode or Flexible mode. The PPSEN must be set, or it stays in Fixed PPS mode by default. XGMAC Core prior 3.20, corresponding PPSEN bits are read-only reserved, always set PPSEN do not make things worse ;) Fixes: 95eaf3cd0a90 ("net: stmmac: dwxgmac: Add Flexible PPS support") Signed-off-by: Furong Xu <0x1207@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 +- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h index 7a8f47e7b728..a4e8b498dea9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h @@ -259,7 +259,7 @@ ((val) << XGMAC_PPS_MINIDX(x)) #define XGMAC_PPSCMD_START 0x2 #define XGMAC_PPSCMD_STOP 0x5 -#define XGMAC_PPSEN0 BIT(4) +#define XGMAC_PPSENx(x) BIT(4 + (x) * 8) #define XGMAC_PPSx_TARGET_TIME_SEC(x) (0x00000d80 + (x) * 0x10) #define XGMAC_PPSx_TARGET_TIME_NSEC(x) (0x00000d84 + (x) * 0x10) #define XGMAC_TRGTBUSY0 BIT(31) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index f352be269deb..53bb8f16c481 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -1178,7 +1178,7 @@ static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index, val |= XGMAC_PPSCMDx(index, XGMAC_PPSCMD_START); val |= XGMAC_TRGTMODSELx(index, XGMAC_PPSCMD_START); - val |= XGMAC_PPSEN0; + val |= XGMAC_PPSENx(index); writel(cfg->start.tv_sec, ioaddr + XGMAC_PPSx_TARGET_TIME_SEC(index)); -- 2.34.1