Hi
You need to change the pinmuxing to the pins you want to use for UART2. And you have to configure the driver to use UART2.
Have a look at this patch.
You likely will want UART2 in the Linux kernel as well. That one is chosen from the kernel cmdline.
This patch changes the U-Boot environment accordingly.
Systemd will automatically spawn a login console for UART2 because of the cmdline.
But it will also spawn an additional login console on UART1 because of the file ‘/etc/systemd/system/getty.target.wants/serial-getty@ttymxc0.service’. Delete that file from the rootfs or build your own rootfs with the SERIAL_CONSOLE assignment changed in the machine configuration file.
Max
PS.:
If one uses U-boot 2016.11-toradex one needs to change in addition to the above the platform data.