8250_dwlib.h 921 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /* Synopsys DesignWare 8250 library header file. */
  3. #include <linux/io.h>
  4. #include <linux/types.h>
  5. #include "8250.h"
  6. struct dw8250_port_data {
  7. /* Port properties */
  8. int line;
  9. /* DMA operations */
  10. struct uart_8250_dma dma;
  11. /* Hardware configuration */
  12. u32 cpr_value;
  13. u8 dlf_size;
  14. /* RS485 variables */
  15. bool hw_rs485_support;
  16. };
  17. void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, const struct ktermios *old);
  18. void dw8250_setup_port(struct uart_port *p);
  19. static inline u32 dw8250_readl_ext(struct uart_port *p, int offset)
  20. {
  21. if (p->iotype == UPIO_MEM32BE)
  22. return ioread32be(p->membase + offset);
  23. return readl(p->membase + offset);
  24. }
  25. static inline void dw8250_writel_ext(struct uart_port *p, int offset, u32 reg)
  26. {
  27. if (p->iotype == UPIO_MEM32BE)
  28. iowrite32be(reg, p->membase + offset);
  29. else
  30. writel(reg, p->membase + offset);
  31. }