zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.83k stars 6.6k forks source link

TFM: Nordic pinctrl consumers broken #77185

Open JordanYates opened 2 months ago

JordanYates commented 2 months ago

Describe the bug

The TFM and Zephyr repositories have mismatched views on how the pinctrl uint32_t is constructed.

https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/069455be098383bf96eab73e3ff8e0c66c60fa5a/platform/ext/target/nordic_nrf/common/core/common/nrf-pinctrl.h#L9-L20

https://github.com/zephyrproject-rtos/zephyr/blob/cce7e9a706ca848f73e4ef2c435668e358b73305/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h#L9-L20

The pinctrl values are consumed by the TFM USART driver: https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/069455be098383bf96eab73e3ff8e0c66c60fa5a/platform/ext/target/nordic_nrf/common/core/cmsis_drivers/Driver_USART.c#L56-L74

Introduced in:

This was probably missed because NRF_FUN_UART_TX is 0, so the shift in bits doesn't affect this one pin. The flow control and RX pins are currently broken.

The first PR is present in Zephyr v3.7.0, so the LTS driver does not currently work as expected.

Expected behavior

TFM and Zephyr need the same view on pinctrl, as TFM consumes the values created by the Zephyr build system.

Impact

Nordic TFM consumers of pinctrl are currently broken.

Environment (please complete the following information):

nordic-piks commented 1 month ago

Triaged internally