STM32 TF-A FSBL customization workflow
I need to customize the TF-A
en.SOURCES-tf-a-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar.xz
Our custom board have a different pin selection for UART4 debug as you can see below, the UART4_TX pin is not on the STM32_PINMUX('G', 11, AF6), but is on the STM32_PINMUX('A', 0, AF8).
Our expectations were to have the system booting simply changing the line below in the file fdts/stm32mp157-pinctrl.dtsi
uart4_pins_a: uart4@0 {
pins1 {
- pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX STM32MP157C-DK2 */
+ pinmux = <STM32_PINMUX('A', 0, AF8)>; /* UART4_TX CUSTOM*/
bias-disable;
drive-push-pull;
slew-rate = <0>;
};However I see that in plat/st/stm32mp1/stm32mp1_helper.S there is a func plat_crash_console_init who wants to use
#define GPIO_TX_SHIFT (DEBUG_UART_TX_GPIO_PORT << 1)
#define GPIO_TX_ALT_SHIFT ((DEBUG_UART_TX_GPIO_PORT - GPIO_ALT_LOWER_LIMIT) << 2)Those macros come from plat/st/stm32mp1/stm32mp1_def.h where I have
/* For UART crash console */
#define STM32MP_DEBUG_USART_BASE UART4_BASE
/* UART4 on HSI@64MHz, TX on GPIOG11 Alternate 6 */
#define DEBUG_UART_TX_GPIO_BANK_ADDRESS GPIOG_BASE
#define DEBUG_UART_TX_GPIO_PORT 11
#define DEBUG_UART_TX_GPIO_ALTERNATE 6however if I change it as I need...
/* Custom UART4 with TX on GPIOA0 Alternate 8 */
#define DEBUG_UART_TX_GPIO_BANK_ADDRESS GPIOA_BASE
#define DEBUG_UART_TX_GPIO_PORT 0
#define DEBUG_UART_TX_GPIO_ALTERNATE 8...the compilation have an error (of course) because DEBUG_UART_TX_GPIO_PORT can't be zero.
Warning: shift count out of range (-32 is not between 0 and 63)So my question is how is supposed to be customized the UAT4_TX in TF-A ?
Do I have to rely on the DTS/DTSI only or there is something more to verify?
Any help would be very appreciated.
Thanks,
