xref: /openbmc/qemu/include/hw/char/bcm2835_aux.h (revision 64547a3b)
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 
15 #define TYPE_BCM2835_AUX "bcm2835-aux"
16 #define BCM2835_AUX(obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835_AUX)
17 
18 #define BCM2835_AUX_RX_FIFO_LEN 8
19 
20 typedef struct {
21     /*< private >*/
22     SysBusDevice parent_obj;
23     /*< public >*/
24 
25     MemoryRegion iomem;
26     CharBackend chr;
27     qemu_irq irq;
28 
29     uint8_t read_fifo[BCM2835_AUX_RX_FIFO_LEN];
30     uint8_t read_pos, read_count;
31     uint8_t ier, iir;
32 } BCM2835AuxState;
33 
34 #endif
35