2019-12-20 06:27 AM
Hi all, I use PZ7 and PZ6 configure for usart1. But it show some error log.
[ 1.633566] stm32mp157-pinctrl soc:pin-controller@50002000: invalid function.
[ 1.640375] stm32-usart: probe of 5c000000.serial failed with error -22
It's right when II try to use another pins . Did you also had this issue?
2019-12-20 07:44 AM
Would be easier to support if you provide the DeviceTree.
Meanwhile, some clues
2019-12-20 07:48 AM
Thanks for your quick response. Below is my dts code. And I also enable all uart/usart in dts, only the usart1 had error.
339 uart1_pins_a: uart1-0 {
340 pins1 {
341 pinmux = <STM32_PINMUX('Z', 7, AF7)>; /* USART1_TX */
342 bias-disable;
343 drive-push-pull;
344 slew-rate = <0>;
345 };
346 pins2 {
347 pinmux = <STM32_PINMUX('Z', 6, AF7)>; /* USART1_RX */
348 bias-disable;
349 };
350 };
856 &usart1 {
857 pinctrl-names = "default", "sleep", "idle";
858 pinctrl-0 = <&uart1_pins_a>;
859 pinctrl-1 = <&uart1_sleep_pins_a>;
860 pinctrl-2 = <&uart1_idle_pins_a>;
861 status = "okay";
862 };
2019-12-20 08:26 AM
I assume the nodes "uart1_sleep_pins_a" and "uart1_idle_pins_a" are defined elsewhere. otherwise, try to remove the "pinctrl-1" and "pinctrl-2" lines.
Please check if USART1 is defined as non-secure in etzpc node of TF-A Device Tree?
2019-12-20 08:50 AM
Sorry for that I missing upload the "uart1_sleep_pins_a" and "uart1_idle_pins_a". I also try to remove those nodes. It also has same issue. Currently, I use basic chain with sdcard boot. I found the etzpc node in TFA device tree file. But I doesn't use the TFA, only the u-uboot-spl.stm32 and u-boot.img.
2019-12-20 08:58 AM
I'm not sure Basic boot support USART1 configuration which is a secure peripheral by default.
We recommend to use TF-A+uBoot as this is the official flow we commit to support for long time.
Basic boot is currently used only for DDR Tools usages and one this tool support will be available using TF-A+uBoot, Basic boot support will be discontinued.
2019-12-20 09:30 AM
I switch to use trusted chain with TFA + uboot. And I follow the link to check the USART1 domain of TFA(by default, it's setting to DECPROT_NS_RW).
https://wiki.st.com/stm32mpu/wiki/ETZPC_device_tree_configuration
But also had same error log. My kernel branch is v4.19-stm32mp-r1.4.
2019-12-24 01:48 AM
I read the wiki link and found the USART1 can be assign to OPTEE and linux context.
https://wiki.st.com/stm32mpu/wiki/USART_internal_peripheral
Does it means the usart1 only used by optee with linux not the non-secure linux context?
2020-04-03 03:33 AM
Hi,
I had the same problem. I muxed the pins in uboot and delete the muxing in devicetree.
After this the uasrt1 works fine.
Seems to be an issue in the pinctrl driver.