Merge tag 'v9.0.0-rc3'
[qemu/ar7.git] / include / hw / usb / bcm2835_usb.h
blob5fa648bbda74baa453d0a387235c83ba935b2836
1 /*
2 * Raspberry Pi emulation (c) 2012 Gregory Estrade
3 * This code is licensed under the GNU GPLv2 and later.
4 */
6 #ifndef BCM2835_USB_H
7 #define BCM2835_USB_H
9 #include "qemu/timer.h"
10 #include "hw/sysbus.h"
11 #include "hw/usb.h"
13 #define BCM2835_USB_HCHANS 8
15 #define TYPE_BCM2835_USB "bcm2835_usb"
16 #define BCM2835_USB(obj) \
17 OBJECT_CHECK(BCM2835UsbState, (obj), TYPE_BCM2835_USB)
19 typedef struct BCM2835UsbState BCM2835UsbState;
21 typedef struct {
22 BCM2835UsbState *parent;
23 int index;
25 uint32_t hcchar;
26 uint32_t hcsplt;
27 uint32_t hcint;
28 uint32_t hcintmsk;
29 uint32_t hctsiz;
30 uint32_t hcdma;
31 uint32_t reserved;
32 uint32_t hcdmab;
34 USBPacket packet;
35 uint8_t buffer[8192];
36 } BCM2835UsbHcState;
38 struct BCM2835UsbState {
39 SysBusDevice busdev;
40 MemoryRegion iomem;
41 MemoryRegion *dma_mr;
42 AddressSpace dma_as;
44 USBBus bus;
45 USBPort port;
46 int attached;
47 int reset_done;
48 QEMUTimer *sof_timer;
50 uint32_t gusbcfg;
51 uint32_t hptxfsiz;
52 uint32_t hcfg;
53 uint32_t dcfg;
54 uint32_t grxfsiz;
55 uint32_t gnptxfsiz;
56 uint32_t dtxfsiz[15];
57 uint32_t gahbcfg;
58 uint32_t grstctl;
59 uint32_t gotgctl;
60 uint32_t gotgint;
61 uint32_t gintsts;
62 uint32_t gintmsk;
63 uint32_t gdfifocfg;
64 uint32_t hprt0;
65 uint32_t haint;
66 uint32_t haintmsk;
67 uint32_t gnptxsts;
68 uint32_t hfnum;
69 uint32_t hptxsts;
70 uint32_t guid;
72 BCM2835UsbHcState hchan[BCM2835_USB_HCHANS];
74 qemu_irq irq;
77 #endif