From patchwork Thu Sep 7 01:05:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sandor Yu X-Patchwork-Id: 1830680 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=rDFZGwTu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Rh1KZ37Csz1yh5 for ; Thu, 7 Sep 2023 11:06:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234703AbjIGBGf (ORCPT ); Wed, 6 Sep 2023 21:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbjIGBGe (ORCPT ); Wed, 6 Sep 2023 21:06:34 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2042.outbound.protection.outlook.com [40.107.14.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A258911B; Wed, 6 Sep 2023 18:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lJDOnU4tDY0eUEq0ieT/Wr6id9sSJwWiWSKpCgtRB7p+neL1h2l7NeYALiNOeXc4neQDllqup+TWhmoj8KpebrpPdWcFi6O3+U5PqdivcWPOq9UqwhAQRev/AEMtrNStsnxsXYMxRDDWnf5VgBRzHVeMmvWK3wELdk8IniChxJYkBwM7L+SdYE4Pv7Ky5KaT69mNwuHk1aja7jWjXjjTWPwEVanZhhbeiCLFxCgcdC7wUTo8kGlny5y0CdWrhles2IV99eAbhWizCbOS2qnxxCXaRob3wsTdP29qkhRem75D3p5PTrrSNOoMsVBQ9oyxIU6H3Qe/lXAdEP91k3YW/A== 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=jP2mBxCcR16jkbGXryEF/X7CXtxDCTZtf1B2XBERk24=; b=i05GKA2mRzOfyCc7r2CFlUfgoxSiVFAQ83ETsBJMsYBx8qZgbhU5mWYlygIkE7FcIYO+KFLurNuToBdpIEXpqBjg0pY8LDpMuPDYor9Mgrrc8dEBZeLbmA+RcPMiW4l0dPboM//M6vvukw96P7/476pSNMJEu83XyVj3HfsA7Ha6Vs0UrNaSDruHqMSQwInwEPqmGWmu3uU33JG4udKAOSRWvk6FZOeh92mKv0E4JMve9mrhV1rXTVPHepdKPSvL4Vu1XcLFRNNafGuJwjGIfgoG14geic+s6/AWS5gogBxFUUpog4oZ0LDpNB0S3lFWoIHcgWlf5xw0uqmlNFpF1A== 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=jP2mBxCcR16jkbGXryEF/X7CXtxDCTZtf1B2XBERk24=; b=rDFZGwTucZJJefqApQwElb0zddD+6PB6TjSMpzvBKC+DRhskwDCEEiu1yJ1zvo4kbScjwvDChPH37NLgBOgwdbLIi8jXo2PPFp5bAfavDcDS67Tv4k4oVEWTXI1bTz85f5PicPfp2UDnINpg+haMffwzlCb6uhRa5LNdG1Ih0Xc= 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 AM0PR04MB6802.eurprd04.prod.outlook.com (2603:10a6:208:184::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.30; Thu, 7 Sep 2023 01:06:26 +0000 Received: from PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::3505:c499:96d4:1429]) by PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::3505:c499:96d4:1429%4]) with mapi id 15.20.6745.034; Thu, 7 Sep 2023 01:06:26 +0000 From: Sandor Yu To: andrzej.hajda@intel.com, neil.armstrong@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, alexander.stein@ew.tq-group.com, sam@ravnborg.org Subject: [PATCH v9 0/7] Initial support Cadence MHDP8501(HDMI/DP) for i.MX8MQ Date: Thu, 7 Sep 2023 09:05:27 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG3P274CA0003.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::15) To PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9448:EE_|AM0PR04MB6802:EE_ X-MS-Office365-Filtering-Correlation-Id: 60a0bb16-3d18-4657-a3b4-08dbaf3ea8f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zn5Tlc/OgJQmsZMDL+p3gTcMxSX/oX4hUmXe+z3q6dLpVF+bqrefT8GsFYrpd8SEXedyP7YMKHIBLJeoVhz17qeqGMOJI96JDp+o0sIL2uY9A7Q+8p6GvWwX2N8eB2qzyN50IWik/4+2yuntQqTP3mzOzBljOBo4YlWBRl/qKWK2PV0bfOKRjftEzW0Z6J6gjBPJ2F7wUsC5BmhjgQxMdEYW5KmPagQlocXnVsEL7jsHijnQs3JBjkKOE8HjnUst1bzsiLxzb0t/e//5oSGt0dincMFbD+dtwrcp4r1mfWCv4hFCTQWM/cfEUHYczbx5IvPLYIej5Re3CFKlNVsYYjlOGC4z2GElTh/J13HGqauBhjeTlQ3H1KqiTen4FBrai2yeP1SHKoMIQj71P9Vsbm12qkebAAw1Nr9l8SbUie+iXHYASvsNUE8f1USg6F9xBlvPnviOgrJk1izXuZBLYds+AHskwZkg5kKiiS/yYPBEtWv8Wv/XF6QWCksVmVT75AFK1Nihl7Yx+zKYkl4f8wzEaaocrtt2U/6vCjMJNyJn0xPChz9Ucnx0u7UtRfkgKg7EyBTE0il+MKFU3igW9g305DGCefUy5tMb+QgJbPKOG0AlWpAgDUn61JMEios5 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:(13230031)(366004)(39860400002)(136003)(376002)(346002)(396003)(1800799009)(186009)(451199024)(921005)(66476007)(966005)(66946007)(26005)(66556008)(478600001)(2616005)(6486002)(6512007)(52116002)(8936002)(4326008)(8676002)(316002)(5660300002)(86362001)(83380400001)(38350700002)(38100700002)(7416002)(36756003)(41300700001)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?JorMXxL9t3UA9XyqI2JMSWdjnbCk?= =?utf-8?q?JXUBFDvAF2T22XoBe8sJIt5IkAsERXfid5mri0v+5dHrFkKfG1+vrIgDmUO1lXene?= =?utf-8?q?1xkN0xSV+LbqinrMzrSGIFElD2Fc93+F9Tza3tq6JRWvgteIf8Nplr0EZgy15Vfti?= =?utf-8?q?8YK6pi0PYfFofm5eQAcQSmk/geWZMGGgXaZWqJx6S3MaZMLIl1zUta6iD+e9UmWpc?= =?utf-8?q?Gj6Eu/67+woR3KVeornjHikCzVOfvg8kUraiRqPOUROREaTqAWAXFLgxR8GqG4RHf?= =?utf-8?q?XobN8/HxFV6jpArf3l1uMFi9oG9NBwwJnT0Zw95quVhN8TnuUHwbrQ13myRcbsab+?= =?utf-8?q?/XMLh4SEY0YmEKEandbBfqjdxqVlTlHZeNnnXuog0F837TJVHt/Upq+3c7IMzPYVO?= =?utf-8?q?Lmx/V0KDp7vAipRArdomf44tESVAtbZ5EEQuM+h4QaJyIoCGXA1FK1EOJlltxMzi0?= =?utf-8?q?a8WHdopUQPYyGos7zbz9eTUhD0cnPTQHO9DIATv8se9mchwXaaprYQjdHnW03SHfB?= =?utf-8?q?zGEC+Rsv7i5L85gxCDJ/UB28BRKbw0uWJUxZALlvm2HDJWqWSSd4Ddiw2Ybkzq/ph?= =?utf-8?q?WFBlKUpyizBSWYjTWASvTvtESQba7K768eY7DXMcx5Q7D/B3He35nNq+h8Zdk4lVE?= =?utf-8?q?A01Mxamk32ngbkijB5OKDD9/aMyPv+Wj6gx5oKnPUNBKxLSvvELGErI07prHApQxz?= =?utf-8?q?fFjkLfkZTKK04tUupW87EL8TU1JPrQpPCIm/0zIAOfndpfSqvBuV/DdMlcEx7jcsm?= =?utf-8?q?OWfuDdO0OC+1pVmjQOvEWo1JVzIN6Aekao+ZTthDPicHob3QvTgCKqpKnVmRChMPc?= =?utf-8?q?1VkuDb42T4s4jOac6QrA3qnQJkP9qflpdDz8y3TLhkNIOV7MrAabQ+KlohZ1hspiG?= =?utf-8?q?QOEK+IZKzB9WGvzp51zf7ACTfHPtUWUG31vscwteLa4KYbNcucgUefvU+u3W/rK6g?= =?utf-8?q?7jQhsUOMW5FSSb8QE8/51fMVSHVCAiDtu1YrW23nuGpOGG8wLOXxHpSYpNmx0JQSU?= =?utf-8?q?CL1LqUext9Ya7dFo0zp6p4T/T01Qr5CZSU3tnKLShd2AzxXCtZQFRV3g6QTLJwIgz?= =?utf-8?q?pRA5Plyfr2sf9y8U4rGKQYBvVPIgtdU058vJ8kghFCGgR8JgFyFMcfKwpRhn5lg56?= =?utf-8?q?XxQb0CGFNWj42tGBFcdaa8O6CZtItKz+tPgKhpj6JPP1EiRssstX+qX79Wgic319J?= =?utf-8?q?stSRIXLHF3F0SahigxYI7Ifo7QlyAgz7U8tg4xruk5uWSoSnzM1z7Apv/Irr+I3Gs?= =?utf-8?q?MhwC/m3lUr6LAPefQDzO/xcEykMB+W5TINkPH7A3Cbtt2OwaWEEi26EDtBqoEpCCD?= =?utf-8?q?aTcO2OgijUS3vFIk0bql8mKtVMHpx3hjf506R8k9Sn07IYPC+3ChrTqdgWRlIhVJo?= =?utf-8?q?+xNwT42ddgkxhwp3OBUJwDfK21GDaab5kg/duDVdu+raRvylDem/N3EZ/fDyZeoun?= =?utf-8?q?Bmevf9YiKJGCebeKlWSu58WbJy8iaJZN8ct7uKVnv1D7iFx/sKWvhKlnb/QitYb0G?= =?utf-8?q?L5OzbAblyHcx?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60a0bb16-3d18-4657-a3b4-08dbaf3ea8f8 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9448.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2023 01:06:26.4502 (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: Ke+qs66dVnDqfz0MzgmaD7GJyFUwS6Uu/4tWNvfLZKVIWPxz+QIP3nuniF/4gRgHcvtMF1SmlO7MpkEyrRyuAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6802 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The patch set initial support 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 MHDP850 drm: bridge: Cadence: Add MHDP8501 DP/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 v8->v9: - Remove compatible string "cdns,mhdp8501" that had removed from dt-bindings file in v8. - Add Dmitry's R-b tag to patch #2 - Add Krzysztof's R-b tag to patch #3 v7->v8: MHDP8501 HDMI/DP: - Correct DT node name to "display-bridge". - Remove "cdns,mhdp8501" from mhdp8501 dt-binding doc. HDMI/DP PHY: - Introduced functions `wait_for_ack` and `wait_for_ack_clear` to handle waiting with acknowledgment bits set and cleared respectively. - Use FIELD_PRE() to set bitfields for both HDMI and DP PHY. v6->v7: MHDP8501 HDMI/DP: - Combine HDMI and DP driver into one mhdp8501 driver. Use the connector type to load the corresponding functions. - Remove connector init functions. - Add in phy_hdmi.h to reuse ‘enum hdmi_colorspace’. HDMI/DP PHY: - Lowercase hex values - Fix parameters indent issue on some functions - Replace ‘udelay’ with ‘usleep_range’ 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 (7): drm: bridge: Cadence: convert mailbox functions to macro functions phy: Add HDMI configuration options dt-bindings: display: bridge: Add Cadence MHDP850 drm: bridge: Cadence: Add MHDP8501 DP/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 | 104 ++ .../bindings/phy/fsl,imx8mq-dp-hdmi-phy.yaml | 53 + drivers/gpu/drm/bridge/cadence/Kconfig | 15 + drivers/gpu/drm/bridge/cadence/Makefile | 2 + .../drm/bridge/cadence/cdns-mhdp8501-core.c | 312 ++++++ .../drm/bridge/cadence/cdns-mhdp8501-core.h | 410 ++++++++ .../gpu/drm/bridge/cadence/cdns-mhdp8501-dp.c | 780 ++++++++++++++ .../drm/bridge/cadence/cdns-mhdp8501-hdmi.c | 674 ++++++++++++ .../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 | 714 +++++++++++++ drivers/phy/freescale/phy-fsl-imx8mq-hdmi.c | 955 ++++++++++++++++++ include/drm/bridge/cdns-mhdp-mailbox.h | 240 +++++ include/linux/phy/phy-hdmi.h | 24 + include/linux/phy/phy.h | 7 +- 17 files changed, 4310 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-core.c create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-core.h 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/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