From patchwork Mon Jul 1 18:28:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 1954887 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=BfcJfUXN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WCZNq1LJtz1xpf for ; Tue, 2 Jul 2024 04:30:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=BfcJfUXN; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WCZNp5M9yz3fR3 for ; Tue, 2 Jul 2024 04:30:50 +1000 (AEST) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=BfcJfUXN; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::12d; helo=mail-lf1-x12d.google.com; envelope-from=fancer.lancer@gmail.com; receiver=lists.ozlabs.org) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4WCZM72rFTz3cR1 for ; Tue, 2 Jul 2024 04:29:23 +1000 (AEST) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-52cdb0d816bso3317194e87.1 for ; Mon, 01 Jul 2024 11:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719858559; x=1720463359; darn=lists.ozlabs.org; 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=GJ6aCZ+zqC/bzroX6nSJ0EOSQTXAboCcbqfSGo7u8OA=; b=BfcJfUXNHwdWVkeziAl/hodA7RFsc+qolRY2/b/QAwEwBE0C7yQltXz7+PoatNzcOI TAyv/p3eFO2Za1QPDfcZS2ENuK5dYHQGPlsnT+hIu8AvJXHZpb/LipGv4nlezHhqX5va FOoCHMKpEm+rhLdbPEs1KPBK4uyIBlir1SQIRNtafudRi9iTaL7eGQDCuOAozLcVxYeg xvhOhz/RAUdn9ouA4ne2WgLuocBm9HkYHQJOSf8qSjsYiN5qWilXGozYwqR6qjP8QtFY XccDf/+w1xSrnUL7Emo8FzNFs63JVyPqnI3Ahvh4Kp1onkI2SQCLyPd+xHkhc2KEwaaL vuWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719858559; x=1720463359; 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=GJ6aCZ+zqC/bzroX6nSJ0EOSQTXAboCcbqfSGo7u8OA=; b=Ql+aLTVFuLjz6exn5hUCBEJBJdGMAqwg6J+5odw6o3HZFn3JyaEKwdtD4L8YZL+Jot ilILEkAwZqJOFpzaeC08xfTrVhHioX1VXGYgy9MoIC5upVLbI4fT7tzEYyIURXhhraDP TRUYWBHWqLthNkSdtjG+zA+PbvNU19Sq0LJLDIlCiF12ytf+OqJVzohxIPbryEoPWwoW rNGNKDPRrdPD7hHqbvI33b1aHEcxFGOdCI2MObEXM8sS65DRdMiiPx+dt8AEcxRygnmY dK27FgE0KUQdmzIHhLTobFgPs4B4aW+zcEFjdZZAgx1Vs//HGzUaL1tlXXLrbefcKNw1 VFCA== X-Forwarded-Encrypted: i=1; AJvYcCViUgYyqxKZNQ9c1eR9ir0IWJQNDwgmKRY98R2vzK+dePce9CxItx8tGK8brEPulWMNjblXtEHSoZFFjsYAQWXdGnJAN+gwtNo= X-Gm-Message-State: AOJu0YwMuY6RCfprMVeRegnU8nLC2c1DqOTFjYS9cCxvpMHL/gijdBD+ 7VOHiQlLJEnWP0uTr+uTEl29PQuNugkk4DG2CoouvvaYvxZh/TdH X-Google-Smtp-Source: AGHT+IFLXQ1G/8tFNvYxI7EXzXU18ZbNW2pwP6myGFGGsl8sAi9kR+tdHtHLzDyd4+qqc+EqkLVjkw== X-Received: by 2002:a05:6512:3d88:b0:52c:89b3:6d74 with SMTP id 2adb3069b0e04-52e7b8df4c4mr3115552e87.6.1719858557253; Mon, 01 Jul 2024 11:29:17 -0700 (PDT) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52e7ab0b809sm1528753e87.37.2024.07.01.11.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 11:29:16 -0700 (PDT) From: Serge Semin To: Andrew Lunn , Heiner Kallweit , Russell King , Alexandre Torgue , Jose Abreu , Jose Abreu , Vladimir Oltean , Florian Fainelli , Maxime Chevallier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: [PATCH net-next v4 01/10] net: pcs: xpcs: Move native device ID macro to linux/pcs/pcs-xpcs.h Date: Mon, 1 Jul 2024 21:28:32 +0300 Message-ID: <20240701182900.13402-2-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240701182900.13402-1-fancer.lancer@gmail.com> References: <20240701182900.13402-1-fancer.lancer@gmail.com> MIME-Version: 1.0 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Tomer Maimon , netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Serge Semin , Jiawen Wu , Abhishek Chauhan , Sagar Cheluvegowda , Mengyuan Lou , Andrew Halaney Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" One of the next commits will alter the DW XPCS driver to support setting a custom device ID for the particular MDIO-device detected on the platform. The generic DW XPCS ID can be used as a custom ID as well in case if the DW XPCS-device was erroneously synthesized with no or some undefined ID. In addition to that having all supported DW XPCS device IDs defined in a single place will improve the code maintainability and readability. Note while at it rename the macros to being shorter and looking alike to the already defined NXP XPCS ID macro. Signed-off-by: Serge Semin Reviewed-by: Andrew Lunn --- Changelog v2: - Alter the commit log so one would refer to the DW XPCS driver change and would describe the change clearer. (@Russell) - s/sinle/single (@Vladimir) --- drivers/net/pcs/pcs-xpcs.c | 8 ++++---- drivers/net/pcs/pcs-xpcs.h | 3 --- include/linux/pcs/pcs-xpcs.h | 2 ++ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 31525fe9c32e..99adbf15ab36 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -1343,16 +1343,16 @@ static const struct xpcs_compat nxp_sja1110_xpcs_compat[DW_XPCS_INTERFACE_MAX] = static const struct xpcs_id xpcs_id_list[] = { { - .id = SYNOPSYS_XPCS_ID, - .mask = SYNOPSYS_XPCS_MASK, + .id = DW_XPCS_ID, + .mask = DW_XPCS_ID_MASK, .compat = synopsys_xpcs_compat, }, { .id = NXP_SJA1105_XPCS_ID, - .mask = SYNOPSYS_XPCS_MASK, + .mask = DW_XPCS_ID_MASK, .compat = nxp_sja1105_xpcs_compat, }, { .id = NXP_SJA1110_XPCS_ID, - .mask = SYNOPSYS_XPCS_MASK, + .mask = DW_XPCS_ID_MASK, .compat = nxp_sja1110_xpcs_compat, }, }; diff --git a/drivers/net/pcs/pcs-xpcs.h b/drivers/net/pcs/pcs-xpcs.h index 96c36b32ca99..369e9196f45a 100644 --- a/drivers/net/pcs/pcs-xpcs.h +++ b/drivers/net/pcs/pcs-xpcs.h @@ -6,9 +6,6 @@ * Author: Jose Abreu */ -#define SYNOPSYS_XPCS_ID 0x7996ced0 -#define SYNOPSYS_XPCS_MASK 0xffffffff - /* Vendor regs access */ #define DW_VENDOR BIT(15) diff --git a/include/linux/pcs/pcs-xpcs.h b/include/linux/pcs/pcs-xpcs.h index da3a6c30f6d2..8dfe90295f12 100644 --- a/include/linux/pcs/pcs-xpcs.h +++ b/include/linux/pcs/pcs-xpcs.h @@ -12,6 +12,8 @@ #define NXP_SJA1105_XPCS_ID 0x00000010 #define NXP_SJA1110_XPCS_ID 0x00000020 +#define DW_XPCS_ID 0x7996ced0 +#define DW_XPCS_ID_MASK 0xffffffff /* AN mode */ #define DW_AN_C73 1