From patchwork Thu Jun 15 01:38:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandor Yu X-Patchwork-Id: 13280642 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 080C7EB64DC for ; Thu, 15 Jun 2023 01:41:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4j3qYN1oGzBFr3QjsrhujCqHjkX0K4DUBzmfVWAcKSA=; b=aKaDVUQuAQz9Zh f5QWXRzAuGcP6SI4kfKfzXWkEW/TizraBqu9cXM0yfS2rpza4kYQuuWN8Wc91jOnJ+99NQ0Q0TGhP 2x5W9CS/cg3+Z56ShAvmORJA26L6sbzsUKW57YAhdQUjU6cEKnDIMn0kMf8Kht2/4i3zUyrP7M8fu cFqWzIn5Ue0wrAlCOXvNfWe04WfavS/3BOsBc3+z4EtpIVe4/ja0z3VpJTvEbKU5++ifJv+Jb6Q4K ixgnNZmfr3vArxWv6eGiI6Nr7LjT6Y64/9paMcbD5F6CR7X376LNf9tNwb7tlJoDNkw/DzmcYU93L s/nvGNL+7ajBPhk8QxWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9bzL-00DGZH-1g; Thu, 15 Jun 2023 01:41:27 +0000 Received: from mail-he1eur04on0630.outbound.protection.outlook.com ([2a01:111:f400:fe0d::630] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q9bzI-00DGXl-0C; Thu, 15 Jun 2023 01:41:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U+O32iR1gXkEJdbCrKdDFjAGdLLHdn0SfAeAqK6twOhfeTiGk5s4j3LGWxcv5JqbhG5ghlZDoR9+OQLwFAbdluuqRluMmk2vaQZ1kw8/krE2ofRqxCgR3Ia9sk4+FenvjYxKd1Hpj/fPwYPMRnvKtEcZqOO1y0frioFHRYwJTKWS7fM1mpQPMpw41Eb8m48UP5JcdUau/WKU1l/r2J+Qtn6NFJ8PUxkts93iwhyof1A3F8pN8/esFbvAHKiLeRLAcvplwDQ197fGSKepRb3YbqFaWm/jBDiILzPVVLqWKS+j9dMtMrf1pqKuBtuwWGLEP5HtpMEPI2CdfZewZ/IVbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=/8yGGuC2DfD1VvgUV1rOu0UBsvecwcgYCTC2CecbBxk=; b=QcIKhuvjQ86QvKyZMQ3QAUBSUzU5gEol0A/eHdnGzpGPs4CIx0SRE02nbsDAUAHnxdOqEguOlcR3NzSrduz0kprE6VXw1xyx8bThjfqDvDlVyXVc7coFbZ0gXLzRT9QVTmZQVLMbNsy+rA74MXT9+aP2DpJWPXgd5J+ieWNWgI11FXgM84W0rN5wy433HxOYcdnc51vEuHjeZLM+zQ+A2UzQqEAtrIbX+fQ6nXzWog9vHOlBF+gyfqeQMhlP1ApUzOznmYRUN+l26Crc4z6UThs/GLSjSF+X8Sdq/tJtR905WbzqASZhOKWZDyIKXp0xehu/jDcajhjt03ArAo0bAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/8yGGuC2DfD1VvgUV1rOu0UBsvecwcgYCTC2CecbBxk=; b=jZTb8B0gVS5lbI7x7cCnkTkx/byXq5BJHDH1P/m/vNzXKP8pkUndzyJJWSCj45n9Ekc+zqp5D10/cqwkS9UcU4OorU8lFpcruwU0046syLdkBmpQUCUn6agU29Ip1Jh4+LnfYhh963M592K/YR4A6UuNknYPO3xjtv4u09zeTD0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) by AM8PR04MB8034.eurprd04.prod.outlook.com (2603:10a6:20b:249::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Thu, 15 Jun 2023 01:41:13 +0000 Received: from PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::8af8:59df:c8ab:ff51]) by PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::8af8:59df:c8ab:ff51%5]) with mapi id 15.20.6477.037; Thu, 15 Jun 2023 01:41:12 +0000 From: Sandor Yu To: andrzej.hajda@intel.com, neil.armstrong@linaro.org, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@gmail.com, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, vkoul@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org Cc: kernel@pengutronix.de, linux-imx@nxp.com, Sandor.yu@nxp.com, oliver.brown@nxp.com Subject: [PATCH v6 0/8] Initial support for Cadence MHDP8501(HDMI/DP) for i.MX8MQ Date: Thu, 15 Jun 2023 09:38:10 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR01CA0176.apcprd01.prod.exchangelabs.com (2603:1096:4:28::32) To PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9448:EE_|AM8PR04MB8034:EE_ X-MS-Office365-Filtering-Correlation-Id: ef1c0003-966a-4202-f002-08db6d4199ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FvWPSYZn8o9YXksT3gK1H8EHCI+5yTCwhMFFhvmi2lkRWA49Sa98fnxOrvogNLgwrk2LJwqPpdJZjVdktvuRhd/jqSe4Bgy9kd4M8DSh7fp2YkYmq7wGjjSEIdhoQpObZp6UJ306dXX+3D74ZbgTI/22coZq+HvTb7UuLqxGC2bUbpKXTmKrUkrcIuh0s1E9kzL3s4cDXMaWOno+1QLn9EpkE9WREFzZIvukfnrYn+pH55sEH8ert7JFB+e6WL0D2mWCa+Dd6M0cjNMriZAsoynpfb2iVw2/9cDke2PZTm4Po8ySa3+pDIfCnVYjl3yDOvfVkJydY5y2QuBuPdCPfvJjJE6rpZUzK1v4EeGTzRkCObko39SnJOUsjsCS9vjsGeG8rfc86qnSz2wjAJjGtu4TmccsGjMFgdmCp/b7qFsgiE7yHL+qcZJh5Za5uH1yNuJxMt/w7f8DC0kO2BMpxb05OVrLgf/JiX1lqs2SBVYdXC0E5q3MrEajOd5s/IDwbl4a+EU63uHRyMvMhEYWEB3kgtlCCjBwoGC0y6JyuC/QmBBgUVYsl+RK9P5qOMRZfMzX/2FaNA+z1dz7FFvAslLcsrnIB30pdg8N1ZSRopKXRmgDF6L0VnbKEWfvdr/7 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9448.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(376002)(136003)(396003)(366004)(451199021)(2616005)(186003)(2906002)(83380400001)(66476007)(66946007)(66556008)(52116002)(316002)(36756003)(8936002)(41300700001)(8676002)(6486002)(966005)(86362001)(4326008)(478600001)(26005)(6512007)(6506007)(7416002)(38100700002)(38350700002)(5660300002)(921005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XAn/SVNXAe5v8ntiIpF5arM18Z6UqQpRTRChaU0QzVRoCfaqHMer+eUEue4xpNpxNsUP/Pn1ilD/Cv4FHQT1n72wuAJaW7MRzcEb4yNucsWMTB2lkpVoUMOJB1cry+mNv3cRSRdaE3oqAAB1Y61DKldu7ljt++UB+G5eanBm6SqMhzxoSlVZz38JauZ3nqdV4Nic5wtIo7qo6NhHGikObFaJFM1ws+BUTIGUyOvG3pLMW2QzsZys4+m3JwEpKOf0A/NmaDoF95adrFv61FerbwC6X08fHomXVigVE1pOQe14f+gX4ZrcrDdX213E0UB3lNm3fnQyIdZixVZPn/Bv7dKzAW+0t8wFYHqO61f8Wm3r8TvnNBhXa6QGRy/ehJN0I9ldoR+Zj3o2SR2E40pbV0rDkRSQrnc9SnXFmE/umBnxN1B/0YQG+q825bqIyteiWLk32hH/Q3duUkJvFBBZmO4knTpIUpjB0gwx/PHZfUHpuTdWxicbX6bj+VTa8WGSNrLPeZl2wSNLtqDL4BUwyLJiUDL8yXkniIpmiQ6U1n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ant-Network-Message-Id: ef1c0003-966a-4202-f002-08db6d4199ef X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9448.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2023 01:41:12.8265 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: x72+tlqDzGDfkTUJLiyoacnFZ/1JCbA+Ot7jlxBi2Wpte2xHLiGaozpnxdem6od6i4fTd8wKJ2fP1b1dPY6Xlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8034 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230614_184124_110830_2B45D05B X-CRM114-Status: GOOD ( 16.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The patch set initial support for Cadence MHDP8501(HDMI/DP) DRM bridge drivers and Cadence HDP-TX PHY(HDMI/DP) drivers for Freescale i.MX8MQ. The patch set compose of DRM bridge drivers and PHY drivers. Both of them need the followed two patches to pass build. drm: bridge: Cadence: convert mailbox functions to macro functions phy: Add HDMI configuration options DRM bridges driver patches: dt-bindings: display: bridge: Add Cadence MHDP8501 HDMI and DP drm: bridge: Cadence: Add MHDP8501 DP driver drm: bridge: Cadence: Add MHDP8501 HDMI driver PHY driver patches: dt-bindings: phy: Add Freescale iMX8MQ DP and HDMI PHY phy: freescale: Add DisplayPort PHY driver for i.MX8MQ phy: freescale: Add HDMI PHY driver for i.MX8MQ v5->v6: HDMI/DP bridge driver - 8501 is the part number of Cadence MHDP on i.MX8MQ. Use MHDP8501 to name hdmi/dp drivers and files. - Add compatible "fsl,imx8mq-mhdp8501-dp" for i.MX8MQ DP driver - Add compatible "fsl,imx8mq-mhdp8501-hdmi" for i.MX8MQ HDMI driver - Combine HDMI and DP dt-bindings into one file cdns,mhdp8501.yaml - Fix HDMI scrambling is not enable issue when driver working in 4Kp60 mode. - Add HDMI/DP PHY API mailbox protect. HDMI/DP PHY driver: - Rename DP and HDMI PHY files and move to folder phy/freescale/ - Remove properties num_lanes and link_rate from DP PHY driver. - Combine HDMI and DP dt-bindings into one file fsl,imx8mq-dp-hdmi-phy.yaml - Update compatible string to "fsl,imx8mq-dp-phy". - Update compatible string to "fsl,imx8mq-hdmi-phy". v4->v5: - Drop "clk" suffix in clock name. - Add output port property in the example of hdmi/dp. v3->v4: dt-bindings: - Correct dt-bindings coding style and address review comments. - Add apb_clk description. - Add output port for HDMI/DP connector PHY: - Alphabetically sorted in Kconfig and Makefile for DP and HDMI PHY - Remove unused registers define from HDMI and DP PHY drivers. - More description in phy_hdmi.h. - Add apb_clk to HDMI and DP phy driver. HDMI/DP: - Use get_unaligned_le32() to replace hardcode type conversion in HDMI AVI infoframe data fill function. - Add mailbox mutex lock in HDMI/DP driver for phy functions to reslove race conditions between HDMI/DP and PHY drivers. - Add apb_clk to both HDMI and DP driver. - Rename some function names and add prefix with "cdns_hdmi/cdns_dp". - Remove bpc 12 and 16 optional that not supported. v2->v3: Address comments for dt-bindings files. - Correct dts-bindings file names Rename phy-cadence-hdptx-dp.yaml to cdns,mhdp-imx8mq-dp.yaml Rename phy-cadence-hdptx-hdmi.yaml to cdns,mhdp-imx8mq-hdmi.yaml - Drop redundant words and descriptions. - Correct hdmi/dp node name. v2 is a completely different version compared to v1. Previous v1 can be available here [1]. v1->v2: - Reuse Cadence mailbox access functions from mhdp8546 instead of rockchip DP. - Mailbox access functions be convert to marco functions that will be referenced by HDP-TX PHY(HDMI/DP) driver too. - Plain bridge instead of component driver. - Standalone Cadence HDP-TX PHY(HDMI/DP) driver. - Audio driver are removed from the patch set, it will be add in another patch set later. [1] https://patchwork.kernel.org/project/linux-rockchip/cover/cover.1590982881.git.Sandor.yu@nxp.com/ Sandor Yu (8): drm: bridge: Cadence: convert mailbox functions to macro functions dt-bindings: display: bridge: Add Cadence MHDP8501 HDMI and DP drm: bridge: Cadence: Add MHDP8501 DP driver phy: Add HDMI configuration options drm: bridge: Cadence: Add MHDP8501 HDMI driver dt-bindings: phy: Add Freescale iMX8MQ DP and HDMI PHY phy: freescale: Add DisplayPort PHY driver for i.MX8MQ phy: freescale: Add HDMI PHY driver for i.MX8MQ .../display/bridge/cdns,mhdp8501.yaml | 105 ++ .../bindings/phy/fsl,imx8mq-dp-hdmi-phy.yaml | 53 + drivers/gpu/drm/bridge/cadence/Kconfig | 25 + drivers/gpu/drm/bridge/cadence/Makefile | 3 + .../gpu/drm/bridge/cadence/cdns-mhdp8501-dp.c | 1078 +++++++++++++++++ .../drm/bridge/cadence/cdns-mhdp8501-hdmi.c | 1024 ++++++++++++++++ .../gpu/drm/bridge/cadence/cdns-mhdp8501.h | 399 ++++++ .../drm/bridge/cadence/cdns-mhdp8546-core.c | 195 +-- .../drm/bridge/cadence/cdns-mhdp8546-core.h | 1 - drivers/phy/freescale/Kconfig | 18 + drivers/phy/freescale/Makefile | 2 + drivers/phy/freescale/phy-fsl-imx8mq-dp.c | 697 +++++++++++ drivers/phy/freescale/phy-fsl-imx8mq-hdmi.c | 889 ++++++++++++++ include/drm/bridge/cdns-mhdp-mailbox.h | 240 ++++ include/linux/phy/phy-hdmi.h | 38 + include/linux/phy/phy.h | 7 +- 16 files changed, 4578 insertions(+), 196 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/bridge/cdns,mhdp8501.yaml create mode 100644 Documentation/devicetree/bindings/phy/fsl,imx8mq-dp-hdmi-phy.yaml create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-dp.c create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501.h create mode 100644 drivers/phy/freescale/phy-fsl-imx8mq-dp.c create mode 100644 drivers/phy/freescale/phy-fsl-imx8mq-hdmi.c create mode 100644 include/drm/bridge/cdns-mhdp-mailbox.h create mode 100644 include/linux/phy/phy-hdmi.h