Hi Zhouwei,
In fsl-imx8mm-evk.dts, you can find I2C4_SCL and I2C4_SDA pins have been used by default:
-----------------------------------------------------------------------------
pinctrl_pcie0: pcie0grp {
fsl,pins = <
MX8MM_IOMUXC_I2C4_SCL_PCIE1_CLKREQ_B 0x61 /* open drain, pull up */
MX8MM_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x41
MX8MM_IOMUXC_SAI2_RXFS_GPIO4_IO21 0x41
>;
};
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0xd6
MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK 0xd6
MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0xd6
MX8MM_IOMUXC_I2C4_SDA_GPIO5_IO21 0xd6
>;
};
-----------------------------------------------------------------------------------
If you want to use it as I2C4, you should comment or delete above 2 lines at first.
Then add your above code for I2C4 to the dts file.
Hope the information is helpful to you.
Have a nice day!
B.R,
Weidong