I was able to enable ttyLP2 with the following changes:
1.
Change the boot setting
・BoardConfig.mk(/device/nxp/imx8q/mek_8q)
Added the following code.
# SELinux
BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive
・init.rc (/device/nxp/imx8q/mek_8q)
Added the following code before "on boot".
chmod 0777 /dev/ttyLP2
2.
Change the device tree.
・imx8qm-mek.dts(vendor/nxp-opensource/kernel_imx/arch/arm64/boot/dts/freescale)
Changed the following code.
&lpuart2 {
pinctrl-0 = <&pinctrl_lpuart2>;
status = "okay";
};
・imx8qm-mek-rpmsg.dts(vendor/nxp-opensource/kernel_imx/arch/arm64/boot/dts/freescale)
Changed the following code.
&lpuart2 {
status = "okay";
};
&uart2_lpcg {
status = "okay";
};
3.
Remove pin assignment of M4 core
・Base on board-imx8qm.c (vendor/nxp/fsl-property/uboot-firmware/imx8q), change as follows.
/* Create M4 1 partition */
if (rm_is_resource_avail(SC_R_M4_1_PID0) != SC_FALSE)
{
sc_rm_mr_t mr;
/* List of resources */
static const sc_rsrc_t rsrc_list[8U] =
{
SC_R_IRQSTR_M4_1,
// SC_R_UART_2,
SC_R_MU_6B,
SC_R_MU_7B,
SC_R_MU_9B,
SC_R_GPT_3,
RM_RANGE(SC_R_CAN_0, SC_R_CAN_2),
SC_R_FSPI_0
};
/* List of pads */
static const sc_pad_t pad_list[6U] =
{
RM_RANGE(SC_P_M41_I2C0_SCL, SC_P_M41_GPIO0_01),
// RM_RANGE(SC_P_UART0_CTS_B, SC_P_UART0_RTS_B),
RM_RANGE(SC_P_FLEXCAN0_RX, SC_P_FLEXCAN2_TX),
RM_RANGE(SC_P_QSPI0A_DATA0, SC_P_COMP_CTL_GPIO_1V8_3V3_QSPI0)
};
・Build with gcc-toolchain and place the generated binary file in vendor/nxp-opensource/imx-mkimage/iMX8QM.
Refer:https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/System-Controller-Firmware-101-Getting-s...
・At this time, change the name of the binary file.
Also, change the code of "scfw-tcm.bin" in the following makefile as above.
(soc.mak, android.mak, autobuild.mak, m4.mak, misc.mak)