/openbmc/u-boot/drivers/serial/ |
H A D | serial_mtk.c | 50 /* the data is correct if the real baud is within 3%. */ 51 #define BAUD_ALLOW_MAX(baud) ((baud) + (baud) * 3 / 100) argument 52 #define BAUD_ALLOW_MIX(baud) ((baud) - (baud) * 3 / 100) argument 59 static void _mtk_serial_setbrg(struct mtk_serial_priv *priv, int baud) in _mtk_serial_setbrg() argument 64 if ((baud <= 115200) && (priv->clock == 12000000)) in _mtk_serial_setbrg() 69 if (baud <= 115200) { in _mtk_serial_setbrg() 71 quot = DIV_ROUND_CLOSEST(priv->clock, 16 * baud); in _mtk_serial_setbrg() 75 quot = DIV_ROUND_CLOSEST(priv->clock, 256 * baud); in _mtk_serial_setbrg() 80 quot * baud); in _mtk_serial_setbrg() 83 if ((realbaud > BAUD_ALLOW_MAX(baud)) || in _mtk_serial_setbrg() [all …]
|
H A D | serial_zynq.c | 35 u32 baud_rate_gen; /* 0x18 - Baud Rate Generator [15:0] */ 39 u32 baud_rate_divider; /* 0x34 - Baud Rate Divider [7:0] */ 46 /* Set up the baud rate in gd struct */ 48 unsigned long clock, unsigned long baud) in _uart_zynq_serial_setbrg() argument 55 if (clock < 1000000 && baud > 4800) in _uart_zynq_serial_setbrg() 56 baud = 4800; in _uart_zynq_serial_setbrg() 59 * Baud rate = ------------------ in _uart_zynq_serial_setbrg() 62 * Find acceptable values for baud generation. in _uart_zynq_serial_setbrg() 65 bgen = clock / (baud * (bdiv + 1)); in _uart_zynq_serial_setbrg() 75 if (baud > calc_baud) in _uart_zynq_serial_setbrg() [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/serial/ |
H A D | nvidia,tegra20-hsuart.yaml | 58 nvidia,adjust-baud-rates: 61 List of entries providing percentage of baud rate adjustment within a range. Each entry 62 contains a set of 3 values: range low/high and adjusted rate. When the baud rate set on the 63 controller falls within the range mentioned in this field, the baud rate will be adjusted by 68 Increase baud rate by 2% when set baud rate falls within range 9600 to 115200. 70 Standard UART devices are expected to have tolerance for baud rate error by -4 to +4 %. All 72 issue. UART RX baud rate tolerance level is 0% to +4% in 1-stop config. Otherwise, the 74 baud rate to be higher than the deviations observed in TX. 77 valid range and Tegra baud rate has to be set above actual TX baud rate observed. To do this 78 we use nvidia,adjust-baud-rates. [all …]
|
H A D | serial.yaml | 117 The maximum baud rate the device operates at. 121 baud rates. 126 The current baud rate the device operates at. 128 the baud rate of the slave device. 130 * device supports auto-baud 133 * device baud rate is configured by its firmware but there is no
|
/openbmc/linux/arch/mips/pic32/pic32mzda/ |
H A D | early_console.c | 50 static void __init configure_uart(int port, int baud) in configure_uart() argument 57 __raw_writel(((pbclk / baud) / 16) - 1, uart_base + U_BRG(port)); in configure_uart() 63 static void __init setup_early_console(int port, int baud) in setup_early_console() argument 69 configure_uart(console_port, baud); in setup_early_console() 111 int baud = -1; in get_baud_from_cmdline() local 124 baud = 0; in get_baud_from_cmdline() 126 baud = baud * 10 + *s++ - '0'; in get_baud_from_cmdline() 130 return baud; in get_baud_from_cmdline() 136 int baud, port; in fw_init_early_console() local 140 baud = get_baud_from_cmdline(arch_cmdline); in fw_init_early_console() [all …]
|
/openbmc/linux/arch/m68k/atari/ |
H A D | debug.c | 168 int baud = cflag & CBAUD; in atari_init_mfp_port() local 173 baud += B38400; in atari_init_mfp_port() 174 if (baud < B1200 || baud > B38400+2) in atari_init_mfp_port() 175 baud = B9600; /* use default 9600bps for non-implemented rates */ in atari_init_mfp_port() 176 baud -= B1200; /* baud_table[] starts at 1200bps */ in atari_init_mfp_port() 181 st_mfp.tim_dt_d = baud_table[baud]; in atari_init_mfp_port() 218 int baud = cflag & CBAUD; in atari_init_scc_port() local 222 baud += B38400; in atari_init_scc_port() 223 if (baud < B1200 || baud > B38400+2) in atari_init_scc_port() 224 baud = B9600; /* use default 9600bps for non-implemented rates */ in atari_init_scc_port() [all …]
|
/openbmc/linux/drivers/usb/serial/ |
H A D | pl2303.c | 570 * Returns the nearest supported baud rate that can be set directly without 573 static speed_t pl2303_get_supported_baud_rate(speed_t baud) in pl2303_get_supported_baud_rate() argument 584 if (baud_sup[i] > baud) in pl2303_get_supported_baud_rate() 589 baud = baud_sup[i - 1]; in pl2303_get_supported_baud_rate() 590 else if (i > 0 && (baud_sup[i] - baud) > (baud - baud_sup[i - 1])) in pl2303_get_supported_baud_rate() 591 baud = baud_sup[i - 1]; in pl2303_get_supported_baud_rate() 593 baud = baud_sup[i]; in pl2303_get_supported_baud_rate() 595 return baud; in pl2303_get_supported_baud_rate() 599 * NOTE: If unsupported baud rates are set directly, the PL2303 seems to 600 * use 9600 baud. [all …]
|
/openbmc/linux/arch/x86/boot/ |
H A D | early_serial_console.c | 26 static void early_serial_init(int port, int baud) in early_serial_init() argument 36 divisor = 115200 / baud; in early_serial_init() 48 int baud = DEFAULT_BAUD; in parse_earlyprintk() local 92 baud = simple_strtoull(arg + pos, &e, 0); in parse_earlyprintk() 93 if (baud == 0 || arg + pos == e) in parse_earlyprintk() 94 baud = DEFAULT_BAUD; in parse_earlyprintk() 98 early_serial_init(port, baud); in parse_earlyprintk() 120 int baud = DEFAULT_BAUD; in parse_console_uart8250() local 140 baud = simple_strtoull(options + 1, &options, 0); in parse_console_uart8250() 142 baud = probe_baud(port); in parse_console_uart8250() [all …]
|
/openbmc/linux/drivers/tty/serial/ |
H A D | suncore.c | 89 int baud, bits, stop, cflag; in sunserial_console_termios() local 121 baud = simple_strtoul(s, NULL, 0); in sunserial_console_termios() 131 switch (baud) { in sunserial_console_termios() 145 default: baud = 9600; cflag |= B9600; break; in sunserial_console_termios() 170 /* Sun serial MOUSE auto baud rate detection. */ 172 int baud; member 187 for (i = 0; mouse_baud_table[i].baud != -1; i++) in suncore_mouse_baud_cflag_next() 192 if (mouse_baud_table[i].baud == -1) in suncore_mouse_baud_cflag_next() 195 *new_baud = mouse_baud_table[i].baud; in suncore_mouse_baud_cflag_next() 201 /* Basically, when the baud rate is wrong the mouse spits out [all …]
|
H A D | 21285.c | 84 * BAUD_BASE / baud - 1 85 * However, typically BAUD_BASE is not divisible by baud, so 88 * int(BAUD_BASE / baud - 0.5) -> 89 * int(BAUD_BASE / baud - (baud >> 1) / baud) -> 90 * int((BAUD_BASE - (baud >> 1)) / baud) 228 unsigned int baud, quot, h_lcr, b; in serial21285_set_termios() local 244 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); in serial21285_set_termios() 245 quot = uart_get_divisor(port, baud); in serial21285_set_termios() 280 uart_update_timeout(port, termios->c_cflag, baud); in serial21285_set_termios() 400 serial21285_get_options(struct uart_port *port, int *baud, in serial21285_get_options() argument [all …]
|
H A D | xilinx_uartps.c | 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 202 unsigned int baud; member 377 * cdns_uart_calc_baud_divs - Calculate baud rate divisors 379 * @baud: Desired baud rate 383 * Return: baud rate, requested baud when possible, or actual baud when there 386 * Formula to obtain baud rate is 393 * baud rate generate register [all …]
|
H A D | vt8500_serial.c | 33 #define VT8500_URDIV 0x0008 /* Clock/Baud rate divisor */ 279 static int vt8500_set_baud_rate(struct uart_port *port, unsigned int baud) in vt8500_set_baud_rate() argument 287 div |= (uart_get_divisor(port, baud) - 1) & 0x3ff; in vt8500_set_baud_rate() 289 /* Effective baud rate */ in vt8500_set_baud_rate() 290 baud = port->uartclk / 16 / ((div & 0x3ff) + 1); in vt8500_set_baud_rate() 297 /* Break signal timing depends on baud rate, update accordingly */ in vt8500_set_baud_rate() 298 vt8500_write(port, mult_frac(baud, 4096, 1000000), VT8500_URBKR); in vt8500_set_baud_rate() 300 return baud; in vt8500_set_baud_rate() 342 unsigned int baud, lcr; in vt8500_set_termios() local 347 /* calculate and set baud rate */ in vt8500_set_termios() [all …]
|
H A D | ar933x_uart.c | 253 unsigned int baud, in ar933x_uart_get_scale_step() argument 263 min_diff = baud; in ar933x_uart_get_scale_step() 268 tstep = baud * (tscale + 1); in ar933x_uart_get_scale_step() 275 diff = abs(ar933x_uart_get_baud(clk, tscale, tstep) - baud); in ar933x_uart_get_scale_step() 292 unsigned int baud, scale, step; in ar933x_uart_set_termios() local 314 baud = uart_get_baud_rate(port, new, old, up->min_baud, up->max_baud); in ar933x_uart_set_termios() 315 ar933x_uart_get_scale_step(port->uartclk, baud, &scale, &step); in ar933x_uart_set_termios() 328 uart_update_timeout(port, new->c_cflag, baud); in ar933x_uart_set_termios() 358 tty_termios_encode_baud_rate(new, baud, baud); in ar933x_uart_set_termios() 665 int baud = 115200; in ar933x_uart_console_setup() local [all …]
|
H A D | sunsab.c | 10 * Fixed to use tty_get_baud_rate, and to allow for arbitrary baud 86 #define SAB82532_MAX_TEC_TIMEOUT 200000 /* 1 character time (at 50 baud) */ 87 #define SAB82532_MAX_CEC_TIMEOUT 50000 /* 2.5 TX CLKs (at 50 baud) */ 621 * transmitted at 9600 baud during shutdown (regardless of the in sunsab_shutdown() 638 * The formula is: Baud = SAB_BASE_BAUD / ((N + 1) * (1 << M)), 643 static void calc_ebrg(int baud, int *n_ret, int *m_ret) in calc_ebrg() argument 647 if (baud == 0) { in calc_ebrg() 658 n = (SAB_BASE_BAUD * 10) / baud; in calc_ebrg() 679 unsigned int iflag, unsigned int baud, in sunsab_convert_to_sab() argument 708 calc_ebrg(baud, &n, &m); in sunsab_convert_to_sab() [all …]
|
/openbmc/u-boot/include/ |
H A D | fsl_qe.h | 134 QE_BRG1, /* Baud Rate Generator 1 */ 135 QE_BRG2, /* Baud Rate Generator 2 */ 136 QE_BRG3, /* Baud Rate Generator 3 */ 137 QE_BRG4, /* Baud Rate Generator 4 */ 138 QE_BRG5, /* Baud Rate Generator 5 */ 139 QE_BRG6, /* Baud Rate Generator 6 */ 140 QE_BRG7, /* Baud Rate Generator 7 */ 141 QE_BRG8, /* Baud Rate Generator 8 */ 142 QE_BRG9, /* Baud Rate Generator 9 */ 143 QE_BRG10, /* Baud Rate Generator 10 */ [all …]
|
/openbmc/linux/drivers/net/hamradio/ |
H A D | baycom_ser_fdx.c | 15 * ser12: This is a very simple 1200 baud AFSK modem. The modem consists only 27 * hsk: This is a 4800 baud FSK modem, designed for TNC use. It works fine 37 * '#' denotes the baud rate / 100, eg. ser12* is '1200 baud, soft DCD' 39 * baud baud rate (between 300 and 4800) 115 unsigned int baud, baud_us, baud_arbdiv, baud_uartdiv, baud_dcdtimeout; member 388 if (bc->baud < 300 || bc->baud > 4800) { in ser12_open() 399 bc->hdrv.par.bitrate = bc->baud; in ser12_open() 400 bc->baud_us = 1000000/bc->baud; in ser12_open() 401 bc->baud_uartdiv = (115200/8)/bc->baud; in ser12_open() 416 * the baud rate is set to produce 100 ints/sec in ser12_open() [all …]
|
/openbmc/linux/arch/x86/kernel/ |
H A D | early_printk.c | 151 unsigned long baud = DEFAULT_BAUD; in early_serial_init() local 177 baud = simple_strtoull(s, &e, 0); in early_serial_init() 179 if (baud == 0 || s == e) in early_serial_init() 180 baud = DEFAULT_BAUD; in early_serial_init() 183 /* Convert from baud to divisor value */ in early_serial_init() 184 divisor = 115200 / baud; in early_serial_init() 213 * The rest of the param should be "[force],B:D.F,baud", where B, D & F describe 220 unsigned long baud = DEFAULT_BAUD; in early_pci_serial_init() local 255 /* A baud might be following */ in early_pci_serial_init() 308 if (kstrtoul(s, 0, &baud) < 0 || baud == 0) in early_pci_serial_init() [all …]
|
/openbmc/linux/drivers/tty/serial/8250/ |
H A D | 8250_mtk.c | 316 unsigned int baud, quot, fraction; in mtk8250_set_termios() local 332 * Store the requested baud rate before calling the generic 8250 in mtk8250_set_termios() 334 * no higher than (uartclk / 16) so the baud will be clamped if it in mtk8250_set_termios() 336 * higher than that, therefore we'll get original baud rate back in mtk8250_set_termios() 340 baud = tty_termios_baud_rate(termios); in mtk8250_set_termios() 344 tty_termios_encode_baud_rate(termios, baud, baud); in mtk8250_set_termios() 359 baud = uart_get_baud_rate(port, termios, old, in mtk8250_set_termios() 363 if (baud < 115200) { in mtk8250_set_termios() 365 quot = uart_get_divisor(port, baud); in mtk8250_set_termios() 368 quot = DIV_ROUND_UP(port->uartclk, 256 * baud); in mtk8250_set_termios() [all …]
|
H A D | 8250_bcm7271.c | 7 * optional features including the ability to use a baud rate clock 8 * mux for more accurate high speed baud rate selection and also 669 dev_err(dev, "Error selecting BAUD MUX clock for %u\n", in init_real_clk_rates() 679 static u32 find_quot(struct device *dev, u32 freq, u32 baud, u32 *percent) in find_quot() argument 688 quot = DIV_ROUND_CLOSEST(rate, baud); in find_quot() 694 hires_baud = (u64)baud * 10000; in find_quot() 702 *percent = (unsigned long)DIV_ROUND_CLOSEST_ULL(hires_err, baud); in find_quot() 704 dev_dbg(dev, "Baud rate: %u, MUX Clk: %u, Error: %u.%u%%\n", in find_quot() 705 baud, freq, *percent / 100, *percent % 100); in find_quot() 711 u32 baud) in set_clock_mux() argument [all …]
|
H A D | 8250_pericom.c | 51 static void pericom_do_set_divisor(struct uart_port *port, unsigned int baud, in pericom_do_set_divisor() argument 58 unsigned int divisor = max(maxrate / baud, 1U); in pericom_do_set_divisor() 59 int delta = maxrate / divisor - baud; in pericom_do_set_divisor() 61 if (baud > maxrate + baud / 50) in pericom_do_set_divisor() 64 if (delta > baud / 50) in pericom_do_set_divisor() 71 delta = maxrate / divisor - baud; in pericom_do_set_divisor() 72 if (abs(delta) < baud / 50) { in pericom_do_set_divisor()
|
/openbmc/linux/Documentation/misc-devices/ |
H A D | oxsemi-tornado.rst | 10 The baud rate produced by the baud generator is obtained from this input 16 determine the actual baud rate used. Baud rates from 15625000bps down 23 used for the divisor to obtain the requested baud rates by software that 41 Here are the figures for the standard and some non-standard baud rates 88 With the baud base set to 15625000 and the unsigned 16-bit UART_DIV_MAX 89 limitation imposed by ``serial8250_get_baud_rate`` standard baud rates 91 200bps requires the baud base to be divided by 78125 and that is beyond 108 the baud rate of 38400bps. Note that the value of 0 in TCR sets the 115 respectively. These parameters will set the baud rate for the serial
|
/openbmc/linux/drivers/clk/at91/ |
H A D | sama7g5.c | 44 * @PLL_ID_BAUD: Baud PLL identifier 598 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, 606 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, 614 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, 622 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, 630 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, 638 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, 646 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, 654 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, 662 .pp = { PLL_IDS_TO_ARR_ENTRY(SYS, DIV0), PLL_IDS_TO_ARR_ENTRY(BAUD, DIV0), }, [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/sound/ |
H A D | serial-midi.yaml | 19 Can only be set to use standard baud rates corresponding to supported rates of the 20 parent serial device. If the standard MIDI baud of 31.25 kBaud is needed 22 configure the clocks of the parent serial device so that a requested baud of 38.4 kBaud 23 results in the standard MIDI baud rate, and set the 'current-speed' property to 38400 (default)
|
/openbmc/linux/drivers/tty/ |
H A D | tty_baudrate.c | 15 * Routine which returns the baud rate of the tty 50 * Convert termios baud rate data into a speed. This should be called 80 * Convert termios baud rate data into a speed. This should be called 163 * Our goal is to find a close match to the standard baud rate in tty_termios_encode_baud_rate() 164 * returned. Walk the baud rate table and if we get a very close in tty_termios_encode_baud_rate() 201 * tty_encode_baud_rate - set baud rate of the tty 203 * @ibaud: input baud rate 204 * @obaud: output baud rate
|
/openbmc/linux/arch/mips/sni/ |
H A D | setup.c | 63 char *baud; in sni_console_setup() local 74 baud = prom_getenv("lbaud"); in sni_console_setup() 78 baud = prom_getenv("rbaud"); in sni_console_setup() 81 if (baud) in sni_console_setup() 82 strcpy(options, baud); in sni_console_setup() 85 baud ? options : NULL); in sni_console_setup() 88 baud ? options : NULL); in sni_console_setup()
|