From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.126.137 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796089267; b=suhyOMfpfBVc1yKOuE0KCulzEv9EHICg1OEbzGqvEn8G5YRjjs70fNABuuKDGLSi8WlW ZCTAP1YeQxpdB3YKYNCtj5resrtqSkvu9XmBq8qxrJEMH6rGc/YVW0BB4LGSU+d9y8e6c /fsb6yER2ny6Qz5AlzpEgpL5DJZa+jRSXjW79fwBAG01vDWF2Q0sWYSIQjkLZF7jBe7JQ KhdmZg5tlh73gUv7iWmFw3cjVnG7HDtIMNQas5V0GtZ6xdy6GzpUA8lTvei7Nv+Js6oP6 IHWZsFzFMuL/1Oa0PrV50LxBYKMnt1CuSzwiK8cHkj67GC4oQ4BDOpCnWOe+sJH3wvw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796089267; h=DMARC-Filter:Received:Received:X-MS-Exchange-Authentication-Results: Received-SPF:Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding: X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:Content-Type: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=dqp6hPMKNC32KWxSyshwWnlFct1Wy8yjPe7qoXhl6AI=; b=Uh4ipmaYuc8UHuIGwbd1p86AnRvKFhDE5E7rSUI8k/9qwbYBvqCdHuh/ma7PuI+wgKTl iwfVRVlwA6njIX3horqDuhWNejH9q7fLhMy6xSh843RVrG/H9ebugikapKMy+xrtPqc/x 3r/IFHH5iTfAjy6iyWeAv8AVzeqIt/Kn4YeesQNrj5ZH2uCKRVJKtkQMU8cXPzHexXRpU EZ2oCqnVvaHtbwkR5t56OWV+n+0RpcgrCkuatDCNHmmXpVw/mQYdzGxOwp/g7fAbFITVR GgNlUwIflnG5UrCzGcoPneBOlR14RPAzqsgp6qI2MlvuH5RlHie3DlgpAPd8nMDMyBA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=cixtech.com; spf=pass smtp.mailfrom=cixtech.com; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.126.137 Received: from TYPPR03CU001.outbound.protection.outlook.com (mail-japaneastazon11022137.outbound.protection.outlook.com [52.101.126.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0F97606A31A; Tue, 1 Dec 2026 01:41:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C0F97606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cixtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cixtech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aIWfLYnDaKHCjxjsMiy7RycVui3ZGrjAAxq1n4bC7I8mj095w8O3ZAF+cO/vUaXyeFhVvqb+iI+VLfYNE0ezuvoh4vC7Bt4Ufz0cBptqkJmMpNFrK/kvc8Puu74EdOpCxSBJJaLLNVJlUuLKfPPhas6rpYGxIne4MlSUt9gBVW2RsqM9QHzuX5fIICM5TOEu77k7DXkD47jA7LBDm68QKfMRM3BuNQhNiOYAQSrfloDsdSI1vrpBCcAo/tP7En6EVk1PJhEGOdaoHn49LfSTuPX4zpDyWhFjkjgGqMy2DyQFWt/UYBzsycaH2bcv9YjNaxXb/CSMwwDbIeVX6PG+EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dqp6hPMKNC32KWxSyshwWnlFct1Wy8yjPe7qoXhl6AI=; b=vy1rXuy7ehePqln7EjO8oAb+Pgxz6nsBcTC++2sqEOPYH5J1pkXB+QtpZXGDmWoVastxu3XtZ5MZ7x6sX6i00JyhB8O0CSx4GV0MPhrhBKQfa9JEuL5+4+zsSScPdiS94mJMwH4LEwm9kFtLUmPGTYoBtMMMHl8XbglE6S6Kmd8k8PYJrz0bYUbJzlV9jv7Ke2oNDggSLLnLabXMTXuDZZjqZrwsavxh6XBUJylRci2Bgl9YIJjsfMzQDC2Lv4dwzIebGpo5PmtVMEtTlx8XmOAEpjLUff7fTAwBzrmgbgpYrFBlEkTlMJDMyu6vZWL5OZf3fdmLNYhkg/GOc90yWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 222.71.101.198) smtp.rcpttodomain=cixtech.com smtp.mailfrom=cixtech.com; dmarc=bestguesspass action=none header.from=cixtech.com; dkim=none (message not signed); arc=none (0) Received: from PSBPR02CA0005.apcprd02.prod.outlook.com (2603:1096:301::15) by TYNPR06MB8452.apcprd06.prod.outlook.com (2603:1096:405:3b4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Tue, 1 Dec 2026 01:41:01 +0000 Received: from OSA0EPF000000C6.apcprd02.prod.outlook.com (2603:1096:301:0:cafe::66) by PSBPR02CA0005.outlook.office365.com (2603:1096:301::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Tue, 1 Dec 2026 01:41:01 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 222.71.101.198) smtp.mailfrom=cixtech.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=cixtech.com; Received-SPF: Pass (protection.outlook.com: domain of cixtech.com designates 222.71.101.198 as permitted sender) receiver=protection.outlook.com; client-ip=222.71.101.198; helo=smtprelay.cixcomputing.com; pr=C Received: from smtprelay.cixcomputing.com (222.71.101.198) by OSA0EPF000000C6.mail.protection.outlook.com (10.167.240.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 01:41:00 +0000 Received: from gary-System-Product-Name (unknown [172.16.66.27]) by smtprelay.cixcomputing.com (Postfix) with ESMTPSA id C8C4740920E2; Tue, 1 Dec 2026 09:40:59 +0800 (CST) From: Gary Yang To: Vinod Koul , Neil Armstrong , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Fugang Duan Cc: Gary Yang , Luo Liu , CIX Linux Kernel Upstream Group , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 0/2] phy: cix: add Sky1 USB/DP combo PHY support Date: Tue, 1 Dec 2026 09:40:57 +0800 Message-ID: <20261201014059.3811728-1-gary.yang@cixtech.com> X-Mailer: git-send-email 2.50.1 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSA0EPF000000C6:EE_|TYNPR06MB8452:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ac625a09-56cd-4f50-4810-08df4f4c2784 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|36860700016|23010399003|1800799024|6133799003|261009223027099003|18002099003|3023799007|56012099006|261021123027099003|261026121527099003|261021121427099003|261028144727099003|261022105027099003|10067099003|261102123227099003|261026140227099003|261022075727099003|261022113327099003; X-Microsoft-Antispam-Message-Info: 23UCJJO2XMtlB2eniJzecUl2CG85fAeL1fzDNqaaXdGLNG8e1pJ3et6dzBlAqW41kzmMMgW5DE36naycAtOEYtwu5PYaHlJnooBGSbA9bTlHWBm0zp5K7jSdyi5Jgq4JBlN1Sp8q4srvp5qvbY7MJbicL++NeDDnZwVwrGO9R5h6BygEjkjJXf1MOIu2HJ5JdiYdp2CT1g/7mHX5FUbNzvJpcotpGCTy5o9LtKJYmZdUHCE9cbacCnifg+5QUFGBao0+HSccyb/m6cKpvITdSbwa0zy4nKBY2f53rwI+BXxgxNrv9PbHs6imMNdo/V1FoTbK61HkK5rgnwEX7B1RQyfHDKrsQsgfRa5EA54t0lMiQau3Doj+lkqE47xshUGJsT25C0jK+vE0/KIU5S9XAqtvyUTFdvWl78mRhuNbGolrAbus3727aY0iEp9POQO/hY0UzijhXPDkTxSIi7+ABwscZ1iKWqVwu9dANpxK1uLn6SP58gbP7g8p1ThNs/gx5CNN3sXFLnSx0ettzuQHJjFBWPJVycHITnwc+lXJqwzyhKWigs5klXsFbFvaXPN3uyqWQrZWI75RYfleGrgQwZuXnGZx35Ur/Ks/eMeGnCBydNXu2VxDdHqbfHfW6DRzhn8cQ3deYTSPioUogILHhW2rEyGPCf9UWEhizSd9XVE= X-Forefront-Antispam-Report: CIP:222.71.101.198;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:smtprelay.cixcomputing.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(36860700016)(23010399003)(1800799024)(6133799003)(261009223027099003)(18002099003)(3023799007)(56012099006)(261021123027099003)(261026121527099003)(261021121427099003)(261028144727099003)(261022105027099003)(10067099003)(261102123227099003)(261026140227099003)(261022075727099003)(261022113327099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mzltTuaCRlP7fhUnuLHQMSW80fsH3Jhnh2mQHWEKvZ5ehjov48INmVZFg5ymxXgr3UCUwNy069Ap66xA5zhVoP+GSFEF3fIs0yVoSyyhivNOztaQ+jVfVH0Tsy0rWqObvvGAPCnB+1QtRJtQpUy7M5qi1WH9j+TFYPVHDmvlIkF2CeyR9eqZCpt/pTBhU+t8cvfVBHkx205ctf7AfxU1WDiV60nIR5S7/vGaha8HaOkrmOswqp/wf21SrkYn1jtm2fyfLUBsKLy61AT2dj2wQTybpFfAoXgZxaro/nPpj2UejsiJDcGikobHZSQ9cxQaSMZBPBND+ke+USxDIbt+d6eonnLElNKB/QzRrdqQK8ltUNsz0Q4FnzmK/kITLVpRfpqk34DDYy/VX9fHojS4tVIVIw1sAGJhdRWmoLJG+8MYpT4revVXg64u8iGeo585 X-OriginatorOrg: cixtech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 01:41:00.5822 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac625a09-56cd-4f50-4810-08df4f4c2784 X-MS-Exchange-CrossTenant-Id: 0409f77a-e53d-4d23-943e-ccade7cb4811 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0409f77a-e53d-4d23-943e-ccade7cb4811;Ip=[222.71.101.198];Helo=[smtprelay.cixcomputing.com] X-MS-Exchange-CrossTenant-AuthSource: OSA0EPF000000C6.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYNPR06MB8452 This series adds support for the USB/DP combo PHY of the CIX Sky1 SoC. Each PHY instance drives one SuperSpeedPlus USB lane and up to four DisplayPort lanes of a USB Type-C port. The USB and the DP controller get their own PHY through the PHY_TYPE_USB3 and PHY_TYPE_DP cells. Plug orientation and the USB/DP mode decision are taken by the Type-C connector driver; the PHY consumes them through the Type-C switch and mux API. The USB and the DisplayPort controllers and the Type-C connector are not yet described in the CIX device trees. The graph links and the consumers will be added together with them. Patch 1 adds the binding and patch 2 the driver. The MAINTAINERS update is part of patch 2, so that patch 2 can be applied without patch 1. The SoC and board nodes are sent separately as a follow-up, since they go through the SoC tree. Patch 2 builds on Luo Liu's "Add Sky1 DisplayPort PHY support" series: https://lore.kernel.org/linux-phy/20261102030425.1957585-1-Luo.Liu@cixtech.com That series creates drivers/phy/cix/ together with the PHY_CIX_DP Kconfig symbol and the CIX SKY1 DISPLAYPORT PHY DRIVER MAINTAINERS entry. This series adds the PHY_CIX_USBDP symbol and the new binding, and renames the entry to CIX SKY1 PHY DRIVERS. It should be applied on top of Luo's series to avoid conflicts in drivers/phy/cix/{Kconfig,Makefile} and MAINTAINERS. Changes in v5: - Attempt the USB restore on every mux event whose requested mode contains USB, instead of only on the plain USB state, so that a configuration change or a disconnect after a 4-lane DP session no longer leaves the initialized USB3 controller attached to a powered down PHY. - Do not run the power-on sequence when the DP PHY releases the lanes: the PHY is still powered at that point, so restoring the USB mode there would enable the APB clock a second time and leak a prepare/enable reference. Account the USB mode again instead and only apply a deferred reprogramming. - Drop the USB mode bit and power the PHY down when the mux switches to a DP-only configuration while USB3 is the only user, instead of keeping the PHY powered with a USB bit that the DP-only register table has already disconnected. The DP PHY powers the block up again when it is powered on. - Apply a deferred mode or plug orientation reprogramming when the DP link parameters are configured, before the link training starts, instead of leaving it pending while the DP PHY is powered. A mode change that arrives after the DP PHY has been powered on with the previous table cannot be applied from the mux notification, and the link would otherwise be trained against the previous lane mapping. Changes in v4: - Map the safe and USB states signalled by the DP altmode driver to the USB+DP mode instead of the USB-only mode, so that a DP PHY power-on request that races with the altmode notification no longer leaves the PHY unpowered and silently drops the link training writes. Handle the deprecated pin assignments A and B the same way as C and D instead of mapping them to USB only. - Apply a deferred mode table or plug orientation reprogramming as soon as the DP PHY stops using the lanes, instead of waiting for a USB3 power-on that is not guaranteed while the PHY stays initialized. - Drop the USB mode bit when a 4-lane DP configuration takes over all the lanes, so that releasing the DP PHY powers the combo PHY down instead of leaving it and its apb clock enabled. Remember whether the USB3 controller still holds the PHY initialized and power the PHY back up to USB once the last DP user releases the lanes, including when the DP altmode driver switches the sink back to USB before the DP PHY is powered off, so that the controller does not end up driving an unpowered PHY. Patch 1 is unchanged from v4. Changes in v3: - Drop the inline keyword from the register access helpers, drop the udphy_write() wrapper and use writel() directly. - Return the actual clk_prepare_enable() error instead of initialising the return value to -EBUSY, and reflow the retry comment to use the full 80 columns. - Initialise the PHY mutex with devm_mutex_init(). Changes in v2: - Replace the hand-written regmap backend over the PHY registers with direct writel()/readl() access. - Take the DP link rate in Mb/s, as defined by struct phy_configure_opts_dp, and select the register table from the link configuration entry instead of repeating it per case. - Protect the PHY state with guard(mutex) and drop the goto-based unlock paths. - Use dev_err_probe() consistently in probe(). - Fix local variable ordering in probe() and sky1_udphy_init(), and drop the unused register read. - Lowercase hex constants, fix overlong lines, add the missing copyright header and a missing newline before return. - Move the driver out of ARM/CIX SOC SUPPORT into the CIX SKY1 PHY DRIVERS entry, and drop the commit message claim about the bootloader handing over an initialized port. - Validate the DP link rate before the PLL is touched, so that an unsupported rate no longer leaves PLL1 disabled. - Honour set_rate, set_lanes and set_voltages independently, and keep the negotiated lane count in the driver, so that a caller that only updates the voltage swing and pre-emphasis levels, as dw-dp does, works with an uninitialised lanes field. Validate all of the options before any of them is applied. - Program the TX voltage swing and pre-emphasis levels per lane instead of applying the settings of lane 0 to all lanes. - Add .init to the USB3 PHY ops and only touch the PHY registers while the PHY is powered. - Track the active and the requested mode separately and reprogram the PHY on the next power-on only when the alt mode or the plug orientation has changed, instead of enabling the APB clock a second time. - Reset the PHY when it is reprogrammed, and only reprogram it when the register table actually changes, so that an active USB link is left alone when the mode changes between USB and USB+DisplayPort. - Handle the deprecated DisplayPort pin assignment F as a USB+DP state, like the other Type-C mux drivers do. - Report the DisplayPort lane count only after the PHY has been powered on. - Ignore Type-C mux states of alt modes other than DisplayPort, which used to be mistaken for a DisplayPort state because the state numbers overlap. - Describe the two PHYs with #phy-cells = <1> instead of child nodes, reference the common USB switch binding, describe the Type-C graph connection, and drop the cix,default-conf property. - Keep the binding example limited to the PHY node and its graph ports, and drop the stubbed USB and DisplayPort consumers. Patch 1 is unchanged from v2. Gary Yang (2): dt-bindings: phy: add CIX Sky1 USB/DP combo PHY phy: cix: add Sky1 USB/DP combo PHY driver .../bindings/phy/cix,sky1-usbdp-phy.yaml | 150 ++ MAINTAINERS | 4 +- drivers/phy/cix/Kconfig | 16 + drivers/phy/cix/Makefile | 1 + drivers/phy/cix/phy-cix-usbdp.c | 1570 +++++++++++++++++ drivers/phy/cix/phy-cix-usbdp.h | 257 +++ 6 files changed, 1997 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/phy/cix,sky1-usbdp-phy.yaml create mode 100644 drivers/phy/cix/phy-cix-usbdp.c create mode 100644 drivers/phy/cix/phy-cix-usbdp.h -- 2.50.1