Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2400337lqb; Mon, 27 May 2024 20:20:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6ejmOYkk/E3dR0lZz6Mq+C8q+BwlTcr2zfO6Lv/hhMIiZQHcvYuSGezTrltjtidZUUcnV8btczoDWaL+m6yjHigauOLFTBuIahND/aQ== X-Google-Smtp-Source: AGHT+IG/bP3KZj8CGAOhbl1kWqHJZk1j9vzL6ZOVOM8kOrRY3TMwBoef64t2E1TT7DfvDKunLlOF X-Received: by 2002:a05:6358:3124:b0:186:1f52:540d with SMTP id e5c5f4694b2df-197e566dc96mr1122240355d.28.1716866418297; Mon, 27 May 2024 20:20:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716866418; cv=pass; d=google.com; s=arc-20160816; b=DZDbQ7UIuJDaykixzdKnbscXWAjbo68vnl2lV9iUHeq1KK/PddueLIhxpl+gsgL3RO yJQVgMmA9bZYCv5OL3pLOEOZs7PzVxlticAjqC52OfjlLLXUO1O12mI4FctMpzfUqsb6 Q6o+wTPbn3FNaiZ/tydQewjVsB/2ZSFDRTXqCNIuvXDviFcDXXAV9ZcU8BdXvKo7pnXC H75kjstgHM5fFXrNvAQgZgRLEDFDJ3ThznZAUmIbwSEfl6kbQBu22UP5dSVxmIcHiSG3 SowCe7zqRTHtFuSwBEccVh+armddrFRkab0ZucDT2UMLp87ft4O7ck3vHU3g13u+Yd6a oFdw== 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=IyKqZ0EVecIGHcTVxucrxhmrX49CoaxBCRnLnN6+gHY=; fh=6JNnxDfEnr7o579DMPRTsQZxS8rnesbXYQmdjTKdPbk=; b=hHzMnmjkZQadml1G74zliy1xOOA/28oHl4RmERw2tSuoWzXA+yNBHLIN/43ga7nHtD WV8kUS+dYlZ5f5ruWsLmyOL9n3QhGLV2YHEYR+flgj9xdpQnxI6YA63jIKDTuRbs8Rq/ E7Af/kXN7las5NgNUlRGMIzENx1TcBkE18BGrgNLWNbvWHcsNi9JcNXgDHNYZK/Gwt+v kNyYARkwj5QjcOLjO0L6FZnD9YmZEtlNvkdM/7ppS+sJL1y//qg9AI9m71dV2WQ1IGKi BwooPGN+YNi/lrA5xyKDPLe1aiXCrI/+P+5yihEYasFg+P+Q/n7M514bDPS1nsyBIRPB V9yg==; 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-191677-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191677-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822ae568cfsi7435114a12.769.2024.05.27.20.20.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 20:20:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191677-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::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-191677-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191677-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3D326B22A75 for ; Tue, 28 May 2024 03:19:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F1F018654; Tue, 28 May 2024 03:19:27 +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 43220171A7; Tue, 28 May 2024 03:19:24 +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=1716866366; cv=none; b=Ix0Fsr892SugVV6IP9MzqFhj1zQAxr07p88MPkU5B7PV6LnPavGdbUfp+GPs9ebLThaODEYviI1RkJsMZ89Iuz6stDLCFv1q+e4i1bfKGHqMb6t1nSDRg9vsViSzNam7kJu9OTgsrRWfdzpb9b7rpThUPFqA5QSL0aoBia4xXRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716866366; c=relaxed/simple; bh=BCjgtX7qnroMhhttvjYYhYxVp0B4QNrMVcp4hig0gvQ=; h=From:To:Cc:Subject:Date:Message-Id; b=NzwZrcvzAUudgbR8pCyKZJkqN5hGrNFpUtawnP3MsfiShTkOVePyY1PlBlGgOrreDL1g6hO9UOX/7QhXLbd+zl8Zub1/4t9LbUiXNHKQxd00McfxGv1/9Yi28mUkmhMOnpysvq++zhdMhXM62Ti9MGIxw0Xzs/T523+okJtM0A0= 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 2F1CF201D3C; Tue, 28 May 2024 05:19:17 +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 A99EF2011C0; Tue, 28 May 2024 05:19:16 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id B4DC7180222F; Tue, 28 May 2024 11:19:14 +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 v6 0/2] Add i.MX8Q HSIO PHY support Date: Tue, 28 May 2024 10:59:12 +0800 Message-Id: <1716865154-25044-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: 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 v6 1/2] dt-bindings: phy: Add i.MX8Q HSIO SerDes PHY binding [PATCH v6 2/2] phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY Documentation/devicetree/bindings/phy/fsl,imx8qm-hsio.yaml | 164 ++++++++++++++++++++++ drivers/phy/freescale/Kconfig | 8 ++ drivers/phy/freescale/Makefile | 1 + drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 612 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 785 insertions(+)