apbuart.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* GRLIB APBUART definitions
  2. *
  3. * (C) Copyright 2010, 2015
  4. * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef __GRLIB_APBUART_H__
  9. #define __GRLIB_APBUART_H__
  10. /* APBUART Register map */
  11. typedef struct {
  12. volatile unsigned int data;
  13. volatile unsigned int status;
  14. volatile unsigned int ctrl;
  15. volatile unsigned int scaler;
  16. } ambapp_dev_apbuart;
  17. /*
  18. * The following defines the bits in the LEON UART Status Registers.
  19. */
  20. #define APBUART_STATUS_DR 0x00000001 /* Data Ready */
  21. #define APBUART_STATUS_TSE 0x00000002 /* TX Send Register Empty */
  22. #define APBUART_STATUS_THE 0x00000004 /* TX Hold Register Empty */
  23. #define APBUART_STATUS_BR 0x00000008 /* Break Error */
  24. #define APBUART_STATUS_OE 0x00000010 /* RX Overrun Error */
  25. #define APBUART_STATUS_PE 0x00000020 /* RX Parity Error */
  26. #define APBUART_STATUS_FE 0x00000040 /* RX Framing Error */
  27. #define APBUART_STATUS_ERR 0x00000078 /* Error Mask */
  28. /*
  29. * The following defines the bits in the LEON UART Ctrl Registers.
  30. */
  31. #define APBUART_CTRL_RE 0x00000001 /* Receiver enable */
  32. #define APBUART_CTRL_TE 0x00000002 /* Transmitter enable */
  33. #define APBUART_CTRL_RI 0x00000004 /* Receiver interrupt enable */
  34. #define APBUART_CTRL_TI 0x00000008 /* Transmitter interrupt enable */
  35. #define APBUART_CTRL_PS 0x00000010 /* Parity select */
  36. #define APBUART_CTRL_PE 0x00000020 /* Parity enable */
  37. #define APBUART_CTRL_FL 0x00000040 /* Flow control enable */
  38. #define APBUART_CTRL_LB 0x00000080 /* Loop Back enable */
  39. #define APBUART_CTRL_DBG (1<<11) /* Debug Bit used by GRMON */
  40. #endif