Lines Matching full:baud
53 #define CDNS_UART_BAUDGEN 0x18 /* Baud Rate Generator */
60 #define CDNS_UART_BAUDDIV 0x34 /* Baud Rate Divider */
180 /* baud dividers min/max values */
192 * @baud: Current baud rate
201 unsigned int baud; member
391 * cdns_uart_calc_baud_divs - Calculate baud rate divisors
393 * @baud: Desired baud rate
397 * Return: baud rate, requested baud when possible, or actual baud when there
400 * Formula to obtain baud rate is
407 * baud rate generate register
408 * baud rate clock divisor register
411 unsigned int baud, u32 *rbdiv, u32 *rcd, int *div8) in cdns_uart_calc_baud_divs() argument
419 if (baud < clk / ((CDNS_UART_BDIV_MAX + 1) * CDNS_UART_CD_MAX)) { in cdns_uart_calc_baud_divs()
427 cd = DIV_ROUND_CLOSEST(clk, baud * (bdiv + 1)); in cdns_uart_calc_baud_divs()
433 if (baud > calc_baud) in cdns_uart_calc_baud_divs()
434 bauderror = baud - calc_baud; in cdns_uart_calc_baud_divs()
436 bauderror = calc_baud - baud; in cdns_uart_calc_baud_divs()
446 if (((besterror * 100) / baud) < 3) in cdns_uart_calc_baud_divs()
447 bestbaud = baud; in cdns_uart_calc_baud_divs()
453 * cdns_uart_set_baud_rate - Calculate and set the baud rate
455 * @baud: Baud rate to set
456 * Return: baud rate, requested baud when possible, or actual baud when there
460 unsigned int baud) in cdns_uart_set_baud_rate() argument
468 calc_baud = cdns_uart_calc_baud_divs(port->uartclk, baud, &bdiv, &cd, in cdns_uart_set_baud_rate()
480 cdns_uart->baud = baud; in cdns_uart_set_baud_rate()
514 * Find out if current baud-rate can be achieved with new clock in cdns_uart_clk_notifier_cb()
517 if (!cdns_uart_calc_baud_divs(ndata->new_rate, cdns_uart->baud, in cdns_uart_clk_notifier_cb()
525 /* Disable the TX and RX to set baud rate */ in cdns_uart_clk_notifier_cb()
536 * Set clk dividers to generate correct baud with new clock in cdns_uart_clk_notifier_cb()
545 cdns_uart->baud = cdns_uart_set_baud_rate(cdns_uart->port, in cdns_uart_clk_notifier_cb()
546 cdns_uart->baud); in cdns_uart_clk_notifier_cb()
685 * stop bits, flow control, baud rate
694 unsigned int baud, minbaud, maxbaud; in cdns_uart_set_termios() local
700 /* Disable the TX and RX to set baud rate */ in cdns_uart_set_termios()
706 * Min baud rate = 6bps and Max Baud Rate is 10Mbps for 100Mhz clk in cdns_uart_set_termios()
707 * min and max baud should be calculated here based on port->uartclk. in cdns_uart_set_termios()
708 * this way we get a valid baud and can safely call set_baud() in cdns_uart_set_termios()
713 baud = uart_get_baud_rate(port, termios, old, minbaud, maxbaud); in cdns_uart_set_termios()
714 baud = cdns_uart_set_baud_rate(port, baud); in cdns_uart_set_termios()
716 tty_termios_encode_baud_rate(termios, baud, baud); in cdns_uart_set_termios()
719 uart_update_timeout(port, termios->c_cflag, baud); in cdns_uart_set_termios()
1171 /* only set baud if specified on command line - otherwise in cdns_early_console_setup()
1174 if (port->uartclk && device->baud) { in cdns_early_console_setup()
1179 cdns_uart_calc_baud_divs(port->uartclk, device->baud, in cdns_early_console_setup()
1259 int baud = 9600; in cdns_uart_console_setup() local
1272 uart_parse_options(options, &baud, &parity, &bits, &flow); in cdns_uart_console_setup()
1281 return uart_set_options(port, co, baud, parity, bits, flow); in cdns_uart_console_setup()