Imx8m-plus uart4

Hello,
I am working with a verdin imx8m-plus SOM.
I am doing some uarts configuration and I wanted to configure uart 4 for external use but I read in the datasheet that uart4 is attended to use for debug output for cortex m7 and in the wifi/bluetooth section says that uart 4 is used for bluetooth uart.
In dts I see that bluetooth uart is configured for uart4 and in this post Enable UART4 on Verdin imx8mp says the same.
Two questions:
One, how can I have access to cortex m7 if uart4 is connected to bluetooth?
If i need to use uart4 for external use I have to desabled bluetooth?

UART_4 interface is intended to be used for the real-time operating system (M7 core). The interface may be used as a general-purpose UART. On modules with Wi-Fi/Bluetooth, the UART_4 is shared with the Bluetooth UART. This means the UART_4 can only be used externally, if the Bluetooth UART is not in use. (explicitly turned off in software) .

Hello @alex.tx
When you say that turn off bluetooth in software thats means disabled in device-tree?
If I need to use uart_4 to have debug output for m7 core I have to disabled Bluetooth too?

If you plan to utilize USB_4 on X1 pins 151/153, Bluetooth functionality can remain active since these pins are not connected to the BT/Wi-Fi module. However, UART_4 can alternatively be used on other pins like ECSPI2_MOSI (X1 pin 152) and ECSPI2_SCLK (X1 pin 164). In this scenario, Bluetooth must be disabled regardless of whether UART_4 is utilized by the M or A cores. Should you require UART_4 for the M core, it must be disabled in the Linux device tree to avoid conflicts arising from A cores accessing the same peripheral.

Sorry, I am a little lost here.
In device-tree for bluetooth we have the following:

/* On-module Bluetooth */
&uart4 {
	uart-has-rtscts;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_bt_uart>;
	status = "okay";

	bluetooth {
		compatible = "mrvl,88w8997";
		max-speed = <921600>;
	};
};
	pinctrl_bt_uart: btuartgrp {
		fsl,pins =
			<MX8MP_IOMUXC_ECSPI2_MISO__UART4_DCE_CTS	0x1c4>,
			<MX8MP_IOMUXC_ECSPI2_MOSI__UART4_DCE_TX		0x1c4>,
			<MX8MP_IOMUXC_ECSPI2_SCLK__UART4_DCE_RX		0x1c4>,
			<MX8MP_IOMUXC_ECSPI2_SS0__UART4_DCE_RTS		0x1c4>;
	};

I can see that pins that bluetooth is usin are 116 128 152 and 164.

If you plan to utilize USB_4 on X1 pins 151/153, Bluetooth functionality can remain active since these pins are not connected to the BT/Wi-Fi module.

Here If I wan to use uart_4 in pins 151/153 I have to remove the uart4 settings with pinctrl-0 = <&pinctrl_bt_uart>; and keep uart4 settings with pinctrl-0 = <&pinctrl_uart4>;

	pinctrl_uart4: uart4grp {
		fsl,pins =
			<MX8MP_IOMUXC_UART4_RXD__UART4_DCE_RX		0x1c4>,	/* SODIMM 151 */
			<MX8MP_IOMUXC_UART4_TXD__UART4_DCE_TX		0x1c4>;	/* SODIMM 153 */
	};

To be clear if I want to use uart4 in 151 / 153 I cannot use bluetooth am I right?

Yes, if you configure pin multiplexing to utilize UART4 on pins 151/153, it will disrupt the Bluetooth functionality, as the SoC will be unable to maintain UART communication with the BT module. However, it’s not necessary to explicitly switch off the BT module in that case. In essence, you cannot use UART4 as a general-purpose UART and the BT functionality simultaneously.