Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp440546lqb; Tue, 28 May 2024 23:19:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbUKJbbDWmRzYZW/gJX4F2/9z/Nl8LwA5FnFrKdFbrm56/4TmpCHBtSRTDU67lfAdfpdG1sQD2QJKPN4hSvO6lN4vxNiTGN0xaeQ31Rw== X-Google-Smtp-Source: AGHT+IHV+rJWTZ6j9nEBff6FCHWqVH+1KA0qh2VRUPA8SUYnuQjWHHaNOA5be8Xr21xUFfHhUt2Z X-Received: by 2002:a05:6214:223:b0:6ad:5f0f:6c33 with SMTP id 6a1803df08f44-6ad5f0f6d3amr128738956d6.57.1716963551872; Tue, 28 May 2024 23:19:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716963551; cv=pass; d=google.com; s=arc-20160816; b=edbhX8EKI8EST3pIzfs6MnFu/Rcs4zNBpKvDLVpJ+BG3iGozg2avlxHTlPhcDePLjI 8uCWjQl2MFpFXLxe8waDDWEu9eENgfJwgsW39UPmxu/tE82GbXWgxJJkxEY66vq71WL7 qs7qQRFJ/bKWctkxOWy81eWGcg3gzwr9lrIf//fhJ01ez4j+2GH4qbqdvQLR1YfKUsQs FZS8eZqtiumkcvZJDVE/hzcV7bsVD5LVGHpqaZYSzrRJsIfODt2tDupPH/HXrbgHYRdO qPkhRYDdo7yybw24osoM9C73Kb//K4e6FSro5KhpShwBKC/Y5KBUa09aWyoy0DCbtJVy KPKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=YvnRZvnvCH7/620t/ENXmnOIq28WRo0UmgtrR+Al7F4=; fh=6JNnxDfEnr7o579DMPRTsQZxS8rnesbXYQmdjTKdPbk=; b=whfYssOKwnZOSFJv6qIckP82lvGtdiWGpwcbHejBy/J+DoxxBOdV+UMMP3GtrfGDL2 TAxA+VQrXMpVUQLR0EJ7gFhTPNlC9pOdVKH2NdRNWLRDNfECAa8ncRqAkXYSh7ewEWnO x76B35XSOz+FYlwp2wkATmsoOJJPcE+S2979qN8vQiv+z7FextH2VX90JcS+PJ+Wl2bb Y/I6PypOEzbKRQq0WPAr6D2JB/10YU5OFmqdrisn+6rDegvAnFLanBQX1tKhCHYGNily MbybolKFXRELWNe66I7qnGT+eK7P5IhlevpK4MBcZubAKOmIOnOo8eNuTBwMTQw3Bpiw 1Lpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-193498-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193498-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac070f0c5fsi121833126d6.283.2024.05.28.23.19.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 23:19:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193498-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-193498-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193498-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0DDAD1C256D5 for ; Wed, 29 May 2024 06:18:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 226A115FD1B; Wed, 29 May 2024 06:18:46 +0000 (UTC) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (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 97A0615ECD9; Wed, 29 May 2024 06:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716963525; cv=none; b=N1a6gmThno+YXDJtyIY3FwFq0v2BaxbtdGGojOi4IMuUxpE8O4r4A7NVgQ8k28Jx+evwf32IouBH5mfapVz4HIla20c5fVdUqyZJZjia4R7TSSKHfyOj1SdBxXs6O8XFyjGwoxKDQZqHnQjKJInZc3DShR0WZle0RZppZHtT/OI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716963525; c=relaxed/simple; bh=J3oHJ6BUvlEp4jAHQzUBker2OU7er4PvjG6IkKQziYo=; h=From:To:Cc:Subject:Date:Message-Id; b=esLhEWvbFYAmCkdoMJ2AF6hrrT55RrHflttCDgDQc7kpq3hSuueR44neiGIYuXpPuoYBBKD/21xYEc4Q/Lrj5gs97aOLVs06+xkebSbNNQsrT7N21bocTjZXf3x331DjK4Cv/JaFevH4iN5izHYUK5VK2ku+IDyHb2Kwm3l1DsI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 683CF20152B; Wed, 29 May 2024 08:18:35 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D520D201527; Wed, 29 May 2024 08:18:34 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id D968E180222F; Wed, 29 May 2024 14:18:32 +0800 (+08) From: Richard Zhu To: conor@kernel.org, vkoul@kernel.org, kishon@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, frank.li@nxp.com, conor+dt@kernel.org Cc: hongxing.zhu@nxp.com, 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: [PATCH v7 0/2] Add i.MX8Q HSIO PHY support Date: Wed, 29 May 2024 14:02:43 +0800 Message-Id: <1716962565-2084-1-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: v7 changes: Rebase to 6.10-rc1 dt-binding - To keep the table format, add "|" to description of "fsl,hsio-cfg" property. - Refine the contents of "fsl,hsio-cfg" property. - Add Reviewed-by: Conor Dooley tag. PHY driver - Use "imx8qm_hsio_drvdata" as imx_hsio_drvdata struct name of i.MX8QM - Remove redundant memset(). - Add Reviewed-by: Frank Li tag. v6:https://patchwork.kernel.org/project/linux-phy/cover/1716865154-25044-1-git-send-email-hongxing.zhu@nxp.com/ v6 changes: - Correct the spell mistake in binding document. - Change the "fsl,hsio-cfg" property to an enum strings too. v5:https://patchwork.kernel.org/project/linux-phy/cover/1715563324-6391-1-git-send-email-hongxing.zhu@nxp.com/ v5 changes: dt-binding - Fix dt_binding_check errors of fsl,refclk-pad-mode. And, add the unused description of this property. - Add description for each register entry. - Add fsl,hsio-cfg description. - Other minor refine changes. PHY driver - To make codes safe enough in multi instances probe, use scoped_guard() to replace the atomic_###() callbacks. v4:https://patchwork.kernel.org/project/linux-phy/cover/1715234181-672-1-git-send-email-hongxing.zhu@nxp.com/ v4 changes: - Re-format the "phy-cells" as <&hsio_phy lane_id phy_mode controller_id> - Use each lane as a phys entry, suggested by Rob. 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>; - Add a new propery "fsl,hsio-cfg". The HSIO configuration (fsl,hsio-cfg) is one global state. It should be known and used to set global setting: PCIE_AB_SELECT and PHY_X1_EPCS_SEL at the begin of HSIO initialization like this listed below. +-------------------------------------------------------------+ |CRR(SYS.CSR) register|PCIAx2 and|PCIEAx1, PCIEBx1|PCIEAx2 and| | |SATA |SATA |PCIEBx1 | |---------------------|----------|----------------|-----------| |PCIE_AB_SELECT | 0 | 1 | 1 | |---------------------|----------|----------------|-----------| |PHY_X1_EPCS_SEL | 1 | 1 | 0 | +-------------------------------------------------------------+ When first PHY instance is probed, PHY driver can't get a global view of the HSIO use case and doesn't know how to set global setting: PCIE_AB_SELECT and PHYX1_EPCS_SEL. Because first PHY instance doesn't know followed PHY instance use mode. So, one property named "fsl,hsio-cfg" has to be introduced here to specify the setting of the global setting: PCIE_AB_SELECT and PHY_X1_EPCS_SEL. Here is the discussion about this. https://lkml.org/lkml/2024/4/26/231 - Address Conor's comments about the "fsl,refclk-pad-mode". fsl,refclk-pad-mode: description: ... enum: ["input", "output"]. v3:https://patchwork.kernel.org/project/linux-phy/cover/1713939683-15328-1-git-send-email-hongxing.zhu@nxp.com/ v3 changes: Refer to Conor's comments. - Let filename match a compatible - Refine description of the fsl,refclk-pad-mode. - Remove power-domains description. - Keep clock ording for two devices. - Drop the unused label and status. Refer to Rob's comments. - Use standard phy mode defines. - Correct the spell mistakes in the binding document. v2:https://patchwork.kernel.org/project/linux-phy/cover/1712036704-21064-1-git-send-email-hongxing.zhu@nxp.com/ v2 changes: - Place the dt-bindings header file changes as the first one in the patch-set, make the annotation more clear, and add Frank's Reviewed-by tag. v1:https://patchwork.kernel.org/project/linux-phy/cover/1711699790-16494-1-git-send-email-hongxing.zhu@nxp.com/ [PATCH v7 1/2] dt-bindings: phy: Add i.MX8Q HSIO SerDes PHY binding [PATCH v7 2/2] phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY Documentation/devicetree/bindings/phy/fsl,imx8qm-hsio.yaml | 164 ++++++++++++++++++++++ drivers/phy/freescale/Kconfig | 9 +- drivers/phy/freescale/Makefile | 1 + drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 610 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 783 insertions(+), 1 deletion(-)