Hi !
I'm wondering about UART clocks:
- from imx7 Reference manual, UART needs two clocks, ipg_clock_root and uart_clock_root
- from linux dts for imx7, we see that both clocks are mapped to IMX7D_UART1_ROOT_CLK
- from linux dts for imx7, we see that "ipg" clock's parent is "ahb", but the clock tree in the reference manual doesn't show this dependency.
Can someone help me clarify the situation:
- do I have to configure IPG_CLK_ROOT to use the UART ?
- why does Linux has both UART's clock set to UART_CLK_ROOT ?
- does IPG_CLK_ROOT depends on AHB_CLK_ROOT (and why ?)
- can IPG_CLK_ROOT be disabled ?
Best,
V.
Solved! Go to Solution.
Hi Vincent,
- do I have to configure IPG_CLK_ROOT to use the UART ?
No, it is always enabled
- why does Linux has both UART's clock set to UART_CLK_ROOT ?
In 'Table 5-12. System Clocks and Gating' you can see that both, IPG_CLK_ROOT and UART1_CLK_ROOT are mapped to clk_enable_uart1 (CCGR148), so it is redundant, and this makes sense for IMX7D because the driver uses the 2 clocks and other devices such as IMX6Q which uses the same driver need the 2 clocks.
- does IPG_CLK_ROOT depends on AHB_CLK_ROOT (and why ?)
In 'Table 5-11. Clock Root Table' you can see that Source for IPG_CLK_ROOT has only one option which is '000 - AHB_CLK_ROOT'
- can IPG_CLK_ROOT be disabled ?
No, Figure 5-15. CCM Clock Tree Root Slices indicates that no CCGRx is assigned to IPG_CLK-ROOT. And this matches with the fact that there is not IPG section in 'Table 5-12. System Clocks and Gating'.
Regards,
Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Vincent,
- What kernel version are you using?
- Regarding this point:
from linux dts for imx7, we see that both clocks are mapped to IMX7D_UART1_ROOT_CLK
what is the name of the file you are looking at? can you share the snippet you refer to?
Regards,
Carlos
Hi and thank you for your time.
My board is a colibri i.MX7 from Toradex, so I'm using their Linux:
- url = git://git.toradex.com/linux-toradex.git
- based on the toradex_imx_4.1.15_1.0.0_ga tag (actual commit is eb479e52f9c6d32164ae76606fd7ce372f2aa153)
I'm mostly looking at imx7 dts files, like arch/arm/boot/dts/imx7s.dtsi where you can find:
uart1: serial@30860000 {
compatible = "fsl,imx7d-uart",
"fsl,imx6q-uart", "fsl,imx21-uart";
reg = <0x30860000 0x10000>;
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX7D_UART1_ROOT_CLK>,
<&clks IMX7D_UART1_ROOT_CLK>;
clock-names = "ipg", "per";
dmas = <&sdma 22 4 0>, <&sdma 23 4 0>;
dma-names = "rx", "tx";
status = "disabled";
};
As you can see, both "ipg" and "per" are aliased to the same clock.
By the way, is there a reference Linux from NXP for i.MX7 board available somewhere ?
Best,
V.
Hi Vincent,
- do I have to configure IPG_CLK_ROOT to use the UART ?
No, it is always enabled
- why does Linux has both UART's clock set to UART_CLK_ROOT ?
In 'Table 5-12. System Clocks and Gating' you can see that both, IPG_CLK_ROOT and UART1_CLK_ROOT are mapped to clk_enable_uart1 (CCGR148), so it is redundant, and this makes sense for IMX7D because the driver uses the 2 clocks and other devices such as IMX6Q which uses the same driver need the 2 clocks.
- does IPG_CLK_ROOT depends on AHB_CLK_ROOT (and why ?)
In 'Table 5-11. Clock Root Table' you can see that Source for IPG_CLK_ROOT has only one option which is '000 - AHB_CLK_ROOT'
- can IPG_CLK_ROOT be disabled ?
No, Figure 5-15. CCM Clock Tree Root Slices indicates that no CCGRx is assigned to IPG_CLK-ROOT. And this matches with the fact that there is not IPG section in 'Table 5-12. System Clocks and Gating'.
Regards,
Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Dear Carlos, thank you for all these information, it is much more clear now.
Best wishes & Happy new year :smileywink:
V.