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.124 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796102197; b=THnFJFvypoA7KnISg7yN4Cyn+Ke5gbauzJx/Iso6j9VXXV1+SQHuCUtBSZ5CPoYrtoge U8yBCXiwWetaww0UVxJYKiEyBQCHsWXLORIUpAtkqXGlc3MjNdsYzzVtGsK9YNc7b1SdM f89PEneDa71oi65nBO4R8k6qsBglSMcHg0+cSQAqukpam/JIejR5jnhMQQXGVrOWHWILm bz3W2Iktv7v5Bbca7D7b8NpkuBCfTYdXGc1npGBoEZVXM6oKe54jmoJ7ixGeZSV7pZQ6W LnNMraUnNIR4Jv/CWn75FE5lfHMo8JsF9WOzybg0jk/OW6zARLFggOcduBqZOEFFXfg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796102197; 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=ETXvuHpJKoBBMoffq5E7bi0YtHbhGb3cQrYyElmT18o=; b=bdCaYVn5xVJ4oyt8MjfRR2wpcL0NHUZmk21ay1HtM2PTZwLmDvhl8s3RFvVDXLJI/u9T VvBXBkrP3r80ltKx4m6feCJJlS8TlLtmxg7w/fb5zctd19hXva4AFRL3ucGi7SMMPjdhM Z3Ooo7QWFzCXSAE2nkVtncKxePMuriq9cLzwprSUvKOvLu4oMuymzQhZCEkvhSttht4cv pdGin0++15Nx5NmrrBD3wSxi4Axl3/WTSPaebTeYqFAxyNAVaVOcv5tZ1/VWi03BkFRby SH5ftKsIfVrJ8qyrReVfZT8YnvcN9yS1/a3Vk3pUIj1b3A8g+Lru5DtX1ImSgGU3TlA== 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.124 Received: from TYPPR03CU001.outbound.protection.outlook.com (mail-japaneastazon11022124.outbound.protection.outlook.com [52.101.126.124]) (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 D4523606A333; Tue, 1 Dec 2026 05:16:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D4523606A333 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=iBdS1BqktnwontuNdxh7nKGk4nTIXR+5GcK20QcW0xeEuGeaNzLEM1xVQ9hgMXJY6puR8JjX+yWLqmJIoUMRNWmZCXU7mDt4ZrsQJhvjxUl+wx1/NypkQwTsDB7z0HB35Eor1yStOXMSgqwunndRQjobrBnRWf2/k4T1JYf8yittB9US4xuy6W6y935DRJaX3wwOPMj0XKdxayAv2Q3gJLPjZYZLeChVG/obW1YCG6NVj4TJ2zX7xJ0wSNeWyU9tA+XWZzp+MLp0T6ZPao27yeV13JQnvqku+irWGJBU6LomAwvX2Ffkie1rNAwRpKwW3FabtgcD0MCEBSiR8tQpTg== 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=ETXvuHpJKoBBMoffq5E7bi0YtHbhGb3cQrYyElmT18o=; b=Gjt3vGngfx5b9Gi1GYDU4gcypQTwcfnKC+uYdHQzKqtcNkGIMplITx9dNQaHLtsUbRMqcqMlbg2ZJPXfL8G/3PyVCAL3XJGjX9Ric1urASm8/kQvSFQetR5uSPoFyBroZB7/b8yTtZgyvg5z2DBngzWRgNZhFZl91JiHGx1QiQoUwip3/BQW12w5J5z2umC+T/iD+3qrKW22rtwmFO6gFKit7j5lugVRm8oOl8EJPuHFwcDVios2ivSLivC+9tRzzcDlrbboEaJt7f62cyGjuCKj32u8YJQuu5soPiJDYZBxfACyce1icMimkXDqco69we0Got+Z6cg1RwosVLx2xg== 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 SI1PR02CA0015.apcprd02.prod.outlook.com (2603:1096:4:1f7::18) by PUZPR06MB6145.apcprd06.prod.outlook.com (2603:1096:301:11a::13) 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 05:16:32 +0000 Received: from SG1PEPF000082E6.apcprd02.prod.outlook.com (2603:1096:4:1f7:cafe::d) by SI1PR02CA0015.outlook.office365.com (2603:1096:4:1f7::18) 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 05:16:31 +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 SG1PEPF000082E6.mail.protection.outlook.com (10.167.240.5) 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 05:16:30 +0000 Received: from gary-System-Product-Name (unknown [172.16.66.27]) by smtprelay.cixcomputing.com (Postfix) with ESMTPSA id 2F4F9427EFDA; Tue, 1 Dec 2026 13:16:30 +0800 (CST) From: Gary Yang To: vkoul@kernel.org, neil.armstrong@linaro.org, mani@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, fugang.duan@cixtech.com Cc: gary.yang@cixtech.com, Luo.Liu@cixtech.com, cix-kernel-upstream@cixtech.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 0/2] phy: cix: add Sky1 USB/DP combo PHY support Date: Tue, 1 Dec 2026 13:16:27 +0800 Message-ID: <20261201051629.3862739-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: SG1PEPF000082E6:EE_|PUZPR06MB6145:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ea8a5ff3-cdc4-446a-fccd-08df4f6a427c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|1800799024|23010399003|82310400026|376014|7416014|10067099003|56012099006|261026140227099003|261028144727099003|261026121527099003|261021121427099003|261102123227099003|261021123027099003|261022113327099003|261022075727099003|261022105027099003|261009223027099003|18002099003|5023799004|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: Y+pudh5bz7TGFWfHN+N8JqIFGtccVfl3vzlnOAfoC/jzO+o72IJOqFn5L+lskiJJ+jjf+mQwNfvLHPn00bY1fz+NdhD9eBqSKJeDCzb3SyFmDJR5QAa0cfJtIDUbOTcToekBdyDur0P3+oLgBFcorLncziRV79px/L1QPyahCN+w5MH0iU7hE8k8C+M6HoEhql0+9c93/KJfEFMZ6qhOtBVal79bL8hjlQnqHOXlwqar6sdbe2kaBsmTW34e3/W5P+iC6sfYozhwnhi31W1J45HdEiJl66YeTw2F1FbVRjJlgNfAzhYjaPafXBOiEaAqw9roIe8JZ8H1wbMzIRPoPc5rwl2XR3k91GOPEHAYnK2bnLj+b77UFHurLvPg76Corpa9zOTm2goFFDJDAwyIdQyK1wlSnd+ERe2p+X1ZU+JKyF2Kxuf0BoWe9eEqnbfeN76agVnZXgAKz+zwf5iNVXF5iC3uhEe/rwS2jA4kRSn/ajLNTkkECUjrvtM74xzgwkWyEPVxU9srHopDHdk0WjHUJcYBXxTOxYWriGmhj454vOFNGgK0I1tx+2POVx0dx7C0ZkN53EKLf/zrLYeCCC71KQBkOfnzCQYALuC7yyK0ny0VBIcMTf9HaAdV251orT+r0ULmbPklY42a2wiDaoVBnv6RHaLrp8mm9C/vALA= 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)(36860700016)(1800799024)(23010399003)(82310400026)(376014)(7416014)(10067099003)(56012099006)(261026140227099003)(261028144727099003)(261026121527099003)(261021121427099003)(261102123227099003)(261021123027099003)(261022113327099003)(261022075727099003)(261022105027099003)(261009223027099003)(18002099003)(5023799004)(6133799003)(3023799007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jcvd3N05OokYY7cQ5xt7WZMoXtdZ7H0/FvuLqWQ9TbW4+bYSp4Ceaw+ki9zrY/TQ2TvFL4+4A2E5ZAjjkaZYCeYTbLONs28vbh1qifoIcThOA3KOkajKurcfJrTOVO8tZnRWK7oah+cplpJu6OeXSkZKiWqHGuB53CV+WegHpyR5Flu+fEFW1lTCYEUv+EybBV85tF5RfxyEh9meA+ESPqvf3kNb26yreRYlwDffyULqikhnpseQH/Ob7apKGQ9pOU8roVpoyPM1f6VEAfK47XLUjFbqdZVbZ6Cju1frxZQjrvpxRiKd8EAFfu0PJ9ge96fpv/pPEpkTO2h6tJQ6z+z8GGBpoytxKwGD+CntuCd1rIru1pryhIw6lWk5xgEwaUh7XMKG+8TkSLeYnLp0un0cP5CdxAgJG1ehIXalhLYj+X8lKMEuysJaBR3SqWY2 X-OriginatorOrg: cixtech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 05:16:30.8085 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea8a5ff3-cdc4-446a-fccd-08df4f6a427c 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: SG1PEPF000082E6.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6145 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 v6: - Keep the DP lane count, the PHY bus width and the USB mode bit in sync with the requested mode when the deferred reprogramming is applied from the DP configuration path, instead of leaving the values from the previous power-on in place. A rate update that does not repeat set_lanes could otherwise program the USB3 lanes after a 4-lane to 2-lane switch, or skip the lanes that became available after a 2-lane to 4-lane switch. Validate the voltage levels against the same lane count, so that the verification and the programming steps agree. - Ignore DP configuration requests that arrive after the connector has left the DisplayPort alt mode, so that a stale link-training call cannot reprogram lanes that no longer belong to DisplayPort. - Complete a DisplayPort power-on that arrives while the mux still reports a USB-only mode when the mux later selects the DisplayPort mode. The PHY core has already taken the power reference, so without remembering the request the DP PHY would stay unpowered for the session and all link configuration would be dropped. - Only remember that power-on once it succeeded or when it has been deferred until the mux selects the DisplayPort mode. A failed power-on does not give the PHY core a reference to account, so remembering it anyway would let the mux path power the block up without a consumer and never power it down again. - Drop a pending reprogramming request when the PHY is fully powered down. The next power-on programs the complete register table for the requested mode and orientation, so the request is applied there and must not leak into the next session. 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 | 1665 +++++++++++++++++ drivers/phy/cix/phy-cix-usbdp.h | 257 +++ 6 files changed, 2092 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