I need to change the we use for stdout from UART1 to UART5, for both bootloader/spl/uboot and kernel. I've modified my .dts file so that the node for lpuart5 is "okay" and lpuart1 is "disabled". However, when I probe UART5 tx, I get a periodic signal around 11kHz. Checking the dts I can see that an LCD device is configured to it, but i have disabled it. From what I've read that should mean the pingroups aren't enabled, although deleting that group would seem ideal.
I've found several similar posts on here:
But these all seem to do it in subtly different ways. So what exactly needs to be done? Are there any example layers that do this, as changing the UART would seem a reasonable thing to do, but the number of hoops you have to jump through in yocto seems ridiculous.
Hi,
Thank you for your interest in NXP Semiconductor products,
You came across multiple boot modes, i.MX93 boot is like 8M family boot, UART assignment is at ATF please change the UART base for 0x42590000.
You must update the PADS if it's not done yet.
Regards
Thanks for the response. I can make the change to imx93_evk.c, but the platform_def.h does not exist in my Yocto tree. I did download IMX_boot to another directory outside of Yocto. But how will Yocto be able to build all the necessary files without it?
I have attempted to use Buildroot and the ATF code is in there too, and in fact I can build some images (rootfs and flash.bin), but I'm having a hard time programming them with uuu.
Hi,
imx93_evk.c is a U-boot file, ATF is loaded before and handles resources with more privileges. If ATF is not found, you can clone the repository then build the binary with:
export CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf-
make PLAT=imx93 all
Clone imx-mkimage and copy the necessary files from your yocto build plus the bl31.bin from your custom build, that would create the imx-boot to use a different UART.
Regards
chosen {
bootargs = "console=ttyLP7,115200 earlycon";
stdout-path = &lpuart8;
};
&lpuart8 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart8>;
status = "okay";
};
&iomuxc {
pinctrl_uart8: uart8grp {
fsl,pins = <
MX93_PAD_GPIO_IO13__LPUART8_RX 0x31e
MX93_PAD_GPIO_IO12__LPUART8_TX 0x31e
>;
};
+dtb-$(CONFIG_ARCH_MXC) += imx93-11x11-evk-custom.dtb
do_patch:append(), do_configure:prepend(), do_install:append(), do_deploy:append() to make sure patches are applied and copied to deployment folder (works)
KERNEL_DEVICETREE:append = " \
freescale/imx93-11x11-evk-custom.dtb \
"
IMAGE_BOOT_FILES:append = " \
freescale/imx93-11x11-evk-custom.dtb \
"
+ imx93-11x11-evk-custom.dtb
static iomux_v3_cfg_t const uart_pads[] = {
- MX93_PAD_UART1_RXD__LPUART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
- MX93_PAD_UART1_TXD__LPUART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX93_PAD_GPIO_IO13__LPUART8_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX93_PAD_GPIO_IO12__LPUART8_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
};
- "console=ttyLP0,115200 earlycon\0" \
+ "console=ttyLP7,115200 earlycon\0" \
void board_init_f(ulong dummy)
memset(__bss_start, 0, __bss_end - __bss_start);
+ // Clock Root Control Register (CLOCK_ROOT32_CONTROL_SET - 0x1000)
+ // Clock Root Control Register (CLOCK_ROOT32_AUTHEN_SET - 0x1030)
+ __raw_writel(0xFFFF0300, 0x44451030); // Enable access to UART8
+ __raw_writel(0x01000000, 0x44451000); // Turn on clock for UART8
- #define IMX_LPUART_BASE U(0x44380000)
+ #define IMX_LPUART_BASE U(0x426a0000) // For UART8
export CROSS_COMPILE=aarch64-linux-gnu-
make PLAT=imx93 clean
make PLAT=imx93 all
make KERNEL_DTB=imx93-11x11-evk-custom.dtb SOC=iMX93 flash_singleboot
Hi @ajhoneybell,
I could replicate on i.MX93EVK, please see the following patches, I did the following steps:
1. Clone U-boot, checkout to lf2024, then apply the patch attached,
$ source /opt/fsl-imx-xwayland/6.12-styhead/environment-setup-armv8a-poky-linux
$ make distclean
$ make imx93_11x11_evk_defconfig
$ make
2. Clone ATF, checkout to lf_v2.10, then apply the patch attached,
$ source /opt/fsl-imx-xwayland/6.12-styhead/environment-setup-armv8a-poky-linux
$ unset LDFLAGS
$ make distclean
$ make plat=imx93
3. Clone mkimage, copy the u-boot.bin and spl/u-boot-spl.bin to imx-mkimage/iMX93, also copy build/fvp/release/bl31.bin from ATF, finally lpddr4* and mx93a1-ahab-container.img from a yocto build,
$ make clean
$ make SOC=iMX93 flash_singleboot
You can flash this with
$ sudo uuu -b emmc flash.bin
Regards
Your patches have mistakes,
- MX93_PAD_UART1_RXD__LPUART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
- MX93_PAD_UART1_TXD__LPUART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX93_PAD_GPIO_IO13__LPUART8_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX93_PAD_GPIO_IO13__LPUART8_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
should be
- MX93_PAD_UART1_RXD__LPUART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
- MX93_PAD_UART1_TXD__LPUART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX93_PAD_GPIO_IO13__LPUART8_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX93_PAD_GPIO_IO12__LPUART8_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
Also, because the &lpuart1 is renamed &lpuart8 in the dtsi, it causes the compile to fail...