Message ID | 20230605223323.578198-2-aford173@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3000611vqr; Mon, 5 Jun 2023 15:57:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6uyQ8VFmcO06CYntW6c2frMGWzmJ3d+GJYlnd7I2URbY8p9Nv6AvZHZDPSM2SJkpOr98TQ X-Received: by 2002:a17:90a:1951:b0:255:8a12:241b with SMTP id 17-20020a17090a195100b002558a12241bmr76353pjh.22.1686005850521; Mon, 05 Jun 2023 15:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686005850; cv=none; d=google.com; s=arc-20160816; b=TpqMaa/fdMziiwJdapvj6vhHtUgAfKRgWvJCNw7bjDxQ3csFnrFGn2TE1dCk5F0lEE T9B8iz4RM8qCyejdReK8Zv1KEpF9Tvs2UGwiq54tVJTjRHhl3do2ToSwDQIODyDMQhtf Mhs7SulkvNp6Dj7W8Z+FpndfsX2B6DjPdSUjB/toQIKrLEi4Xo20eXY/Zh3+ZR8qvP7f HtKv34lc3IZQeGAomff7NXxQrfgjjEUOGFQv7FlE++NMI0v7WUkJCyi8fIIn2SnaEC2L H9DaNW2M8X/qXGHIPmZaNMb8i7eQNk/GMGRDO5EwBfeEFYy+FQ6vibZysOkV/fYypaG6 4sHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9qrkcUSJMXH0Vt6X0WzrKau5dB9wxr1OuFrtEpxM138=; b=ONcOkIOCuhy/GIWC6M6O1CPGanQw3tfLOa4JEVu1CwCJysfFi9zPJ83Qf6Q5DtiyYX 6j29wlwsV8JuCH7vFVY1Dq3ZaQz0VHSHDAX6Wl98ZnngE7zFpmdyTQZPwDRjaNV2M55B Lj21Roj/YwkUIoKoRmIGxazvElMz0cjJQvzNnowWWkjS37YSIEF9S3S92uCWrazVIhM1 2vgbgGDcIPY7NZHkEapQCo4RhlXaFRGny4NZJnh1U0obhONoN47QlBBlkaTutXizb1wq QZUi6IhLstigLEoZup2qshesCSJ2LppVrGjfPeKHisRL90PLLqQZpLOEGHxF6ee/cHBq PaWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=foBOUhVP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a72-20020a63904b000000b00543ec36863asi328352pge.898.2023.06.05.15.57.18; Mon, 05 Jun 2023 15:57:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=foBOUhVP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231495AbjFEWdo (ORCPT <rfc822;xxoosimple@gmail.com> + 99 others); Mon, 5 Jun 2023 18:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230269AbjFEWdl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 5 Jun 2023 18:33:41 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8978C100; Mon, 5 Jun 2023 15:33:38 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-777ac791935so66076839f.2; Mon, 05 Jun 2023 15:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686004418; x=1688596418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9qrkcUSJMXH0Vt6X0WzrKau5dB9wxr1OuFrtEpxM138=; b=foBOUhVPyFSo4R2VJVY+bzWa0TWVFyZXWaT1nHlIivK/JyLo7Xx/YT8yh+n2lQJmau lOBBG+GlqHiQtjT2gAdnHFHpzIymm0Ewa96zQeGib9SBe4xRUNeRYKvtqsYDHHsfR+f/ dZW3ETpwuoFc0og+Q3kTh31Z0SmYvjnzyAxDHinihLr1uIRs5wKD/TAgYJkBXL7qXZSW kPX96FWdnKqawXcSs0y9ghCzzEme4Ts7LF6jSzpSPpsZUgKfbEbWJ6WZla39v+nTcORC n3MG8HjBwLX6qisvrohCI2UWU7kZ/wERDchQD/JV7Q0Lo/tuF8ulCDqier/Mh+hWnoKo qDXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686004418; x=1688596418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9qrkcUSJMXH0Vt6X0WzrKau5dB9wxr1OuFrtEpxM138=; b=ad8USeD4usHznneNMOV0Bf6dAu5Qxsb3yiQhhxoy0vuAjN7oZW7iHHwVmKo9MfHCnp UteVcxrWLqa3GuhLZEsZGk2Rip1Ppg05TRzFIkVDGRmcNyIQWj3FpstKs+H2nIx3NwvH 7FGov0EXIM8DKwS9TfexVR9aLbP6CX8ByNtSaK8lLpfrusQ3NJz6s52qGBLNooKMBOkH 1vfX06qAq/NaZmk/XLNrMRvP9A0TXh7Buo7bZOlVpp/ehArIwQbNAgzZSzPipGU8wl7Y Jv4ve0X72TF6qI6+hlsqpK2b3s2gPMr5ArD8viqDg195RolOS9GiL4WzWGF2QZi8iESV VaJA== X-Gm-Message-State: AC+VfDyecu3V8awK5zpyJSWV68Xy5o9iKkFxPQ+O8MoOOUdSnY34dXxM C/eHdQT9AeeHdEnskiysJDtFxO7Ys48= X-Received: by 2002:a05:6602:54:b0:762:f8d4:6f9 with SMTP id z20-20020a056602005400b00762f8d406f9mr565989ioz.2.1686004417754; Mon, 05 Jun 2023 15:33:37 -0700 (PDT) Received: from aford-B741.lan ([2601:447:d001:897f:f45b:1201:1374:ebd2]) by smtp.gmail.com with ESMTPSA id j13-20020a02a68d000000b004035b26b6d8sm2477068jam.2.2023.06.05.15.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 15:33:37 -0700 (PDT) From: Adam Ford <aford173@gmail.com> To: linux-arm-kernel@lists.infradead.org Cc: aford@beaconembedded.com, Adam Ford <aford173@gmail.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 1/2] arm64: dts: imx8mn-beacon: Add HDMI video with sound Date: Mon, 5 Jun 2023 17:33:22 -0500 Message-Id: <20230605223323.578198-2-aford173@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230605223323.578198-1-aford173@gmail.com> References: <20230605223323.578198-1-aford173@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767905270732839423?= X-GMAIL-MSGID: =?utf-8?q?1767905270732839423?= |
Series |
arm64: dts: imx8mn/imx8mm-beacon: Add HDMI
|
|
Commit Message
Adam Ford
June 5, 2023, 10:33 p.m. UTC
The Beacon Embedded imx8mn development kit has a DSI
to HDMI bridge chip. The bridge supports stereo audio
and hot-plug detection.
Signed-off-by: Adam Ford <aford173@gmail.com>
Comments
Hi Adam, On 06.06.23 00:33, Adam Ford wrote: > The Beacon Embedded imx8mn development kit has a DSI > to HDMI bridge chip. The bridge supports stereo audio > and hot-plug detection. > > Signed-off-by: Adam Ford <aford173@gmail.com> > > diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > index 1392ce02587b..2108ec8c019c 100644 > --- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > +++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts I have to minor comments below, otherwise this looks good to me. As I'm trying to come up with similar changes for our boards I also have some questions below. Maybe you could share your knowledge on these. Thanks! Frieder > @@ -16,4 +16,138 @@ / { > chosen { > stdout-path = &uart2; > }; > + > + connector { > + compatible = "hdmi-connector"; > + type = "a"; > + > + port { > + hdmi_connector_in: endpoint { > + remote-endpoint = <&adv7535_out>; > + }; > + }; > + }; > + > + reg_hdmi: regulator-hdmi-dvdd { > + compatible = "regulator-fixed"; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_reg_hdmi>; > + regulator-name = "hdmi_pwr_en"; > + regulator-min-microvolt = <3300000>; > + regulator-max-microvolt = <3300000>; > + gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>; > + enable-active-high; > + startup-delay-us = <70000>; > + regulator-always-on; > + }; > + > + sound-hdmi { > + compatible = "simple-audio-card"; > + simple-audio-card,name = "sound-hdmi"; > + simple-audio-card,format = "i2s"; > + > + simple-audio-card,cpu { > + sound-dai = <&sai5 0>; > + system-clock-direction-out; > + }; > + > + simple-audio-card,codec { > + sound-dai = <&adv_bridge>; > + }; > + }; > +}; > + > +&i2c2 { > + adv_bridge: hdmi@3d { > + compatible = "adi,adv7535"; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_hdmi_bridge>; > + reg = <0x3d>, <0x3b>; > + reg-names = "main", "cec"; > + adi,dsi-lanes = <4>; On our boards we have this working with 4 lanes. But we also have some boards that only have 2 DSI lanes connected. We don't get any image in on the display in this case. Did you ever try 2 lanes or do you have an idea what could be wrong? > + adi,fixed-lanes; I think this property comes from downstream and should be removed. I don't see it anywhere in the upstream driver or bindings. > + dvdd-supply = <®_hdmi>; > + v3p3-supply = <®_hdmi>; > + v1p2-supply = <®_hdmi>; > + a2vdd-supply = <®_hdmi>; > + avdd-supply = <®_hdmi>; > + pvdd-supply = <®_hdmi>; Please sort the reg properties above alphabetically. > + interrupt-parent = <&gpio1>; > + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; > + #sound-dai-cells = <0>; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + > + port@0 { > + reg = <0>; > + > + adv7535_in: endpoint { > + remote-endpoint = <&dsi_out>; > + }; > + }; > + > + port@1 { > + reg = <1>; > + > + adv7535_out: endpoint { > + remote-endpoint = <&hdmi_connector_in>; > + }; > + }; > + }; > + }; > +}; > + > +&lcdif { > + assigned-clocks = <&clk IMX8MN_VIDEO_PLL1>; > + assigned-clock-rates = <594000000>; Just out of interest: Why do you need to set the video PLL clock here and how did you determine the "correct" value? Why is this missing in the i.MX8MM dts? > + status = "okay"; > +}; > + > +&mipi_dsi { > + samsung,esc-clock-frequency = <20000000>; Same here, I'm interested in how you determined the "correct" value for this property. Are there any rules to follow? > + status = "okay"; > + > + ports { > + port@1 { > + reg = <1>; > + > + dsi_out: endpoint { > + remote-endpoint = <&adv7535_in>; > + }; > + }; > + }; > +}; > + > +&sai5 { > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_sai5>; > + assigned-clocks = <&clk IMX8MN_CLK_SAI5>; > + assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>; > + assigned-clock-rates = <24576000>; > + #sound-dai-cells = <0>; > + status = "okay"; > +}; > + > +&iomuxc { > + pinctrl_hdmi_bridge: hdmibridgegrp { > + fsl,pins = < > + MX8MN_IOMUXC_GPIO1_IO09_GPIO1_IO9 0x19 > + >; > + }; > + > + pinctrl_reg_hdmi: reghdmigrp { > + fsl,pins = < > + MX8MN_IOMUXC_SD1_STROBE_GPIO2_IO11 0x16 > + >; > + }; > + > + pinctrl_sai5: sai5grp { > + fsl,pins = < > + MX8MN_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6 > + MX8MN_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6 > + MX8MN_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6 > + >; > + }; > };
On Tue, Jun 6, 2023 at 2:13 AM Frieder Schrempf <frieder.schrempf@kontron.de> wrote: > > Hi Adam, > > On 06.06.23 00:33, Adam Ford wrote: > > The Beacon Embedded imx8mn development kit has a DSI > > to HDMI bridge chip. The bridge supports stereo audio > > and hot-plug detection. > > > > Signed-off-by: Adam Ford <aford173@gmail.com> > > > > diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > index 1392ce02587b..2108ec8c019c 100644 > > --- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > +++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > I have to minor comments below, otherwise this looks good to me. > > As I'm trying to come up with similar changes for our boards I also have > some questions below. Maybe you could share your knowledge on these. > > Thanks! > Frieder > > > @@ -16,4 +16,138 @@ / { > > chosen { > > stdout-path = &uart2; > > }; > > + > > + connector { > > + compatible = "hdmi-connector"; > > + type = "a"; > > + > > + port { > > + hdmi_connector_in: endpoint { > > + remote-endpoint = <&adv7535_out>; > > + }; > > + }; > > + }; > > + > > + reg_hdmi: regulator-hdmi-dvdd { > > + compatible = "regulator-fixed"; > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pinctrl_reg_hdmi>; > > + regulator-name = "hdmi_pwr_en"; > > + regulator-min-microvolt = <3300000>; > > + regulator-max-microvolt = <3300000>; > > + gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>; > > + enable-active-high; > > + startup-delay-us = <70000>; > > + regulator-always-on; > > + }; > > + > > + sound-hdmi { > > + compatible = "simple-audio-card"; > > + simple-audio-card,name = "sound-hdmi"; > > + simple-audio-card,format = "i2s"; > > + > > + simple-audio-card,cpu { > > + sound-dai = <&sai5 0>; > > + system-clock-direction-out; > > + }; > > + > > + simple-audio-card,codec { > > + sound-dai = <&adv_bridge>; > > + }; > > + }; > > +}; > > + > > +&i2c2 { > > + adv_bridge: hdmi@3d { > > + compatible = "adi,adv7535"; > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pinctrl_hdmi_bridge>; > > + reg = <0x3d>, <0x3b>; > > + reg-names = "main", "cec"; > > + adi,dsi-lanes = <4>; > > On our boards we have this working with 4 lanes. But we also have some > boards that only have 2 DSI lanes connected. We don't get any image in > on the display in this case. Did you ever try 2 lanes or do you have an > idea what could be wrong? I didn't try 2-lane, but see below regarding clocks to see if any of that makes any sense. > > > + adi,fixed-lanes; > > I think this property comes from downstream and should be removed. I > don't see it anywhere in the upstream driver or bindings. You're right. This came from some early debugging I was doing for a patch I was going to propose when someone beat me to it. I'll submit a V3 with this removed. > > > + dvdd-supply = <®_hdmi>; > > + v3p3-supply = <®_hdmi>; > > + v1p2-supply = <®_hdmi>; > > + a2vdd-supply = <®_hdmi>; > > + avdd-supply = <®_hdmi>; > > + pvdd-supply = <®_hdmi>; > > Please sort the reg properties above alphabetically. OK. > > > + interrupt-parent = <&gpio1>; > > + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; > > + #sound-dai-cells = <0>; > > + > > + ports { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + port@0 { > > + reg = <0>; > > + > > + adv7535_in: endpoint { > > + remote-endpoint = <&dsi_out>; > > + }; > > + }; > > + > > + port@1 { > > + reg = <1>; > > + > > + adv7535_out: endpoint { > > + remote-endpoint = <&hdmi_connector_in>; > > + }; > > + }; > > + }; > > + }; > > +}; > > + > > +&lcdif { > > + assigned-clocks = <&clk IMX8MN_VIDEO_PLL1>; > > + assigned-clock-rates = <594000000>; > > Just out of interest: Why do you need to set the video PLL clock here > and how did you determine the "correct" value? Why is this missing in > the i.MX8MM dts? I am glad you asked this question. In an ideal world we would not need to set this, because the display clock would propagate up to the video_pll, but that's currently not happening yet, so one needs to find a video-pll clock rate that nicely divides into the maximum number of resoltions as possible. When you run modetest on a display, you'll get a list of resolutions with their refresh rate and horizontal and vertical timings as well as the pixel clock. The mxsfb needs its clock to match the pixel clock in order for the displays to sync properly. With 594000000 set for the video-pll, the disp-clock divdes down to achieve what it can to hit the required pixel clock. Here is an example with some of the extra timing info removed. The final column is the 594MHz / pix-clk name refresh pix clk Divide by 594000000 1920x1080 60 148500 4000 1920x1080 59.94 148352 4003.990509 1920x1080 50 148500 4000 1920x1080 30 74250 8000 1920x1080 29.97 74176 8007.981018 1920x1080 24 74250 8000 1920x1080 23.98 74176 8007.981018 1600x900 60 108000 5500 1280x1024 60.02 108000 5500 1280x800 59.91 71000 8366.197183 1152x864 59.97 81579 7281.285625 1280x720 60 74250 8000 1280x720 59.94 74176 8007.981018 1024x768 60 65000 9138.461538 800x600 60.32 40000 14850 720x576 50 27000 22000 720x480 60 27027 21978.02198 720x480 59.94 27000 22000 640x480 60 25200 23571.42857 640x480 59.94 25175 23594.83615 As you can see, there are a number of resolutions which divide evenly, but there are a bunch that do not. If you wanted to achieve resolutions that do not divide evenly by 594MHz, you'd need to change the video-pll clock to something else in order for this clock to evenly divide but then it would break other resolutions.. I have tested this, and I can get some of these additional resolutions to work with a different video-pll clock rate. NXP's downstream kernel masks this by blocking out clock rates that didn't divide evenly. The Mini has a different clock parent-child relationship, and the clock appears to default to 594MHz already, but the Nano has a default of 650MHz which is why I had to add the clock there. I didn't want to put it into the imx8mn.dtsi file, because this may not be appropriate for some people or people with a fixed display running at specific resltion and/or pixel rate. I proposed a solution which would fix both Mini and Nano by allowing the requested display clock to propagate back up to the video-pll. On the Mini and Nano, a patch I proposed can help achieve more accurate lcdif clocks. For example, when trying to get a pixel clock of 31.500MHz on an imx8m Nano, the clocks divided the 594MHz down, but left the parent rate untouched which caused a calculation error. Before: video_pll 594000000 video_pll_bypass 594000000 video_pll_out 594000000 disp_pixel 31263158 disp_pixel_clk 31263158 Variance = -236842 Hz After this patch: video_pll 31500000 video_pll_bypass 31500000 video_pll_out 31500000 disp_pixel 31500000 disp_pixel_clk 31500000 Variance = 0 Hz If you want to check out the patch I proposed, look at [1]. I'd love to get some tracking and/or feedback for this. This would allow the Mini and Nano to sync more resolutions and allow people to not have to specify the video-pll rate. imx8mp is little more complicated, because there are two different pixel clocks generated from the same video-pll (the DSI and the LDB/LVDS) > > > + status = "okay"; > > +}; > > + > > +&mipi_dsi { > > + samsung,esc-clock-frequency = <20000000>; > > Same here, I'm interested in how you determined the "correct" value for > this property. Are there any rules to follow? 20MHz was the max clock rate supported by the DSI controller. It also appears to be the clock speed set in the NXP downstream kernel, so I used it. I wish I had a better explanation. adam [1] - https://lore.kernel.org/linux-arm-kernel/20230506195325.876871-1-aford173@gmail.com/ > > > + status = "okay"; > > + > > + ports { > > + port@1 { > > + reg = <1>; > > + > > + dsi_out: endpoint { > > + remote-endpoint = <&adv7535_in>; > > + }; > > + }; > > + }; > > +}; > > + > > +&sai5 { > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pinctrl_sai5>; > > + assigned-clocks = <&clk IMX8MN_CLK_SAI5>; > > + assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>; > > + assigned-clock-rates = <24576000>; > > + #sound-dai-cells = <0>; > > + status = "okay"; > > +}; > > + > > +&iomuxc { > > + pinctrl_hdmi_bridge: hdmibridgegrp { > > + fsl,pins = < > > + MX8MN_IOMUXC_GPIO1_IO09_GPIO1_IO9 0x19 > > + >; > > + }; > > + > > + pinctrl_reg_hdmi: reghdmigrp { > > + fsl,pins = < > > + MX8MN_IOMUXC_SD1_STROBE_GPIO2_IO11 0x16 > > + >; > > + }; > > + > > + pinctrl_sai5: sai5grp { > > + fsl,pins = < > > + MX8MN_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6 > > + MX8MN_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6 > > + MX8MN_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6 > > + >; > > + }; > > };
On Tue, Jun 6, 2023 at 7:57 AM Adam Ford <aford173@gmail.com> wrote: > > On Tue, Jun 6, 2023 at 2:13 AM Frieder Schrempf > <frieder.schrempf@kontron.de> wrote: > > > > Hi Adam, > > > > On 06.06.23 00:33, Adam Ford wrote: > > > The Beacon Embedded imx8mn development kit has a DSI > > > to HDMI bridge chip. The bridge supports stereo audio > > > and hot-plug detection. > > > > > > Signed-off-by: Adam Ford <aford173@gmail.com> > > > > > > diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > > index 1392ce02587b..2108ec8c019c 100644 > > > --- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > > +++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > > > I have to minor comments below, otherwise this looks good to me. > > > > As I'm trying to come up with similar changes for our boards I also have > > some questions below. Maybe you could share your knowledge on these. > > > > Thanks! > > Frieder > > > > > @@ -16,4 +16,138 @@ / { > > > chosen { > > > stdout-path = &uart2; > > > }; > > > + > > > + connector { > > > + compatible = "hdmi-connector"; > > > + type = "a"; > > > + > > > + port { > > > + hdmi_connector_in: endpoint { > > > + remote-endpoint = <&adv7535_out>; > > > + }; > > > + }; > > > + }; > > > + > > > + reg_hdmi: regulator-hdmi-dvdd { > > > + compatible = "regulator-fixed"; > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&pinctrl_reg_hdmi>; > > > + regulator-name = "hdmi_pwr_en"; > > > + regulator-min-microvolt = <3300000>; > > > + regulator-max-microvolt = <3300000>; > > > + gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>; > > > + enable-active-high; > > > + startup-delay-us = <70000>; > > > + regulator-always-on; > > > + }; > > > + > > > + sound-hdmi { > > > + compatible = "simple-audio-card"; > > > + simple-audio-card,name = "sound-hdmi"; > > > + simple-audio-card,format = "i2s"; > > > + > > > + simple-audio-card,cpu { > > > + sound-dai = <&sai5 0>; > > > + system-clock-direction-out; > > > + }; > > > + > > > + simple-audio-card,codec { > > > + sound-dai = <&adv_bridge>; > > > + }; > > > + }; > > > +}; > > > + > > > +&i2c2 { > > > + adv_bridge: hdmi@3d { > > > + compatible = "adi,adv7535"; > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&pinctrl_hdmi_bridge>; > > > + reg = <0x3d>, <0x3b>; > > > + reg-names = "main", "cec"; > > > + adi,dsi-lanes = <4>; > > > > On our boards we have this working with 4 lanes. But we also have some > > boards that only have 2 DSI lanes connected. We don't get any image in > > on the display in this case. Did you ever try 2 lanes or do you have an > > idea what could be wrong? > > I didn't try 2-lane, but see below regarding clocks to see if any of > that makes any sense. I tried configuring my hardware for 2-lane operation, and it appears to not function, but I haven't been able to determine why. Have you made any progress on getting your 2-lane interface operational? 2-lane clocks probably require a pixel clock 2x the speed of the 4-lane modes. I'm really tight on time right now, but I can try to put some time in to investigating the 2-lane operation. adam > > > > > > + adi,fixed-lanes; > > > > I think this property comes from downstream and should be removed. I > > don't see it anywhere in the upstream driver or bindings. > > You're right. This came from some early debugging I was doing for a > patch I was going to propose when someone beat me to it. I'll submit > a V3 with this removed. > > > > > + dvdd-supply = <®_hdmi>; > > > + v3p3-supply = <®_hdmi>; > > > + v1p2-supply = <®_hdmi>; > > > + a2vdd-supply = <®_hdmi>; > > > + avdd-supply = <®_hdmi>; > > > + pvdd-supply = <®_hdmi>; > > > > Please sort the reg properties above alphabetically. > > OK. > > > > > > + interrupt-parent = <&gpio1>; > > > + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; > > > + #sound-dai-cells = <0>; > > > + > > > + ports { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + port@0 { > > > + reg = <0>; > > > + > > > + adv7535_in: endpoint { > > > + remote-endpoint = <&dsi_out>; > > > + }; > > > + }; > > > + > > > + port@1 { > > > + reg = <1>; > > > + > > > + adv7535_out: endpoint { > > > + remote-endpoint = <&hdmi_connector_in>; > > > + }; > > > + }; > > > + }; > > > + }; > > > +}; > > > + > > > +&lcdif { > > > + assigned-clocks = <&clk IMX8MN_VIDEO_PLL1>; > > > + assigned-clock-rates = <594000000>; > > > > Just out of interest: Why do you need to set the video PLL clock here > > and how did you determine the "correct" value? Why is this missing in > > the i.MX8MM dts? > > I am glad you asked this question. In an ideal world we would not > need to set this, because the display clock would propagate up to the > video_pll, but that's currently not happening yet, so one needs to > find a video-pll clock rate that nicely divides into the maximum > number of resoltions as possible. > > When you run modetest on a display, you'll get a list of resolutions > with their refresh rate and horizontal and vertical timings as well as > the pixel clock. The mxsfb needs its clock to match the pixel clock > in order for the displays to sync properly. With 594000000 set for > the video-pll, the disp-clock divdes down to achieve what it can to > hit the required pixel clock. > > Here is an example with some of the extra timing info removed. The > final column is the 594MHz / pix-clk > name refresh pix clk Divide by 594000000 > 1920x1080 60 148500 4000 > 1920x1080 59.94 148352 4003.990509 > 1920x1080 50 148500 4000 > 1920x1080 30 74250 8000 > 1920x1080 29.97 74176 8007.981018 > 1920x1080 24 74250 8000 > 1920x1080 23.98 74176 8007.981018 > 1600x900 60 108000 5500 > 1280x1024 60.02 108000 5500 > 1280x800 59.91 71000 8366.197183 > 1152x864 59.97 81579 7281.285625 > 1280x720 60 74250 8000 > 1280x720 59.94 74176 8007.981018 > 1024x768 60 65000 9138.461538 > 800x600 60.32 40000 14850 > 720x576 50 27000 22000 > 720x480 60 27027 21978.02198 > 720x480 59.94 27000 22000 > 640x480 60 25200 23571.42857 > 640x480 59.94 25175 23594.83615 > > > As you can see, there are a number of resolutions which divide evenly, > but there are a bunch that do not. If you wanted to achieve > resolutions that do not divide evenly by 594MHz, you'd need to change > the video-pll clock to something else in order for this clock to > evenly divide but then it would break other resolutions.. I have > tested this, and I can get some of these additional resolutions to > work with a different video-pll clock rate. NXP's downstream kernel > masks this by blocking out clock rates that didn't divide evenly. > > The Mini has a different clock parent-child relationship, and the > clock appears to default to 594MHz already, but the Nano has a default > of 650MHz which is why I had to add the clock there. I didn't want to > put it into the imx8mn.dtsi file, because this may not be appropriate > for some people or people with a fixed display running at specific > resltion and/or pixel rate. > > I proposed a solution which would fix both Mini and Nano by allowing > the requested display clock to propagate back up to the video-pll. > > On the Mini and Nano, a patch I proposed can help achieve more accurate > lcdif clocks. For example, when trying to get a pixel clock of 31.500MHz > on an imx8m Nano, the clocks divided the 594MHz down, but > left the parent rate untouched which caused a calculation error. > > Before: > video_pll 594000000 > video_pll_bypass 594000000 > video_pll_out 594000000 > disp_pixel 31263158 > disp_pixel_clk 31263158 > > Variance = -236842 Hz > > After this patch: > video_pll 31500000 > video_pll_bypass 31500000 > video_pll_out 31500000 > disp_pixel 31500000 > disp_pixel_clk 31500000 > > Variance = 0 Hz > > If you want to check out the patch I proposed, look at [1]. I'd love > to get some tracking and/or feedback for this. This would allow the > Mini and Nano to sync more resolutions and allow people to not have to > specify the video-pll rate. > imx8mp is little more complicated, because there are two different > pixel clocks generated from the same video-pll (the DSI and the > LDB/LVDS) > > > > > > + status = "okay"; > > > +}; > > > + > > > +&mipi_dsi { > > > + samsung,esc-clock-frequency = <20000000>; > > > > Same here, I'm interested in how you determined the "correct" value for > > this property. Are there any rules to follow? > > 20MHz was the max clock rate supported by the DSI controller. It also > appears to be the clock speed set in the NXP downstream kernel, so I > used it. I wish I had a better explanation. > > adam > > [1] - https://lore.kernel.org/linux-arm-kernel/20230506195325.876871-1-aford173@gmail.com/ > > > > > > + status = "okay"; > > > + > > > + ports { > > > + port@1 { > > > + reg = <1>; > > > + > > > + dsi_out: endpoint { > > > + remote-endpoint = <&adv7535_in>; > > > + }; > > > + }; > > > + }; > > > +}; > > > + > > > +&sai5 { > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&pinctrl_sai5>; > > > + assigned-clocks = <&clk IMX8MN_CLK_SAI5>; > > > + assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>; > > > + assigned-clock-rates = <24576000>; > > > + #sound-dai-cells = <0>; > > > + status = "okay"; > > > +}; > > > + > > > +&iomuxc { > > > + pinctrl_hdmi_bridge: hdmibridgegrp { > > > + fsl,pins = < > > > + MX8MN_IOMUXC_GPIO1_IO09_GPIO1_IO9 0x19 > > > + >; > > > + }; > > > + > > > + pinctrl_reg_hdmi: reghdmigrp { > > > + fsl,pins = < > > > + MX8MN_IOMUXC_SD1_STROBE_GPIO2_IO11 0x16 > > > + >; > > > + }; > > > + > > > + pinctrl_sai5: sai5grp { > > > + fsl,pins = < > > > + MX8MN_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6 > > > + MX8MN_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6 > > > + MX8MN_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6 > > > + >; > > > + }; > > > };
On Sat, Jun 10, 2023 at 1:11 PM Adam Ford <aford173@gmail.com> wrote: > > On Tue, Jun 6, 2023 at 7:57 AM Adam Ford <aford173@gmail.com> wrote: > > > > On Tue, Jun 6, 2023 at 2:13 AM Frieder Schrempf > > <frieder.schrempf@kontron.de> wrote: > > > > > > Hi Adam, > > > > > > On 06.06.23 00:33, Adam Ford wrote: > > > > The Beacon Embedded imx8mn development kit has a DSI > > > > to HDMI bridge chip. The bridge supports stereo audio > > > > and hot-plug detection. > > > > > > > > Signed-off-by: Adam Ford <aford173@gmail.com> > > > > > > > > diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > > > index 1392ce02587b..2108ec8c019c 100644 > > > > --- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > > > +++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts > > > > > > I have to minor comments below, otherwise this looks good to me. > > > > > > As I'm trying to come up with similar changes for our boards I also have > > > some questions below. Maybe you could share your knowledge on these. > > > > > > Thanks! > > > Frieder > > > > > > > @@ -16,4 +16,138 @@ / { > > > > chosen { > > > > stdout-path = &uart2; > > > > }; > > > > + > > > > + connector { > > > > + compatible = "hdmi-connector"; > > > > + type = "a"; > > > > + > > > > + port { > > > > + hdmi_connector_in: endpoint { > > > > + remote-endpoint = <&adv7535_out>; > > > > + }; > > > > + }; > > > > + }; > > > > + > > > > + reg_hdmi: regulator-hdmi-dvdd { > > > > + compatible = "regulator-fixed"; > > > > + pinctrl-names = "default"; > > > > + pinctrl-0 = <&pinctrl_reg_hdmi>; > > > > + regulator-name = "hdmi_pwr_en"; > > > > + regulator-min-microvolt = <3300000>; > > > > + regulator-max-microvolt = <3300000>; > > > > + gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>; > > > > + enable-active-high; > > > > + startup-delay-us = <70000>; > > > > + regulator-always-on; > > > > + }; > > > > + > > > > + sound-hdmi { > > > > + compatible = "simple-audio-card"; > > > > + simple-audio-card,name = "sound-hdmi"; > > > > + simple-audio-card,format = "i2s"; > > > > + > > > > + simple-audio-card,cpu { > > > > + sound-dai = <&sai5 0>; > > > > + system-clock-direction-out; > > > > + }; > > > > + > > > > + simple-audio-card,codec { > > > > + sound-dai = <&adv_bridge>; > > > > + }; > > > > + }; > > > > +}; > > > > + > > > > +&i2c2 { > > > > + adv_bridge: hdmi@3d { > > > > + compatible = "adi,adv7535"; > > > > + pinctrl-names = "default"; > > > > + pinctrl-0 = <&pinctrl_hdmi_bridge>; > > > > + reg = <0x3d>, <0x3b>; > > > > + reg-names = "main", "cec"; > > > > + adi,dsi-lanes = <4>; > > > > > > On our boards we have this working with 4 lanes. But we also have some > > > boards that only have 2 DSI lanes connected. We don't get any image in > > > on the display in this case. Did you ever try 2 lanes or do you have an > > > idea what could be wrong? > > + Lucas, > > I didn't try 2-lane, but see below regarding clocks to see if any of > > that makes any sense. > Frieder, > I tried configuring my hardware for 2-lane operation, and it appears > to not function, but I haven't been able to determine why. Have you > made any progress on getting your 2-lane interface operational? I looked at the NXP down-stream code to compare the HBP, HFP, and HSA values [1] to what we're generating with this mainline code, but the formula to achieve these values doesn't make sense to me. The equations for the 4-lane calculation were pretty straight-forward. I tried to do a look-up table similar to the method that NXP did, but it was rejected in favor of a formula to calculate values. You might try to see if using hard-coded values for HFP, HBP and HSA work for your display which would at least narrow down where the problem might be. NXP's downstream code also has a work-around for calculating the PHY [2] which only appears to affect 720P@60 for some reason. If someone has an idea of how to calculate the 2-lane timings for HFP, HBP, and HSA, that would be useful. 720p@60 HFP HBP HSA 159 324 54 (calculated with current formula) 159 320 40 (downstream look-up table) adam [1] - https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/drivers/gpu/drm/bridge/sec-dsim.c#L369 [2] - https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/drivers/gpu/drm/bridge/sec-dsim.c#L1018 > > 2-lane clocks probably require a pixel clock 2x the speed of the > 4-lane modes. I'm really tight on time right now, but I can try to > put some time in to investigating the 2-lane operation. > > adam > > > > > > > > > + adi,fixed-lanes; > > > > > > I think this property comes from downstream and should be removed. I > > > don't see it anywhere in the upstream driver or bindings. > > > > You're right. This came from some early debugging I was doing for a > > patch I was going to propose when someone beat me to it. I'll submit > > a V3 with this removed. > > > > > > > + dvdd-supply = <®_hdmi>; > > > > + v3p3-supply = <®_hdmi>; > > > > + v1p2-supply = <®_hdmi>; > > > > + a2vdd-supply = <®_hdmi>; > > > > + avdd-supply = <®_hdmi>; > > > > + pvdd-supply = <®_hdmi>; > > > > > > Please sort the reg properties above alphabetically. > > > > OK. > > > > > > > > > + interrupt-parent = <&gpio1>; > > > > + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; > > > > + #sound-dai-cells = <0>; > > > > + > > > > + ports { > > > > + #address-cells = <1>; > > > > + #size-cells = <0>; > > > > + > > > > + port@0 { > > > > + reg = <0>; > > > > + > > > > + adv7535_in: endpoint { > > > > + remote-endpoint = <&dsi_out>; > > > > + }; > > > > + }; > > > > + > > > > + port@1 { > > > > + reg = <1>; > > > > + > > > > + adv7535_out: endpoint { > > > > + remote-endpoint = <&hdmi_connector_in>; > > > > + }; > > > > + }; > > > > + }; > > > > + }; > > > > +}; > > > > + > > > > +&lcdif { > > > > + assigned-clocks = <&clk IMX8MN_VIDEO_PLL1>; > > > > + assigned-clock-rates = <594000000>; > > > > > > Just out of interest: Why do you need to set the video PLL clock here > > > and how did you determine the "correct" value? Why is this missing in > > > the i.MX8MM dts? > > > > I am glad you asked this question. In an ideal world we would not > > need to set this, because the display clock would propagate up to the > > video_pll, but that's currently not happening yet, so one needs to > > find a video-pll clock rate that nicely divides into the maximum > > number of resoltions as possible. > > > > When you run modetest on a display, you'll get a list of resolutions > > with their refresh rate and horizontal and vertical timings as well as > > the pixel clock. The mxsfb needs its clock to match the pixel clock > > in order for the displays to sync properly. With 594000000 set for > > the video-pll, the disp-clock divdes down to achieve what it can to > > hit the required pixel clock. > > > > Here is an example with some of the extra timing info removed. The > > final column is the 594MHz / pix-clk > > name refresh pix clk Divide by 594000000 > > 1920x1080 60 148500 4000 > > 1920x1080 59.94 148352 4003.990509 > > 1920x1080 50 148500 4000 > > 1920x1080 30 74250 8000 > > 1920x1080 29.97 74176 8007.981018 > > 1920x1080 24 74250 8000 > > 1920x1080 23.98 74176 8007.981018 > > 1600x900 60 108000 5500 > > 1280x1024 60.02 108000 5500 > > 1280x800 59.91 71000 8366.197183 > > 1152x864 59.97 81579 7281.285625 > > 1280x720 60 74250 8000 > > 1280x720 59.94 74176 8007.981018 > > 1024x768 60 65000 9138.461538 > > 800x600 60.32 40000 14850 > > 720x576 50 27000 22000 > > 720x480 60 27027 21978.02198 > > 720x480 59.94 27000 22000 > > 640x480 60 25200 23571.42857 > > 640x480 59.94 25175 23594.83615 > > > > > > As you can see, there are a number of resolutions which divide evenly, > > but there are a bunch that do not. If you wanted to achieve > > resolutions that do not divide evenly by 594MHz, you'd need to change > > the video-pll clock to something else in order for this clock to > > evenly divide but then it would break other resolutions.. I have > > tested this, and I can get some of these additional resolutions to > > work with a different video-pll clock rate. NXP's downstream kernel > > masks this by blocking out clock rates that didn't divide evenly. > > > > The Mini has a different clock parent-child relationship, and the > > clock appears to default to 594MHz already, but the Nano has a default > > of 650MHz which is why I had to add the clock there. I didn't want to > > put it into the imx8mn.dtsi file, because this may not be appropriate > > for some people or people with a fixed display running at specific > > resltion and/or pixel rate. > > > > I proposed a solution which would fix both Mini and Nano by allowing > > the requested display clock to propagate back up to the video-pll. > > > > On the Mini and Nano, a patch I proposed can help achieve more accurate > > lcdif clocks. For example, when trying to get a pixel clock of 31.500MHz > > on an imx8m Nano, the clocks divided the 594MHz down, but > > left the parent rate untouched which caused a calculation error. > > > > Before: > > video_pll 594000000 > > video_pll_bypass 594000000 > > video_pll_out 594000000 > > disp_pixel 31263158 > > disp_pixel_clk 31263158 > > > > Variance = -236842 Hz > > > > After this patch: > > video_pll 31500000 > > video_pll_bypass 31500000 > > video_pll_out 31500000 > > disp_pixel 31500000 > > disp_pixel_clk 31500000 > > > > Variance = 0 Hz > > > > If you want to check out the patch I proposed, look at [1]. I'd love > > to get some tracking and/or feedback for this. This would allow the > > Mini and Nano to sync more resolutions and allow people to not have to > > specify the video-pll rate. > > imx8mp is little more complicated, because there are two different > > pixel clocks generated from the same video-pll (the DSI and the > > LDB/LVDS) > > > > > > > > > + status = "okay"; > > > > +}; > > > > + > > > > +&mipi_dsi { > > > > + samsung,esc-clock-frequency = <20000000>; > > > > > > Same here, I'm interested in how you determined the "correct" value for > > > this property. Are there any rules to follow? > > > > 20MHz was the max clock rate supported by the DSI controller. It also > > appears to be the clock speed set in the NXP downstream kernel, so I > > used it. I wish I had a better explanation. > > > > adam > > > > [1] - https://lore.kernel.org/linux-arm-kernel/20230506195325.876871-1-aford173@gmail.com/ > > > > > > > > > + status = "okay"; > > > > + > > > > + ports { > > > > + port@1 { > > > > + reg = <1>; > > > > + > > > > + dsi_out: endpoint { > > > > + remote-endpoint = <&adv7535_in>; > > > > + }; > > > > + }; > > > > + }; > > > > +}; > > > > + > > > > +&sai5 { > > > > + pinctrl-names = "default"; > > > > + pinctrl-0 = <&pinctrl_sai5>; > > > > + assigned-clocks = <&clk IMX8MN_CLK_SAI5>; > > > > + assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>; > > > > + assigned-clock-rates = <24576000>; > > > > + #sound-dai-cells = <0>; > > > > + status = "okay"; > > > > +}; > > > > + > > > > +&iomuxc { > > > > + pinctrl_hdmi_bridge: hdmibridgegrp { > > > > + fsl,pins = < > > > > + MX8MN_IOMUXC_GPIO1_IO09_GPIO1_IO9 0x19 > > > > + >; > > > > + }; > > > > + > > > > + pinctrl_reg_hdmi: reghdmigrp { > > > > + fsl,pins = < > > > > + MX8MN_IOMUXC_SD1_STROBE_GPIO2_IO11 0x16 > > > > + >; > > > > + }; > > > > + > > > > + pinctrl_sai5: sai5grp { > > > > + fsl,pins = < > > > > + MX8MN_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6 > > > > + MX8MN_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6 > > > > + MX8MN_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6 > > > > + >; > > > > + }; > > > > };
diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts index 1392ce02587b..2108ec8c019c 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts +++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-kit.dts @@ -16,4 +16,138 @@ / { chosen { stdout-path = &uart2; }; + + connector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&adv7535_out>; + }; + }; + }; + + reg_hdmi: regulator-hdmi-dvdd { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_reg_hdmi>; + regulator-name = "hdmi_pwr_en"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>; + enable-active-high; + startup-delay-us = <70000>; + regulator-always-on; + }; + + sound-hdmi { + compatible = "simple-audio-card"; + simple-audio-card,name = "sound-hdmi"; + simple-audio-card,format = "i2s"; + + simple-audio-card,cpu { + sound-dai = <&sai5 0>; + system-clock-direction-out; + }; + + simple-audio-card,codec { + sound-dai = <&adv_bridge>; + }; + }; +}; + +&i2c2 { + adv_bridge: hdmi@3d { + compatible = "adi,adv7535"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hdmi_bridge>; + reg = <0x3d>, <0x3b>; + reg-names = "main", "cec"; + adi,dsi-lanes = <4>; + adi,fixed-lanes; + dvdd-supply = <®_hdmi>; + v3p3-supply = <®_hdmi>; + v1p2-supply = <®_hdmi>; + a2vdd-supply = <®_hdmi>; + avdd-supply = <®_hdmi>; + pvdd-supply = <®_hdmi>; + interrupt-parent = <&gpio1>; + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + #sound-dai-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + adv7535_in: endpoint { + remote-endpoint = <&dsi_out>; + }; + }; + + port@1 { + reg = <1>; + + adv7535_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; +}; + +&lcdif { + assigned-clocks = <&clk IMX8MN_VIDEO_PLL1>; + assigned-clock-rates = <594000000>; + status = "okay"; +}; + +&mipi_dsi { + samsung,esc-clock-frequency = <20000000>; + status = "okay"; + + ports { + port@1 { + reg = <1>; + + dsi_out: endpoint { + remote-endpoint = <&adv7535_in>; + }; + }; + }; +}; + +&sai5 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai5>; + assigned-clocks = <&clk IMX8MN_CLK_SAI5>; + assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>; + assigned-clock-rates = <24576000>; + #sound-dai-cells = <0>; + status = "okay"; +}; + +&iomuxc { + pinctrl_hdmi_bridge: hdmibridgegrp { + fsl,pins = < + MX8MN_IOMUXC_GPIO1_IO09_GPIO1_IO9 0x19 + >; + }; + + pinctrl_reg_hdmi: reghdmigrp { + fsl,pins = < + MX8MN_IOMUXC_SD1_STROBE_GPIO2_IO11 0x16 + >; + }; + + pinctrl_sai5: sai5grp { + fsl,pins = < + MX8MN_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6 + MX8MN_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6 + MX8MN_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6 + >; + }; };