renesas_sci.h 943 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Renesas Serial Communication Interface
  3. *
  4. * Copyright (c) 2018 Yoshinori Sato
  5. *
  6. * SPDX-License-Identifier: GPL-2.0-or-later
  7. */
  8. #ifndef HW_CHAR_RENESAS_SCI_H
  9. #define HW_CHAR_RENESAS_SCI_H
  10. #include "chardev/char-fe.h"
  11. #include "hw/sysbus.h"
  12. #include "qom/object.h"
  13. #define TYPE_RENESAS_SCI "renesas-sci"
  14. typedef struct RSCIState RSCIState;
  15. DECLARE_INSTANCE_CHECKER(RSCIState, RSCI,
  16. TYPE_RENESAS_SCI)
  17. enum {
  18. ERI = 0,
  19. RXI = 1,
  20. TXI = 2,
  21. TEI = 3,
  22. SCI_NR_IRQ = 4
  23. };
  24. struct RSCIState {
  25. /*< private >*/
  26. SysBusDevice parent_obj;
  27. /*< public >*/
  28. MemoryRegion memory;
  29. QEMUTimer timer;
  30. CharBackend chr;
  31. qemu_irq irq[SCI_NR_IRQ];
  32. uint8_t smr;
  33. uint8_t brr;
  34. uint8_t scr;
  35. uint8_t tdr;
  36. uint8_t ssr;
  37. uint8_t rdr;
  38. uint8_t scmr;
  39. uint8_t semr;
  40. uint8_t read_ssr;
  41. int64_t trtime;
  42. int64_t rx_next;
  43. uint64_t input_freq;
  44. };
  45. #endif