From patchwork Thu Jun 27 00:41:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13713569 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 019E85223; Thu, 27 Jun 2024 00:41:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719448920; cv=none; b=C6pEIGgFPtbVKiJ1yWvk9W6d4DpPeuslmn7nxQ4B+aiZx1+DBSmssEfVpC0JPnnxGI8nQqQvoL8/qjd6kgr7h/CH5YJxnc8UUzr2I5wws84wG6Fw/3Ff5enYJ5BsETuECidH9mQaT8bqWkoGmgzssjC/u/uVqtNCm1hHd7sl/vc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719448920; c=relaxed/simple; bh=HKd+U5CDCJq1sAkohvaBdQJfgDvEMWTiR6NKfKP+qm0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kq+/L7/M/k2wZJaKbeELZ/NwJyV5GPynRrHRDkcvIYNxjIXGue3verN3MkUQHUY6kGBdv6XVh5G5rLkspEev3IPaBp1GMoHdPCVvdS1EbDMPKuYBistm9MUpePEtafbycV7FC3UXrePHvXNKKEoUVxLBiWjtU87/vXoOu3xMqKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NhayioMV; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NhayioMV" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52ce9ba0cedso5078310e87.2; Wed, 26 Jun 2024 17:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719448917; x=1720053717; darn=vger.kernel.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=riZO9gpWg+72DwRvoZciAprxyAK6Sq4iImVOkfuj2k8=; b=NhayioMVp971nXJlU92dP6rTex0rYJnUQUQBKfKRI6juuI7bTQ0EWfedim41v9clmi TBEomK8/qwEGORmphuz1AedLBX8xDYDCCk6iQItbxWCRbONYsdp3jhdXw4y8ZXdwsT+T aNGMlmur3IFEIt9EsUOK00pqQZIKs0R0HHvVmmU7N3fwDxZCBK1PQfsZGtJBCDS+24sI s5dKoD980oJrKdW27T7tZXVybugFHt99rV4Lx5bV+uesKXhDVXUmrhEXTgQN5orC+vRI vW4yhcaRlGS1bF0qaZFU21SoP+GMubUnLASe/dDaoMYOyuAcrSmCZNSdoueRh0IBUTPY WDaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719448917; x=1720053717; 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=riZO9gpWg+72DwRvoZciAprxyAK6Sq4iImVOkfuj2k8=; b=pyqmwa2nmdtDC70GwT4647aFL9i34x+8rlnuNQJqm0BZvIp7RVZBJLPziqxxoS1nj0 JHAMzX42tTJYCiF+H8lU6fYSoKhdAhwMpRU7wMImdmvb+4FZiJix88XMLGmRjzs6QO56 wmWbPg39oe1X6nyDIrKUoL7hiVCClnkKYF6G/kX6vamYVAHPLbTa/zAcbCpMw2N2L/zI z8q9FJj9JYBi5fmXNhODtutvL/sAfhxh1dbYbEtYTEbhztMqWupqX0hLgVi91Fl8rJaD bYh6mE3bH/I0KhHiw4MYK3sJkBb/APzP7MgKoZ3fQE/7O8qaZvMrdFRFAy7aP2WHUCNq yAPA== X-Forwarded-Encrypted: i=1; AJvYcCUPdm138sTiPqRunBHktRZZDUROxM9tNt/Ey7Zu2QNtcz2QJJY7gPgX0NlyRMYWnOpwU0aeuz0K000Un4KYRV0U+B57XLTuNvtdo8ExZ+/X+ExN8rUU03wzY6RPYGuHE98DivzRgtfNXMJE74+8/qyXVr1zCeCHZLsltbFuRqguLw== X-Gm-Message-State: AOJu0Yy6re1QGi3rnUMAheHPfnYVoS3My3YJDOI3O943f/2VavxWOfTr eUbP1xL8tyk88Pune6OkctK9INHc/0mzzy4g3w/uWryTuIQ7GPXh X-Google-Smtp-Source: AGHT+IG9xWPw91sL+7geI8Yw5mhFbwzbfnCv10lu3eKdnkF87T5urspemd32cPB+C/RlkO+fzeL6Bw== X-Received: by 2002:a05:6512:39ca:b0:521:cc8a:46dd with SMTP id 2adb3069b0e04-52ce182bcd5mr11611361e87.11.1719448915879; Wed, 26 Jun 2024 17:41:55 -0700 (PDT) Received: from localhost ([89.113.147.248]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52e712a7ba7sm20161e87.56.2024.06.26.17.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 17:41:55 -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 Cc: Serge Semin , Sagar Cheluvegowda , Abhishek Chauhan , Andrew Halaney , Jiawen Wu , Mengyuan Lou , Tomer Maimon , openbmc@lists.ozlabs.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v3 01/10] net: pcs: xpcs: Move native device ID macro to linux/pcs/pcs-xpcs.h Date: Thu, 27 Jun 2024 03:41:21 +0300 Message-ID: <20240627004142.8106-2-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240627004142.8106-1-fancer.lancer@gmail.com> References: <20240627004142.8106-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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