From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4428F1F8F19 for ; Wed, 22 Jan 2025 10:38:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737542332; cv=none; b=OCXA0O3VOeC3Wp/Ybz6cqRPWwKsnpH2C9T388R7f/CVBLFsFVJhygjI9ml4JNfLd0+7yxE3UwZmMbmP4McmiaYxHkiqGz02qR9MuUscwRl3eGTZI+Pu0DnI1aJSvDS0ZI4OsramsDHuJsUO0P3IejM706QLoQrQP1Luq9EJwkUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737542332; c=relaxed/simple; bh=2t8HACXgNdpkCFzOmCwLprVtUhEk0/fR+04oTuG4bWM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=KWIrPPHLczFIXGwFHVBuGJNeL8BY/Cxd3kv78ZZOlCaRbb0btNG5nzazbEzTuvaJoHZnX+i3H+mkITbTF1BpnS4Sdt4F1+HKrRQzjiXMFAbeUN4ZdvcAr+kAKctaox15Q/+akeRb6R6nEJyTKoAL5zIFXCsScqRX4JeQIvwKQVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=EVf6W+nN; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="EVf6W+nN" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-43624b2d453so73463525e9.2 for ; Wed, 22 Jan 2025 02:38:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1737542328; x=1738147128; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wIz5Dg4pJALggVCJV3aAQrkAcnenmZfu2TddhDFfjFE=; b=EVf6W+nNpxlBJYy5s2M/jllAjwQzO2YDckGdGtk2C+nxen7jb4hXoLw0+E1fDSK1Se 2aYYog3EnP3rAzntG9hJa2jNb3LJ5YGPi/y8mOFam8QRqdLY1qh0rIvAV6ZwY6uhA63x 8nGIQ5dVYtJGvuaiAs9qoA2I1twuVNdg88J9bKGbb3Z2D6aQTV7REldwEgHIEx//E6yD tdW4PCUAuKyIzrK2nSjA9DUUxm0IidjfTqb/syh2qYxAkPqk3NQNNSWa8l7e4WwPXNQE 2mKIWLhRpNnByifFuqT2hGnV6YStQrj+lyN5CiSrJGxb8BP+TVmLX5idTu+fXNY3jzzW Er8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737542328; x=1738147128; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wIz5Dg4pJALggVCJV3aAQrkAcnenmZfu2TddhDFfjFE=; b=XIWAa6t1LXlVs5miUO4x0UsoXKOlrExomFtx6Hs3qLihbwOh+JLz7MME4RujZmeXfu wie1Nvhg81pMD5CPpWXvI93z2dhTBL4TTOUnG1q8vITZRkJy35kAi/Rc6+WiqAFG43e/ B9dyiX7E/+km8Hx3nDlTy7kfmscVE/lQLyhyRLpqQPQALbmbe5Xt2AKEyn2uGQYOE1TJ +bQYXILv7SCXzcUzDUEfaGE8lkR7d62+VEQtHwARRmkVKhIglifg9qUhnHacpGeT59cl NwrpTLFgECmhRiP7GX6tHiTrQ1XPFfNGour5U7cXMjCn0to28zCdILABjfXaUc1nIYGk Q9qw== X-Forwarded-Encrypted: i=1; AJvYcCUzxLw9SITkrsEXA39ZA4KVltg6i5ABR43iqKvwnsuaCXCWr/SdzMvyNHbpkM6fAKIiyhsZkgTU+6jn17s=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7rx4vzEOeW8MSuy5z7PxZpfigMOXwFfm2O85l47GlNnwwjLkb dKb737pXX53mYpSsao2nvMu8Q1oqw9mI5of2YMjsm/VdOSflv5mtr/5vJZlZajU= X-Gm-Gg: ASbGnctGJzlQyGk18dkJLlHwLMaCkZMeMtGxs3cl9UQeZrFSuc+8N5naDJcOBuvFNYi /QgX9M/tmxK5VoBChMrepEZ9Y03N6H8LiE4ku+Xt2NwUmW2GYBgKfEp42C833YekruKzbttoK91 4KelzCwVt7v5KPrtOOlCPkuQ/km47OEU8yS+6S0ACyk6m+aK0wlAehtiZI2EYchY6ZkTQM+HNLY br46IBnjikem4DWyCuI5tD/i72N6yigsXKe36fLbxjbk3OycH16wBE41Fx+yyq6HfSpkg== X-Google-Smtp-Source: AGHT+IGHWICVymyczl4ii8tG0TEJPCRASpGt6Bh6um0Z96LWBrB4SGwG4XeA1Yko2Ghrm1yauaArzQ== X-Received: by 2002:a05:600c:35c3:b0:434:f131:1e71 with SMTP id 5b1f17b1804b1-438913cf2e0mr197285195e9.8.1737542328421; Wed, 22 Jan 2025 02:38:48 -0800 (PST) Received: from localhost ([2a01:e0a:3c5:5fb1:c6fe:2fe2:acd6:8e99]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438b31b1566sm19283775e9.24.2025.01.22.02.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 02:38:47 -0800 (PST) From: Jerome Brunet To: Ao Xu Cc: Martin Blumenstingl , Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , 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 Subject: Re: [PATCH 00/11] Subject: [PATCH 00/11] Add DRM support for Amlogic S4 In-Reply-To: <3aa88bdb-ce84-4029-b497-2502ab1eb7a5@amlogic.com> (Ao Xu's message of "Wed, 22 Jan 2025 17:50:25 +0800") References: <20250110-drm-s4-v1-0-cbc2d5edaae8@amlogic.com> <1jwmex5lpc.fsf@starbuckisacylon.baylibre.com> <3aa88bdb-ce84-4029-b497-2502ab1eb7a5@amlogic.com> User-Agent: mu4e 1.12.8; emacs 29.4 Date: Wed, 22 Jan 2025 11:38:47 +0100 Message-ID: <1jldv3i154.fsf@starbuckisacylon.baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed 22 Jan 2025 at 17:50, Ao Xu wrote: > On 2025/1/15 1:50, Jerome Brunet wrote: >> [ EXTERNAL EMAIL ] >> >> On Sun 12 Jan 2025 at 23:44, Martin Blumenstingl wrote: >> >>> Hello, >>> >>> On Fri, Jan 10, 2025 at 6:39=E2=80=AFAM Ao Xu via B4 Relay >>> wrote: >>>> This patch series adds DRM support for the Amlogic S4-series SoCs. >>>> Compared to the Amlogic G12-series, the S4-series introduces the follo= wing changes: >>> Thanks for your patches. With this mail I'll try to summarize my >>> understanding of the situation with the drm/meson driver as I'm not >>> sure how familiar you are with previous discussions. >>> >>>> 1 The S4-series splits the HIU into three separate components: `sys_ct= rl`, `pwr_ctrl`, and `clk_ctrl`. >>>> As a result, VENC and VCLK drivers are updated with S4-specific com= patible strings to accommodate these changes. >>> Jerome has already commented on patch 3/11 that this mixes in too many >>> IP blocks into one driver. >>> This is not a new situation, the existing code is doing exactly the sam= e. >>> >>> Jerome has previously sent a series which started "an effort to remove >>> the use HHI syscon" [0] from the drm/meson hdmi driver. >>> In the same mail he further notes: "[the patchset] stops short of >>> making any controversial DT changes. To decouple the HDMI >>> phy driver and main DRM driver, allowing the PHY to get hold of its >>> registers, I believe a DT ABI break is inevitable. Ideally the >>> register region of the PHY within the HHI should provided, not the >>> whole HHI. That's pain for another day ..." >>> >>> For now I'm assuming you're familiar with device-tree ABI. >>> If not then please let us know so we can elaborate further on this. >>> >>> My own notes for meson_dw_hdmi.c are: >>> - we should not program HHI_HDMI_CLK_CNTL directly but go through CCF >>> (common clock framework) instead (we should already have the driver >>> for this in place) >>> - we should not program HHI_MEM_PD_REG0 directly but go through the >>> genpd/pmdomain framework (we should already have the driver for this >>> in place) >>> - for the HDMI PHY registers: on Meson8/8b/8m2 (those were 32-bit SoCs >>> in case you're not familiar with them, they predate GXBB/GXL/...) I >>> wrote a PHY driver (which is already upstream: >>> drivers/phy/amlogic/phy-meson8-hdmi-tx.c) as that made most sense to >>> me >>> >>> Then there's meson_venc.c which has two writes to HHI_GCLK_MPEG2. >>> I think those should go through CCF instead of directly accessing this = register. >>> >>> Also there's the VDAC registers in meson_encoder_cvbs.c: >>> I think Neil suggested at one point to make it a PHY driver. I even >>> started working on this (if you're curious: see [0] and [1]). >>> DT ABI backwards compatibility is also a concern here. >>> >>> And finally there's the video clock tree programming in meson_vclk.c. >>> My understanding here is that video PLL settings are very sensitive >>> and require fine-tuning according to the desired output clock. >>> Since it's a bunch of clocks I'd say that direct programming of the >>> clock registers should be avoided and we need to go through CCF as >>> well. >>> But to me those register values are all magic (as I am not aware of >>> any documentation that's available to me which describes how to >>> determine the correct PLL register values - otherside the standard >>> en/m/n/frac/lock and reset bits). >>> >>> I'm not saying that all of my thoughts are correct and immediately >>> need to be put into code. >>> Think of them more as an explanation to Jerome's reaction. >>> >>> I think what we need next is a discussion on how to move forward with >>> device-tree ABI for new SoCs. >>> Neil, Jerome: I'd like to hear your feedback on this. >> I completely agree with your description of the problem, that and >> Krzysztof's remark on patch 6. This is not new with this series indeed, >> so it does not introduce new problems really but it compounds the >> existing ones. >> >> Addressing those issues, if we want to, will get more difficult as more >> support is added for sure. > > Hi=EF=BC=8Cjerome > > =C2=A0=C2=A0=C2=A0 What are the next steps for "an effort to remove the u= se HHI syscon" > patch set, and what is the schedule? I have no idea. You should check with Neil whether or not it is something he wants to do and how. If you (or anyone else) want to make a v2 out of the first clean-up I've made [2], you are welcome to. I'm handling other things ATM and I don't expect to get to it any time soon. [2]: https://lore.kernel.org/linux-amlogic/20240730125023.710237-1-jbrunet@= baylibre.com/ > >>>> 2 The S4-series secures access to HDMITX DWC and TOP registers, >>>> requiring modifications to the driver to handle this new access met= hod. >> Regmap buses are made for those cases where the registers are the same, >> but accessed differently. There is an example in the patchset referenced= by >> Martin, to handle GXL and G12 diff. >> >>> This info should go into patch 1/11 to explain why the g12a compatible >>> string cannot be used as fallback. >>> >>> >>> Best regards, >>> Martin >>> >>> >>> [0] https://github.com/xdarklight/linux/commit/36e698edc25dc698a0d57b72= 9a7a4587fafc0987 >>> [1] >>> https://github.com/xdarklight/linux/commit/824b792fdbd2d3c0b71b21e1105e= ca0aaad8daa6 >> -- >> Jerome --=20 Jerome