From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,RDNS_NONE,SIGNED_OFF_BY,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from outils.crapouillou.net ([89.234.176.41]:35792 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729103AbgCKNUV (ORCPT ); Wed, 11 Mar 2020 09:20:21 -0400 Date: Wed, 11 Mar 2020 14:20:09 +0100 From: Paul Cercueil Subject: Re: [RFC v2 6/8] MIPS: DTS: jz4780: account for Synopsys HDMI driver and LCD controller To: "H. Nikolaus Schaller" Cc: Paul Boddie , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Ralf Baechle , Paul Burton , Linus Walleij , Andi Kleen , Krzysztof Kozlowski , Geert Uytterhoeven , "Eric W. Biederman" , Miquel Raynal , "open list:DRM PANEL DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , linux-mips@vger.kernel.org, "open list:GPIO SUBSYSTEM" , Discussions about the Letux Kernel , MIPS Creator CI20 Development Message-Id: <1583932809.3.0@crapouillou.net> In-Reply-To: References: <04b485165f38744816a0446e95150cafdeb716ee.1582913973.git.hns@goldelico.com> <1583177253.3.5@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org List-ID: Message-ID: <20200311132009.U1qsbSkhH79hf5LO0loqRS_UR6ZOuFwNgNjMoEBQbmU@z> Hi Nikolaus, Le mer., mars 11, 2020 at 13:43, H. Nikolaus Schaller=20 a =E9crit : > Hi Paul, >=20 >> Am 02.03.2020 um 20:27 schrieb Paul Cercueil : >>=20 >> Hi Nikolaus, >>=20 >>=20 >> Le ven., f=E9vr. 28, 2020 at 19:19, H. Nikolaus Schaller=20 >> a =E9crit : >>> From: Paul Boddie >>> A specialisation of the generic Synopsys HDMI driver is employed=20 >>> for JZ4780 >>> HDMI support. This requires a new driver, plus device tree and=20 >>> configuration >>> modifications. >>> Signed-off-by: Paul Boddie >>> Signed-off-by: H. Nikolaus Schaller >>> --- >>> arch/mips/boot/dts/ingenic/jz4780.dtsi | 32=20 >>> ++++++++++++++++++++++++++ >>> 1 file changed, 32 insertions(+) >>> diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi=20 >>> b/arch/mips/boot/dts/ingenic/jz4780.dtsi >>> index f928329b034b..391d4e1efd35 100644 >>> --- a/arch/mips/boot/dts/ingenic/jz4780.dtsi >>> +++ b/arch/mips/boot/dts/ingenic/jz4780.dtsi >>> @@ -433,4 +433,36 @@ >>> status =3D "disabled"; >>> }; >>> + >>> + hdmi: hdmi@10180000 { >>> + compatible =3D "ingenic,jz4780-dw-hdmi"; >>> + reg =3D <0x10180000 0x8000>; >>> + reg-io-width =3D <4>; >>> + >>> + clocks =3D <&cgu JZ4780_CLK_HDMI>, <&cgu JZ4780_CLK_AHB0>; >>> + clock-names =3D "isfr" , "iahb"; >>> + >>> + assigned-clocks =3D <&cgu JZ4780_CLK_HDMI>; >>> + assigned-clock-rates =3D <27000000>; >>=20 >> I *think* this should go to the board file. >>=20 >>> + >>> + interrupt-parent =3D <&intc>; >>> + interrupts =3D <3>; >>> + >>> + /* ddc-i2c-bus =3D <&i2c4>; */ >>> + >>> + status =3D "disabled"; >>> + }; >>> + >>> + lcd: lcd@13050000 { >>=20 >> The node name should be 'lcd-controller'. >>=20 >>> + compatible =3D "ingenic,jz4740-lcd"; >>=20 >> The JZ4780's LCD controller is much newer than the JZ4740 one, so=20 >> even if it works with the "ingenic,jz4740-lcd" compatible string,=20 >> you want it as a fallback. >> So this should be: compatible =3D "ingenic,jz4780-lcd",=20 >> "ingenic,jz4740-lcd". >>=20 >> That means the YAML should be updated too. >=20 > I have started to look into jz4780 HDMI setup again. >=20 > Well, there is no driver compatible to "ingenic,jz4780-lcd" so far > and it is questionalbe if we need a different one. >=20 > I think we should rather make the driver also compatible > than adding a fallback to ingenic,jz4740-lcdto the DTS. >=20 > The reason why this is better even if both LCDC are almost > compatible is that the jz4780 allows for much bigger displays > and therefore should have its own jz_soc_info with 4k x 2k > as maximum. Sure, feel free to extend the driver. > Next I tried to find out if the LCDC are really compatible. >=20 > Well the jz4780 has two lcdc instances but they are separated > by the reg addr. Next, there are unique features (like picture in > picture with alpha blending) but those are probably disabled > if not programmed from reset state. This may become a reason > to separate or augment the driver for the jz4780 but at the > moment we can ignore that. Two LCDC instances -> two lcd-controller@... nodes. It's that simple. The other features you listed are outside the LCDC, so outside the=20 scope of this driver. > There are also subtly different bit definitions and register > widths (e.g. 24 bit in addition to 16/18 bit modes or more bits > for the sync position) but it looks as if the ingenic_drm > driver already handles this. >=20 > Then I tried to read back the registers. Strangely they > are all 0x00000000. So there is no programming of the > lcd-controller in our DT setup with HDMI at all! How did you read them? Do it from the regmap: should be "cat=20 /sys/kernel/debug/regmap/13050000.lcd-controller/registers" (not sure=20 about the path) > I also checked that ingenic_drm_probe() is called and > returns successfully 0. It also reports that a /dev/fb > has been created: >=20 > [ 7.908830] ingenic-drm 13050000.lcd-controller: fb0:=20 > ingenic-drmdrmf frame buffer device >=20 > But for example ingenic_drm_encoder_atomic_mode_set() is > never called which should write some registers of the LCDC. >=20 > I only did see some calls to ingenic_drm_encoder_atomic_check(). >=20 > This of course explains why we have no HDMI signals despite > proper HPD and a /dev/fb0. Because the LCDC is not being > programmed. It won't be called until the HDMI driver says that the cable is=20 plugged, and there's a client application (e.g. fbdev emulation)=20 running. So the problem is most likely within the HDMI driver. Cheers, -Paul > Any ideas / hints how to check or improve? >=20 > BR and thanks, > Nikolaus >=20 =