iMX8m EVK UART4 unavailable

cancel
Showing results for 
Search instead for 
Did you mean: 

iMX8m EVK UART4 unavailable

1,195 Views
mariosan
Contributor II

Hi, I'm working on a iMX8M Mini EVK (official NXP Android bsp) and I want to use the UART4 , formally used as debug

port for M4 microcontroller .

Changed the DTS file to include the UART:

/*pin muxing */

        pinctrl_uart4: uart4grp {
            fsl,pins = <
                MX8MM_IOMUXC_UART4_RXD_UART4_DCE_RX            0x140    /* GPIO5.28 */
                MX8MM_IOMUXC_UART4_TXD_UART4_DCE_TX            0x140    /* GPIO5.29 */
            >;
        };

&uart4 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_uart4>;
    assigned-clocks = <&clk IMX8MM_CLK_UART4_SRC>;
    assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
    /* status = "disabled"; */
    status = "okay";
};

But  system will go in crash when accesing the first UART4 register.

Problem is that the RDC register @ 303d0518  is set to 0xFC, so UART is assigned to M4 core:

A workaround is to set a macro in UBOOT to set register to 0xFF:

setenv ena_uart4 mw.l 0x303D0518 0xFF

setenv bootcmd  'run ena_uart4; boota mmc0'

Problem is that in UBOOT code I was not able to detect  where the register is initially set to 0xfc:

a patch placed into board_early_init_f() do not works as expected, and it was impossible to

assign the UART4 to UBOOT console ...

Any idea where to find this setting?

M. Sangalli

5 Replies

667 Views
MarioEBV
Contributor II

Hi,

Modification needed is in the imx-atf (arm trusted firmware)

File :plat/imx/imx8mm/imx8mm_bl31_setup.c

mmio_write_32(IMX_RDC_BASE + 0x518, 0xfc);   -> 0xfc change to 0xff

rgds,

Mario

667 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

You can file the file in the following path:

$ android_build/vendor/nxp-opensource/arm-trusted-firmware/plat/imx/imx8mm/imx8mm_bl31_setup.c

Hope this could help you.

Best regards,

Diego.

667 Views
mariosan
Contributor II

Thank You Diego, but such directory do not exist in my distro(it was based on imx-p9.0.9_1-0.0-beta) :

the only arm-trusted-firmware is under linaro and I've not found any reference to IMX_RDC_BASE anyway

but UART4 is evidently locked to M4.

I do not want to upgrade now the sources to latest bsp because I've to do a lot of  works to allign...

Any other suggestion where to find this setting?

Thanks mario

0 Kudos

667 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

Unfortunately, the BSP that you are using is not an official BSP from us. What I suggest you is to use our Android BSP. Otherwise, we cannot guarantee anything. I apologize for the inconvenience this could give you.

Best regards,

Diego.

0 Kudos

667 Views
mariosan
Contributor II

Hi Mario: I do not have a imx-atf directory in my Android' s tree: I've search in the whole sources

for IMX_RDC_BASE but with no results

I've found android_build\device\linaro\bootloader\arm-trusted-firmware directory, but in plat directory
I'v found only a generic arm, none specific of imx8 , no RDC_BASE in any sources..
Maybe the setting is in some other point ?

Thank You

Mario

0 Kudos