cmsdk-apb-uart.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * ARM CMSDK APB UART emulation
  3. *
  4. * Copyright (c) 2017 Linaro Limited
  5. * Written by Peter Maydell
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 or
  9. * (at your option) any later version.
  10. */
  11. #ifndef CMSDK_APB_UART_H
  12. #define CMSDK_APB_UART_H
  13. #include "hw/sysbus.h"
  14. #include "chardev/char-fe.h"
  15. #include "qom/object.h"
  16. #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart"
  17. OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBUART, CMSDK_APB_UART)
  18. struct CMSDKAPBUART {
  19. /*< private >*/
  20. SysBusDevice parent_obj;
  21. /*< public >*/
  22. MemoryRegion iomem;
  23. CharBackend chr;
  24. qemu_irq txint;
  25. qemu_irq rxint;
  26. qemu_irq txovrint;
  27. qemu_irq rxovrint;
  28. qemu_irq uartint;
  29. guint watch_tag;
  30. uint32_t pclk_frq;
  31. uint32_t state;
  32. uint32_t ctrl;
  33. uint32_t intstatus;
  34. uint32_t bauddiv;
  35. /* This UART has no FIFO, only a 1-character buffer for each of Tx and Rx */
  36. uint8_t txbuf;
  37. uint8_t rxbuf;
  38. };
  39. #endif