From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 DBF603F484D for ; Mon, 24 Aug 2026 09:32:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787563954; cv=none; b=j1rboULnWaPeUPoyoLcA/0QV7sO8L1GFjnoqEqv7cckGswImH7z9+rcXlhhbXxfbuWh7HzJMMAU1x69G93Q6zRC++ZnBlGDRdnqiR5ZmnkdZMGFEZMv++eSlPAAoN7+3HSjwiyEtOG/s/bokOiF6PkfdoI7LQnMVTrCVX3FgW84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787563954; c=relaxed/simple; bh=hJWivipbzrq/Yp85Ioax6DLsoXVKNqX9wEPdMO5xGIU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UUnTEHV/PwisH8QKhcv/STnAczmSn98P7wJVTiKSRItOg2bq97DuT0ZtktZL+a1tLIoR+yu8/qRwMTMYc8hOLw4qpoJADbdZdiJSZNRhGay1LXXLjgDFadTpM+N0f92Dm67nV+yRJn7lGFHShhTWmNwRgNPfrvZriSCLurVXdbI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-499a4d1d7f1so17285035e9.3 for ; Mon, 24 Aug 2026 02:32:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787563951; x=1788168751; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gJloPN89elVAin5U0ydRdECi+cW4StvyY0mXdouFdaQ=; b=RjjnwcEw0lrzbgS1xpXudX4y8CyuuJCN50AiSV2ik6zYZ42s7lE0w1ouBAf8pcGdKT TNSbXztZ+Lz5P19AcKHCdKMW9NtU1Hh+bR32fstlMv8O3WaLwa9uQeAOMzpdypZB3SGB UYeU/PShXuS9mP9XVdAVue9qyRyOW0q5Xi545kCqkXVtwRvv/aDRUWL9MicRWRBI3ONs 4bOCJbrdfMc+Ls+6TjjnS8VTKU/XcFsKRh6/RuGlAoyoMiqDQFCzQ2ZFL2J9g3yVAcug yWhUpUFViDlsxDY2ooew4i2Fie/YmzoRdD8N9ARKcp22KwdE2/O3m7RkCgMnSS7DO5WE +gDQ== X-Forwarded-Encrypted: i=1; AHgh+RqPBEICT3sZ5lnHN5qKHuEAIixXLek2mKPuIpVyZW4wYdi1NFX/oVukmMpMDbG/Gez1K6HNIajEWWI1Fso=@vger.kernel.org X-Gm-Message-State: AFuF++l6fWwiIuYqbJQiMdf0KZifQhxdwAfVfAPr04uV4NISJz6ElYW6 h3eqs3Ukgn/SzRIq/L5Gtw6gFPU4kMUV9wNzlcM9/Y+8m0Xm64/HrriwYUwJ7w== X-Gm-Gg: AR+sD11hH+PLvb1AsFAeolZa9g3UEbM34tSEq1EJabeVF5QYjWQudT1igqxOXT3ERHp 4GapjfXYD2M0OLXaYNHYr7im5MDvNe5GJuM8wFgnWgzpQ4EYiGjwMBDMSkQ1pjx8/VJU5M24xpt b1ymMUWcn2gIoi4yMdu6Oa/1bSFHlOF4+3wik8u2OvkjotbSPijoJcLWP2aeYEq+I2cX2ZLpmWw sRUOSSsF3FaY0sdwXAhWr1yR4E3b5MzKHowcrDSQoOcZh385RnWYl11l7MgB+Qbt8hQW6CvH0gp mRa6uIYF7iHozsQhX62VVbmdqSwyMvvucYsEN0V8iDDJRevpu4rIZ4WITc+SxZK/SKyf6jJ4NyG E8+xdFd/cJVl38Muu/gdDoTlLyD7tGWezVSTRde8rjIIRLTxLyp0w0ZjO0eJwgN7s/0TIWc6HmH Gi7FYIx6gis7b3kWrjKcsYhe9vveFCbBMvzDsYl/YSml+k94F8HnIV/s146ubv/K4zFoWT0efox ce+7UgnAdUHaNdsEpeXNA== X-Received: by 2002:a05:600c:1387:b0:499:7a4f:d13d with SMTP id 5b1f17b1804b1-499b8313ad3mr240196255e9.4.1787563950900; Mon, 24 Aug 2026 02:32:30 -0700 (PDT) Received: from [192.168.1.135] ([83.106.158.114]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499b914bfcbsm117572285e9.9.2026.08.24.02.32.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Aug 2026 02:32:30 -0700 (PDT) Message-ID: <7c7f447d-8796-4f6e-b607-5251d9129665@linux.com> Date: Mon, 24 Aug 2026 10:32:29 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk To: Ronald Claveau , Xianwei Zhao Cc: linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Kevin Hilman , Rob Herring , Krzysztof Kozlowski , Conor Dooley References: <20260818191159.11523-1-tanure@linux.com> <20260818191159.11523-2-tanure@linux.com> <6673edea-6822-4368-9374-29f92195fcf5@aliel.fr> <0969d872-faff-4b0f-81ad-972b7aa9bb7f@linux.com> <78721fe3-d9d0-4f85-a1ec-a01ebbf4f9a3@aliel.fr> Content-Language: en-US From: Lucas Tanure In-Reply-To: <78721fe3-d9d0-4f85-a1ec-a01ebbf4f9a3@aliel.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 24/08/2026 10:15, Ronald Claveau wrote: > On 8/23/26 1:39 PM, Lucas Tanure wrote: >> On 19/08/2026 08:25, Ronald Claveau wrote: >>> On 8/19/26 4:39 AM, Xianwei Zhao wrote: >>>> Hi Lucas, >>>> >>>> On 2026/8/19 03:11, Lucas Tanure wrote: >>>>> uart_a lists the 24MHz crystal for all three of its clocks, because >>>>> the T7 clock controller driver did not exist when these boards were >>>>> added. >>>>> >>>>> That leaves the real UART bus clock without a user, so the kernel >>>>> turns it off when it disables unused clocks at the end of boot, and >>>>> the board hangs. >>>>> >>>>> Point uart_a at the real clocks, the way meson-s4.dtsi does, and drop >>>>> the placeholders from the two board files. >>>>> >>>>> Fixes: 4fef056588f5 ("arm64: dts: amlogic-t7-a311d2-khadas-vim4: add >>>>> initial device-tree") >>>>> Fixes: 6f048cc7a635 ("arm64: dts: add board AN400") >>>>> Signed-off-by: Lucas Tanure >>>>> Assisted-by: Claude:claude-fable-5 >>>>> --- >>>>>    arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-an400.dts       | 2 -- >>>>>    arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 2 -- >>>>>    arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi                   | 4 >>>>> ++++ >>>>>    3 files changed, 4 insertions(+), 4 deletions(-) >>>>> >>>>> diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-an400.dts >>>>> b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-an400.dts >>>>> index cab2ee9ea0d3..dcbcd08a78b9 100644 >>>>> --- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-an400.dts >>>>> +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-an400.dts >>>>> @@ -33,7 +33,5 @@ xtal: xtal-clk { >>>>>    }; >>>>> >>>>>    &uart_a { >>>>> -       clocks = <&xtal>, <&xtal>, >>>>> <&xtal>; >>>>> -       clock-names = "xtal", "pclk", "baud"; >>>>>           status = "okay"; >>>>>    }; >>>>> diff --git >>>>> a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts >>>>> b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts >>>>> index c41525a34b72..677069e58f30 100644 >>>>> --- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts >>>>> +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts >>>>> @@ -266,6 +266,4 @@ &sd_emmc_c { >>>>> >>>>>    &uart_a { >>>>>           status = "okay"; >>>>> -       clocks = <&xtal>, <&xtal>, >>>>> <&xtal>; >>>>> -       clock-names = "xtal", "pclk", "baud"; >>>>>    }; >>>>> diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi >>>>> b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi >>>>> index cc371fcd1896..7847582e77ed 100644 >>>>> --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi >>>>> +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi >>>>> @@ -587,6 +587,10 @@ uart_a: serial@78000 { >>>>>                                   compatible = "amlogic,t7-uart", >>>>> "amlogic,meson-s4-uart"; >>>>>                                   reg = <0x0 0x78000 0x0 0x18>; >>>>>                                   interrupts = >>>> IRQ_TYPE_EDGE_RISING>; >>>>> +                               clocks = <&xtal>, >>>>> +                                        <&clkc_periphs >>>>> CLKID_SYS_UART_A>, >>>>> +                                        <&xtal>; >>>>> +                               clock-names = "xtal", "pclk", "baud"; >>>>>                                   status = "disabled"; >>>>>                           }; >>>> >>>> I agree with moving the UART clock configuration to the DTSI file. >>>> However, it seems a little odd to keep the XTAL clock definition in the >>>> DTS, as the alias may not be consistent across different boards, which >>>> could result in compilation errors. Could we move the XTAL clock >>>> definition to the DTSI as well, similar to other Amlogic SoCs? >>> >>> It seems similar to changes in this series : >>> >>> https://lore.kernel.org/all/20260420-add-bluetooth-t7-vim4- >>> v4-0-9505df0e7016@aliel.fr/ >>> >>> What do you think ? >>> >> Thanks for pointing out that series, though I wasn't aware of it. >> And after reading I don't agree with it. The clocks are not redundant, >> they are there because we agreed sometime ago that xtal belongs to the >> board files. >> So I still vote for my change in v2, that I will send in a few minutes. > > I don't get why it would be better to define the exact same clocks in > each DTS file. > > The xtal recommended characteristics provided at the SOC level can be > defined in the DTSI and overridden, if really necessary, in the DTS. > Hi Ronald, The preference for keeping xtal in board-specific .dts files rather than the SoC .dtsi comes down to DT hardware modeling principles and upstream maintainer guidelines: Hardware Topology: The xtal is physically located on the board PCB, not inside the SoC silicon. The .dtsi file models the SoC silicon internal architecture (clock controllers, IPs, registers), whereas .dts files describe the physical board layout surrounding it. Avoiding Implicit Assumptions: Defining a default 24MHz xtal in .dtsi assumes every T7 board will use the same oscillator configuration. If a custom board design uses a different crystal frequency or an external clock generator/TCXO, overriding a .dtsi-level node can lead to messy DT overrides or silent clock rate mismatches if forgotten. Upstream DT Maintainer Policy: Kernel DT maintainers consistently push to keep board-level hardware explicitly declared in the board .dts files to reflect actual physical board components. That said, I acknowledge the trade-off is minor boilerplate duplication across board DTS files. If the Amlogic SoC maintainers prefer setting a default 24MHz xtal in amlogic-t7.dtsi to match older SoC generations, I am open to updating it—provided the maintainers explicitly prefer that tradeoff over strict DT topology modeling. Best regards, Lucas