From patchwork Mon Sep 9 15:14:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13797232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5760BECE57A for ; Mon, 9 Sep 2024 15:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References:Message-ID :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=udaCC7bjXTe50bv9tIIMajMSsA10zTolQrlq1oA7Rjc=; b=NTwJ29QcUMD8/V 2kQs7/FZyM0o0n7+eoxOUeRktACFgtJ6CxNTd2kEG/9FKvOTZe3LJ145VKMw+sshYMgEZBxMHyQVe 0FgqCwFT+VW1Y5uDC0nNOccb1023qoret//zNRVwq2VeOpsfzz4J6/frDogHO+ZiqafnLW+lya0EF NT5oDK8eB6Sty9/j1STNbJCnLc0O1yqwO6UnEwOZq7IuRgqRkkWL5NfHJSO1X3gPhH95g2i1BzZnu 4Xrv0SQIHBd73vI9d3J2n5NWVgUa7cZYHrYF7qHU5cwJMeJH3Ac52C/Lo3Fm/2yErhb4NYmrMv51b 1k9IT4vSiqkfQQYODgVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sngBj-00000002RfI-004d; Mon, 09 Sep 2024 15:20:23 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sng6u-00000002QDJ-1iUE; Mon, 09 Sep 2024 15:15:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1725894924; x=1757430924; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=r4GYCCAPrezVJF9S4lAxcxW+jn6P9wg342VL0Po3ozE=; b=W4bxVadkpZ9Zlft3mqLNGlhk8MiUE+4EALk1DAeJhedt2wNmBxkk7f9b v2BiCsVkKFbVpbxAFbYvikG8RlCZyEqjtZfk+mNtKAU4CUyeT+l7FmaXO cDqPbGAo5HjJCwOqBxFhX7rmtqsP3gv0hA8Xlu4cKUzbUuo7MOnaBnFYE y7pCOkzLcvIdLzeucfOnFMPrzWrIv2dSz0rdg8aZiirveoSPkzvBL4N1B hiunge9OfakDt97XdJsloltc+uWMwhZ0x71j2khiz9sBqeuQ6rJhyavUg 2d66y0sx91IFHdrTgKTr3os0KGsBytC8fOovk6F09vyjeL2CU8iwYGnlP A==; X-CSE-ConnectionGUID: /ltMKKTeRqSXWxXLFfJz/g== X-CSE-MsgGUID: yMs9w0RmSQCdshHUtdFUwQ== X-IronPort-AV: E=Sophos;i="6.10,214,1719903600"; d="scan'208";a="31514507" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 09 Sep 2024 08:15:23 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 9 Sep 2024 08:15:01 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 9 Sep 2024 08:14:59 -0700 From: Daniel Machon Date: Mon, 9 Sep 2024 17:14:43 +0200 Subject: [PATCH v2 3/9] phy: sparx5-serdes: add constant for the number of CMU's MIME-Version: 1.0 Message-ID: <20240909-sparx5-lan969x-serdes-driver-v2-3-d695bcb57b84@microchip.com> References: <20240909-sparx5-lan969x-serdes-driver-v2-0-d695bcb57b84@microchip.com> In-Reply-To: <20240909-sparx5-lan969x-serdes-driver-v2-0-d695bcb57b84@microchip.com> To: Vinod Koul , Kishon Vijay Abraham I , Lars Povlsen , Steen Hegelund , , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , X-Mailer: b4 0.14-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_081524_675218_98851491 X-CRM114-Status: GOOD ( 14.01 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org The number of CMU's differ for Sparx5 and lan969x, so add a new field: cmu_max and use it throughout. Signed-off-by: Daniel Machon Reviewed-by: Steen Hegelund --- drivers/phy/microchip/sparx5_serdes.c | 5 ++--- drivers/phy/microchip/sparx5_serdes.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/phy/microchip/sparx5_serdes.c b/drivers/phy/microchip/sparx5_serdes.c index c3ed028fc74e..9c91545dd8e1 100644 --- a/drivers/phy/microchip/sparx5_serdes.c +++ b/drivers/phy/microchip/sparx5_serdes.c @@ -21,8 +21,6 @@ #include "sparx5_serdes.h" -#define SPX5_CMU_MAX 14 - #define SPX5_SERDES_10G_START 13 #define SPX5_SERDES_25G_START 25 #define SPX5_SERDES_6G10G_CNT SPX5_SERDES_25G_START @@ -1101,7 +1099,7 @@ static void sparx5_serdes_cmu_power_off(struct sparx5_serdes_private *priv) int i; /* Power down each CMU */ - for (i = 0; i < SPX5_CMU_MAX; i++) { + for (i = 0; i < priv->data->consts.cmu_max; i++) { cmu_inst = sdx5_inst_get(priv, TARGET_SD_CMU, i); cmu_cfg_inst = sdx5_inst_get(priv, TARGET_SD_CMU_CFG, i); @@ -2512,6 +2510,7 @@ static const struct sparx5_serdes_match_data sparx5_desc = { .iomap_size = ARRAY_SIZE(sparx5_serdes_iomap), .consts = { .sd_max = 33, + .cmu_max = 14, }, }; diff --git a/drivers/phy/microchip/sparx5_serdes.h b/drivers/phy/microchip/sparx5_serdes.h index 8c27cfde4938..87c44bbaf368 100644 --- a/drivers/phy/microchip/sparx5_serdes.h +++ b/drivers/phy/microchip/sparx5_serdes.h @@ -28,6 +28,7 @@ enum sparx5_serdes_mode { struct sparx5_serdes_consts { int sd_max; + int cmu_max; }; struct sparx5_serdes_match_data {