STM32MP157C Enabling usart1 by using device tree
Hi all,
The development board we are using STM32MP157C-YA157C from Myirtech is running Ubuntu 18 with openstlinux.
I am trying to interface the usart1 with another module but by default, the peripheral is not enabled from device tree.
So, I modified the device tree as follows (pins z6 and z7 are used by usart1) according to the document of ST :
usart1_pins_a: usart1-0 {
pins1 {
pinmux = <STM32_PINMUX('Z', 7, AF7)>; /* UART1_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('Z', 6, AF7)>; /* UART1_RX */
bias-disable;
};
};
usart1_idle_pins_a: usart1-idle-0 {
pins1 {
pinmux = <STM32_PINMUX('Z', 7, ANALOG)>; /* UART1_TX */
};
pins2 {
pinmux = <STM32_PINMUX('Z', 6, AF7)>; /* UART1_RX */
bias-disable;
};
};
usart1_sleep_pins_a: usart1-sleep-0 {
pins {
pinmux = <STM32_PINMUX('Z', 7, ANALOG)>, /* UART1_TX */
<STM32_PINMUX('Z', 6, ANALOG)>; /* UART1_RX */
};
};&usart1 {
pinctrl-names = "default", "sleep", "idle"; /* pin configurations definition */
pinctrl-0 = <&usart1_pins_a>; /* default pin configuration selection */
pinctrl-1 = <&usart1_sleep_pins_a>; /* sleep pin configuration selection */
pinctrl-2 = <&usart1_idle_pins_a>; /* idle pin configuration selection */
status = "okay"; /* device activation */
};aliases {
ethernet0 = ðernet0;
serial0 = &uart4;
serial1 = &usart1;
serial2 = &uart8;//rs232
serial3 = &uart5;//rs485
serial4 = &uart7;//bt
};usart1: serial@5c000000 {
compatible = "st,stm32h7-uart";
reg = <0x5c000000 0x400>;
interrupts-extended = <&exti 26 IRQ_TYPE_LEVEL_HIGH>;
//clocks = <&scmi0_clk CK_SCMI0_USART1>;
//resets = <&scmi0_reset RST_SCMI0_USART1>;
clocks = <&rcc USART1_K>;
resets = <&rcc USART1_R>;
wakeup-source;
power-domains = <&pd_core>;
status = "disabled";
};
On boot up, the kernel cannot enable the usart1 module (5c000000):
[ 1.961813] stm32-usart 40010000.serial: interrupt mode for rx (no dma)
[ 1.961838] stm32-usart 40010000.serial: interrupt mode for tx (no dma)
[ 1.961877] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 57, base_baud = 4000000) is a stm32-usart
[ 3.239179] 40011000.serial: ttySTM3 at MMIO 0x40011000 (irq = 58, base_baud = 4000000) is a stm32-usart
[ 3.249682] 40018000.serial: ttySTM4 at MMIO 0x40018000 (irq = 59, base_baud = 4000000) is a stm32-usart
[ 3.264333] 40019000.serial: ttySTM2 at MMIO 0x40019000 (irq = 60, base_baud = 4000000) is a stm32-usart
[ 3.279710] stm32-usart: probe of 5c000000.serial failed with error -22
The clock summary is as follows (grep -E "clock|usart" /sys/kernel/debug/clk/clk_summary | sed 's,\s\+, ,g' | column -t):
clock count count count rate accuracy phase cycle
usart1_k 0 0 0 64000000 0 0 50000
usart3_k 0 0 0 64000000 0 0 50000
usart2_k 0 0 0 64000000 0 0 50000
usart6 0 0 0 104438965 0 0 50000
usart3 0 0 0 104438965 0 0 50000
usart2 0 0 0 104438965 0 0 50000
I noticed that the usart1_k clock is not enabled. How can I enable it?
What am I missing?
Thank you.
Best regards,
Mert
