Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1769851lqo; Sun, 12 May 2024 18:41:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJVuODlTa1KtC0AwASYVNMy1CxS4Jpd0JGOFQKv2VnuWGsF9t8ct0tdCxMeo5GcQ0vnuoXZm/8VKoXeLbPsYgodHZUMJuZNgCJbL2p+g== X-Google-Smtp-Source: AGHT+IE8HKMW6XuNzar9w0xIjyBr11YJGcj5bbA62Kg2QgfYBf9II/8BKbVRBgzuxEy4l6w3WSi5 X-Received: by 2002:a05:6a00:2195:b0:6ea:baf6:5720 with SMTP id d2e1a72fcca58-6f4e0299da6mr9130198b3a.3.1715564495409; Sun, 12 May 2024 18:41:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715564495; cv=pass; d=google.com; s=arc-20160816; b=zqBlKdjn3VHFWWumbIlpHIJ9s6XXJEcHZ7DdRu+50MRXh7eWvXKJalbayZ+C9TcBTi JIX2whZ7gEiURbjUr3y3VpIdXe8Pw5KY25vue/1MJOddMxhAMZOQta+PGIX/0PT4hzao JL1vGt+nwyWWLzY0Lj37vGceNEsNRAzh+8a4M7Aq+TaX2HPxdY7XlRi2fGDPlcyT80GY lQevXPgVW2xn6HAvrgkTzTC1K9MLtipKIbj3GE1Q/zKoXrVhvA9z/Yqxgnzh5w/bXAGi m8iJL3xXKPRj/6enlsdG2s8goDUDtNViQB3pu0Jqre+mjaE00j4PXQ+l9AvME32EphTD cfvA== 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=rjVg2cIDL5jllETIG4dQsKBjYrQzhIypJA1G40SC6is=; fh=6JNnxDfEnr7o579DMPRTsQZxS8rnesbXYQmdjTKdPbk=; b=uPmj5HAVdWF4vGuY4WwPhI1eRLZj3ur/VqatEUsXlrobPgmCWEXyir4JzvaGgkp7Ae IkTW4D3ekNJvxwvOTeDfAZRZznQPflxQ+ekmaQmTLb8CxZNMqkzBI1QnMXDCG4tOQ6qY k0/J1Oo8u7GN01/Joq13Oy4CrH+fI8/kXI1cCNMD+n+6QnL7lY8B/o6Ddr/pDTpXc62t vgyH/WXfvMr5Cer0YnQjcZQPxETuCEqAACaR759GPCOu0A3pUBJqAV3+/qP+wbRxHWni HMvzXjOHlP+3AnLxFbaOnFRkIomKVNCy8DzfQySHvT9VCj8bVaHAeh2TYYF749SXDAiH EJhg==; 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-177079-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4f3f4acfcsi3305961b3a.115.2024.05.12.18.41.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 18:41:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177079-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-177079-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177079-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AE94228129A for ; Mon, 13 May 2024 01:41:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FB4AE56A; Mon, 13 May 2024 01:41:29 +0000 (UTC) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) (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 3D655BE4F; Mon, 13 May 2024 01:41:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715564488; cv=none; b=LgtUBGzBhe2HiNcMIhUIBeHgLqiYe5MhRipl3ySZb1WoEkFozzfF10WWbkl3NaZ5E3R8WsjDujzQ4BOFQAtwb+q5BeJ7nHpSm9nlWD30fGUgFGHvM4y1G1II7TE2sNYo30Y/W5rwfbfrPW52J0a10Hvyg5FQbNC2B3xsORp/y9k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715564488; c=relaxed/simple; bh=HExHPsON4CqrO3LxsKWufOI3fJDGO7ZL+VCYtmf411Q=; h=From:To:Cc:Subject:Date:Message-Id; b=fEY4i33lS5pqofLKoza0YWFiIhaT6nUhOieEmJuR9PYbxUYauXGSEFasx1AY7wW/AkgnzhPIG6JtyabDD+3H9Q1cUH4Go4h0oHl5T+Ffm8cP7JHTzq8cMojIWP3fHqhs4eT1+l8/qU+21hMOz0wl850HPzBwbdMe3rALfp3SgLQ= 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.13 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 inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5BBBC1A03B8; Mon, 13 May 2024 03:41:20 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E4B971A12E1; Mon, 13 May 2024 03:41:19 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 25A11180226C; Mon, 13 May 2024 09:41:18 +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 v5 0/2] Add i.MX8Q HSIO PHY support Date: Mon, 13 May 2024 09:22:02 +0800 Message-Id: <1715563324-6391-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: 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 v5 1/2] dt-bindings: phy: Add i.MX8Q HSIO SerDes PHY binding [PATCH v5 2/2] phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY Documentation/devicetree/bindings/phy/fsl,imx8qm-hsio.yaml | 152 +++++++++++++++++++++ drivers/phy/freescale/Kconfig | 8 ++ drivers/phy/freescale/Makefile | 1 + drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 608 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/dt-bindings/phy/phy-imx8-pcie.h | 29 ++++ 5 files changed, 798 insertions(+)