PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
iop_mmio_hwport.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __IOP_MMIO_HWPORT__
17#define __IOP_MMIO_HWPORT__
18
19typedef struct dmac_channel_
20{
21 vu32 madr;
22 vu32 bcr;
23 vu32 chcr;
24 vu32 tadr;
26
27typedef struct dmac1_mmio_hwport_
28{
29 dmac_channel_t oldch[7];
30 vu32 dpcr1;
31 vu32 dicr1;
33
34typedef struct dmac2_mmio_hwport_
35{
36 dmac_channel_t newch[6];
37 dmac_channel_t new_unusedch;
38 vu32 dpcr2;
39 vu32 dicr2;
40 vu32 dmacen;
41 vu32 dmacinten;
43
44typedef struct dmac_channel3_
45{
46 vu32 madr;
47 vu32 dlen;
48 vu32 slice;
49 vu32 chcr;
50 vu32 rtar;
51 vu32 DmarReadStart;
52 vu32 DmarReadEnd;
54
55typedef struct dmac3_mmio_hwport_
56{
57 dmac_channel3_t dmac_channel3_0;
58 u8 unused_1c[0x4];
59 dmac_channel3_t dmac_channel3_1;
60 u8 unused_3c[0x4];
61 dmac_channel3_t dmac_channel3_2;
62 vu32 DmarWriteStart;
63 vu32 DmarWriteEnd;
64 u8 unused_64[0x1C];
66
67typedef struct ssbus1_mmio_hwport_
68{
69 vu32 ind_0_address;
70 vu32 ind_8_address;
71 vu32 ind_0_delay;
72 vu32 ind_1_delay;
73 vu32 ind_2_delay;
74 vu32 ind_4_delay;
75 vu32 ind_5_delay;
76 vu32 ind_8_delay;
77 vu32 common_delay;
79
80typedef struct ssbus2_mmio_hwport_
81{
82 vu32 ind_1_address;
83 vu32 ind_4_address;
84 vu32 ind_5_address;
85 vu32 ind_9_address;
86 vu32 ind_B_address;
87 vu32 ind_9_delay;
88 vu32 ind_A_delay;
89 vu32 ind_B_delay;
90 vu32 ind_C_delay;
92
93typedef struct sio0_1_mmio_hwport_
94{
95 vu32 data;
96 vu32 stat;
97 vu16 mode;
98 vu16 ctrl;
99 vu16 misc;
100 vu16 baud;
102
103typedef struct sio2_mmio_hwport_
104{
105 vu8 send3_buf[0x40];
106 vu8 send1_2_buf[0x20];
107 vu32 out_fifo; /* PCSX2 says in */
108 vu32 in_fifo; /* PCSX2 says out */
109 vu32 ctrl;
110 vu32 recv1;
111 vu32 recv2;
112 vu32 recv3;
113 vu32 unk_78;
114 vu32 unk_7c;
115 vu32 stat;
116 u8 unused[0x7c];
118
119typedef struct usb_mmio_hwport_
120{
121 vu32 HcRevision;
122 vu32 HcControl;
123 vu32 HcCommandStatus;
124 vu32 HcInterruptStatus;
125 vu32 HcInterruptEnable;
126 vu32 HcInterruptDisable;
127 vu32 HcHCCA;
128 vu32 HcPeriodCurrentEd;
129 vu32 HcControlHeadEd;
130 vu32 HcControlCurrentEd;
131 vu32 HcBulkHeadEd;
132 vu32 HcBulkCurrentEd;
133 vu32 HcDoneHead;
134 vu32 HcFmInterval;
135 vu32 HcFmRemaining;
136 vu32 HcFmNumber;
137 vu32 HcPeriodicStart;
138 vu32 HcLsThreshold;
139 vu32 HcRhDescriptorA;
140 vu32 HcRhDescriptorB;
141 vu32 HcRhStatus;
142 vu32 HcRhPortStatus[2]; /* PCSX2 says 15 or 11 */
143 u8 unused[0xa4];
145
147{
148 vu32 NodeID;
149 vu32 CycleTime;
150
151 vu32 ctrl0;
152 vu32 ctrl1;
153 vu32 ctrl2;
154
155 vu32 PHYAccess;
156
157 vu32 UnknownRegister18;
158 vu32 UnknownRegister1C;
159
160 vu32 intr0;
161 vu32 intr0Mask;
162
163 vu32 intr1;
164 vu32 intr1Mask;
165
166 vu32 intr2;
167 vu32 intr2Mask;
168
169 vu32 dmar;
170 vu32 ack_status;
171 vu32 ubufTransmitNext;
172 vu32 ubufTransmitLast;
173 vu32 ubufTransmitClear;
174 vu32 ubufReceiveClear;
175 vu32 ubufReceive;
176 vu32 ubufReceiveLevel;
177
178 vu32 unmapped1[0x06];
179
180 vu32 UnknownRegister70;
181 vu32 UnknownRegister74;
182 vu32 UnknownRegister78;
183 vu32 UnknownRegister7C;
184
185 vu32 PHT_ctrl_ST_R0;
186 vu32 PHT_split_TO_R0;
187 vu32 PHT_ReqResHdr0_R0;
188 vu32 PHT_ReqResHdr1_R0;
189 vu32 PHT_ReqResHdr2_R0;
190
191 vu32 STRxNIDSel0_R0;
192 vu32 STRxNIDSel1_R0;
193
194 vu32 STRxHDR_R0;
195 vu32 STTxHDR_R0;
196
197 vu32 DTransCTRL0;
198 vu32 CIPHdrTx0_R0;
199 vu32 CIPHdrTx1_R0;
200
201 vu32 padding4;
202 vu32 STTxTimeStampOffs_R0;
203
204 vu32 dmaCtrlSR0;
205 vu32 dmaTransTRSH0;
206 vu32 dbufFIFO_lvlR0;
207 vu32 dbufTxDataR0;
208 vu32 dbufRxDataR0;
209
210 vu32 dbufWatermarksR0;
211 vu32 dbufFIFOSzR0;
212
213 vu32 unmapped2[0x0B];
214
215 vu32 PHT_ctrl_ST_R1;
216 vu32 PHT_split_TO_R1;
217 vu32 PHT_ReqResHdr0_R1;
218 vu32 PHT_ReqResHdr1_R1;
219 vu32 PHT_ReqResHdr2_R1;
220
221 vu32 STRxNIDSel0_R1;
222 vu32 STRxNIDSel1_R1;
223
224 vu32 STRxHDR_R1;
225 vu32 STTxHDR_R1;
226
227 vu32 DTransCTRL1;
228 vu32 CIPHdrTx0_R1;
229 vu32 CIPHdrTx1_R1;
230
231 vu32 padding5;
232 vu32 STTxTimeStampOffs_R1;
233
234 vu32 dmaCtrlSR1;
235 vu32 dmaTransTRSH1;
236 vu32 dbufFIFO_lvlR1;
237 vu32 dbufTxDataR1;
238 vu32 dbufRxDataR1;
239
240 vu32 dbufWatermarksR1;
241 vu32 dbufFIFOSzR1;
243
245{
246 vu32 count;
247 vu32 mode;
248 vu32 target;
249 vu32 unused_c;
251
252typedef struct iop_mmio_hwport_ /* base -> 0xBF800000 */
253{
254 u8 scratchpad_cache0[0x400];
255 u8 scratchpad_cache1[0x400];
256 u8 unv_0800[0x800];
257 ssbus1_mmio_hwport_t ssbus1; /* 0x1000 */
258 u8 unv_1024[0x1c];
261 vu32 iop_ram_size;
262 u8 unv_1064[0xC];
263 vu32 istat;
264 vu32 imask;
265 vu32 iop_sbus_info;
266 vu32 unk_107c;
267 dmac1_mmio_hwport_t dmac1; /* 0x1080 */
268 u8 unv_10f8[0x8];
269 iop_counter_mmio_hwport_t counter1[3]; /* 0x1100 */
270 u8 unv_1130[0x2d0];
271 ssbus2_mmio_hwport_t ssbus2; /* 0x1400 */
272 u8 unv_1424[0x2c];
273 vu32 iop_sbus_ctrl[2]; /* 0x1450 */
274 u8 unk_1458[0x8];
275 u8 dev9c[0x20];
276 iop_counter_mmio_hwport_t counter2[3]; /* 0x1480 */
277 u8 unk_14b0[0x10];
278 vu32 rtc_holdmode;
279 u8 unk_14c4[0x3c];
280 dmac2_mmio_hwport_t dmac2; /* 0x1500 */
281 dmac3_mmio_hwport_t dmac3; /* 0x1580 */
282 usb_mmio_hwport_t usb; /* 0x1600 */
283 u8 unk_1700[0x100];
284 vu32 ps1_cdrom;
285 u8 unk_1804[0xc];
286 vu32 ps1_gpu1;
287 vu32 ps1_gpu2;
288 u8 unk_1818[0x8];
289 vu32 ps1_mdec1;
290 vu32 ps1_mdec2;
291 u8 unk_1828[0x8];
292 u8 unk_1830[0xd0];
293 u8 deckard_i2c[0x20]; /* 0x1900 */
294 u8 unv_1920[0x2e0];
295 u8 spu_core0[0x400]; /* 0x1C00 */
296 u8 exp2_r2[0x2000]; /* 0x2000 */
297 u8 unk_4000[0x4000];
298 u8 sio2_internal[0x200]; /* 0x8000 */
299 sio2_mmio_hwport_t sio2; /* 0x8200 */
300 u8 unk_8300[0x100];
301 ieee1394_mmio_hwport_t ieee1394; /* 0x8400 */
303
304#if !defined(USE_IOP_MMIO_HWPORT) && defined(_IOP)
305// cppcheck-suppress-macro constVariablePointer
306#define USE_IOP_MMIO_HWPORT() iop_mmio_hwport_t *const iop_mmio_hwport = (iop_mmio_hwport_t *)0xBF800000
307#endif
308#if !defined(USE_IOP_MMIO_HWPORT)
309#define USE_IOP_MMIO_HWPORT()
310#endif
311
312#endif /* __IOP_MMIO_HWPORT__ */