This feature is tested and can be enabled in Linux4.14 kernel by following the below listed steps
enable config
CONFIG_GPIO_MPC8XXX=y
CONFIG_SERIAL_SC16IS7XX_CORE=y
CONFIG_SERIAL_SC16IS7XX=y
CONFIG_SERIAL_SC16IS7XX_SPI=y
Disable , CONFIG_SERIAL_DEV_CTRL_TTYPORT
CONFIG_SERIAL_DEV_CTRL_TTYPORT is not set
Apply dts patch
0001-arm64-dts-ls1012afrwy-add-spi-to-uart-enablement.patch
Test step:
- Flash RCW
tftp 0x81000000 <path/to/file>PBL_swapped_CRC_not_swapped.bin
sf probe 0:0; sf erase 0 10000; sf write 0x81000000 0x0 10000
- Append ramdisk_size in bootargs
console=ttyS0,115200 root=/dev/ram0 ramdisk_size=0x3000000 earlycon=uart8250,mmio,0x21c0500 lpj=250000
- tftp kernel image and boot
tftp 96000000 <path/of/image>kernel-ls1012a-frwy.itb && bootm 96000000
- Check if the device file is created for serial driver
ls /dev/ttySC0
- set baud rate
stty -F /dev/ttySC0 115200
- send some data on ttySC0
echo test1 > /dev/ttySC0
echo 12345 > /dev/ttySC0
same data should be seen on the other end via MIKRO-bus adaptor connected to serial-to-usb and finally to laptop.
- To receive some data on ttySC0
cat /dev/ttySC0
wait for the data to receive. Ctrl +C to break out of listening mode.