add defines for VC4 mbox communication
[AROS.git] / arch / arm-native / soc / broadcom / 2708 / usb / usb2otg / usb2otg_intern.h
blob41a6cb6398882b4306a85988435d061c05cfc2ff
1 #ifndef USB2OTG_INTERN_H
2 #define USB2OTG_INTERN_H
3 /*
4 Copyright � 2013-2015, The AROS Development Team. All rights reserved.
5 $Id$
6 */
8 #include LC_LIBDEFS_FILE
10 #include <aros/libcall.h>
11 #include <aros/asmcall.h>
12 #include <aros/symbolsets.h>
14 #include <exec/types.h>
15 #include <exec/lists.h>
16 #include <exec/memory.h>
17 #include <exec/libraries.h>
18 #include <exec/interrupts.h>
19 #include <exec/semaphores.h>
20 #include <exec/execbase.h>
21 #include <exec/devices.h>
22 #include <exec/io.h>
23 #include <exec/ports.h>
24 #include <exec/errors.h>
25 #include <exec/resident.h>
26 #include <exec/initializers.h>
27 #include <dos/dos.h>
29 #include <devices/timer.h>
30 #include <utility/utility.h>
32 #include <devices/usbhardware.h>
33 #include <devices/newstyle.h>
35 #include <oop/oop.h>
37 extern IPTR __arm_periiobase;
38 #define ARM_PERIIOBASE __arm_periiobase
39 #include <hardware/bcm2708.h>
40 #include <hardware/usb2otg.h>
43 Force the USB chipset to run in Host mode
44 AFAIK Poseidon doesnt support device mode? - TODO
46 //#define OTG_FORCEHOSTMODE
47 //#define OTG_FORCEDEVICEMODE
49 /* Reply the iorequest with success */
50 #define RC_OK 0
52 /* Magic cookie, don't set error fields & don't reply the ioreq */
53 #define RC_DONTREPLY -1
55 #define MAX_ROOT_PORTS 16
57 #define VCMB_PROPCHAN 8
58 #define VCPOWER_USBHCD 3
59 #define VCPOWER_STATE_ON 1
60 #define VCPOWER_STATE_WAIT 2
62 struct USBNSDeviceQueryResult
64 ULONG DevQueryFormat;
65 ULONG SizeAvailable;
66 UWORD DeviceType;
67 UWORD DeviceSubType;
68 const UWORD *SupportedCommands; /* 0 terminated list of cmd's */
71 struct USB2OTGUnit
73 struct Unit hu_Unit;
75 struct List hu_IOPendingQueue; /* Root Hub Pending IO Requests */
77 struct List hu_TDQueue;
78 struct List hu_PeriodicTDQueue;
79 struct List hu_CtrlXFerQueue;
80 struct List hu_IntXFerQueue;
81 struct List hu_IsoXFerQueue;
82 struct List hu_BulkXFerQueue;
84 struct List hu_AbortQueue;
86 APTR hu_GlobalIRQHandle;
87 struct Interrupt hu_PendingInt;
88 struct Interrupt hu_NakTimeoutInt;
89 struct timerequest hu_NakTimeoutReq;
90 struct MsgPort hu_NakTimeoutMsgPort;
92 UBYTE hu_OperatingMode; /* HOST/DEVICE mode */
93 UBYTE hu_HubAddr;
94 UBYTE hu_HostChans;
95 UBYTE hu_DevEPs;
96 UBYTE hu_DevInEPs;
98 BOOL hu_UnitAllocated; /* unit opened */
99 BOOL hu_HubPortChanged; /* Root port state change */
102 /* PRIVATE device node */
103 struct USB2OTGDevice
105 struct Library hd_Library; /* standard */
106 UWORD hd_Flags; /* various flags */
108 APTR hd_KernelBase; /* kernel.resource base */
109 APTR hd_UtilityBase; /* for tags etc */
111 APTR hd_MemPool; /* memory pool */
113 struct USB2OTGUnit *hd_Unit; /* we only currently support a single unit.. */
115 struct MsgPort *hd_MsgPort;
116 struct timerequest *hd_TimerReq; /* Timer I/O Requests */
120 #define FNAME_DEV(x) USB2OTG__Dev__ ## x
121 #define FNAME_ROOTHUB(x) USB2OTG__RootHub__ ## x
123 #ifdef UtilityBase
124 #undef UtilityBase
125 #endif
127 #ifdef KernelBase
128 #undef KernelBase
129 #endif
131 #define UtilityBase USB2OTGBase->hd_UtilityBase
133 #define KernelBase USB2OTGBase->hd_KernelBase
135 struct Unit *FNAME_DEV(OpenUnit)(struct IOUsbHWReq *, LONG, struct USB2OTGDevice *);
136 void FNAME_DEV(CloseUnit)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
138 void FNAME_DEV(TermIO)(struct IOUsbHWReq *, struct USB2OTGDevice *);
140 WORD FNAME_DEV(cmdNSDeviceQuery)(struct IOStdReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
141 WORD FNAME_DEV(cmdQueryDevice)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
143 WORD FNAME_DEV(cmdReset)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
144 WORD FNAME_DEV(cmdFlush)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
146 WORD FNAME_DEV(cmdUsbReset)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
147 WORD FNAME_DEV(cmdUsbResume)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
148 WORD FNAME_DEV(cmdUsbSuspend)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
149 WORD FNAME_DEV(cmdUsbOper)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
150 WORD FNAME_DEV(cmdControlXFer)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
151 WORD FNAME_DEV(cmdBulkXFer)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
152 WORD FNAME_DEV(cmdIntXFer)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
153 WORD FNAME_DEV(cmdIsoXFer)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
155 void FNAME_DEV(Cause)(struct USB2OTGDevice *, struct Interrupt *);
157 WORD FNAME_ROOTHUB(cmdControlXFer)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
158 WORD FNAME_ROOTHUB(cmdIntXFer)(struct IOUsbHWReq *, struct USB2OTGUnit *, struct USB2OTGDevice *);
159 void FNAME_ROOTHUB(PendingIO)(struct USB2OTGUnit *);
161 #endif /* USB2OTG_INTERN_H */