Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp715226lqd; Wed, 24 Apr 2024 14:57:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUeBkP830MF+WN8PsC0PaR+lNsWjW3u7MjL9Fo2Vwq+Q6lVyb48+JU94GW3UvXmeIMGtcLINWutbw0rAlzIwm6TfVt3Ijl6Jeaaop8jwQ== X-Google-Smtp-Source: AGHT+IHnzRCD+RLqzjoGtSjXJhmxaWO0amB7WYOqp+CzLD9kK+iHWGpkC/M0dMiguqSu0R3V1jmx X-Received: by 2002:ac2:5d63:0:b0:515:fc44:b3f7 with SMTP id h3-20020ac25d63000000b00515fc44b3f7mr2668855lft.24.1713995873330; Wed, 24 Apr 2024 14:57:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713995873; cv=pass; d=google.com; s=arc-20160816; b=xenj4/2Krr+jVAdBncCZDOuBRy4mK/oh2G4o6f3GtXah8rUZ7sjTFKFuctb9VtbaDh lZQB/358L/AUxZYaM8vUHMBLs+BkZgcazrtibs2WnoYJ6GaJLcjnxlVX1YvcP9m2pJa4 Cb/j0KddAjwqrQmHTO7OWRZUk1zsyRe9cBLTcd/wtObW2szQv0JnaSL1ld9/3vxswdFH Oe8Ynk2GdD2Kd+O4pTiEczgLRNYdHRDa21jGZfCdK4bknhruZJHYxSLCp3QGzBWABlsP Q3SEUENsFXA2Cetoe7wN+u2sRJkHRjEgsH1JoGs9If9b+Obm3Vl9IafGrnHjG6o8bgJS kThA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RmfP0PQAyfImZC24Qp9svRZFxP62V3VgujdAw15mFpc=; fh=2dlQ6fMqiyKeiEhTW85ituLYKFB+hkPtvW0ViR9wy1U=; b=vzmbEXE4WI1TumKGq780AYQaiOnziD4tAIEcCEck/nqgKdMqV3An9diotSAyTSEMdq KJKMUBck2/cdf5Tc8wgZNiSU4DMpSh9V82FF4pWaelFuXQjT9jU+iTOoHsb4Grx8uptd Mf8HxpbPm2rMnCfmdYyRIaZn9MrjgdA6TtrmxzRlErQxtdLtcvjI69vUu4sYPfKlid2P YC1w+6JtswH6v1rrC62v54guIIbC0TpZ7BQUW7KQRVQTr097GTGdDe6bcgBLpNlOy0FU HkBJMAwbrwNvC3kzaDD3IYo9c1Kx1NXeqa650bWpYI4Q8ggbPXzgdCrFMSjHzYlbO/rC Nk4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DL63qqX8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157756-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l7-20020a170906644700b00a55b5b4aa59si4272945ejn.249.2024.04.24.14.57.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 14:57:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DL63qqX8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157756-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 11D4A1F236EC for ; Wed, 24 Apr 2024 21:57:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62602158852; Wed, 24 Apr 2024 21:57:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DL63qqX8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72F7F15687F; Wed, 24 Apr 2024 21:57:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713995865; cv=none; b=dq703JpJenD4diSCbjmZnjAat/+KpsTcuAGkpxsF1+iVEetCvkRZqno8PHd6EO2phn2C1lvfFpeQHIQrr8qZCJPbw6Ok86jGwI5xQlA/lK++HxkX78nu9r/ooF/j47TDc7oWcGn8LXrh8MITFp/c5bPkWU+vcYORODZNJOoJV98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713995865; c=relaxed/simple; bh=iA5er1v7o8xOSguwB/KZCt1Mz1Z6XF4dQ/9cOa/ZGMQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UJN1ZHAN9CkftDYMtGMkND/Oih9bWNk6jll8nIHkKZylE1HoJ7r9wNTzA2bM4EXU11EHTsnJ1MaewtEBY3ZyCqA+KP+vbNzuWLZwpNh481dNAQqA2z6sqn+GEmFYHiZ7VT2+XqOYmayB52IUu3GSbjCj0y4ivK5sW/n3EX5HQ04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DL63qqX8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5F14C113CD; Wed, 24 Apr 2024 21:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713995865; bh=iA5er1v7o8xOSguwB/KZCt1Mz1Z6XF4dQ/9cOa/ZGMQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DL63qqX8i3ZFMOMJJPIpHSxyDW1eb6aZJpUvgCNNmt8eNfVsVS81/OuLlUjyI4rMz 9Wx0J/3echd9pxR7MK3eb5xC7bCD0NGOi08FHVGUltq6B60RhHJXH1sGhyY0aiKRSO NyWpyFtgiWce7GevhcZG5o3lBAalBegjBcYCidJkKdYxZyi6C0LSQYOL4J/Uz4sGML jIazZv1mr8a71FzC/7Xc+1qwbTaqas5Tgxgd8btL8w68axLhcpsOWKKNSeuv5gWC4W MxExK7THeqKisCIgF6/A+O3P2htwE7z/pABFcU+ywLjIvZWMoMtXjMsPhnoKHDzXl2 3iEh/FDYwbgJQ== Date: Wed, 24 Apr 2024 16:57:42 -0500 From: Rob Herring To: Richard Zhu Cc: conor@kernel.org, vkoul@kernel.org, kishon@kernel.org, krzysztof.kozlowski+dt@linaro.org, frank.li@nxp.com, conor+dt@kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, imx@lists.linux.dev Subject: Re: [PATCH v3 1/3] dt-bindings: phy: phy-imx8-pcie: Add header file for i.MX8Q HSIO SerDes PHY Message-ID: <20240424215742.GB460126-robh@kernel.org> References: <1713939683-15328-1-git-send-email-hongxing.zhu@nxp.com> <1713939683-15328-2-git-send-email-hongxing.zhu@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1713939683-15328-2-git-send-email-hongxing.zhu@nxp.com> On Wed, Apr 24, 2024 at 02:21:21PM +0800, Richard Zhu wrote: > Add lane index and HSIO configuration definitions of the i.MX8Q HSIO > SerDes PHY into header file. This belongs in the binding patch. It is part of the binding. > Signed-off-by: Richard Zhu > Reviewed-by: Frank Li > --- > include/dt-bindings/phy/phy-imx8-pcie.h | 62 +++++++++++++++++++++++++ > 1 file changed, 62 insertions(+) > > diff --git a/include/dt-bindings/phy/phy-imx8-pcie.h b/include/dt-bindings/phy/phy-imx8-pcie.h > index 8bbe2d6538d8..60447b95a952 100644 > --- a/include/dt-bindings/phy/phy-imx8-pcie.h > +++ b/include/dt-bindings/phy/phy-imx8-pcie.h > @@ -11,4 +11,66 @@ > #define IMX8_PCIE_REFCLK_PAD_INPUT 1 > #define IMX8_PCIE_REFCLK_PAD_OUTPUT 2 > > +/* > + * i.MX8QM HSIO subsystem has three lane PHYs and three controllers: > + * PCIEA(2 lanes capable PCIe controller), PCIEB (only support one > + * lane) and SATA. > + * > + * Meanwhile, i.MX8QXP HSIO subsystem has one lane PHY and PCIEB(only > + * support one lane) controller. > + * > + * In the different use cases. PCIEA can be bound to PHY lane0, lane1 > + * or Lane0 and lane1. PCIEB can be bound to lane1 or lane2 PHY. SATA > + * can only be bound to last lane2 PHY. > + * > + * +-------------------------------+------------------+ > + * | i.MX8QM | i.MX8QXP | > + * |-------------------------------|------------------| > + * | | PCIEA | PCIEB | SATA | | PCIEB | > + * |-------------------------------|-------|----------| > + * | LAN 0 | X | | | LAN 0 | * | LAN? Local Area Network? Just use 'Lane'. Don't need this column ^^^^^^^ > + * |-------------------------------|-------|----------| > + * | LAN 1 | X | * | | | | > + * |-------------------------------|-------|----------| > + * | LAN 2 | | * | * | | | > + * +-------------------------------+------------------+ > + * NOTE: > + * *: Choose one only. > + * X: Choose any of these. > + * > + * Define i.MX8Q HSIO PHY lane index here to specify the lane mask. > + */ > +#define IMX8Q_HSIO_LANE0 0x1 > +#define IMX8Q_HSIO_LANE1 0x2 > +#define IMX8Q_HSIO_LANE2 0x4 Thinking about this some more, in most cases of the phy binding where individual lanes can be assigned, each lane is a phys entry. PCIEA: phys = <&hsio_phy 0 PHY_MODE_PCIE>; or: phys = <&hsio_phy 0 PHY_MODE_PCIE>, <&hsio_phy 1 PHY_MODE_PCIE>; PCIEB: phys = <&hsio_phy 1 PHY_MODE_PCIE>; or: phys = <&hsio_phy 2 PHY_MODE_PCIE>; SATA: phys = <&hsio_phy 2 PHY_MODE_SATA>; > + > +/* > + * Regarding the design of i.MX8QM HSIO subsystem, HSIO module can be > + * confiured as following three use cases. > + * > + * Define different configurations refer to the use cases, since it is > + * mandatory required in the initialization. > + * > + * On i.MX8QXP, HSIO module only has PCIEB and one lane PHY. > + * Define "IMX8Q_HSIO_CFG_PCIEB" for i.MX8QXP platforms. > + * > + * +----------------------------------------------------+----------+ > + * | | i.MX8QM | i.MX8QXP | > + * |-------------------------------|--------------------|----------| > + * | | LAN0 | LAN1 | LAN2 | LAN0 | s/LAN/Lane/ > + * |-------------------------------|------|------|------|----------| > + * | IMX8Q_HSIO_CFG_PCIEAX2SATA | PCIEA| PCIEA| SATA | | > + * |-------------------------------|------|------|------|----------| > + * | IMX8Q_HSIO_CFG_PCIEAX2PCIEB | PCIEA| PCIEA| PCIEB| | > + * |-------------------------------|------|------|------|----------| > + * | IMX8Q_HSIO_CFG_PCIEAPCIEBSATA | PCIEA| PCIEB| SATA | | > + * |-------------------------------|------|------|------|----------| > + * | IMX8Q_HSIO_CFG_PCIEB | - | - | - | PCIEB | > + * +----------------------------------------------------+----------+ > + */ > +#define IMX8Q_HSIO_CFG_PCIEAX2SATA 0x1 > +#define IMX8Q_HSIO_CFG_PCIEAX2PCIEB 0x2 > +#define IMX8Q_HSIO_CFG_PCIEAPCIEBSATA (IMX8Q_HSIO_CFG_PCIEAX2SATA | IMX8Q_HSIO_CFG_PCIEAX2PCIEB) > +#define IMX8Q_HSIO_CFG_PCIEB IMX8Q_HSIO_CFG_PCIEAX2PCIEB Again, I don't see why you need all this. You now have mode and lanes, and per SoC data in the driver, so you should be able to figure out what you need from this. Rob