* [PATCH 0/2] arm64: dts: amlogic: t7: fix UART clock and SD card recovery
@ 2026-08-18 19:11 Lucas Tanure
2026-08-18 19:11 ` [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk Lucas Tanure
2026-08-18 19:11 ` [PATCH 2/2] arm64: dts: amlogic: t7: khadas-vim4: allow the SD card to be power cycled Lucas Tanure
0 siblings, 2 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-08-18 19:11 UTC (permalink / raw)
To: Neil Armstrong, Kevin Hilman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-kernel, Xianwei Zhao, linux-amlogic, devicetree,
linux-kernel
Two fixes found while booting mainline on a Khadas VIM4.
The first one wires uart_a to the real UART bus clock. It was pointed at
the 24MHz crystal as a placeholder, because the T7 clock controller
driver did not exist when these boards were added. That leaves the real
clock without a user, so the kernel turns it off when it disables unused
clocks at the end of boot, and the board hangs with the console gone.
The second one drops regulator-always-on from the SD card supply. A card
that refuses the 1.8V UHS switch can only be recovered by removing its
power, which that property prevents, so the card never initialises and
the MMC core retries forever.
Both were tested on a Khadas VIM4 booting v7.2 from the SD card.
Lucas Tanure (2):
arm64: dts: amlogic: t7: use the real UART pclk
arm64: dts: amlogic: t7: khadas-vim4: allow the SD card to be power
cycled
arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-an400.dts | 2 --
arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 3 ---
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 4 ++++
3 files changed, 4 insertions(+), 5 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk
2026-08-18 19:11 [PATCH 0/2] arm64: dts: amlogic: t7: fix UART clock and SD card recovery Lucas Tanure
@ 2026-08-18 19:11 ` Lucas Tanure
2026-08-19 2:39 ` Xianwei Zhao
2026-08-18 19:11 ` [PATCH 2/2] arm64: dts: amlogic: t7: khadas-vim4: allow the SD card to be power cycled Lucas Tanure
1 sibling, 1 reply; 9+ messages in thread
From: Lucas Tanure @ 2026-08-18 19:11 UTC (permalink / raw)
To: Neil Armstrong, Kevin Hilman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-kernel, Xianwei Zhao, linux-amlogic, devicetree,
linux-kernel
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 <tanure@linux.com>
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 = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&xtal>,
+ <&clkc_periphs CLKID_SYS_UART_A>,
+ <&xtal>;
+ clock-names = "xtal", "pclk", "baud";
status = "disabled";
};
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] arm64: dts: amlogic: t7: khadas-vim4: allow the SD card to be power cycled
2026-08-18 19:11 [PATCH 0/2] arm64: dts: amlogic: t7: fix UART clock and SD card recovery Lucas Tanure
2026-08-18 19:11 ` [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk Lucas Tanure
@ 2026-08-18 19:11 ` Lucas Tanure
1 sibling, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-08-18 19:11 UTC (permalink / raw)
To: Neil Armstrong, Kevin Hilman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-kernel, Xianwei Zhao, linux-amlogic, devicetree,
linux-kernel
SD cards start at 3.3V and switch to 1.8V to reach UHS-I speeds. Some
cards refuse that switch, and the SD specification says the only way
to recover is to power the card off and start again.
SD_3V3 is marked regulator-always-on, so the supply never goes off,
the card stays stuck half way through the switch, and the MMC core
retries forever:
mmc1: error -95 whilst initialising SD card
Drop regulator-always-on. regulator-boot-on still turns the supply on
at boot, and a card that refuses the switch now falls back to high
speed instead of failing to initialise.
Fixes: 8c45bf9ae4ef ("arm64: dts: amlogic: t7: khadas-vim4: Add power regulators")
Signed-off-by: Lucas Tanure <tanure@linux.com>
Assisted-by: Claude:claude-fable-5
---
arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 1 -
1 file changed, 1 deletion(-)
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 677069e58f30..3f53630e107f 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
@@ -71,7 +71,6 @@ sd_3v3: regulator-sdcard-3v3 {
vin-supply = <&vddao_3v3>;
gpio = <&gpio GPIOD_11 GPIO_ACTIVE_LOW>;
regulator-boot-on;
- regulator-always-on;
};
sdio_pwrseq: sdio-pwrseq {
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk
2026-08-18 19:11 ` [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk Lucas Tanure
@ 2026-08-19 2:39 ` Xianwei Zhao
2026-08-19 7:25 ` Ronald Claveau
2026-08-23 11:29 ` Lucas Tanure
0 siblings, 2 replies; 9+ messages in thread
From: Xianwei Zhao @ 2026-08-19 2:39 UTC (permalink / raw)
To: Lucas Tanure, Neil Armstrong, Kevin Hilman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-kernel, linux-amlogic, devicetree, linux-kernel
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<tanure@linux.com>
> 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 = <GIC_SPI 168
> 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?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk
2026-08-19 2:39 ` Xianwei Zhao
@ 2026-08-19 7:25 ` Ronald Claveau
2026-08-23 11:39 ` Lucas Tanure
2026-08-23 11:29 ` Lucas Tanure
1 sibling, 1 reply; 9+ messages in thread
From: Ronald Claveau @ 2026-08-19 7:25 UTC (permalink / raw)
To: Xianwei Zhao, Lucas Tanure
Cc: linux-arm-kernel, linux-amlogic, devicetree, linux-kernel,
Neil Armstrong, Kevin Hilman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
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<tanure@linux.com>
>> 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 = <GIC_SPI 168
>> 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 ?
--
Best regards,
Ronald
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk
2026-08-19 2:39 ` Xianwei Zhao
2026-08-19 7:25 ` Ronald Claveau
@ 2026-08-23 11:29 ` Lucas Tanure
1 sibling, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-08-23 11:29 UTC (permalink / raw)
To: Xianwei Zhao, Neil Armstrong, Kevin Hilman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-kernel, linux-amlogic, devicetree, linux-kernel
On 19/08/2026 03:39, 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<tanure@linux.com>
>> 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 = <GIC_SPI 168
>> 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?
I think keeping it in the board files is actually better here, as the
crystal (xtal) physically belongs to the board rather than the SoC. To
keep things clean without moving xtal into amlogic-t7.dtsi, I've updated
v2 to modify only the board DTS files.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk
2026-08-19 7:25 ` Ronald Claveau
@ 2026-08-23 11:39 ` Lucas Tanure
2026-08-24 9:15 ` Ronald Claveau
0 siblings, 1 reply; 9+ messages in thread
From: Lucas Tanure @ 2026-08-23 11:39 UTC (permalink / raw)
To: Ronald Claveau, Xianwei Zhao
Cc: linux-arm-kernel, linux-amlogic, devicetree, linux-kernel,
Neil Armstrong, Kevin Hilman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
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<tanure@linux.com>
>>> 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 = <GIC_SPI 168
>>> 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk
2026-08-23 11:39 ` Lucas Tanure
@ 2026-08-24 9:15 ` Ronald Claveau
2026-08-24 9:32 ` Lucas Tanure
0 siblings, 1 reply; 9+ messages in thread
From: Ronald Claveau @ 2026-08-24 9:15 UTC (permalink / raw)
To: Lucas Tanure, Xianwei Zhao
Cc: linux-arm-kernel, linux-amlogic, devicetree, linux-kernel,
Neil Armstrong, Kevin Hilman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
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<tanure@linux.com>
>>>> 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 = <GIC_SPI 168
>>>> 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.
--
Best regards,
Ronald
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk
2026-08-24 9:15 ` Ronald Claveau
@ 2026-08-24 9:32 ` Lucas Tanure
0 siblings, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-08-24 9:32 UTC (permalink / raw)
To: Ronald Claveau, Xianwei Zhao
Cc: linux-arm-kernel, linux-amlogic, devicetree, linux-kernel,
Neil Armstrong, Kevin Hilman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
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<tanure@linux.com>
>>>>> 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 = <GIC_SPI 168
>>>>> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-08-24 9:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 19:11 [PATCH 0/2] arm64: dts: amlogic: t7: fix UART clock and SD card recovery Lucas Tanure
2026-08-18 19:11 ` [PATCH 1/2] arm64: dts: amlogic: t7: use the real UART pclk Lucas Tanure
2026-08-19 2:39 ` Xianwei Zhao
2026-08-19 7:25 ` Ronald Claveau
2026-08-23 11:39 ` Lucas Tanure
2026-08-24 9:15 ` Ronald Claveau
2026-08-24 9:32 ` Lucas Tanure
2026-08-23 11:29 ` Lucas Tanure
2026-08-18 19:11 ` [PATCH 2/2] arm64: dts: amlogic: t7: khadas-vim4: allow the SD card to be power cycled Lucas Tanure
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox