Lines Matching refs:ofs
104 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_config_rs485() local
111 stm32_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); in stm32_config_rs485()
118 cr1 = readl_relaxed(port->membase + ofs->cr1); in stm32_config_rs485()
119 cr3 = readl_relaxed(port->membase + ofs->cr3); in stm32_config_rs485()
120 usartdiv = readl_relaxed(port->membase + ofs->brr); in stm32_config_rs485()
141 writel_relaxed(cr3, port->membase + ofs->cr3); in stm32_config_rs485()
142 writel_relaxed(cr1, port->membase + ofs->cr1); in stm32_config_rs485()
144 stm32_clr_bits(port, ofs->cr3, USART_CR3_DEM | USART_CR3_DEP); in stm32_config_rs485()
145 stm32_clr_bits(port, ofs->cr1, in stm32_config_rs485()
149 stm32_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); in stm32_config_rs485()
176 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_pending_rx() local
180 *sr = readl_relaxed(port->membase + ofs->isr); in stm32_pending_rx()
201 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_get_char() local
210 return readl_relaxed(port->membase + ofs->rdr); in stm32_get_char()
218 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_receive_chars() local
238 if (ofs->icr != UNDEF_REG) in stm32_receive_chars()
241 ofs->icr); in stm32_receive_chars()
273 struct stm32_usart_offsets *ofs = &stm32port->info->ofs; in stm32_tx_dma_complete() local
277 ret = readl_relaxed_poll_timeout_atomic(port->membase + ofs->isr, in stm32_tx_dma_complete()
285 if (ofs->icr == UNDEF_REG) in stm32_tx_dma_complete()
286 stm32_clr_bits(port, ofs->isr, USART_SR_TC); in stm32_tx_dma_complete()
288 stm32_set_bits(port, ofs->icr, USART_CR_TC); in stm32_tx_dma_complete()
290 stm32_clr_bits(port, ofs->cr3, USART_CR3_DMAT); in stm32_tx_dma_complete()
300 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_transmit_chars_pio() local
306 stm32_clr_bits(port, ofs->cr3, USART_CR3_DMAT); in stm32_transmit_chars_pio()
310 ret = readl_relaxed_poll_timeout_atomic(port->membase + ofs->isr, in stm32_transmit_chars_pio()
318 stm32_set_bits(port, ofs->cr1, USART_CR1_TXEIE); in stm32_transmit_chars_pio()
320 writel_relaxed(xmit->buf[xmit->tail], port->membase + ofs->tdr); in stm32_transmit_chars_pio()
328 struct stm32_usart_offsets *ofs = &stm32port->info->ofs; in stm32_transmit_chars_dma() local
380 stm32_clr_bits(port, ofs->isr, USART_SR_TC); in stm32_transmit_chars_dma()
381 stm32_set_bits(port, ofs->cr3, USART_CR3_DMAT); in stm32_transmit_chars_dma()
390 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_transmit_chars() local
395 stm32_clr_bits(port, ofs->cr3, USART_CR3_DMAT); in stm32_transmit_chars()
396 writel_relaxed(port->x_char, port->membase + ofs->tdr); in stm32_transmit_chars()
400 stm32_set_bits(port, ofs->cr3, USART_CR3_DMAT); in stm32_transmit_chars()
430 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_interrupt() local
435 sr = readl_relaxed(port->membase + ofs->isr); in stm32_interrupt()
437 if ((sr & USART_SR_WUF) && (ofs->icr != UNDEF_REG)) in stm32_interrupt()
439 port->membase + ofs->icr); in stm32_interrupt()
473 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_tx_empty() local
475 return readl_relaxed(port->membase + ofs->isr) & USART_SR_TXE; in stm32_tx_empty()
481 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_set_mctrl() local
484 stm32_set_bits(port, ofs->cr3, USART_CR3_RTSE); in stm32_set_mctrl()
486 stm32_clr_bits(port, ofs->cr3, USART_CR3_RTSE); in stm32_set_mctrl()
499 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_stop_tx() local
501 stm32_clr_bits(port, ofs->cr1, USART_CR1_TXEIE); in stm32_stop_tx()
519 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_throttle() local
523 stm32_clr_bits(port, ofs->cr1, USART_CR1_RXNEIE); in stm32_throttle()
531 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_unthrottle() local
535 stm32_set_bits(port, ofs->cr1, USART_CR1_RXNEIE); in stm32_unthrottle()
543 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_stop_rx() local
545 stm32_clr_bits(port, ofs->cr1, USART_CR1_RXNEIE); in stm32_stop_rx()
556 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_startup() local
580 stm32_set_bits(port, ofs->cr1, val); in stm32_startup()
588 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_shutdown() local
596 stm32_clr_bits(port, ofs->cr1, val); in stm32_shutdown()
606 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_set_termios() local
623 writel_relaxed(0, port->membase + ofs->cr1); in stm32_set_termios()
665 stm32_set_bits(port, ofs->cr1, USART_CR1_OVER8); in stm32_set_termios()
669 stm32_clr_bits(port, ofs->cr1, USART_CR1_OVER8); in stm32_set_termios()
674 writel_relaxed(mantissa | fraction, port->membase + ofs->brr); in stm32_set_termios()
722 writel_relaxed(cr3, port->membase + ofs->cr3); in stm32_set_termios()
723 writel_relaxed(cr2, port->membase + ofs->cr2); in stm32_set_termios()
724 writel_relaxed(cr1, port->membase + ofs->cr1); in stm32_set_termios()
726 stm32_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); in stm32_set_termios()
762 struct stm32_usart_offsets *ofs = &stm32port->info->ofs; in stm32_pm() local
772 stm32_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); in stm32_pm()
883 struct stm32_usart_offsets *ofs = &stm32port->info->ofs; in stm32_of_dma_rx_probe() local
907 config.src_addr = port->mapbase + ofs->rdr; in stm32_of_dma_rx_probe()
955 struct stm32_usart_offsets *ofs = &stm32port->info->ofs; in stm32_of_dma_tx_probe() local
979 config.dst_addr = port->mapbase + ofs->tdr; in stm32_of_dma_tx_probe()
1059 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_serial_remove() local
1062 stm32_clr_bits(port, ofs->cr3, USART_CR3_DMAR); in stm32_serial_remove()
1072 stm32_clr_bits(port, ofs->cr3, USART_CR3_DMAT); in stm32_serial_remove()
1095 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_console_putchar() local
1097 while (!(readl_relaxed(port->membase + ofs->isr) & USART_SR_TXE)) in stm32_console_putchar()
1100 writel_relaxed(ch, port->membase + ofs->tdr); in stm32_console_putchar()
1107 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_console_write() local
1122 old_cr1 = readl_relaxed(port->membase + ofs->cr1); in stm32_console_write()
1125 writel_relaxed(new_cr1, port->membase + ofs->cr1); in stm32_console_write()
1130 writel_relaxed(old_cr1, port->membase + ofs->cr1); in stm32_console_write()
1194 struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; in stm32_serial_enable_wakeup() local
1202 stm32_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); in stm32_serial_enable_wakeup()
1203 stm32_set_bits(port, ofs->cr1, USART_CR1_UESM); in stm32_serial_enable_wakeup()
1204 val = readl_relaxed(port->membase + ofs->cr3); in stm32_serial_enable_wakeup()
1208 writel_relaxed(val, port->membase + ofs->cr3); in stm32_serial_enable_wakeup()
1209 stm32_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); in stm32_serial_enable_wakeup()
1211 stm32_clr_bits(port, ofs->cr1, USART_CR1_UESM); in stm32_serial_enable_wakeup()