Tool/software:
Hello TI experts,
I am working to prototype using wkup_uart0 as the "serial" debug console on a J784S4XEVM board. I am trying to make this work with the ti-u-boot release 10.00.08. I am aware, and have significantly utilized, the details documented here:
However, ti-u-boot 10.00.08 is based on u-boot 2024.04, while the version used in the above link (09.01.00.06) is based on u-boot 2023.04. Most of the modifications to u-boot in the above link do not appear to have a direct correlation in the newer u-boot (probably due to the fact that between 2023.04 and 2024.04 upstream u-boot incorporated basic j784s4 support natively).
I have been unable to get this newer version to operate successfully with wkup_uart0. With the default configuration using main_uart8, I am able to build and u-boot as expected. Here are the details of what I am building with:
ti-linux-firmware: commit 35fa44a93549d8d91b1c37a7b9f8767dbe7d37eb (tag: 10.00.08)
optee_os: commit 1c0d52ace3c237ca6276cafb5c73f699a75c1d40 (tag: 4.3.0)
trusted-firmware-a: commit f2735ebccf5173f74c0458736ec526276106097e (tag: v2.11.0, tag: v2.11)
ti-u-boot: commit 818c76aed67f94059b9ebb94d237418802620b81 (tag: 10.00.08)
With the repositories at these commits, my build works as desired on main_uart8.
The following changes are what I am currently applying to attempt to make this build work with wkup_uart0 instead:
For trusted-firmware-a, the following patch is applied:
diff --git a/plat/ti/k3/include/platform_def.h b/plat/ti/k3/include/platform_def.h index a2cc62d34..d008169c5 100644 --- a/plat/ti/k3/include/platform_def.h +++ b/plat/ti/k3/include/platform_def.h @@ -105,14 +105,14 @@ /* Platform default console definitions */ #ifndef K3_USART_BASE -#define K3_USART_BASE (0x02800000 + 0x10000 * K3_USART) +#define K3_USART_BASE (0x42300000 + 0x10000 * K3_USART) #endif /* USART has a default size for address space */ #define K3_USART_SIZE 0x1000 #ifndef K3_USART_CLK_SPEED -#define K3_USART_CLK_SPEED 48000000 +#define K3_USART_CLK_SPEED 96000000 #endif /* Crash console defaults */
For optee_os, the following patch is applied:
diff --git a/core/arch/arm/plat-k3/platform_config.h b/core/arch/arm/plat-k3/platform_config.h index cffca0a07..0467cdad8 100644 --- a/core/arch/arm/plat-k3/platform_config.h +++ b/core/arch/arm/plat-k3/platform_config.h @@ -11,7 +11,7 @@ #define UART0_BASE 0x02800000 -#define CONSOLE_UART_BASE (UART0_BASE + CFG_CONSOLE_UART * 0x10000) +#define CONSOLE_UART_BASE (0x42300000 + CFG_CONSOLE_UART * 0x10000) #define CONSOLE_BAUDRATE 115200 #define CONSOLE_UART_CLK_IN_HZ 48000000
For ti-u-boot, the following patch is applied:
diff --git a/arch/arm/dts/k3-j784s4-evm.dts b/arch/arm/dts/k3-j784s4-evm.dts index afd84a6dfa..4a0cd38752 100644 --- a/arch/arm/dts/k3-j784s4-evm.dts +++ b/arch/arm/dts/k3-j784s4-evm.dts @@ -20,9 +20,9 @@ }; aliases { - serial0 = &wkup_uart0; + serial0 = &main_uart8; serial1 = &mcu_uart0; - serial2 = &main_uart8; + serial2 = &wkup_uart0; mmc0 = &main_sdhci0; mmc1 = &main_sdhci1; i2c0 = &wkup_i2c0; @@ -670,10 +670,12 @@ }; &wkup_uart0 { - /* Firmware usage */ - status = "reserved"; + /* Debug UART */ + bootph-all; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&wkup_uart0_pins_default>; + clock-frequency = <96000000>; }; &wkup_i2c0 { diff --git a/arch/arm/dts/k3-j784s4-mcu-wakeup.dtsi b/arch/arm/dts/k3-j784s4-mcu-wakeup.dtsi index d580f9e948..61cb449fe7 100644 --- a/arch/arm/dts/k3-j784s4-mcu-wakeup.dtsi +++ b/arch/arm/dts/k3-j784s4-mcu-wakeup.dtsi @@ -305,10 +305,6 @@ reg = <0x00 0x42300000 0x00 0x200>; interrupts = <GIC_SPI 897 IRQ_TYPE_LEVEL_HIGH>; current-speed = <115200>; - clocks = <&k3_clks 397 0>; - clock-names = "fclk"; - power-domains = <&k3_pds 397 TI_SCI_PD_EXCLUSIVE>; - status = "disabled"; }; mcu_uart0: serial@40a00000 { diff --git a/board/ti/j784s4/j784s4.env b/board/ti/j784s4/j784s4.env index 09d41a7871..56b0fdfbb0 100644 --- a/board/ti/j784s4/j784s4.env +++ b/board/ti/j784s4/j784s4.env @@ -10,7 +10,7 @@ name_kern=Image console=ttyS2,115200n8 -args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02880000 +args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x42300000 ${mtdparts} run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
With the above patches applied, as expected I get no output on main_uart8. I do get the following on wkup_uart0:
U-Boot SPL 2024.04-00001-gf84f61eab5 (Sep 11 2024 - 10:51:07 -0500)
ti_power_domain_probe(dev=41c661b8)
But, then it stops.
I have tried various other changes to the devicetree files for the uart configurations, but none seems to make a difference, I can't seem to get past this point. There is a comment in k3-j784s4-r5.dtsi above the wkup_uart0 configuration that says "WKUP UART0 is used for DM firmware logs". Does the device management firmware for the r5 core need to be changed to support this?
Any direction on how to make this work will be greatly appreciated.