| 1 | /* |
| 2 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | * |
| 4 | * Goldfish TTY |
| 5 | * |
| 6 | * (c) 2020 Laurent Vivier <laurent@vivier.eu> |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | #ifndef HW_CHAR_GOLDFISH_TTY_H |
| 11 | #define HW_CHAR_GOLDFISH_TTY_H |
| 12 | |
| 13 | #include "qemu/fifo8.h" |
| 14 | #include "chardev/char-fe.h" |
| 15 | #include "hw/core/sysbus.h" |
| 16 | |
| 17 | #define TYPE_GOLDFISH_TTY "goldfish_tty" |
| 18 | OBJECT_DECLARE_SIMPLE_TYPE(GoldfishTTYState, GOLDFISH_TTY) |
| 19 | |
| 20 | #define GOLFISH_TTY_BUFFER_SIZE 128 |
| 21 | |
| 22 | struct GoldfishTTYState { |
| 23 | SysBusDevice parent_obj; |
| 24 | |
| 25 | MemoryRegion iomem; |
| 26 | qemu_irq irq; |
| 27 | CharFrontend chr; |
| 28 | |
| 29 | uint32_t data_len; |
| 30 | uint64_t data_ptr; |
| 31 | bool int_enabled; |
| 32 | |
| 33 | Fifo8 rx_fifo; |
| 34 | }; |
| 35 | |
| 36 | #endif |