The UART can be configured as a whole, i.e. settings for the TX and RX sides are common, or the TX and RX sections can be configured individually. Thus setting different stop bit, parity, data lengths for each section. By default the Linux drivers set the UART as a whole, the following sequence inserted into the serial drivers allow the application to behave as we want, 2 stop bits outgoing, 1 stop bit incoming:
1st line puts the same configuration in the control registers for TX and RX. The global line control register becomes the RX line control register, the 2 line control registers is used for the TX section.
2nd line tells the UART to apply the 2 control registers for settings, 1 for TX 1 for RX
3rd line changes the settings in the TX section of the UART.
1. Copy the HW_UARTAPP_LINECTRL register into the HW_UARTAPP_LINECTRL2 regfister
2. Set the USE_LCR2 bit in the HW_UARTAPP_CTRL2 register.
3. Set the STP2 bit in the HW_UARTAPP_LINECTRL2 register.