public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* serial8250: can not change baudrate while the controller is busy
@ 2023-04-14  9:31 qianfan
  2023-04-14 12:10 ` Ilpo Järvinen
  0 siblings, 1 reply; 11+ messages in thread
From: qianfan @ 2023-04-14  9:31 UTC (permalink / raw)
  To: linux-serial; +Cc: Greg Kroah-Hartman, Jiri Slaby

Hi:

My custom board is based on allwinner R40, the uart is compatibled with
serial8250. Based on it's datasheet:

 > When TX transmit data, or RX receives data, or TX FIFO is not empty, 
then the
 > BUSY flag bit can be set to 1 by hardware, which indicates the UART
 > controller is busy.

We cannot write LCR and DLL to update UART params such as baudrate and 
partity
while the UART is busy, however `serial8250_do_set_termios` is a void 
function,
the upper level always assume the uart params is updated.

The upper level `uart_set_termios` do noting if ktermios params is not 
changed,
it will not update when the user space program running tcsetattr set a same
baudrate again. So we can not fix the baudrate when 
`serial8250_do_set_termios`
failed.

Allwinner R40's datasheet provided a way for this case.

 > CHCFG_AT_BUSY(configure at busy): Enable the bit, software can also 
set UART
 > controller when UART is busy, such as the LCR, DLH, DLL register.
 > CHANGE_UPDATE(change update): If CHCFG_AT_BUSY is enabled, and 
CHANGE_UPDATE
 > is written to 1, the configuration of UART controller can be updated.
 > After completed update, the bit is cleared to 0 automatically.

I can't know this feature is expanded by allwinner, or it is a common 
functiton
of serial8250. Perhaps the serial8250 driver need this.

Thanks


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-08-31 13:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-14  9:31 serial8250: can not change baudrate while the controller is busy qianfan
2023-04-14 12:10 ` Ilpo Järvinen
2023-04-15  1:09   ` qianfan
2023-05-05  2:58   ` qianfan
2023-05-08 10:17     ` Ilpo Järvinen
2023-05-08 11:33       ` qianfan
2023-05-08 13:34         ` Ilpo Järvinen
2023-05-09  0:57           ` qianfan
2023-05-09 11:03             ` Ilpo Järvinen
     [not found]               ` <6cefcc6d-266f-64f0-91fc-93815b627828@163.com>
2023-05-10 10:58                 ` Ilpo Järvinen
2023-08-31 13:27                   ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox