xref: /openbmc/qemu/include/hw/char/bcm2835_aux.h (revision 8fa3b702)
1 /*
2  * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
3  * Written by Andrew Baumann
4  *
5  * This work is licensed under the terms of the GNU GPL, version 2 or later.
6  * See the COPYING file in the top-level directory.
7  */
8 
9 #ifndef BCM2835_AUX_H
10 #define BCM2835_AUX_H
11 
12 #include "hw/sysbus.h"
13 #include "chardev/char-fe.h"
14 #include "qom/object.h"
15 
16 #define TYPE_BCM2835_AUX "bcm2835-aux"
17 typedef struct BCM2835AuxState BCM2835AuxState;
18 DECLARE_INSTANCE_CHECKER(BCM2835AuxState, BCM2835_AUX,
19                          TYPE_BCM2835_AUX)
20 
21 #define BCM2835_AUX_RX_FIFO_LEN 8
22 
23 struct BCM2835AuxState {
24     /*< private >*/
25     SysBusDevice parent_obj;
26     /*< public >*/
27 
28     MemoryRegion iomem;
29     CharBackend chr;
30     qemu_irq irq;
31 
32     uint8_t read_fifo[BCM2835_AUX_RX_FIFO_LEN];
33     uint8_t read_pos, read_count;
34     uint8_t ier, iir;
35 };
36 
37 #endif
38