From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 841FF606A332 for ; Sat, 5 Dec 2026 15:14:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Qf/WSexR; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=mieulab.com header.i=@mieulab.com header.a=rsa-sha256 header.s=key1 header.b=5qcIckXR 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:References:In-Reply-To: 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: List-Unsubscribe-Post:List-Owner; bh=3Pd3IvSJndNnfOGixXlUMtjHgNF4M9pDZAggx1XeY4c=; b=Qf/WSexReouDmh5r3WXrSr5ynQ KusRzHM1qv49iiGkq7607j7Kzy8w4RiYB7qgDRki71aQG9bH117eZb0roL2ncQGvL/9QaqO/9UtRy 1mNG4Erm9DdF+BVBKJ3gJucgFutUIxskaY4TuWwFzquisvu7GTtmvcaxBHryMBDtdWc7haqDDUOBV 4jfCuFi1m4KKxZTT4fSrzaiIUFy9yXZApQ4K0ttE9H7hbrIOSP6kcXJ/Q6aWjBZVaSbJ9GqNtLRMF WVqqnMgwx9l7nLu+CxnR1DNcXei5e08ASuZHxrfoWhCcW32y27PP3i7/EGS4X+rHYWN0PKSx1amMs TGvC+BKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZrSu-00000002a12-0fB0; Sat, 05 Dec 2026 15:14:20 +0000 Received: from out-74.mta0.migadu.com ([2001:41d0:1004:224b::4a] helo=mta0.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZrSr-00000002Zxd-3Ez4 for linux-amlogic@lists.infradead.org; Sat, 05 Dec 2026 15:14:19 +0000 X-Envelope-To: linux-amlogic@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=N0DGySnYNDnEOmBEo76/eV5OdgTSo3ycUz4bLXVSMz0=; c=simple/simple; d=mieulab.com; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796483655; v=1; x=1797088455; b=5qcIckXRLbdyIct2R3N5Bucm8MomZhE3v2sF0GRfvtEhqLaM42NSGuFcAW6IB9ZDMnxh6V7j pu5UGRk9YvXh0sj90BQEpZ+CoALdIX8Qw2eEuv1GO2SWE68EkuRCFyIdsQn7YiYc5FwbJ6lsKNa T/nXKv2XZPGU5vCT/Jl8+Y7rZMaN8CaEjabWDKdYMR21+JnH7SG+zGZJMz8oQajWcvMW2cNV4wZ ycvcDxWT7O4BSfz9Hp/x5rCx69e2tCaZtlJWJn2WBHc6hNjgp63qnueABY10ITUZUGXcV306Vdg 3JUKvK290gYouBjG13htqMVbnEfpKgEdfXBECR6glPGHg== X-Envelope-To: linux-amlogic@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id d8a004c7f01438f5; Sat, 05 Dec 2026 15:14:15 +0000 X-Mizu-Trace-ID: d8a004c7f01438f5 X-Migadu-Flow: FLOW_OUT From: Zinan Zhou To: Neil Armstrong Cc: Zinan Zhou , Ronald Claveau , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Vinod Koul , Manivannan Sadhasivam , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org Subject: [RFC PATCH v2 3/3] drm/meson: support direct HDMI register access on GXLX2 Date: Sun, 6 Dec 2026 00:13:17 +0900 Message-ID: <20261205151317.4017910-4-zinan@mieulab.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261205151317.4017910-1-zinan@mieulab.com> References: <20261205151317.4017910-1-zinan@mieulab.com> X-Archived-By: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261205_071417_963040_D2550998 X-CRM114-Status: GOOD ( 13.59 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The indirect GX accessors return an invalid DesignWare controller ID on GXLX2 and prevent HDMI component binding. Select the direct G12A TOP and controller accessors for GXLX2 and skip the indirect APB3 control writes on controllers with that register layout. Select the GXLX2 legacy PHY data for device trees that omit the PHY phandle. Assisted-by: Codex:gpt-5.6-sol Assisted-by: Codex:gpt-6 Signed-off-by: Zinan Zhou --- drivers/gpu/drm/meson/meson_drv.c | 1 + drivers/gpu/drm/meson/meson_dw_hdmi.c | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 5343323f404a19e063f96b25f01980483b235482..06693856d45401b2ed234564db6e9833865805d4 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -477,6 +477,7 @@ static void meson_drv_shutdown(struct platform_device *pdev) static const struct of_device_id components_dev_match[] = { { .compatible = "amlogic,meson-gxbb-dw-hdmi" }, { .compatible = "amlogic,meson-gxl-dw-hdmi" }, + { .compatible = "amlogic,meson-gxlx2-dw-hdmi" }, { .compatible = "amlogic,meson-gxm-dw-hdmi" }, { .compatible = "amlogic,meson-g12a-dw-hdmi" }, {} diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index b54c85c21882e22698033b24a40c47f2718e17b5..0f43c1e2813d77dae5bc3c0a4d3c3328fc98bb95 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -126,6 +126,7 @@ struct meson_dw_hdmi_data { unsigned int addr); void (*dwc_write)(struct meson_dw_hdmi *dw_hdmi, unsigned int addr, unsigned int data); + bool uses_direct_regs; enum meson_hdmi_phy_soc phy_soc; /* legacy PHY only */ }; @@ -507,12 +508,21 @@ static const struct meson_dw_hdmi_data meson_dw_hdmi_g12a_data = { .top_write = dw_hdmi_g12a_top_write, .dwc_read = dw_hdmi_g12a_dwc_read, .dwc_write = dw_hdmi_g12a_dwc_write, + .uses_direct_regs = true, .phy_soc = MESON_HDMI_PHY_G12A, }; +static const struct meson_dw_hdmi_data meson_dw_hdmi_gxlx2_data = { + .top_read = dw_hdmi_g12a_top_read, + .top_write = dw_hdmi_g12a_top_write, + .dwc_read = dw_hdmi_g12a_dwc_read, + .dwc_write = dw_hdmi_g12a_dwc_write, + .uses_direct_regs = true, + .phy_soc = MESON_HDMI_PHY_GXLX2, +}; + static int meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi) { - struct meson_drm *priv = meson_dw_hdmi->priv; int ret; /* Reset HDMITX APB & TX & PHY */ @@ -520,8 +530,8 @@ static int meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi) reset_control_reset(meson_dw_hdmi->hdmitx_ctrl); reset_control_reset(meson_dw_hdmi->hdmitx_phy); - /* Enable APB3 fail on error */ - if (!meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) { + /* The APB3 control registers exist only on the indirect interface. */ + if (!meson_dw_hdmi->data->uses_direct_regs) { writel_bits_relaxed(BIT(15), BIT(15), meson_dw_hdmi->hdmitx + HDMITX_TOP_CTRL_REG); writel_bits_relaxed(BIT(15), BIT(15), @@ -699,6 +709,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, dw_plat_data->output_port = 1; if (dw_hdmi_is_compatible(meson_dw_hdmi, "amlogic,meson-gxl-dw-hdmi") || + dw_hdmi_is_compatible(meson_dw_hdmi, "amlogic,meson-gxlx2-dw-hdmi") || dw_hdmi_is_compatible(meson_dw_hdmi, "amlogic,meson-gxm-dw-hdmi") || dw_hdmi_is_compatible(meson_dw_hdmi, "amlogic,meson-g12a-dw-hdmi")) dw_plat_data->use_drm_infoframe = true; @@ -823,6 +834,8 @@ static const struct of_device_id meson_dw_hdmi_of_table[] = { .data = &meson_dw_hdmi_gxbb_data }, { .compatible = "amlogic,meson-gxl-dw-hdmi", .data = &meson_dw_hdmi_gxl_data }, + { .compatible = "amlogic,meson-gxlx2-dw-hdmi", + .data = &meson_dw_hdmi_gxlx2_data }, { .compatible = "amlogic,meson-gxm-dw-hdmi", .data = &meson_dw_hdmi_gxl_data }, { .compatible = "amlogic,meson-g12a-dw-hdmi", _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic