Hi
I plan to develop an target board based on the i.MX 8m Mini EVK.
I want to set the UART on the target board as follows:
UART1 (UART1_RX / UART1_TX / UART1_CTS_B / UART1_RTS_B)
UART2 (UART2_RX / UART2_TX)
UART3 (ECSPI1_MISO / ECSPI1_SSO / ECSPI1_SCLK / ECSPI1_MOSI)
UART4 (UART4_RX / UART4_TX)
I'm not sure how to modify the Linux files.
Do I need to change drivers or DTS files?
Can you please tell me the location of driver and DTS file if you need to change?
Also, I would like to confirm whether each device has the following allocation.
Where should I confirm?
UART1=/dev/ttyS0
UART2=/dev/ttyS1
UART3=/dev/ttyS2
UART4=/dev/ttyS3
Thanks.
Hi yuichi
for uart1 example one can look at fsl-imx8mm-evk.dts
fsl-imx8mm-evk.dts\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel
DTS customization tutorial
https://boundarydevices.com/mx6-device-tree-customization/
for customization may be useful Porting Guide included in
Linux 5.4.3_1.0.0 Documentation
Best regards
igor
Hi ysato.ad@minebeamitsumi.com,
Please find my below in-line response.
Do I need to change drivers or DTS files?
Every pad can be multiplexed in various modes. For configuring any pad or any pinmux, you need to change the pinmux in device tree. To see the supported muxing modes please refer to "Table 8-1 Muxing Options" from the attached Reference Manual of i.MX8M Mini.
Can you please tell me the location of the driver and DTS file if you need to change?
You need to change the pinmux in the device tree.
Location of Device tree files: "build_imx8mmevk/tmp/work-shared/imx8mmevk/kernel-source/arch/arm64/boot/dts/freescale/" (for evk Rev B, this file "fsl-imx8mm-evk.dts" will be used.)
Location of Driver file of UART: "build_imx8mmevk/tmp/work-shared/imx8mmevk/kernel-source/drivers/tty/serial/imx.c" (you can verify using the "compatible" property in device tree node of UART, the same would be in the driver and that is driver files are matched).
Also, I would like to confirm whether each device has the following allocation.
Where should I confirm?
UART1=/dev/ttyS0
UART2=/dev/ttyS1
UART3=/dev/ttyS2
UART4=/dev/ttyS3
If you look at the driver it would have Device Name as ttymxc defined at the top. You will get the device name by ttmxc0, ttymxc1, etc.
Feel free to ask in case of any queries.
Regards,
Kunal
Hi ysato.ad@minebeamitsumi.com,
Please find below the in-line response:
In the build environment, "MACHINE = imx8mmevk" is set,
but is this MACHINE setting good for "RevC" and "RevB"?In RevC, QSPI is connected and the board is obviously different,
but I don't know the DTS switching between RevB and RevC boards.
Yes, the machine setting is the same. You can see the "sources/meta-fsl-bsp-release/imx/meta-bsp/conf/machine/imx8mmevk.conf" file for DTS files for LPDDR4 and DDR4 EVK.
The Makefile has the following description.
Does the meaning below mean that you are using all of the following dtb (= dts)?
Please refer to the "Table-10 Kernel and Device Tree Configurations" from Release Note of the BSP you are using.(I have Attached Release note of BSP L4.14.98-2.0.0 for your reference).
If you search for uart4, it is defined in the following three files.
It is not defined in fsl-imx8mm-evk.dts. Is uart4 undefined?
Or is it defined in the following 3 files?
I'm confused that status is "okay" or "disabled".
Please refer to https://elinux.org/images/f/f9/Petazzoni-device-tree-dummies_0.pdf for the understanding of the device tree.In general, dtsi is include file where soc specific peripherals are written, and which we want to use are enabled and written in dts files.
To disable the M4 program and use UART4, ECSPI2, I2C3 from Linux,
Should I just add the tag to fsl-imx8mm-evk.dts?
Yes. If you are not using M4 than fsl-imx8mm-evk.dts can be used.
Hope this would help.
Regards,
Kunal